<?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/19760" />

	<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>2014-07-31T17:24:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2014-07-31T17:24:29-04:00</updated>

		<published>2014-07-31T17:24:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103109#p103109</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103109#p103109"/>
		<title type="html"><![CDATA[Writing a manual points tracking script - need some guidance]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103109#p103109"><![CDATA[
I might start out that script a little more like this...<br><div class="codebox"><p>Code: </p><pre><code>set our_chan "&lt;channel&gt;"  ;## &lt;- MUST set a channel!##bind msg o points addpoints proc addpoints {nick host hand text} {   global our_chan    lassign [split [string trim $text]] whom points   if {$whom eq ""} {      puthelp "PRIVMSG $nick :Use: \002/msg $::botnick &lt;handle&gt; \[points\]\002"       return 0    }   if {![validuser $whom]} {      puthelp "PRIVMSG $nick :\002$whom\002 is not a valid handle!"       return 0    }   if {[string match -nocase $whom $hand]} {      puthelp "PRIVMSG $nick :You can't award yourself points. Don't be a schmuck."       return 0    }   if {![string is digit -strict $points]} {  set points 100  }          puthelp "PRIVMSG $our_chan :$nick gives $points to $whom."    # now you can check if they already have any points   # and do the math for their new total points   # and save the new total points to the user file   return 0} </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Thu Jul 31, 2014 5:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hideflomein]]></name></author>
		<updated>2014-07-31T10:46:57-04:00</updated>

		<published>2014-07-31T10:46:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103102#p103102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103102#p103102"/>
		<title type="html"><![CDATA[Writing a manual points tracking script - need some guidance]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103102#p103102"><![CDATA[
Awesome! Thanks - I've never used Tcl before, so a lot of the syntax is very new to me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12419">hideflomein</a> — Thu Jul 31, 2014 10:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2014-07-31T10:39:59-04:00</updated>

		<published>2014-07-31T10:39:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103101#p103101</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103101#p103101"/>
		<title type="html"><![CDATA[Writing a manual points tracking script - need some guidance]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103101#p103101"><![CDATA[
First off, any proc called by a /msg bind MUST be called with the correct number of arguments...<blockquote class="uncited"><div>bind msg &lt;flags&gt; &lt;command&gt; &lt;proc&gt;<br>procname &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;text&gt;</div></blockquote>Your addpoints proc must have exactly 4 arguments like...<div class="codebox"><p>Code: </p><pre><code>proc addpoints {nick host hand text} {</code></pre></div>Notice that a /msg bind doesn't provide a channel to the called proc.<br>So your very first if statement fails with unknown var $chan...<div class="codebox"><p>Code: </p><pre><code>if {[string tolower $chan] != $our_chan} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Thu Jul 31, 2014 10:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hideflomein]]></name></author>
		<updated>2014-07-31T09:20:08-04:00</updated>

		<published>2014-07-31T09:20:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103100#p103100</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103100#p103100"/>
		<title type="html"><![CDATA[Writing a manual points tracking script - need some guidance]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103100#p103100"><![CDATA[
So I'm writing a script for a points tracking system for my eggdrop. The idea is that an op can /msg the bot with the command "points &lt;user&gt; &lt;value&gt;" where &lt;value&gt; is optional (if left blank, it defaults to 100). The bot then stores the score in the user's whois field under "points". <br><div class="codebox"><p>Code: </p><pre><code>set our_chan "&lt;channel&gt;"bind msg o points addpointsproc addpoints {nick text} {global our_chanif {[string tolower $chan] != $our_chan} {return 0}set whom [lindex $text 0]if {$whom != $nick} {set inputparse [lrange $text first last]if {[inputparse first] == [inputparse last]} {set points 100} else {set points [lindex $text 1]}putserv "PRIVMSG $chan :$nick gives $points to $whom."} else {putserv "PRIVMSG $nick: You can't award yourself points. Don't be a schmuck."}}</code></pre></div><br>I think I'm on the right track, but I'm not sure if I have everything I need.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12419">hideflomein</a> — Thu Jul 31, 2014 9:20 am</p><hr />
]]></content>
	</entry>
	</feed>
