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

	<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>2005-04-20T14:24:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2005-04-20T14:24:53-04:00</updated>

		<published>2005-04-20T14:24:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48360#p48360</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48360#p48360"/>
		<title type="html"><![CDATA[script request]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48360#p48360"><![CDATA[
thx to allmighty De Kus the script works now =)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Wed Apr 20, 2005 2:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-20T12:59:02-04:00</updated>

		<published>2005-04-20T12:59:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48350#p48350</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48350#p48350"/>
		<title type="html"><![CDATA[script request]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48350#p48350"><![CDATA[
after some talk on IRC here the fixed total version<div class="codebox"><p>Code: </p><pre><code>set chanlist [channels]set vs "vs"bind pub - !cw ewa_cwbind pub - !help ewa_helpbind msg m|m spam ewa_spambind pub - !ctb ewa_pcwbind pub - !cwlist ewa_cwlistbind pub - !remove ewa_removeproc ewa_spam { nick uhost handle arg } {  global chanlist  for { set index 0 } { $index&lt;[llength $chanlist] } { incr index } {            puthelp "PRIVMSG [lindex $chanlist $index] :$arg"  }}              proc ewa_help { nick uhost handle channel arg } {  puthelp "NOTICE $nick : *******Matchfind*******"  puthelp "NOTICE $nick : !cw &lt;number of players&gt; &lt;time&gt; &lt;on/off&gt;"  puthelp "NOTICE $nick : You can do '!CTB' with same use to ask for a Capture the briefcase cw."  puthelp "NOTICE $nick : for example: !cw 4 9pm on"  puthelp "NOTICE $nick : &lt;on/off&gt; is the status of a server. If you can have one do 'on', if not do 'off'."  puthelp "NOTICE $nick : You need to be OP to ask for a cw. If ReactionBot is not on your channel ask it to Dragoneye @ #clan.sup or mail dragon@netikka.fi."    puthelp "NOTICE $nick : *******Teh End**********"}proc ewa_cw { nick uhost handle channel arg } {  global chanlist vs cwflood   set arg [split $arg]  if { ![info exists cwflood($channel)] } {  set cwflood($channel) 1  } elseif { $cwflood($channel) &gt; 2 } {    puthelp "NOTICE $nick :Sorry dude, you have reached your limit, try again a few minutes later."    return 0  } else {    incr cwflood($channel)  }  timer 10 [list incr cwflood($channel) -1]  set file datafile.txt  if {![file exists $file]} {close [open $file w]}  set io [open $file a]    if { [isop $nick $channel] } {    set ewa_playernumber [string tolower [lindex $arg 0]]    set ewa_time [lindex $arg 1]    set ewa_server [string tolower [lindex $arg 2]]    if { ( $ewa_playernumber != "" ) &amp;&amp; ( $ewa_time !="" ) &amp;&amp; ( $ewa_server !="" ) } {      if { $ewa_playernumber == "1" || $ewa_playernumber == "2" || $ewa_playernumber == "3" || $ewa_playernumber == "4" || $ewa_playernumber == "5" || $ewa_playernumber == "6" || $ewa_playernumber == "7" || $ewa_playernumber == "8" } {        if { ( $ewa_server == "on" ) || ( $ewa_server == "off" ) } {          set ewa_status $ewa_server          for { set index 0 } { $index&lt;[llength $chanlist] } { incr index } {            putserv "PRIVMSG [lindex $chanlist $index] :\\[ RQ3 CW \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"           # putserv "PRIVMSG reactionbot3 :spam \[ RQ3 CW \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"           # putserv "PRIVMSG reactionbot2 :spam \[ RQ3 CW \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"    }    puts $io "\[ RQ3 CW ]\ $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"  close $io  timer 15 [list ewa_t_remove "\[ RQ3 CW ]\ $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"]       } else {          puthelp "NOTICE $nick : $ewa_server is a bad server status, it must be 'on' or 'off'. Try '!help' for more info."        }       } else {        puthelp "NOTICE $nick : $ewa_playernumber is bad, it's the number of players you want in the cw. It must be set between 1 and 8. Try '!help' for more info."      }    } else {      puthelp "NOTICE $nick : Uh?? What are you trying to say? Do '!help' for more info."    }    } else {    puthelp "NOTICE $nick : You need to be OP to ask for a cw. You need to be OP to ask for a cw. If ReactionBot is not on your channel ask it to Dragoneye @ #clan.sup or mail dragon@netikka.fi."  }}proc ewa_pcw { nick uhost handle channel arg } {  global chanlist vs cwflood   set arg [split $arg]  if { ![info exists cwflood($channel)] } {  set cwflood($channel) 1  } elseif { $cwflood($channel) &gt; 2 } {    puthelp "NOTICE $nick :Sorry dude, you have reached your limit, try again a few minutes later."    return 0  } else {    incr cwflood($channel)  }  timer 10 [list incr cwflood($channel) -1]  if { [isop $nick $channel] } {    set ewa_playernumber [string tolower [lindex $arg 0]]    set ewa_time [lindex $arg 1]    set ewa_server [string tolower [lindex $arg 2]]    if { ( $ewa_playernumber != "" ) &amp;&amp; ( $ewa_time !="" ) &amp;&amp; ( $ewa_server !="" ) } {      if { $ewa_playernumber == "1" || $ewa_playernumber == "2" || $ewa_playernumber == "3" || $ewa_playernumber == "4" || $ewa_playernumber == "5" || $ewa_playernumber == "6" || $ewa_playernumber == "7" || $ewa_playernumber == "8" } {        if { ( $ewa_server == "on" ) || ( $ewa_server == "off" ) } {          set ewa_status $ewa_server          for { set index 0 } { $index&lt;[llength $chanlist] } { incr index } {            putserv "PRIVMSG [lindex $chanlist $index] :\\[ RQ3 CTB \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"         #   putserv "PRIVMSG reactionbot3 :spam \[ RQ3 CTB \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"         #   putserv "PRIVMSG reactionbot2 :spam \[ RQ3 CTB \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"}        } else {          puthelp "NOTICE $nick : $ewa_server is a bad server status, it must be 'on' or 'off'. Try '!help' for more info."        }       } else {        puthelp "NOTICE $nick : $ewa_playernumber is bad, it's the number of players you want in the cw. It must be set between 1 and 8. Try '!help' for more info."      }    } else {      puthelp "NOTICE $nick : Uh?? What are you trying to say? Do '!help' for more info."    }    } else {    puthelp "NOTICE $nick : You need to be OP to ask for a cw. You need to be OP to ask for a cw. If ReactionBot is not on your channel ask it to Dragoneye @ #clan.sup or mail dragon@netikka.fi."  }}proc ewa_cwlist {nick uhost handle channel arg} {  set file datafile.txt  if {![file exists $file]} {close [open $file w]}  set io [open $file r]  set list ""  while {![eof $io]} {    gets $io line    if {[string trim $line] == ""} {continue}    lappend list $line  }  close $io  set length [llength $list]  set message "$length match[expr {($length == "1")?"":"es"}] found."  putserv "PRIVMSG $channel :$message"  foreach line $list {    putserv "PRIVMSG $channel :$line"  }}proc ewa_remove {nick uhost handle channel arg} {  set file datafile.txt  if {![file exists $file]} {close [open $file w]}  set io [open $file r]  set list ""  while {![eof $io]} {    gets $io line    set line [string tolower $line]    if {([string trim $line] == "") ||        ($line == [string tolower $arg])} {continue}    lappend list $line  }  close $io  set io [open $file w]  foreach line $list {puts $io $line}  close $io  putserv "PRIVMSG $channel :Removed. $arg"}proc ewa_t_remove {text} {   set file datafile.txt   set io [open $file r]      set list [split [read $io] \n]   close $io   if { [set line [lsearch -exact $list $text]] != -1 } {      set list [lreplace $list $line $line]      set io [open $file w]         puts -nonewline $io [join $list \n]      close $io   } else {      putlog "error triing find line to delete in $file."   }}</code></pre></div>PS: edited<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Apr 20, 2005 12:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-20T11:17:27-04:00</updated>

		<published>2005-04-20T11:17:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48345#p48345</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48345#p48345"/>
		<title type="html"><![CDATA[script request]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48345#p48345"><![CDATA[
flood:<br>place a "set cwflood 0" to the global init (like below set vs).<br><br>then append cwflood to "global chanlist vs", as far as I can see you need to do this in both procs.<br>now add this code below the global line:<div class="codebox"><p>Code: </p><pre><code>   if { $cwflood &gt; 3 } {      return 0   }   incr cwflood   utimer 60 {incr cwflood -1}</code></pre></div>replace the number '3' and '60' to whatever you like. The current setting would limit the usage to 3 per 60sec, meaning the 4th and more is ignored until 60sec of the 4th has passed.<br><br>delete:<br>add this line just below the puts and close where it will be saved:<br><br>timer 15 [list ewa_t_remove "\[ RQ3 CW ]\ $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"]<br><br>then add this proc:<div class="codebox"><p>Code: </p><pre><code>proc ewa_t_remove {text} {   set file datafile.txt   set io [open $file r]      set list [split [read $io] \n]   close $io   if { [set line [lsearch $list $text]] != -1 } {      set list [lreplace $list $line $line]      set io [open $file w]         puts -nonewline [join $line \n]      close $io   } else {      putlog "error triing find line to delete in $file."   }}</code></pre></div>I am not 100% sure if this lsearch will find it again this way, so i put in the putlog to catch this logical error, if it occurs <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br><br>PS: in the proc where you add the new entry via put you should rather use "set io [open $file a]" instead of "set io [open $file w]". opening with w will just overwrite the file, a will append at the end without reading the complete file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Wed Apr 20, 2005 11:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dragoneye]]></name></author>
		<updated>2005-04-20T10:55:34-04:00</updated>

		<published>2005-04-20T10:55:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48344#p48344</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48344#p48344"/>
		<title type="html"><![CDATA[script request]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48344#p48344"><![CDATA[
hello guys again =) im currently working on a matchfindbot-script but i cannot figure how to make a spam protection to it, i also need somekinda timer to delete 1 line from the database.<br>script works like this when u type !cw 3 now on the bot will <br>msg [ RQ3 CW ] #channel is looking for 3vs3 @ now - Server on <br>and save it to database.txt, when u type !cwlist the bot will read the database.txt and passes the text to the channel. i need somekinda timer to delete the msg from the database when 15min have passed, but i dont wanna delete all messages from there only that 1 line wich you typed 15mins ago. so here is the script. that !remove is only a temporally until i can get that timerthing to work<br><div class="codebox"><p>Code: </p><pre><code># (c) Dragoneye &amp; babouset chanlist [channels]set vs "vs"bind pub - !cw ewa_cwbind pub - !help ewa_helpbind msg m|m spam ewa_spambind pub - !ctb ewa_pcwbind pub - !cwlist ewa_cwlistbind pub - !remove ewa_removeproc ewa_spam { nick uhost handle arg } {  global chanlist  for { set index 0 } { $index&lt;[llength $chanlist] } { incr index } {            puthelp "PRIVMSG [lindex $chanlist $index] :$arg"  }}              proc ewa_help { nick uhost handle channel arg } {  puthelp "NOTICE $nick : *******Matchfind*******"  puthelp "NOTICE $nick : !cw &lt;number of players&gt; &lt;time&gt; &lt;on/off&gt;"  puthelp "NOTICE $nick : You can do '!CTB' with same use to ask for a Capture the briefcase cw."  puthelp "NOTICE $nick : for example: !cw 4 9pm on"  puthelp "NOTICE $nick : &lt;on/off&gt; is the status of a server. If you can have one do 'on', if not do 'off'."  puthelp "NOTICE $nick : You need to be OP to ask for a cw. If ReactionBot is not on your channel ask it to Dragoneye @ #clan.sup or mail dragon@netikka.fi."    puthelp "NOTICE $nick : *******Teh End**********"}proc ewa_cw { nick uhost handle channel arg } {  global chanlist vsset file datafile.txt  if {![file exists $file]} {close [open $file w]}  set io [open $file w]    if { [isop $nick $channel] } {    set ewa_playernumber [string tolower [lindex $arg 0]]    set ewa_time [lindex $arg 1]    set ewa_server [string tolower [lindex $arg 2]]    if { ( $ewa_playernumber != "" ) &amp;&amp; ( $ewa_time !="" ) &amp;&amp; ( $ewa_server !="" ) } {      if { $ewa_playernumber == "1" || $ewa_playernumber == "2" || $ewa_playernumber == "3" || $ewa_playernumber == "4" || $ewa_playernumber == "5" || $ewa_playernumber == "6" || $ewa_playernumber == "7" || $ewa_playernumber == "8" } {        if { ( $ewa_server == "on" ) || ( $ewa_server == "off" ) } {          set ewa_status $ewa_server          for { set index 0 } { $index&lt;[llength $chanlist] } { incr index } {            putserv "PRIVMSG [lindex $chanlist $index] :\\[ RQ3 CW \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"           # putserv "PRIVMSG reactionbot3 :spam \[ RQ3 CW \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"           # putserv "PRIVMSG reactionbot2 :spam \[ RQ3 CW \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"    }puts $io "\[ RQ3 CW ]\ $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"  close $io        } else {          puthelp "NOTICE $nick : $ewa_server is a bad server status, it must be 'on' or 'off'. Try '!help' for more info."        }       } else {        puthelp "NOTICE $nick : $ewa_playernumber is bad, it's the number of players you want in the cw. It must be set between 1 and 8. Try '!help' for more info."      }    } else {      puthelp "NOTICE $nick : Uh?? What are you trying to say? Do '!help' for more info."    }    } else {    puthelp "NOTICE $nick : You need to be OP to ask for a cw. You need to be OP to ask for a cw. If ReactionBot is not on your channel ask it to Dragoneye @ #clan.sup or mail dragon@netikka.fi."  }}proc ewa_pcw { nick uhost handle channel arg } {   global chanlist vs  if { [isop $nick $channel] } {    set ewa_playernumber [string tolower [lindex $arg 0]]    set ewa_time [lindex $arg 1]    set ewa_server [string tolower [lindex $arg 2]]    if { ( $ewa_playernumber != "" ) &amp;&amp; ( $ewa_time !="" ) &amp;&amp; ( $ewa_server !="" ) } {      if { $ewa_playernumber == "1" || $ewa_playernumber == "2" || $ewa_playernumber == "3" || $ewa_playernumber == "4" || $ewa_playernumber == "5" || $ewa_playernumber == "6" || $ewa_playernumber == "7" || $ewa_playernumber == "8" } {        if { ( $ewa_server == "on" ) || ( $ewa_server == "off" ) } {          set ewa_status $ewa_server          for { set index 0 } { $index&lt;[llength $chanlist] } { incr index } {            putserv "PRIVMSG [lindex $chanlist $index] :\\[ RQ3 CTB \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"         #   putserv "PRIVMSG reactionbot3 :spam \[ RQ3 CTB \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"         #   putserv "PRIVMSG reactionbot2 :spam \[ RQ3 CTB \] $channel is looking for $ewa_playernumber$vs$ewa_playernumber @ $ewa_time - Server $ewa_status"}        } else {          puthelp "NOTICE $nick : $ewa_server is a bad server status, it must be 'on' or 'off'. Try '!help' for more info."        }       } else {        puthelp "NOTICE $nick : $ewa_playernumber is bad, it's the number of players you want in the cw. It must be set between 1 and 8. Try '!help' for more info."      }    } else {      puthelp "NOTICE $nick : Uh?? What are you trying to say? Do '!help' for more info."    }    } else {    puthelp "NOTICE $nick : You need to be OP to ask for a cw. You need to be OP to ask for a cw. If ReactionBot is not on your channel ask it to Dragoneye @ #clan.sup or mail dragon@netikka.fi."  }}proc ewa_cwlist {nick uhost handle channel arg} {  set file datafile.txt  if {![file exists $file]} {close [open $file w]}  set io [open $file r]  set list ""  while {![eof $io]} {    gets $io line    if {[string trim $line] == ""} {continue}    lappend list $line  }  close $io  set length [llength $list]  set message "$length match[expr {($length == "1")?"":"es"}] found."  putserv "PRIVMSG $channel :$message"  foreach line $list {    putserv "PRIVMSG $channel :$line"  }}proc ewa_remove {nick uhost handle channel arg} {  set file datafile.txt  if {![file exists $file]} {close [open $file w]}  set io [open $file r]  set list ""  while {![eof $io]} {    gets $io line    set line [string tolower $line]    if {([string trim $line] == "") ||        ($line == [string tolower $arg])} {continue}    lappend list $line  }  close $io  set io [open $file w]  foreach line $list {puts $io $line}  close $io  putserv "PRIVMSG $channel :Removed. $arg"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6114">dragoneye</a> — Wed Apr 20, 2005 10:55 am</p><hr />
]]></content>
	</entry>
	</feed>
