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

	<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>2006-02-18T15:27:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Winters]]></name></author>
		<updated>2006-02-18T15:27:55-04:00</updated>

		<published>2006-02-18T15:27:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60505#p60505</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60505#p60505"/>
		<title type="html"><![CDATA[need help changing team manager script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60505#p60505"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># needs: tfile(dir/ver)# include files neededset tfile(cmm) "$tfile(dir)/team-common.dat"set tfile(cms) "0"# team-#channel.datproc learn:rcf {channel} {   global tfile   if {$tfile(cms) == 1} {     return $tfile(cmm)   } else {     return $tfile(dir)/team-$channel.dat   } }# team-#channel.dat.auxproc learn:rcx {channel} {   global tfile   if {$tfile(cms) == 1} {     return $tfile(cmm).aux   } else {     return $tfile(dir)/team-$channel.dat.aux   } }proc pub:learn:cmd {nick host hand channel text} {   global tfile ttrig   if {[channel get $channel noteam]} {     return 0   }    if {[lindex $text 0] == ""} {     putserv "notice $nick :$ttrig(cmd) &lt;option&gt; ... (rev. $tfile(ver))"     putserv "notice $nick :$ttrig(get) &lt;command&gt; (notice)"     putserv "notice $nick :$ttrig(teg) &lt;command&gt; (channel)"     if {[matchattr [nick2hand $nick] f]} {       putserv "notice $nick :$ttrig(cmd) &lt;command&gt; &lt;definition&gt;"     }     putserv "notice $nick :bug reports or innovations to http://sourceforge.net/projects/teambot/"     return 0    }   if {[lindex $text 0] == "-a"} {     pub:learn:add $nick $channel [lrange $text 1 end]     return 0   }   if {[lindex $text 0] == "-d"} {     pub:learn:del $nick $channel [lrange $text 1 end]     return 0   }    if {[lindex $text 0] == "commands" || [lindex $text 0] == "roster" || [lindex $text 0] == "servers" || [lindex $text 0] == "sponsors" || [lindex $text 0] == "rules" || [lindex $text 0] == "news" || [lindex $text 0] == "leagues" || [lindex $text 0] == "practices" || [lindex $text 0] == "web" || [lindex $text 0] == "motd"} {     pub:learn:del $nick $channel [lrange $text 0 0]     pub:learn:add $nick $channel [lrange $text 0 end]     return 0   }   putserv "notice $nick :invalid option.  option: commands, roster, servers, sponsors, rules, news, leagues, practices, web, motd "  }proc team:commands {nick host hand channel text} {   global ttrig tfile tmatch   if {[channel get $channel noteam]} {     return 0   }    if {$tmatch(queue)!=""} {     if {[expr [unixtime] - $tmatch(queue)] &lt;$tmatch(sec)} {       putserv "notice $nick : Someone is already requesting help, try again in $tmatch(sec) seconds please"       return 0     }   }   set tmatch(queue) [unixtime]   putserv "notice $nick :You can use these commands :"   pub:learn:get $nick $host $hand $channel commands   putserv "notice $nick :\002$ttrig(get)steamid\002, \002$ttrig(get)searchsteam\002, \002$ttrig(get)last\002, \002$ttrig(get)next\002, \002$ttrig(get)record\002."   }proc team:roster {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel roster   }proc team:servers {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel servers   }proc team:sponsors {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel sponsors   }proc team:rules {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel rules   }proc team:news {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel news   }   proc team:leagues {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel leagues   }proc team:practices {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel practices   }proc team:web {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    pub:learn:get $nick $host $hand $channel web   }proc team:help {nick uhost handle channel arg} {   global ttrig tfile tmatch   if {[channel get $channel noteam]} {     return 0   }   if {[matchattr $handle T|T $channel]} {     putserv "notice $nick :You can use these commands :"     putserv "notice $nick :\002$ttrig(get)addmatch\002 team(xxx) date(hh:mm-mm/dd/yy) map(x) ( + infos(x) ) Add a match un the calendar, info(x) are not required."     putserv "notice $nick :\002$ttrig(get)addresult\002 &lt;id&gt; &lt;your-score&gt; &lt;opponent-socre&gt; Add a result on a pending match."     putserv "notice $nick :\002$ttrig(get)chinfo\002 &lt;id&gt; &lt;new entries&gt;. Change stored informations about &lt;id&gt;."     putserv "notice $nick :\002$ttrig(get)delete\002 &lt;id&gt; Delete a match from database."     putserv "notice $nick :\002$ttrig(get)id\002 Shows you last entries in database and the ID (set by default to $tmatch(shownumber))."     putserv "notice $nick :\002$ttrig(get)pending\002 &lt;x&gt; Shows you the more recent match(es) waiting for a result."     putserv "notice $nick :\002$ttrig(get)upcoming\002 &lt;x&gt; Shows you the next &lt;x&gt; matches in the calendar."     putserv "notice $nick :team manager v$tfile(ver) by LorT"   }   }# needs: learn:rcfproc learn:get {channel unikey uniidx} {   set rslt [list]   set fp [open [learn:rcf $channel] r]   while {![eof $fp]} {     set line [gets $fp]     if {[lindex $line 0] == $unikey} {     set rslt [linsert $rslt 0 $line]     }   }   close $fp  # reverse stack list (shouldn't happen :-()   set tlsr [list]   foreach unikey $rslt {     set tlsr [linsert $tlsr 0 $unikey]   }   return $tlsr }proc learn:dln {nick list idx udx} {   foreach unikey $list {     if {[lrange $unikey 0 0] == "motd"} {       putserv "notice $nick : [join [lrange $unikey 1 end]]"     } else {       putserv "notice $nick :\002[join [lrange $unikey 0 0]]:\002 [join [lrange $unikey 1 end]]"    }  }}proc learn:dlc {channel list idx udx} {   foreach unikey $list {     putserv "privmsg $channel :\002[join [lrange $unikey 0 0]]:\002 [join [lrange $unikey 1 end]]"     }  }proc learn:cdf {channel unikey} {   set bdc 0   set fp [open [learn:rcf $channel] r]   while {![eof $fp]} {     set line [gets $fp]     if {[lindex $line 0] == $unikey} {       incr bdc     }   }   close $fp   return $bdc  }proc pub:learn:get {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }   if {[lindex $text 0] == ""} {    puthelp "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    return 0  }  set unikey [string tolower [lindex $text 0]]  set uniidx 0  if {[string is integer -strict [lindex $text 1]]} {    set uniidx [lindex $text 1]  }  set rslt [learn:get $channel $unikey $uniidx]  if {$rslt == ""} {  } else {    learn:dln $nick $rslt $uniidx [learn:cdf $channel $unikey]  }}proc pub:learn:teg {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }   if {[lindex $text 0] == ""} {    puthelp "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    return 0  }  set unikey [string tolower [lindex $text 0]]  set uniidx 0  if {[string is integer -strict [lindex $text 1]]} {    set uniidx [lindex $text 1]  }  set rslt [learn:get $channel $unikey $uniidx]  if {$rslt == ""} {  } else {    learn:dlc $channel $rslt $uniidx [learn:cdf $channel $unikey]  }}# needs: tfile(max/def) learn:rcfproc learn:cdef {unikey channel} {  set bdc 0  set fp [open [learn:rcf $channel] r]  while {![eof $fp]} {    set line [gets $fp]    if {[lindex $line 0] == $unikey} {      incr bdc    }  }  close $fp  return $bdc}proc pub:learn:add {nick channel text} {  global tfile  if {[lindex $text 1] == ""} {    putserv "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    set fp [open [learn:rcf $channel] a]    close $fp  }  set unikey [string tolower [lindex $text 0]]  set phrase [lrange $text 1 end]  set time [strftime %FT%TZ]  if {[learn:cdef $unikey $channel] == $tfile(def)} {    putserv "notice $nick :table full ($tfile(def)).  not added"    return 0  }  if {[string length $phrase] &lt; $tfile(max)} {    set fp [open [learn:rcf $channel] a]    puts $fp "$unikey [join [lrange [split $phrase] 0 end]]"    close $fp    putserv "notice $nick :command recorded"  } else {    putserv "notice $nick :command too long (+ $tfile(max) chars)"  }}# needs: learn:rcf learn:rcx# team-dell.tclproc learn:del {channel unikey uniidx} {  set idct 0  set fp1 [open [learn:rcf $channel] r]  set fp2 [open [learn:rcx $channel] a]  while {![eof $fp1]} {    set line [gets $fp1]    if {$line != ""} {      if {[lindex $line 0] != $unikey} {        puts $fp2 $line      } else {        incr idct   if {$uniidx != $idct &amp;&amp; $uniidx != 0} {     puts $fp2 $line   }      }    }  }  close $fp1  close $fp2  exec rm -f [learn:rcf $channel]  exec mv [learn:rcx $channel] [learn:rcf $channel]}proc pub:learn:del {nick channel text} {   if {[channel get $channel noteam]} {     return 0   }   if {[lindex $text 0] == ""} {    putserv "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    return 0  }  set unikey [string tolower [lindex $text 0]]  set uniidx 0  if {[string is integer -strict [lindex $text 1]]} {    set uniidx [lindex $text 1]  }  set rslt [learn:get $channel $unikey $uniidx]  if {$rslt == ""} {#    putserv "notice $nick :key not found"  } else {    learn:del $channel $unikey $uniidx#    putserv "notice $nick :key forgotten"  }}putlog "team-cmd.tcl, original by mferra"</code></pre></div>This should work <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=6461">Winters</a> — Sat Feb 18, 2006 3:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[R-WaT]]></name></author>
		<updated>2006-02-16T16:21:43-04:00</updated>

		<published>2006-02-16T16:21:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60479#p60479</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60479#p60479"/>
		<title type="html"><![CDATA[need help changing team manager script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60479#p60479"><![CDATA[
&lt;rwat^ms&gt; .commands<br>-MouseSkills- You can use these commands :<br>-MouseSkills- commands: .test .penis .lawler .website<br>-MouseSkills- .steamid to retrieve steamid.<br>-MouseSkills- .searchsteam to search server, map, player.<br>-MouseSkills- .last Shows you last match(es).<br>-MouseSkills- .next Shows you the next match.<br>-MouseSkills- .record Shows you the records.<br><br><br>I dont want mouseskills replying with all that info. I just want it to say "Commands - .command .command .commands" and thats it.<br><div class="codebox"><p>Code: </p><pre><code># needs: tfile(dir/ver)# include files neededset tfile(cmm) "$tfile(dir)/team-common.dat"set tfile(cms) "0"# team-#channel.datproc learn:rcf {channel} {   global tfile   if {$tfile(cms) == 1} {     return $tfile(cmm)   } else {     return $tfile(dir)/team-$channel.dat   } }# team-#channel.dat.auxproc learn:rcx {channel} {   global tfile   if {$tfile(cms) == 1} {     return $tfile(cmm).aux   } else {     return $tfile(dir)/team-$channel.dat.aux   } }proc pub:learn:cmd {nick host hand channel text} {   global tfile ttrig   if {[channel get $channel noteam]} {     return 0   }     if {[lindex $text 0] == ""} {     putserv "notice $nick :$ttrig(cmd) &lt;option&gt; ... (rev. $tfile(ver))"     putserv "notice $nick :$ttrig(get) &lt;command&gt; (notice)"     putserv "notice $nick :$ttrig(teg) &lt;command&gt; (channel)"     if {[matchattr [nick2hand $nick] f]} {       putserv "notice $nick :$ttrig(cmd) &lt;command&gt; &lt;definition&gt;"     }     putserv "notice $nick :bug reports or innovations to http://sourceforge.net/projects/teambot/"     return 0    }   if {[lindex $text 0] == "-a"} {     pub:learn:add $nick $channel [lrange $text 1 end]     return 0   }   if {[lindex $text 0] == "-d"} {     pub:learn:del $nick $channel [lrange $text 1 end]     return 0   }     if {[lindex $text 0] == "commands" || [lindex $text 0] == "roster" || [lindex $text 0] == "servers" || [lindex $text 0] == "sponsors" || [lindex $text 0] == "rules" || [lindex $text 0] == "news" || [lindex $text 0] == "leagues" || [lindex $text 0] == "practices" || [lindex $text 0] == "web" || [lindex $text 0] == "motd"} {      pub:learn:del $nick $channel [lrange $text 0 0]     pub:learn:add $nick $channel [lrange $text 0 end]     return 0   }   putserv "notice $nick :invalid option.  option: commands, roster, servers, sponsors, rules, news, leagues, practices, web, motd "  }proc team:commands {nick host hand channel text} {   global ttrig tfile tmatch   if {[channel get $channel noteam]} {     return 0   }     if {$tmatch(queue)!=""} {     if {[expr [unixtime] - $tmatch(queue)] &lt;$tmatch(sec)} {       putserv "notice $nick : Someone is already requesting help, try again in $tmatch(sec) seconds please"       return 0     }   }   set tmatch(queue) [unixtime]   putserv "notice $nick :You can use these commands :"   pub:learn:get $nick $host $hand $channel commands   putserv "notice $nick :\002$ttrig(get)steamid\002 to retrieve steamid."   putserv "notice $nick :\002$ttrig(get)searchsteam\002 to search server, map, player."   putserv "notice $nick :\002$ttrig(get)last\002 Shows you last match(es)."   putserv "notice $nick :\002$ttrig(get)next\002 Shows you the next match."   putserv "notice $nick :\002$ttrig(get)record\002 Shows you the records."   }proc team:roster {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel roster   }proc team:servers {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel servers   }proc team:sponsors {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel sponsors   }proc team:rules {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel rules   }proc team:news {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel news   }   proc team:leagues {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel leagues   }proc team:practices {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel practices   }proc team:web {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }     pub:learn:get $nick $host $hand $channel web   }proc team:help {nick uhost handle channel arg} {   global ttrig tfile tmatch   if {[channel get $channel noteam]} {     return 0   }    if {[matchattr $handle T|T $channel]} {     putserv "notice $nick :You can use these commands :"     putserv "notice $nick :\002$ttrig(get)addmatch\002 team(xxx) date(hh:mm-mm/dd/yy) map(x) ( + infos(x) ) Add a match un the calendar, info(x) are not required."     putserv "notice $nick :\002$ttrig(get)addresult\002 &lt;id&gt; &lt;your-score&gt; &lt;opponent-socre&gt; Add a result on a pending match."     putserv "notice $nick :\002$ttrig(get)chinfo\002 &lt;id&gt; &lt;new entries&gt;. Change stored informations about &lt;id&gt;."      putserv "notice $nick :\002$ttrig(get)delete\002 &lt;id&gt; Delete a match from database."     putserv "notice $nick :\002$ttrig(get)id\002 Shows you last entries in database and the ID (set by default to $tmatch(shownumber))."     putserv "notice $nick :\002$ttrig(get)pending\002 &lt;x&gt; Shows you the more recent match(es) waiting for a result."     putserv "notice $nick :\002$ttrig(get)upcoming\002 &lt;x&gt; Shows you the next &lt;x&gt; matches in the calendar."     putserv "notice $nick :team manager v$tfile(ver) by LorT"   }    }# needs: learn:rcfproc learn:get {channel unikey uniidx} {   set rslt [list]   set fp [open [learn:rcf $channel] r]   while {![eof $fp]} {     set line [gets $fp]     if {[lindex $line 0] == $unikey} {  set rslt [linsert $rslt 0 $line]     }   }   close $fp  # reverse stack list (shouldn't happen :-()   set tlsr [list]   foreach unikey $rslt {     set tlsr [linsert $tlsr 0 $unikey]   }   return $tlsr }proc learn:dln {nick list idx udx} {   foreach unikey $list {     if {[lrange $unikey 0 0] == "motd"} {       putserv "notice $nick : [join [lrange $unikey 1 end]]"      } else {        putserv "notice $nick :\002[join [lrange $unikey 0 0]]:\002 [join [lrange $unikey 1 end]]"    }  } }proc learn:dlc {channel list idx udx} {   foreach unikey $list {     putserv "privmsg $channel :\002[join [lrange $unikey 0 0]]:\002 [join [lrange $unikey 1 end]]"     }  }proc learn:cdf {channel unikey} {   set bdc 0   set fp [open [learn:rcf $channel] r]   while {![eof $fp]} {     set line [gets $fp]     if {[lindex $line 0] == $unikey} {       incr bdc     }   }   close $fp   return $bdc  }proc pub:learn:get {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    if {[lindex $text 0] == ""} {    puthelp "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    return 0  }  set unikey [string tolower [lindex $text 0]]  set uniidx 0  if {[string is integer -strict [lindex $text 1]]} {    set uniidx [lindex $text 1]  }  set rslt [learn:get $channel $unikey $uniidx]  if {$rslt == ""} {  } else {    learn:dln $nick $rslt $uniidx [learn:cdf $channel $unikey]  }}proc pub:learn:teg {nick host hand channel text} {   if {[channel get $channel noteam]} {     return 0   }    if {[lindex $text 0] == ""} {    puthelp "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    return 0  }  set unikey [string tolower [lindex $text 0]]  set uniidx 0  if {[string is integer -strict [lindex $text 1]]} {    set uniidx [lindex $text 1]  }  set rslt [learn:get $channel $unikey $uniidx]  if {$rslt == ""} {  } else {    learn:dlc $channel $rslt $uniidx [learn:cdf $channel $unikey]  }}# needs: tfile(max/def) learn:rcfproc learn:cdef {unikey channel} {  set bdc 0  set fp [open [learn:rcf $channel] r]  while {![eof $fp]} {    set line [gets $fp]    if {[lindex $line 0] == $unikey} {      incr bdc    }  }  close $fp  return $bdc}proc pub:learn:add {nick channel text} {  global tfile  if {[lindex $text 1] == ""} {    putserv "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    set fp [open [learn:rcf $channel] a]    close $fp  }  set unikey [string tolower [lindex $text 0]]  set phrase [lrange $text 1 end]  set time [strftime %FT%TZ]  if {[learn:cdef $unikey $channel] == $tfile(def)} {    putserv "notice $nick :table full ($tfile(def)).  not added"    return 0  }  if {[string length $phrase] &lt; $tfile(max)} {    set fp [open [learn:rcf $channel] a]    puts $fp "$unikey [join [lrange [split $phrase] 0 end]]"    close $fp    putserv "notice $nick :command recorded"  } else {    putserv "notice $nick :command too long (+ $tfile(max) chars)"  }}# needs: learn:rcf learn:rcx# team-dell.tclproc learn:del {channel unikey uniidx} {  set idct 0  set fp1 [open [learn:rcf $channel] r]  set fp2 [open [learn:rcx $channel] a]  while {![eof $fp1]} {    set line [gets $fp1]    if {$line != ""} {      if {[lindex $line 0] != $unikey} {        puts $fp2 $line      } else {        incr idctif {$uniidx != $idct &amp;&amp; $uniidx != 0} {  puts $fp2 $line}      }    }  }  close $fp1  close $fp2  exec rm -f [learn:rcf $channel]  exec mv [learn:rcx $channel] [learn:rcf $channel]}proc pub:learn:del {nick channel text} {   if {[channel get $channel noteam]} {     return 0   }    if {[lindex $text 0] == ""} {    putserv "notice $nick :invalid syntax"    return 0  }  if {![file exists [learn:rcf $channel]]} {    return 0  }  set unikey [string tolower [lindex $text 0]]  set uniidx 0  if {[string is integer -strict [lindex $text 1]]} {    set uniidx [lindex $text 1]  }  set rslt [learn:get $channel $unikey $uniidx]  if {$rslt == ""} {#    putserv "notice $nick :key not found"  } else {    learn:del $channel $unikey $uniidx#    putserv "notice $nick :key forgotten"  }}putlog "team-cmd.tcl, original by mferra"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7208">R-WaT</a> — Thu Feb 16, 2006 4:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
