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

	<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>2009-06-18T20:38:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[LB_1981]]></name></author>
		<updated>2009-06-18T20:36:45-04:00</updated>

		<published>2009-06-18T20:36:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89244#p89244</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89244#p89244"/>
		<title type="html"><![CDATA[Need help small script[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89244#p89244"><![CDATA[
changed that over this is what i have now<br><div class="codebox"><p>Code: </p><pre><code>bind msg o|o act cmd:actbind msg o|o notice cmd:noticebind msg o|o forcejoin cmd:forcejoinbind msg o|o sapart cmd:sapartbind msg o|o tempshun cmd:tempshunbind msg o|o kill cmd:killbind msg o|o tempgline cmd:tempglineproc cmd:act {nick uhost hand arg} {   set chan [lindex [split $arg] 0]   set text [lrange [split $arg] 1 end]   putserv "PRIVMSG $chan :\001ACTION $text\001" }proc cmd:notice {nick uhost hand arg} {  set chan [lindex [split $arg] 0]   set text [lrange [split $arg] 1 end]   putserv "NOTICE $chan :$text"}proc cmd:forcejoin {nick uhost hand args} {  set args [join $args]  set nick [lindex $args 0]  set chan [lrange $args 1 end]  putserv "SAJOIN $nick :$chan"}proc cmd:sapart {nick uhost hand args} {  set args [join $args]  set nick [lindex $args 0]  set chan [lrange $args 1 end]  putserv "SAPART $nick :$chan"}proc cmd:tempshun {nick uhost hand arg} {  set nick [lindex [split $arg] 0]   set reason [lrange [split $arg] 1 end]   putserv "TEMPSHUN $nick :$reason"  } proc cmd:kill {nick uhost hand arg} {   set username [lindex [split $arg] 0]    set reason [lrange [split $arg] 1 end]    putserv "KILL $username :$reason"  } proc cmd:tempgline {nick uhost hand args} {  set args [join $args]  set username [lindex $args 0]  set reason [lrange $args 1 end]  putserv "GLINE $username 4H :$reason"  } all seems to work ok many thanks for your help</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10704">LB_1981</a> — Thu Jun 18, 2009 8:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2009-06-17T08:52:54-04:00</updated>

		<published>2009-06-17T08:52:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89219#p89219</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89219#p89219"/>
		<title type="html"><![CDATA[Need help small script[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89219#p89219"><![CDATA[
The variable "args" has a special meaning in Tcl and shouldn't be used as an argument for "text" in your procedures. Instead, do it like this:<div class="codebox"><p>Code: </p><pre><code>proc cmd:act {nick uhost hand arg} {  set chan [lindex [split $arg] 0]  set text [lrange [split $arg] 1 end]  putserv "PRIVMSG $chan :\001ACTION $text\001"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Jun 17, 2009 8:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LB_1981]]></name></author>
		<updated>2009-06-17T08:23:23-04:00</updated>

		<published>2009-06-17T08:23:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89218#p89218</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89218#p89218"/>
		<title type="html"><![CDATA[Need help small script[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89218#p89218"><![CDATA[
Many thanks for your reply i have however managed to sort some of this script myself after a few days of rapping my brains and going through some of the old forums ive come up with this and it all seems to work ok<br><div class="codebox"><p>Code: </p><pre><code>bind msg o|o act cmd:actbind msg o|o notice cmd:noticebind msg o|o forcejoin cmd:forcejoinbind msg o|o tempshun cmd:tempshunbind msg o|o kill cmd:killproc cmd:act {nick uhost hand args} {  set args [join $args]  set chan [lindex $args 0]  set text [lrange $args 1 end]   putserv "PRIVMSG $chan :\001ACTION $text\001"}proc cmd:notice {nick uhost hand args} {  set args [join $args]  set chan [lindex $args 0]  set text [lrange $args 1 end]   putserv "NOTICE $chan :$text"}proc cmd:forcejoin {nick uhost hand args} {  set args [join $args]  set nick [lindex $args 0]  set chan [lrange $args 1 end]   putserv "SAJOIN $nick :$chan"}proc cmd:tempshun {nick uhost hand args} {  set args [join $args]  set nick [lindex $args 0]  set reason [lrange $args 1 end]   putserv "TEMPSHUN $nick :$reason"}proc cmd:kill {nick uhost hand args} {  set args [join $args]  set username [lindex $args 0]  set reason [lrange $args 1 end]   putserv "KILL $username :$reason"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10704">LB_1981</a> — Wed Jun 17, 2009 8:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-06-16T10:12:25-04:00</updated>

		<published>2009-06-16T10:12:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89208#p89208</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89208#p89208"/>
		<title type="html"><![CDATA[Need help small script[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89208#p89208"><![CDATA[
I don't have oper privileges on any irc network so I can't be certain of my response.<br><br>Your commands seem in some cases incomplete :-<br>eg. putserv "sajoin $target" should probably be putserv "sajoin $target #channelname"<br><br>In other cases in error :-<br>eg. you declare a bind proc as msg:GLINE then go on to define a proc named msg:Gline<br><br>I have tried to code two of the commands (sajoin and kill). Documentation suggests that the bot would need Csop privileges for sajoin command and IRCop privileges for kill command.<br><br>I have also included a catch for raw 481, which is what the bot would receive from the ircd if it tried to use either command but did not have the appropriate privileges.<br><br>I have also commented the code so that you can follow the logic and code the other commands in a similar manner. Note that, for completeness, other ircd error responses (besides RAW 481) may occur. What happens if you try to kill a nick that is frozen or not online. These are issues that would have to be addressed and accounted for if you want a 'complete' and competent script.<br><div class="codebox"><p>Code: </p><pre><code># syntax /msg botnick sajoin ?nick? &lt;channel&gt;# forces ?nick? to join &lt;channel&gt;# acts on the script user in the absence of the optional argument ?nick?# requires script user to have global owner bot flag# requires bot to have Csop priviledgesbind MSG n sajoin msg:sajoinproc msg:sajoin {nick uhost hand text} {    # declare as global and set command user for use in further error messages    global cmduser    set cmduser $nick    # unset the global variable cmduser in case of ircd response not occuring within a reasonable timescale    utimer 10 [list unset cmduser]    # remove any spurious leading/trailing space characters from the text arguments    set arguments [string trim $text]    # check the number of text arguments provided and assign variables accordingly    # notice the script user with error message if an incorrect number of arguments is provided    switch -- [llength [split $arguments]] {        1 {            set username $nick            set channel $arguments        }        2 {            set username [lindex [split $arguments] 0]            set channel [lindex [split $arguments] 1]        }        default {            putserv "NOTICE $nick :-error- correct syntax is /msg botnick sajoin ?nick? &lt;channel&gt;"            return 0        }    }    # check that the username argument provided is in the format of a valid irc nick    # otherwise notice the script user with error message    if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $username]} {                  # check that the channel argument proovided is in the format of a valid irc channel        # otherwise notice the script user with error message        if {[regexp -- {^#} $channel]} {            # send the sajoin command to the ircd            putserv "sajoin $username $channel"        } else {putserv "NOTICE $nick :-error- $channel is not in the format of a valid irc channel"}    } else {putserv "NOTICE $nick :-error- $username is not in the format of a valid irc nick"}    return 0}# syntax /msg botnick kill &lt;nick&gt; ?reason?# forcibly disconnects &lt;nick&gt; from all linked servers for ?reason? if specified# provides default reason text if optional ?reason? argument is not specified# requires script user to have global owner bot flag# requires bot to have IRCop priviledgesbind MSG n kill msg:killproc msg:kill {nick uhost hand text} {    # declare as global and set command user for use in further error messages    global cmduser    set cmduser $nick    # unset the global variable cmduser in case of ircd response not occuring within a reasonable timescale    utimer 10 [list unset cmduser]    # remove any spurious leading/trailing space characters from the text arguments    set arguments [string trim $text]    # check the number of text arguments provided and assign variables accordingly    # notice the script user with error message if an incorrect number of arguments is provided    switch -- [llength [split $arguments]] {        0 {            putserv "NOTICE $nick :-error- correct syntax is /msg botnick kill &lt;nick&gt; ?reason?"            return 0        }        1 {            set username $arguments            set reason "no reason specified"        }        default {            set username [lindex [split $arguments] 0]            set reason [join [lrange [split $arguments] 1 end]]        }    }    # check that the username argument provided is in the format of a valid irc nick    # otherwise notice the script user with error message    if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $username]} {                  # send the kill command to the ircd        putserv "kill $username $reason"    } else {putserv "NOTICE $nick :-error- $username is not in the format of a valid irc nick"}    return 0}# a raw 481 is received by the bot from the ircd server if it tries to use oper commands but does not have oper privilegesbind RAW - 481 msg:raw481proc msg:raw481 {from keyword text} {    # allow use of global variable cmduser within this proc    global cmduser        # if the global variable cmduser exists, notice the command user and unset cmduser    if {[info exists cmduser]} {        putserv "NOTICE $cmduser :Permission denied, I do not have the correct irc operator privileges"        unset cmduser    }    return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Jun 16, 2009 10:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LB_1981]]></name></author>
		<updated>2009-06-18T20:38:28-04:00</updated>

		<published>2009-06-10T07:49:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89157#p89157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89157#p89157"/>
		<title type="html"><![CDATA[Need help small script[solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89157#p89157"><![CDATA[
Any help please I cant get it to work so if any one can help id appreciate it <br><br>basicaly is what i need it to do is <br>/msg botnick kill $nick reason<br>/msg botnick act $chan text to act<br>/msg botnick tempshun $nick reason for shun<br>/msg botnick sajoin $nick $chan<br>/msg botnick gline $nick 4h reason<br><br>I think i got the basics but im stuck going any further with it <br><div class="codebox"><p>Code: </p><pre><code>bind msg o kill msg:killbind msg o act msg:actbind msg o tempshun msg:tempshunbind msg o sajoin msg:sajoinbind msg o GLINE msg:GLINE proc msg:kill {nick uhost hand arg} {  set target [lindex [split $arg] 0]  putserv "kill $target" }proc msg:act {nick uhost hand arg} {  set target [lindex [split $arg] 0]  putserv "act $target" }proc msg:tempshun {nick uhost hand arg} {  set target [lindex [split $arg] 0]  putserv "tempshun $target" }proc msg:sajoin {nick uhost hand arg} {  set target [lindex [split $arg] 0]  putserv "sajoin $target" }proc msg:Gline {nick uhost hand arg} {  set target [lindex [split $arg] 0]  putserv "GLINE $target" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10704">LB_1981</a> — Wed Jun 10, 2009 7:49 am</p><hr />
]]></content>
	</entry>
	</feed>
