<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/18596" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2024-04-11T07:02:03-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/18596</id>

		<entry>
		<author><name><![CDATA[pektek]]></name></author>
		<updated>2024-04-11T07:02:03-04:00</updated>

		<published>2024-04-11T07:02:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112711#p112711</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112711#p112711"/>
		<title type="html"><![CDATA[Re: On join msg; doesn't work when users have no record in bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112711#p112711"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc tgjoinmsg {nick host hand chan} {global tgscoresbyname tgranksbyname tgflagsstart tgplaying tgchan# is it the trivia channel?if {![string equal $chan $tgchan]} { return }# yes, is it the bots nickname?if {![botnick $nick]} {# no, does an entry exist for this nickname?if {[info exists tgranksbyname([strlwr $nick])]} {# yes, set the messageset _msg "Welcome $nick! You're on the [tgcolmisc2][ordnumber $tgranksbyname([strlwr $nick])][tgcolmisc1] rank with [tgcolmisc2]$tgscoresbyname([strlwr $nick])[tgcolmisc1] points."# is trivia off, but this person can start it?if {[matchattr $hand $tgflagsstart $tgchan]&amp;&amp;$tgplaying==0} {# yes, append the messageappend _msg " !!!Enter !start to start the game!!!"}} else {# no, an entry doesn't exist for this person, set the messageset _msg "Welcome $nick. You currently have no score for trivia."}# outputtgpriv $chan "$_msg"}}</code></pre></div>this shape change<br><br><div class="codebox"><p>Code: </p><pre><code>#triggered when someone joins trivia chan. proc tgjoinmsg {nick host hand chan} {global botnick tgscoresbyname tgranksbyname tgflagsstart tgplaying tgchan# is it the trivia channel?if {![string equal $chan $tgchan]} { return }# yes, is it the bots nickname?if {$nick != $botnick} {# no, does an entry exist for this nickname?if {[info exists tgranksbyname([strlwr $nick])]} {# yes, set the messageset _msg "Welcome $nick! You're on the [tgcolmisc2][ordnumber $tgranksbyname([strlwr $nick])][tgcolmisc1] rank with [tgcolmisc2]$tgscoresbyname([strlwr $nick])[tgcolmisc1] points."# is trivia off, but this person can start it?if {[matchattr $hand $tgflagsstart $tgchan]&amp;&amp;$tgplaying==0} {# yes, append the messageappend _msg " !!!Enter !start to start the game!!!"}} else {# no, an entry doesn't exist for this person, set the messageset _msg "Welcome $nick. You currently have no score for trivia."}# output[tgpriv] $nick "$_msg"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=13010">pektek</a> — Thu Apr 11, 2024 7:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2012-07-03T14:43:01-04:00</updated>

		<published>2012-07-03T14:43:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99662#p99662</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99662#p99662"/>
		<title type="html"><![CDATA[On join msg; doesn't work when users have no record in bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99662#p99662"><![CDATA[
Why not call only the <em class="text-italics">tgchan</em> variable and if the channel is it the trivia channel proceed with also calling the rest of the variables? In theory should save up precious some resources.<br><br>Also, why not store nick in a lower format (strlwr $nick) and use it instead of transforming it 3 times.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jul 03, 2012 2:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2012-07-02T18:24:30-04:00</updated>

		<published>2012-07-02T18:24:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99659#p99659</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99659#p99659"/>
		<title type="html"><![CDATA[Re: On join msg; doesn't work when users have no record in b]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99659#p99659"><![CDATA[
<blockquote class="uncited"><div>It works when the user already has a score (1 or above), <strong class="text-strong">but it doesn't work for unknown users</strong>... I'd like the bot to say Welcome to the new user, and tell him that he currently doesn't have any scores.</div></blockquote><div class="codebox"><p>Code: </p><pre><code>proc tgjoinmsg {nick host hand chan} {global tgscoresbyname tgranksbyname tgflagsstart tgplaying tgchan# is it the trivia channel?if {![string equal $chan $tgchan]} { return }# yes, is it the bots nickname?if {![botnick $nick]} {# no, does an entry exist for this nickname?if {[info exists tgranksbyname([strlwr $nick])]} {# yes, set the messageset _msg "Welcome $nick! You're on the [tgcolmisc2][ordnumber $tgranksbyname([strlwr $nick])][tgcolmisc1] rank with [tgcolmisc2]$tgscoresbyname([strlwr $nick])[tgcolmisc1] points."# is trivia off, but this person can start it?if {[matchattr $hand $tgflagsstart $tgchan]&amp;&amp;$tgplaying==0} {# yes, append the messageappend _msg " !!!Enter !start to start the game!!!"}} else {# no, an entry doesn't exist for this person, set the messageset _msg "Welcome $nick. You currently have no score for trivia."}# outputtgpriv $chan "$_msg"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Jul 02, 2012 6:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2012-06-22T12:22:56-04:00</updated>

		<published>2012-06-22T12:22:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99621#p99621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99621#p99621"/>
		<title type="html"><![CDATA[Trivia with a working onjoin message:)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99621#p99621"><![CDATA[
Try BogusTrivia for a trivia game with a working on join message for unknown players.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Jun 22, 2012 12:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rapattack]]></name></author>
		<updated>2011-08-18T07:17:39-04:00</updated>

		<published>2011-08-18T07:17:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97437#p97437</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97437#p97437"/>
		<title type="html"><![CDATA[On join msg; doesn't work when users have no record in bot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97437#p97437"><![CDATA[
Dear all,<br><br>I was creating something that mentions which score a user has and also which rank he has got when he joins the <strong class="text-strong">trivia chan</strong>.<br><br>Below is the code:<br><div class="codebox"><p>Code: </p><pre><code>proc tgjoinmsg {nick host hand chan} {global botnick tgplaying tgcmdhelp tgcmdstart tgflagsstart tgcmdstop tgflagsstop tgchan tgscoresbyname tgranksbynameif {$nick != $botnick} {set _msg ""append _msg "Welcome $nick! You're on the [tgcolmisc2][ordnumber $tgranksbyname([strlwr $nick])][tgcolmisc1] rank with [tgcolmisc2]$tgscoresbyname([strlwr $nick])[tgcolmisc1] points."if {$tgplaying==1} {append _msg ""} else {append _msg ""}if {[matchattr $hand $tgflagsstart $tgchan]&amp;&amp;$tgplaying==0} {append _msg "!!!Enter !start to start the game!!!"}append _msg ""[tgpriv] $chan "$_msg"}}</code></pre></div>It works when the user already has a score (1 or above), <strong class="text-strong">but it doesn't work for unknown users</strong>... I'd like the bot to say Welcome to the new user, and tell him that he currently doesn't have any scores.<br><br>Thanks for all help in advance !!!!!!! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":-)" title="Smile"><br><br><br>Oh yeah this is the error I get when an unknown user joins the channel:<br>[13:09:20] Tcl error [tgjoinmsg]: can't read "tgranksbyname(maagd15m)": no such element in array<br><br>But I don't know how to fix it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11754">rapattack</a> — Thu Aug 18, 2011 7:17 am</p><hr />
]]></content>
	</entry>
	</feed>
