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

	<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>2013-03-24T18:26:59-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-03-24T18:26:59-04:00</updated>

		<published>2013-03-24T18:26:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101295#p101295</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101295#p101295"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101295#p101295"><![CDATA[
Here's an updated version of the script with "Public 'Set User Comment' Command" added...<br><div class="codebox"><p>Code: </p><pre><code># ByRequest.tcl Version 1.1 (24 Mar 2013) # # author:  SpiKe^^ # # e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com # # webpage: http://mytclscripts.com/ # # This file is Copyrighted under the GNU Public License. # # http://www.gnu.org/copyleft/gpl.html # ########### General Text File Settings ########### # Set the full route &amp; file name of the file to edit # # Note: The !req &lt;message&gt; command will attempt to make this file if needed. set byReq(file) {/usr/home/spike/eggdrop/scripts/byreq.txt} ########### Public 'Add Request' Command Settings ########### ## settings for the public !req &lt;message&gt; command ## # Set the listen channel(s) for !req &lt;message&gt; command # set byReq(achan) {#yourchannel #anotherchannel #someotherchan} # Set the access flags to use the !req &lt;message&gt; command # set byReq(aflags) {R|R} # Set the public trigger for the !req &lt;message&gt; command # # to add a request at the end of the file: #    example:  !req I want coke. set byReq(add) {!req} ########### Public 'Read Requests' Commands Settings ########### ## settings for the public !reqview &lt;req#&gt; and !reqlist commands ## # Set the listen channel(s) for the public Read Requests commands # set byReq(rchan) {#yourchannel #anotherchannel #someotherchan} # Set the access flags to use the public Read Requests commands # set byReq(rflags) {o|o} # Should these 2 commands reply by Public or User Notice ?? # #   1 = reply by public to the channel #   2 = reply by user notice set byReq(rhow) "1" # Set the public trigger for the !reqview &lt;req#&gt; / !reqview &lt;handle&gt; command # # to read a specific request (by line number) from the text file #    example:  !reqview 4 #    note: use to check for correct line before doing !reqedit or !reqdone # to read all requests by &lt;handle&gt; from the text file #    example:  !reqview spike set byReq(read) {!reqview} # Set the public trigger for the !reqlist command # # to read all requests from the text file #    example:  !reqlist set byReq(readf) {!reqlist} ########### Public 'Edit/Delete Requests' Commands Settings ########### ## settings for the public !reqedit &lt;req#&gt; and !reqdone &lt;req#&gt; commands ## # Set the listen channel(s) for the public Edit/Delete Requests commands # set byReq(echan) {#yourchannel #anotherchannel #someotherchan} # Set the access flags to use the public Edit/Delete Requests commands # set byReq(eflags) {m|m} # Should these 2 commands reply by Public or User Notice ?? # #   1 = reply by public to the channel #   2 = reply by user notice set byReq(ehow) "1" # Set the public trigger for the !reqedit &lt;req#&gt; &lt;new text&gt; command # # to edit a specific request (by line number) in the text file #    example:  !reqedit 4 coke is not good for health. set byReq(edit) {!reqedit} # Set the public trigger for the !reqdone &lt;req#&gt; command # # to delete a specific request (by line number) from the text file #    example:  !reqdone 4 #    note: this will renumber all requests after request 4! set byReq(del) {!reqdone} ########### Public 'Delete All Requests' Command Settings ########### ## settings for the public !reqpurge command ## # Set the listen channel(s) for the public Delete All Requests command # set byReq(dchan) {#yourchannel #anotherchannel #someotherchan} # Set the access flags to use the public Delete All Requests command # set byReq(dflags) {n|n} # Should this command reply by Public or User Notice ?? # #   1 = reply by public to the channel #   2 = reply by user notice set byReq(dhow) "1" # Set the public trigger for the !reqpurge command # # to delete all requests from the text file #    example:  !reqpurge set byReq(delf) {!reqpurge} ########### Public 'Set/Read User Comment' Commands Settings ########### ## settings for the public !userlink and !requser commands ## # Set the listen channel(s) for the public Set/Read User Comment commands # set byReq(uchan) {#yourchannel #anotherchannel #someotherchan} # Set the access flags to use the public Set/Read User Comment commands # set byReq(uflags) {n|n} # Should these 2 commands reply by Public or User Notice ?? # #   1 = reply by public to the channel #   2 = reply by user notice set byReq(uhow) "2" # Set the public trigger for the !userlink command # # to set the comment field for a handle in the bot's user file #    example:  !userlink spike www.mytclscripts.comset byReq(setc) {!userlink} # Set the public trigger for the !requser command # # to read the comment field for a handle in the bot's user file #    example:  !requser spike set byReq(user) {!requser} ################ End Settings ################ bind pub $byReq(aflags) $byReq(add) bReqProcAdd bind pub $byReq(rflags) $byReq(read) bReqProcRead bind pub $byReq(rflags) $byReq(readf) bReqProcReadF bind pub $byReq(eflags) $byReq(del) bReqProcDel bind pub $byReq(eflags) $byReq(edit) bReqProcEdit bind pub $byReq(dflags) $byReq(delf) bReqProcDelF bind pub $byReq(uflags) $byReq(setc) bReqProcUserS bind pub $byReq(uflags) $byReq(user) bReqProcUser set byReq(achan) [split [string tolower $byReq(achan)]] set byReq(rchan) [split [string tolower $byReq(rchan)]] set byReq(echan) [split [string tolower $byReq(echan)]] set byReq(dchan) [split [string tolower $byReq(dchan)]] set byReq(uchan) [split [string tolower $byReq(uchan)]] if {$byReq(rhow) ne "2"} {  set byReq(rhow) 1  } if {$byReq(ehow) ne "2"} {  set byReq(ehow) 1  } if {$byReq(dhow) ne "2"} {  set byReq(dhow) 1  } if {$byReq(uhow) ne "2"} {  set byReq(uhow) 1  } proc bReqProcAdd {nk uh hn ch tx} {    global byReq    set ch [string tolower $ch]  ;  set tx [string trim $tx]    if {[lsearch -exact $byReq(achan) $ch]=="-1"} {  return 0  }    if {$tx eq ""} {       puthelp "PRIVMSG $ch :Correct syntax is: $byReq(add) &lt;your-message-here&gt;"       puthelp "PRIVMSG $ch :Example: $byReq(add) I want coke."  ;  return 0    }    set tf $byReq(file)  ;  set ftime [clock format [unixtime] -format %D@%R]    set id [open $tf a]  ;  puts $id "\[$hn\] $tx ($ftime)"  ;  close $id    if {![file exists $tf]} {       puthelp "PRIVMSG $ch :Unable to find or make text file: $tf"    } else {  puthelp "PRIVMSG $ch :$nk: Request Accepted."  }    return 0 } proc bReqProcReadF {nk uh hn ch tx} {    bReqProcRead $nk $uh $hn $ch $tx file  ;  return 0 } proc bReqProcRead {nk uh hn ch tx {do line} } {    global byReq    set ch [string tolower $ch]  ;  set tx [string trim $tx]    if {[lsearch -exact $byReq(rchan) $ch]=="-1"} {  return 0  }    if {$byReq(rhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }    if {$do eq "line" &amp;&amp; $tx eq ""} {       puthelp "$pre :Correct syntax is: $byReq(read) &lt;line# or handle&gt;"       puthelp "$pre :Example: $byReq(read) 4"       puthelp "$pre :Example: $byReq(read) spike"       puthelp "$pre :Or type $byReq(readf) to see all pending requests."  ;  return 0    }    set tf $byReq(file)    if {![file exists $tf]} {       puthelp "$pre :$nk: There are no pending requests."  ;  return 0    }    if {$do eq "line"} {  set tx [lindex [split $tx] 0]  ;  set scnt 0       if {[string is digit -strict $tx]} {  set fline $tx  } else {  set fhand "\\\[$tx\\\] *"  }    }    set tid [open $tf]  ;  set lnum 0    while {![eof $tid]} {  set line [gets $tid]       if {$line ne ""} {  incr lnum          if {$do eq "file"} {  puthelp "$pre :$lnum - $line"          } elseif {[info exists fline] &amp;&amp; $lnum==$fline} {             puthelp "$pre :$lnum - $line"  ;  break          } elseif {[info exists fhand] &amp;&amp; [string match -nocase $fhand $line]} {             puthelp "$pre :$lnum - $line"  ;  incr scnt          }       }    }    close $tid    if {$lnum=="0"} {  puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }    if {$do eq "file"} {  puthelp "$pre :List Completed - Total Pending Requests ($lnum)."    } elseif {[info exists fhand] &amp;&amp; $scnt=="0"} {  puthelp "$pre :$tx has no pending requests."    } elseif {[info exists fline] &amp;&amp; $fline&gt;$lnum} {  set tl request       if {$lnum&gt;"1"} {  set tl requests  }       puthelp "$pre :$nk: Request number $fline doesn't exist ($lnum pending $tl)."    }    return 0 } proc bReqProcDel {nk uh hn ch tx} {    bReqProcEdit $nk $uh $hn $ch $tx del  ;  return 0 } proc bReqProcEdit {nk uh hn ch tx {do edit} } {    global byReq    set ch [string tolower $ch]  ;  set tx [split [string trim $tx]]    if {[lsearch -exact $byReq(echan) $ch]=="-1"} {  return 0  }    if {$byReq(ehow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }    if {$do eq "edit"} {       if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {          puthelp "$pre :Correct syntax is: $byReq(edit) &lt;req#&gt; &lt;new-message&gt;"          puthelp "$pre :Example: $byReq(edit) 4 coke is not good for health."  ;  return 0       }    } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {       puthelp "$pre :Correct syntax is: $byReq(del) &lt;req#&gt;"       puthelp "$pre :Example: $byReq(del) 4"  ;  return 0    }    set tf $byReq(file)    if {![file exists $tf]} {       puthelp "$pre :$nk: There are no pending requests."  ;  return 0    }    set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]    set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]    set tid [open $tf]  ;  set lnum 0    while {![eof $tid]} {  set line [gets $tid]       if {$line ne ""} {  incr lnum          if {$lnum==$find} {             if {$do eq "edit"} {  set line [split $line]                set date [lindex $line end]  ;  set hand [lindex $line 0]                puthelp "$pre :$nk: Requests List Updated successfully."                puts $nid "$hand $tx $date"             } elseif {$do eq "del"} {                puthelp "$pre :$nk: Request Done - Deleted from the list."             }          } else {  puts $nid $line  }       }    }    close $tid    if {$find&gt;$lnum} {       if {$lnum&gt;"0"} {  set tl request          if {$lnum&gt;"1"} {  set tl requests  }          puthelp "$pre :$nk: Request number $find doesn't exist ($lnum pending $tl)."       } else {  puthelp "$pre :$nk: There are no pending requests."  }       close $nid  ;  file delete $new    } else {  close $nid  ;  file rename -force $new $tf  }    return 0 } proc bReqProcDelF {nk uh hn ch tx} {    global byReq    set ch [string tolower $ch]    if {[lsearch -exact $byReq(dchan) $ch]=="-1"} {  return 0  }    if {$byReq(dhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }    set tf $byReq(file)    if {![file exists $tf]} {       puthelp "$pre :$nk: There are no pending requests."  ;  return 0    }    puthelp "$pre :$nk: All pending requests deleted successfully!"    file delete $tf  ;  return 0 } proc bReqProcUserS {nk uh hn ch tx} {    bReqProcUser $nk $uh $hn $ch $tx setc  ;  return 0 } proc bReqProcUser {nk uh hn ch tx {do getc} } {    global byReq    set ch [string tolower $ch]  ;  set tx [string trim $tx]    if {[lsearch -exact $byReq(uchan) $ch]=="-1"} {  return 0  }    if {$byReq(uhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }    if {$tx eq ""} {       if {$do eq "getc"} {  set cmd $byReq(user)  ;  set mor ""  ;  set mo2 ""      } else { set cmd $byReq(setc) ;set mor " &lt;new-comment&gt;" ;set mo2 " www.mytclscripts.com" }      puthelp "$pre :Correct syntax is: $cmd &lt;handle&gt;$mor"       puthelp "$pre :Example: $cmd spike$mo2"  ;  return 0    }   set rest [join [lrange [split $tx] 1 end]]   set tx [lindex [split $tx] 0]    if {![validuser $tx]} {       puthelp "$pre :$nk: $tx is not a valid user handle."  ;  return 0    }    if {$do eq "setc"} {      setuser $tx COMMENT $rest      puthelp "$pre :$nk: Comment for $tx set to: $rest"  ;  return 0    }    if {[set cmt [getuser $tx COMMENT]] eq ""} {       puthelp "$pre :$nk: There is no comment for $tx."  ;  return 0    }    puthelp "$pre :$nk: $tx - $cmt"  ;  return 0 } putlog "ByRequest.tcl Ver. 1.1 by SpiKe^^ loaded." </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sun Mar 24, 2013 6:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-03-22T19:16:07-04:00</updated>

		<published>2013-03-22T19:16:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101282#p101282</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101282#p101282"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101282#p101282"><![CDATA[
I loaded and fully tested the script, again.<br>The script is fully working as expected, no problems encountered, in any of the set channels.<br><br>Your problems with the script have to be related to your bot's uesrfile.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Mar 22, 2013 7:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fyre]]></name></author>
		<updated>2013-03-22T18:27:31-04:00</updated>

		<published>2013-03-22T18:27:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101281#p101281</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101281#p101281"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101281#p101281"><![CDATA[
Sure, load the script and join 3/4 channels and leave the bot idle for aprox 20-30mins. Then try using pub commands without doing partyline.<br><br>PS: I also sent you PM, have a look.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7846">fyre</a> — Fri Mar 22, 2013 6:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-03-22T17:00:10-04:00</updated>

		<published>2013-03-22T17:00:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101280#p101280</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101280#p101280"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101280#p101280"><![CDATA[
I will load the script and do some testing but...<br>Each command in the script also has a 'listen channel(s)' setting,<br>to control what channels are active for each command.<br>You MUST set the active 'listen channel(s)' for EACH of the commands in the script!<br>There are 5 different 'listen channel(s)' settings in the script set up,<br>All of them need to be set to the channels you wish the script to monitor for the corresponding commands.<br><br>Are you setting the userfile flags for users as global or channel specific?<br>If setting channel specific flags for users, <br>maybe they don't have the channel specific flag required to use the command in #channel2.<br><br>I will load and test the script to see how it works from here, and make another post with my results.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Mar 22, 2013 5:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fyre]]></name></author>
		<updated>2013-03-22T14:57:31-04:00</updated>

		<published>2013-03-22T14:57:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101278#p101278</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101278#p101278"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101278#p101278"><![CDATA[
Bro, <br>You didn't get my point.<br>Bot respond to #channel1 but after pub command triggered in #channel2<br><br>If flags are not properly added then bot shouldn't respond in any channel either #channel1 or #channel2<br><br>Just have a test at your end and see if it works.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7846">fyre</a> — Fri Mar 22, 2013 2:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-03-22T12:23:53-04:00</updated>

		<published>2013-03-22T12:23:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101276#p101276</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101276#p101276"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101276#p101276"><![CDATA[
The script has no code that would tie any of it's commands to anything having to do with partyline access at all!!<br><br>Replying (or not) to any of the commands created by the script are controlled only by the userfile flags for a user.<br><br>Seems to me the bot isn't replying to a user because they either don't have the required flags, <br>or they don't match any of the current masks for an allowed user in the bot's userfile.<br><br>Each command in the script has it's own allowed flags setting, <br>make sure each user you wish to use the commands has the correct user file flags for those commands.<br>They will also need a host mask that will match their current nick!user@host info, or the bot will not respond to them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Mar 22, 2013 12:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fyre]]></name></author>
		<updated>2013-03-21T14:27:33-04:00</updated>

		<published>2013-03-21T14:27:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=101272#p101272</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=101272#p101272"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=101272#p101272"><![CDATA[
I facing some strange problem which I observed couple of days ago.<br>Using this script bot does not respond to pub commands unless I do partyline access.<br><br><strong class="text-strong">Second thing How it respond to pub command without partyline?</strong><br><br>I've added 2 channels #abc &amp; #xyz on the bot, but when I tried to use !req on #abc so it doesnt respond and after that when I tried to use !req in #xyz it respond to it and eventually it start responding on channel #abc again, why? <br><br>When both the channels are added and it its responding to 1 channel, why not responding to 2 channel?<br><br>Note: If you are connected to partyline, then no issues.. its working fine, and I am using the latest version of eggdrop.<br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7846">fyre</a> — Thu Mar 21, 2013 2:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fyre]]></name></author>
		<updated>2013-02-08T17:13:37-04:00</updated>

		<published>2013-02-08T17:13:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100931#p100931</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100931#p100931"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100931#p100931"><![CDATA[
Thanks to all for helping me, and sorry for my late reply as I am traveling now a days still not at home but I've checked this one and it works awesome...  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7846">fyre</a> — Fri Feb 08, 2013 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2013-02-06T16:01:38-04:00</updated>

		<published>2013-02-06T16:01:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100916#p100916</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100916#p100916"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100916#p100916"><![CDATA[
<blockquote class="uncited"><div>In Partyline:<blockquote class="uncited"><div>&lt;(Bot&gt; [05:49] Tcl error [bReqProcRead]: can't read "byReq(rhow)": no such variable<br>&lt;(Bot&gt; [05:49] Tcl error [bReqProcEdit]: can't read "byReq(ehow)": no such variable<br>&lt;(Bot&gt; [05:49] Tcl error [bReqProcUser]: can't read "byReq(uhow)": no such variable<br>&lt;(Bot&gt; [05:50] Tcl error [bReqProcReadF]: can't read "byReq(rhow)": no such variable</div></blockquote></div></blockquote>Q) When to use the "global var" statement versus referencing the variable directly in global space using $::var ? <br><br>A) When you reference it more than twice using $:: a global would've been the better choice. Yes! Because the more you reference your var with $::, you may forget once and simply use $. It's a headache and a chore to keep in check. As well as, it's slower to copy vars from the same array 3x,  than to have just copied the entire array at once.<br><br>Anyways, here is a correction and yes, this version chose to global. Enjoy. All credit to Spike^^. Long live eggdrop. Dance like an robot. Beep boop beep...<br><div class="codebox"><p>Code: </p><pre><code># ByRequest.tcl Version 1.0 (6 Feb 2013) ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############ General Text File Settings ############ Set the full route &amp; file name of the file to edit ## Note: The !req &lt;message&gt; command will attempt to make this file if needed.set byReq(file) {/usr/home/spike/eggdrop/scripts/byreq.txt}########### Public 'Add Request' Command Settings ############# settings for the public !req &lt;message&gt; command ### Set the listen channel(s) for !req &lt;message&gt; command #set byReq(achan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the !req &lt;message&gt; command #set byReq(aflags) {R|R}# Set the public trigger for the !req &lt;message&gt; command ## to add a request at the end of the file:#    example:  !req I want coke.set byReq(add) {!req}########### Public 'Read Requests' Commands Settings ############# settings for the public !reqview &lt;req#&gt; and !reqlist commands ### Set the listen channel(s) for the public Read Requests commands #set byReq(rchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Read Requests commands #set byReq(rflags) {o|o}# Should these 2 commands reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(rhow) "1"# Set the public trigger for the !reqview &lt;req#&gt; / !reqview &lt;handle&gt; command ## to read a specific request (by line number) from the text file#    example:  !reqview 4#    note: use to check for correct line before doing !reqedit or !reqdone# to read all requests by &lt;handle&gt; from the text file#    example:  !reqview spikeset byReq(read) {!reqview}# Set the public trigger for the !reqlist command ## to read all requests from the text file#    example:  !reqlistset byReq(readf) {!reqlist}########### Public 'Edit/Delete Requests' Commands Settings ############# settings for the public !reqedit &lt;req#&gt; and !reqdone &lt;req#&gt; commands ### Set the listen channel(s) for the public Edit/Delete Requests commands #set byReq(echan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Edit/Delete Requests commands #set byReq(eflags) {m|m}# Should these 2 commands reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(ehow) "1"# Set the public trigger for the !reqedit &lt;req#&gt; &lt;new text&gt; command ## to edit a specific request (by line number) in the text file#    example:  !reqedit 4 coke is not good for health.set byReq(edit) {!reqedit}# Set the public trigger for the !reqdone &lt;req#&gt; command ## to delete a specific request (by line number) from the text file#    example:  !reqdone 4#    note: this will renumber all requests after request 4!set byReq(del) {!reqdone}########### Public 'Delete All Requests' Command Settings ############# settings for the public !reqpurge command ### Set the listen channel(s) for the public Delete All Requests command #set byReq(dchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Delete All Requests command #set byReq(dflags) {n|n}# Should this command reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(dhow) "1"# Set the public trigger for the !reqpurge command ## to delete all requests from the text file#    example:  !reqpurgeset byReq(delf) {!reqpurge}########### Public 'Read User Comment' Command Settings ############# settings for the public !requser command ### Set the listen channel(s) for the public Read User Comment command #set byReq(uchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Read User Comment command #set byReq(uflags) {n|n}# Should this command reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(uhow) "2"# Set the public trigger for the !reqpurge command ## to delete all requests from the text file#    example:  !reqpurgeset byReq(user) {!requser}################ End Settings ################bind pub $byReq(aflags) $byReq(add) bReqProcAddbind pub $byReq(rflags) $byReq(read) bReqProcReadbind pub $byReq(rflags) $byReq(readf) bReqProcReadFbind pub $byReq(eflags) $byReq(del) bReqProcDelbind pub $byReq(eflags) $byReq(edit) bReqProcEditbind pub $byReq(dflags) $byReq(delf) bReqProcDelFbind pub $byReq(uflags) $byReq(user) bReqProcUserset byReq(achan) [split [string tolower $byReq(achan)]]set byReq(rchan) [split [string tolower $byReq(rchan)]]set byReq(echan) [split [string tolower $byReq(echan)]]set byReq(dchan) [split [string tolower $byReq(dchan)]]set byReq(uchan) [split [string tolower $byReq(uchan)]]if {$byReq(rhow) ne "2"} {  set byReq(rhow) 1  }if {$byReq(ehow) ne "2"} {  set byReq(ehow) 1  }if {$byReq(dhow) ne "2"} {  set byReq(dhow) 1  }if {$byReq(uhow) ne "2"} {  set byReq(uhow) 1  }proc bReqProcAdd {nk uh hn ch tx} {   global byReq   set ch [string tolower $ch]  ;  set tx [string trim $tx]   if {[lsearch -exact $byReq(achan) $ch]=="-1"} {  return 0  }   if {$tx eq ""} {      puthelp "PRIVMSG $ch :Correct syntax is: $byReq(add) &lt;your-message-here&gt;"      puthelp "PRIVMSG $ch :Example: $byReq(add) I want coke."  ;  return 0   }   set tf $byReq(file)  ;  set ftime [clock format [unixtime] -format %D@%R]   set id [open $tf a]  ;  puts $id "\[$hn\] $tx ($ftime)"  ;  close $id   if {![file exists $tf]} {      puthelp "PRIVMSG $ch :Unable to find or make text file: $tf"   } else {  puthelp "PRIVMSG $ch :$nk: Request Accepted."  }   return 0}proc bReqProcReadF {nk uh hn ch tx} {   bReqProcRead $nk $uh $hn $ch $tx file  ;  return 0}proc bReqProcRead {nk uh hn ch tx {do line} } {   global byReq   set ch [string tolower $ch]  ;  set tx [string trim $tx]   if {[lsearch -exact $byReq(rchan) $ch]=="-1"} {  return 0  }   if {$byReq(rhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }   if {$do eq "line" &amp;&amp; $tx eq ""} {      puthelp "$pre :Correct syntax is: $byReq(read) &lt;line# or handle&gt;"      puthelp "$pre :Example: $byReq(read) 4"      puthelp "$pre :Example: $byReq(read) spike"      puthelp "$pre :Or type $byReq(readf) to see all pending requests."  ;  return 0   }   set tf $byReq(file)   if {![file exists $tf]} {      puthelp "$pre :$nk: There are no pending requests."  ;  return 0   }   if {$do eq "line"} {  set tx [lindex [split $tx] 0]  ;  set scnt 0      if {[string is digit -strict $tx]} {  set fline $tx  } else {  set fhand "\\\[$tx\\\] *"  }   }   set tid [open $tf]  ;  set lnum 0   while {![eof $tid]} {  set line [gets $tid]      if {$line ne ""} {  incr lnum         if {$do eq "file"} {  puthelp "$pre :$lnum - $line"         } elseif {[info exists fline] &amp;&amp; $lnum==$fline} {            puthelp "$pre :$lnum - $line"  ;  break         } elseif {[info exists fhand] &amp;&amp; [string match -nocase $fhand $line]} {            puthelp "$pre :$lnum - $line"  ;  incr scnt         }      }   }   close $tid   if {$lnum=="0"} {  puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }   if {$do eq "file"} {  puthelp "$pre :List Completed - Total Pending Requests ($lnum)."   } elseif {[info exists fhand] &amp;&amp; $scnt=="0"} {  puthelp "$pre :$tx has no pending requests."   } elseif {[info exists fline] &amp;&amp; $fline&gt;$lnum} {  set tl request      if {$lnum&gt;"1"} {  set tl requests  }      puthelp "$pre :$nk: Request number $fline doesn't exist ($lnum pending $tl)."   }   return 0}proc bReqProcDel {nk uh hn ch tx} {   bReqProcEdit $nk $uh $hn $ch $tx del  ;  return 0}proc bReqProcEdit {nk uh hn ch tx {do edit} } {   global byReq   set ch [string tolower $ch]  ;  set tx [split [string trim $tx]]   if {[lsearch -exact $byReq(echan) $ch]=="-1"} {  return 0  }   if {$byReq(ehow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }   if {$do eq "edit"} {      if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {         puthelp "$pre :Correct syntax is: $byReq(edit) &lt;req#&gt; &lt;new-message&gt;"         puthelp "$pre :Example: $byReq(edit) 4 coke is not good for health."  ;  return 0      }   } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {      puthelp "$pre :Correct syntax is: $byReq(del) &lt;req#&gt;"      puthelp "$pre :Example: $byReq(del) 4"  ;  return 0   }   set tf $byReq(file)   if {![file exists $tf]} {      puthelp "$pre :$nk: There are no pending requests."  ;  return 0   }   set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]   set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]   set tid [open $tf]  ;  set lnum 0   while {![eof $tid]} {  set line [gets $tid]      if {$line ne ""} {  incr lnum         if {$lnum==$find} {            if {$do eq "edit"} {  set line [split $line]               set date [lindex $line end]  ;  set hand [lindex $line 0]               puthelp "$pre :$nk: Requests List Updated successfully."               puts $nid "$hand $tx $date"            } elseif {$do eq "del"} {               puthelp "$pre :$nk: Request Done - Deleted from the list."            }         } else {  puts $nid $line  }      }   }   close $tid   if {$find&gt;$lnum} {      if {$lnum&gt;"0"} {  set tl request         if {$lnum&gt;"1"} {  set tl requests  }         puthelp "$pre :$nk: Request number $find doesn't exist ($lnum pending $tl)."      } else {  puthelp "$pre :$nk: There are no pending requests."  }      close $nid  ;  file delete $new   } else {  close $nid  ;  file rename -force $new $tf  }   return 0}proc bReqProcDelF {nk uh hn ch tx} {   global byReq   set ch [string tolower $ch]   if {[lsearch -exact $byReq(dchan) $ch]=="-1"} {  return 0  }   if {$byReq(dhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }   set tf $byReq(file)   if {![file exists $tf]} {      puthelp "$pre :$nk: There are no pending requests."  ;  return 0   }   puthelp "$pre :$nk: All pending requests deleted successfully!"   file delete $tf  ;  return 0}proc bReqProcUser {nk uh hn ch tx} {   global byReq   set ch [string tolower $ch]  ;  set tx [string trim $tx]   if {[lsearch -exact $byReq(uchan) $ch]=="-1"} {  return 0  }   if {$byReq(uhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }   if {$tx eq ""} {      puthelp "$pre :Correct syntax is: $byReq(user) &lt;handle&gt;"      puthelp "$pre :Example: $byReq(user) spike"  ;  return 0   }   set tx [lindex [split $tx] 0]   if {![validuser $tx]} {      puthelp "$pre :$nk: $tx is not a valid user handle."  ;  return 0   }   if {[set cmt [getuser $tx COMMENT]] eq ""} {      puthelp "$pre :$nk: There is no comment for $tx."  ;  return 0   }   puthelp "$pre :$nk: $tx - $cmt"  ;  return 0}putlog "ByRequest.tcl Ver. 1.0 by SpiKe^^ loaded." </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Feb 06, 2013 4:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Madalin]]></name></author>
		<updated>2013-02-06T07:23:18-04:00</updated>

		<published>2013-02-06T07:23:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100913#p100913</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100913#p100913"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100913#p100913"><![CDATA[
Modifyed it.. it should work now<br>If that error was the only one.<br><div class="codebox"><p>Code: </p><pre><code># ByRequest.tcl Version 1.0 (6 Feb 2013) ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############ General Text File Settings ############ Set the full route &amp; file name of the file to edit ## Note: The !req &lt;message&gt; command will attempt to make this file if needed.set byReq(file) {/usr/home/spike/eggdrop/scripts/byreq.txt}########### Public 'Add Request' Command Settings ############# settings for the public !req &lt;message&gt; command ### Set the listen channel(s) for !req &lt;message&gt; command #set byReq(achan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the !req &lt;message&gt; command #set byReq(aflags) {R|R}# Set the public trigger for the !req &lt;message&gt; command ## to add a request at the end of the file:#    example:  !req I want coke.set byReq(add) {!req}########### Public 'Read Requests' Commands Settings ############# settings for the public !reqview &lt;req#&gt; and !reqlist commands ### Set the listen channel(s) for the public Read Requests commands #set byReq(rchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Read Requests commands #set byReq(rflags) {o|o}# Should these 2 commands reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(rhow) "1"# Set the public trigger for the !reqview &lt;req#&gt; / !reqview &lt;handle&gt; command ## to read a specific request (by line number) from the text file#    example:  !reqview 4#    note: use to check for correct line before doing !reqedit or !reqdone# to read all requests by &lt;handle&gt; from the text file#    example:  !reqview spikeset byReq(read) {!reqview}# Set the public trigger for the !reqlist command ## to read all requests from the text file#    example:  !reqlistset byReq(readf) {!reqlist}########### Public 'Edit/Delete Requests' Commands Settings ############# settings for the public !reqedit &lt;req#&gt; and !reqdone &lt;req#&gt; commands ### Set the listen channel(s) for the public Edit/Delete Requests commands #set byReq(echan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Edit/Delete Requests commands #set byReq(eflags) {m|m}# Should these 2 commands reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(ehow) "1"# Set the public trigger for the !reqedit &lt;req#&gt; &lt;new text&gt; command ## to edit a specific request (by line number) in the text file#    example:  !reqedit 4 coke is not good for health.set byReq(edit) {!reqedit}# Set the public trigger for the !reqdone &lt;req#&gt; command ## to delete a specific request (by line number) from the text file#    example:  !reqdone 4#    note: this will renumber all requests after request 4!set byReq(del) {!reqdone}########### Public 'Delete All Requests' Command Settings ############# settings for the public !reqpurge command ### Set the listen channel(s) for the public Delete All Requests command #set byReq(dchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Delete All Requests command #set byReq(dflags) {n|n}# Should this command reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(dhow) "1"# Set the public trigger for the !reqpurge command ## to delete all requests from the text file#    example:  !reqpurgeset byReq(delf) {!reqpurge}########### Public 'Read User Comment' Command Settings ############# settings for the public !requser command ### Set the listen channel(s) for the public Read User Comment command #set byReq(uchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Read User Comment command #set byReq(uflags) {n|n}# Should this command reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(uhow) "2"# Set the public trigger for the !reqpurge command ## to delete all requests from the text file#    example:  !reqpurgeset byReq(user) {!requser}################ End Settings ################bind pub $byReq(aflags) $byReq(add) bReqProcAddbind pub $byReq(rflags) $byReq(read) bReqProcReadbind pub $byReq(rflags) $byReq(readf) bReqProcReadFbind pub $byReq(eflags) $byReq(del) bReqProcDelbind pub $byReq(eflags) $byReq(edit) bReqProcEditbind pub $byReq(dflags) $byReq(delf) bReqProcDelFbind pub $byReq(uflags) $byReq(user) bReqProcUserset byReq(achan) [split [string tolower $byReq(achan)]]set byReq(rchan) [split [string tolower $byReq(rchan)]]set byReq(echan) [split [string tolower $byReq(echan)]]set byReq(dchan) [split [string tolower $byReq(dchan)]]set byReq(uchan) [split [string tolower $byReq(uchan)]]if {$byReq(rhow) ne "2"} {  set byReq(rhow) 1  }if {$byReq(ehow) ne "2"} {  set byReq(ehow) 1  }if {$byReq(dhow) ne "2"} {  set byReq(dhow) 1  }if {$byReq(uhow) ne "2"} {  set byReq(uhow) 1  }proc bReqProcAdd {nk uh hn ch tx} {set ch [string tolower $ch]  ;  set tx [string trim $tx]if {[lsearch -exact $::byReq(achan) $ch]=="-1"} {  return 0  }if {$tx eq ""} {puthelp "PRIVMSG $ch :Correct syntax is: $::byReq(add) &lt;your-message-here&gt;"puthelp "PRIVMSG $ch :Example: $::byReq(add) I want coke."  ;  return 0}set tf $::byReq(file)  ;  set ftime [clock format [unixtime] -format %D@%R]set id [open $tf a]  ;  puts $id "\[$hn\] $tx ($ftime)"  ;  close $idif {![file exists $tf]} {puthelp "PRIVMSG $ch :Unable to find or make text file: $tf"} else {  puthelp "PRIVMSG $ch :$nk: Request Accepted."  }return 0}proc bReqProcReadF {nk uh hn ch tx} {bReqProcRead $nk $uh $hn $ch $tx file  ;  return 0}proc bReqProcRead {nk uh hn ch tx {do line} } {set ch [string tolower $ch]  ;  set tx [string trim $tx]if {[lsearch -exact $::byReq(rchan) $ch]=="-1"} {  return 0  }if {$::byReq(rhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }if {$do eq "line" &amp;&amp; $tx eq ""} {puthelp "$pre :Correct syntax is: $::byReq(read) &lt;line# or handle&gt;"puthelp "$pre :Example: $::byReq(read) 4"puthelp "$pre :Example: $::byReq(read) spike"puthelp "$pre :Or type $::byReq(readf) to see all pending requests."  ;  return 0}set tf $::byReq(file)if {![file exists $tf]} {puthelp "$pre :$nk: There are no pending requests."  ;  return 0}if {$do eq "line"} {  set tx [lindex [split $tx] 0]  ;  set scnt 0if {[string is digit -strict $tx]} {  set fline $tx  } else {  set fhand "\\\[$tx\\\] *"  }}set tid [open $tf]  ;  set lnum 0while {![eof $tid]} {  set line [gets $tid]if {$line ne ""} {  incr lnumif {$do eq "file"} {  puthelp "$pre :$lnum - $line"} elseif {[info exists fline] &amp;&amp; $lnum==$fline} {puthelp "$pre :$lnum - $line"  ;  break} elseif {[info exists fhand] &amp;&amp; [string match -nocase $fhand $line]} {puthelp "$pre :$lnum - $line"  ;  incr scnt}}}close $tidif {$lnum=="0"} {  puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }if {$do eq "file"} {  puthelp "$pre :List Completed – Total Pending Requests ($lnum)."} elseif {[info exists fhand] &amp;&amp; $scnt=="0"} {  puthelp "$pre :$tx has no pending requests."} elseif {[info exists fline] &amp;&amp; $fline&gt;$lnum} {  set tl requestif {$lnum&gt;"1"} {  set tl requests  }puthelp "$pre :$nk: Request number $fline doesn't exist ($lnum pending $tl)."}return 0}proc bReqProcDel {nk uh hn ch tx} {bReqProcEdit $nk $uh $hn $ch $tx del  ;  return 0}proc bReqProcEdit {nk uh hn ch tx {do edit} } {set ch [string tolower $ch]  ;  set tx [split [string trim $tx]]if {[lsearch -exact $::byReq(echan) $ch]=="-1"} {  return 0  }if {$::byReq(ehow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }if {$do eq "edit"} {if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {puthelp "$pre :Correct syntax is: $::byReq(edit) &lt;req#&gt; &lt;new-message&gt;"puthelp "$pre :Example: $::byReq(edit) 4 coke is not good for health."  ;  return 0}} elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {puthelp "$pre :Correct syntax is: $::byReq(del) &lt;req#&gt;"puthelp "$pre :Example: $::byReq(del) 4"  ;  return 0}set tf $::byReq(file)if {![file exists $tf]} {puthelp "$pre :$nk: There are no pending requests."  ;  return 0}set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]set tid [open $tf]  ;  set lnum 0while {![eof $tid]} {  set line [gets $tid]if {$line ne ""} {  incr lnumif {$lnum==$find} {if {$do eq "edit"} {  set line [split $line]set date [lindex $line end]  ;  set hand [lindex $line 0]puthelp "$pre :$nk: Requests List Updated successfully."puts $nid "$hand $tx $date"} elseif {$do eq "del"} {puthelp "$pre :$nk: Request Done – Deleted from the list."}} else {  puts $nid $line  }}}close $tidif {$find&gt;$lnum} {if {$lnum&gt;"0"} {  set tl requestif {$lnum&gt;"1"} {  set tl requests  }puthelp "$pre :$nk: Request number $find doesn't exist ($lnum pending $tl)."} else {  puthelp "$pre :$nk: There are no pending requests."  }close $nid  ;  file delete $new} else {  close $nid  ;  file rename -force $new $tf  }return 0}proc bReqProcDelF {nk uh hn ch tx} {set ch [string tolower $ch]if {[lsearch -exact $::byReq(dchan) $ch]=="-1"} {  return 0  }if {$::byReq(dhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }set tf $::byReq(file)if {![file exists $tf]} {puthelp "$pre :$nk: There are no pending requests."  ;  return 0}puthelp "$pre :$nk: All pending requests deleted successfully!"file delete $tf  ;  return 0}proc bReqProcUser {nk uh hn ch tx} {set ch [string tolower $ch]  ;  set tx [string trim $tx]if {[lsearch -exact $::byReq(uchan) $ch]=="-1"} {  return 0  }if {$::byReq(uhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }if {$tx eq ""} {puthelp "$pre :Correct syntax is: $::byReq(user) &lt;handle&gt;"puthelp "$pre :Example: $::byReq(user) spike"  ;  return 0}set tx [lindex [split $tx] 0]if {![validuser $tx]} {puthelp "$pre :$nk: $tx is not a valid user handle."  ;  return 0}if {[set cmt [getuser $tx COMMENT]] eq ""} {puthelp "$pre :$nk: There is no comment for $tx."  ;  return 0}puthelp "$pre :$nk: $tx - $cmt"  ;  return 0}putlog "ByRequest.tcl Ver. 1.0 by SpiKe^^ loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6396">Madalin</a> — Wed Feb 06, 2013 7:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fyre]]></name></author>
		<updated>2013-02-06T06:53:55-04:00</updated>

		<published>2013-02-06T06:53:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100912#p100912</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100912#p100912"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100912#p100912"><![CDATA[
Thank you so much Spike!!<br>But have a look below when I tried to test this script...<br><br>In Public:<blockquote class="uncited"><div>&lt;fyre&gt; !reqview<br>&lt;fyre&gt; !reqedit<br>&lt;fyre&gt; !requser<br>&lt;fyre&gt; !reqlist</div></blockquote>In Partyline:<blockquote class="uncited"><div>&lt;(Bot&gt; [05:49] Tcl error [bReqProcRead]: can't read "byReq(rhow)": no such variable<br>&lt;(Bot&gt; [05:49] Tcl error [bReqProcEdit]: can't read "byReq(ehow)": no such variable<br>&lt;(Bot&gt; [05:49] Tcl error [bReqProcUser]: can't read "byReq(uhow)": no such variable<br>&lt;(Bot&gt; [05:50] Tcl error [bReqProcReadF]: can't read "byReq(rhow)": no such variable</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7846">fyre</a> — Wed Feb 06, 2013 6:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2013-02-06T03:42:04-04:00</updated>

		<published>2013-02-06T03:42:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100911#p100911</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100911#p100911"/>
		<title type="html"><![CDATA[ByRequest.tcl Version 1.0 (6 Feb 2013)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100911#p100911"><![CDATA[
Hey fyre, here's that requests script you were looking for.<br>Still completely untested, so please let us know how it works out for you:)<br><div class="codebox"><p>Code: </p><pre><code># ByRequest.tcl Version 1.0 (6 Feb 2013) ## author:  SpiKe^^ ## e-mail:  spike&lt;at&gt;mytclscripts&lt;dot&gt;com ## webpage: http://mytclscripts.com/ ## This file is Copyrighted under the GNU Public License. ## http://www.gnu.org/copyleft/gpl.html ############ General Text File Settings ############ Set the full route &amp; file name of the file to edit ## Note: The !req &lt;message&gt; command will attempt to make this file if needed.set byReq(file) {/usr/home/spike/eggdrop/scripts/byreq.txt}########### Public 'Add Request' Command Settings ############# settings for the public !req &lt;message&gt; command ### Set the listen channel(s) for !req &lt;message&gt; command #set byReq(achan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the !req &lt;message&gt; command #set byReq(aflags) {R|R}# Set the public trigger for the !req &lt;message&gt; command ## to add a request at the end of the file:#    example:  !req I want coke.set byReq(add) {!req}########### Public 'Read Requests' Commands Settings ############# settings for the public !reqview &lt;req#&gt; and !reqlist commands ### Set the listen channel(s) for the public Read Requests commands #set byReq(rchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Read Requests commands #set byReq(rflags) {o|o}# Should these 2 commands reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(rhow) "1"# Set the public trigger for the !reqview &lt;req#&gt; / !reqview &lt;handle&gt; command ## to read a specific request (by line number) from the text file#    example:  !reqview 4#    note: use to check for correct line before doing !reqedit or !reqdone# to read all requests by &lt;handle&gt; from the text file#    example:  !reqview spikeset byReq(read) {!reqview}# Set the public trigger for the !reqlist command ## to read all requests from the text file#    example:  !reqlistset byReq(readf) {!reqlist}########### Public 'Edit/Delete Requests' Commands Settings ############# settings for the public !reqedit &lt;req#&gt; and !reqdone &lt;req#&gt; commands ### Set the listen channel(s) for the public Edit/Delete Requests commands #set byReq(echan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Edit/Delete Requests commands #set byReq(eflags) {m|m}# Should these 2 commands reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(ehow) "1"# Set the public trigger for the !reqedit &lt;req#&gt; &lt;new text&gt; command # # to edit a specific request (by line number) in the text file #    example:  !reqedit 4 coke is not good for health. set byReq(edit) {!reqedit} # Set the public trigger for the !reqdone &lt;req#&gt; command # # to delete a specific request (by line number) from the text file #    example:  !reqdone 4 #    note: this will renumber all requests after request 4! set byReq(del) {!reqdone} ########### Public 'Delete All Requests' Command Settings ############# settings for the public !reqpurge command ### Set the listen channel(s) for the public Delete All Requests command #set byReq(dchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Delete All Requests command #set byReq(dflags) {n|n}# Should this command reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(dhow) "1"# Set the public trigger for the !reqpurge command ## to delete all requests from the text file#    example:  !reqpurgeset byReq(delf) {!reqpurge}########### Public 'Read User Comment' Command Settings ############# settings for the public !requser command ### Set the listen channel(s) for the public Read User Comment command #set byReq(uchan) {#yourchannel #anotherchannel #someotherchan}# Set the access flags to use the public Read User Comment command #set byReq(uflags) {n|n}# Should this command reply by Public or User Notice ?? ##   1 = reply by public to the channel#   2 = reply by user noticeset byReq(uhow) "2"# Set the public trigger for the !reqpurge command ## to delete all requests from the text file#    example:  !reqpurgeset byReq(user) {!requser}################ End Settings ################bind pub $byReq(aflags) $byReq(add) bReqProcAddbind pub $byReq(rflags) $byReq(read) bReqProcReadbind pub $byReq(rflags) $byReq(readf) bReqProcReadFbind pub $byReq(eflags) $byReq(del) bReqProcDelbind pub $byReq(eflags) $byReq(edit) bReqProcEditbind pub $byReq(dflags) $byReq(delf) bReqProcDelFbind pub $byReq(uflags) $byReq(user) bReqProcUserset byReq(achan) [split [string tolower $byReq(achan)]]set byReq(rchan) [split [string tolower $byReq(rchan)]]set byReq(echan) [split [string tolower $byReq(echan)]]set byReq(dchan) [split [string tolower $byReq(dchan)]]set byReq(uchan) [split [string tolower $byReq(uchan)]]if {$byReq(rhow) ne "2"} {  set byReq(rhow) 1  }if {$byReq(ehow) ne "2"} {  set byReq(ehow) 1  }if {$byReq(dhow) ne "2"} {  set byReq(dhow) 1  }if {$byReq(uhow) ne "2"} {  set byReq(uhow) 1  }proc bReqProcAdd {nk uh hn ch tx} {  set ch [string tolower $ch]  ;  set tx [string trim $tx]  if {[lsearch -exact $::byReq(achan) $ch]=="-1"} {  return 0  }  if {$tx eq ""} {    puthelp "PRIVMSG $ch :Correct syntax is: $::byReq(add) &lt;your-message-here&gt;"    puthelp "PRIVMSG $ch :Example: $::byReq(add) I want coke."  ;  return 0  }  set tf $::byReq(file)  ;  set ftime [clock format [unixtime] -format %D@%R]  set id [open $tf a]  ;  puts $id "\[$hn\] $tx ($ftime)"  ;  close $id  if {![file exists $tf]} {    puthelp "PRIVMSG $ch :Unable to find or make text file: $tf"  } else {  puthelp "PRIVMSG $ch :$nk: Request Accepted."  }   return 0}proc bReqProcReadF {nk uh hn ch tx} {  bReqProcRead $nk $uh $hn $ch $tx file  ;  return 0} proc bReqProcRead {nk uh hn ch tx {do line} } {  set ch [string tolower $ch]  ;  set tx [string trim $tx]  if {[lsearch -exact $::byReq(rchan) $ch]=="-1"} {  return 0  }  if {$byReq(rhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }  if {$do eq "line" &amp;&amp; $tx eq ""} {    puthelp "$pre :Correct syntax is: $::byReq(read) &lt;line# or handle&gt;"    puthelp "$pre :Example: $::byReq(read) 4"    puthelp "$pre :Example: $::byReq(read) spike"    puthelp "$pre :Or type $::byReq(readf) to see all pending requests."  ;  return 0  }   set tf $::byReq(file)  if {![file exists $tf]} {    puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }  if {$do eq "line"} {  set tx [lindex [split $tx] 0]  ;  set scnt 0    if {[string is digit -strict $tx]} {  set fline $tx  } else {  set fhand "\\\[$tx\\\] *"  }  }  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$do eq "file"} {  puthelp "$pre :$lnum - $line"      } elseif {[info exists fline] &amp;&amp; $lnum==$fline} {        puthelp "$pre :$lnum - $line"  ;  break      } elseif {[info exists fhand] &amp;&amp; [string match -nocase $fhand $line]} {        puthelp "$pre :$lnum - $line"  ;  incr scnt      }    }  }  close $tid  if {$lnum=="0"} {  puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }  if {$do eq "file"} {  puthelp "$pre :List Completed – Total Pending Requests ($lnum)."  } elseif {[info exists fhand] &amp;&amp; $scnt=="0"} {  puthelp "$pre :$tx has no pending requests."  } elseif {[info exists fline] &amp;&amp; $fline&gt;$lnum} {  set tl request    if {$lnum&gt;"1"} {  set tl requests  }    puthelp "$pre :$nk: Request number $fline doesn't exist ($lnum pending $tl)."  }  return 0}proc bReqProcDel {nk uh hn ch tx} {  bReqProcEdit $nk $uh $hn $ch $tx del  ;  return 0}proc bReqProcEdit {nk uh hn ch tx {do edit} } {  set ch [string tolower $ch]  ;  set tx [split [string trim $tx]]  if {[lsearch -exact $::byReq(echan) $ch]=="-1"} {  return 0  }  if {$byReq(ehow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }  if {$do eq "edit"} {    if {[llength $tx]&lt;"2" || ![string is digit -strict [lindex $tx 0]]} {      puthelp "$pre :Correct syntax is: $::byReq(edit) &lt;req#&gt; &lt;new-message&gt;"      puthelp "$pre :Example: $::byReq(edit) 4 coke is not good for health."  ;  return 0    }  } elseif {$do eq "del" &amp;&amp; ![string is digit -strict [lindex $tx 0]]} {    puthelp "$pre :Correct syntax is: $::byReq(del) &lt;req#&gt;"    puthelp "$pre :Example: $::byReq(del) 4"  ;  return 0  }  set tf $::byReq(file)  if {![file exists $tf]} {    puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }  set find [lindex $tx 0]  ;  set tx [string trim [join [lrange $tx 1 end]]]  set new [file dirname $tf]/newfile.tmp  ;  set nid [open $new w]  set tid [open $tf]  ;  set lnum 0  while {![eof $tid]} {  set line [gets $tid]    if {$line ne ""} {  incr lnum      if {$lnum==$find} {        if {$do eq "edit"} {  set line [split $line]          set date [lindex $line end]  ;  set hand [lindex $line 0]          puthelp "$pre :$nk: Requests List Updated successfully."          puts $nid "$hand $tx $date"        } elseif {$do eq "del"} {          puthelp "$pre :$nk: Request Done – Deleted from the list."        }      } else {  puts $nid $line  }    }  }  close $tid  if {$find&gt;$lnum} {    if {$lnum&gt;"0"} {  set tl request      if {$lnum&gt;"1"} {  set tl requests  }      puthelp "$pre :$nk: Request number $find doesn't exist ($lnum pending $tl)."    } else {  puthelp "$pre :$nk: There are no pending requests."  }    close $nid  ;  file delete $new  } else {  close $nid  ;  file rename -force $new $tf  }  return 0}proc bReqProcDelF {nk uh hn ch tx} {  set ch [string tolower $ch]  if {[lsearch -exact $::byReq(dchan) $ch]=="-1"} {  return 0  }  if {$byReq(dhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }  set tf $::byReq(file)  if {![file exists $tf]} {    puthelp "$pre :$nk: There are no pending requests."  ;  return 0  }  puthelp "$pre :$nk: All pending requests deleted successfully!"  file delete $tf  ;  return 0}proc bReqProcUser {nk uh hn ch tx} {  set ch [string tolower $ch]  ;  set tx [string trim $tx]  if {[lsearch -exact $::byReq(uchan) $ch]=="-1"} {  return 0  }  if {$byReq(uhow)=="2"} {  set pre "NOTICE $nk"  } else {  set pre "PRIVMSG $ch"  }  if {$tx eq ""} {    puthelp "$pre :Correct syntax is: $::byReq(user) &lt;handle&gt;"    puthelp "$pre :Example: $::byReq(user) spike"  ;  return 0  }  set tx [lindex [split $tx] 0]  if {![validuser $tx]} {    puthelp "$pre :$nk: $tx is not a valid user handle."  ;  return 0  }  if {[set cmt [getuser $tx COMMENT]] eq ""} {    puthelp "$pre :$nk: There is no comment for $tx."  ;  return 0  }  puthelp "$pre :$nk: $tx - $cmt"  ;  return 0}putlog "ByRequest.tcl Ver. 1.0 by SpiKe^^ loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Feb 06, 2013 3:42 am</p><hr />
]]></content>
	</entry>
	</feed>
