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

	<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>2008-03-13T14:55:38-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Exedore]]></name></author>
		<updated>2008-03-13T14:55:38-04:00</updated>

		<published>2008-03-13T14:55:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81678#p81678</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81678#p81678"/>
		<title type="html"><![CDATA[-commands.tcl- [to send reports on channel]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81678#p81678"><![CDATA[
<strong class="text-strong"><span style="font-size:150%;line-height:116%">Thank you very very much YooHoo!<br>IT WORKS</span></strong>  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9666">Exedore</a> — Thu Mar 13, 2008 2:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2008-03-12T18:52:09-04:00</updated>

		<published>2008-03-12T18:52:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81644#p81644</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81644#p81644"/>
		<title type="html"><![CDATA[-commands.tcl- [to send reports on channel]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81644#p81644"><![CDATA[
Timeless classics  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Wed Mar 12, 2008 6:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[YooHoo]]></name></author>
		<updated>2008-03-12T17:13:31-04:00</updated>

		<published>2008-03-12T17:13:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81643#p81643</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81643#p81643"/>
		<title type="html"><![CDATA[Re: -commands.tcl- [to send reports on channel]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81643#p81643"><![CDATA[
<blockquote class="uncited"><div>Hello friends..<br><br>I have this TCL script called Commands.TCL<br>perhaps you might know this..<br>OK<br><br>The thing is...<br>this dude reports with NOTICE, or PRIVATE MESAGGE<br>and I want to reports on channel..<br>i switched this code <div class="codebox"><p>Code: </p><pre><code>puthelp "NOTICE $nick</code></pre></div>for this code<div class="codebox"><p>Code: </p><pre><code>puthelp "MSG $chan</code></pre></div>but it doesn't work</div></blockquote>You really should contact the author before muckin around with his code, but I can tell you this much, 'MSG' isn't a normal tcl command, PRIVMSG is. To make a bot 'speak' in a channel, the way to do it is <div class="codebox"><p>Code: </p><pre><code>puthelp "PRIVMSG $chan :message goes here"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2706">YooHoo</a> — Wed Mar 12, 2008 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Exedore]]></name></author>
		<updated>2008-03-12T16:14:28-04:00</updated>

		<published>2008-03-12T16:14:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81642#p81642</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81642#p81642"/>
		<title type="html"><![CDATA[-commands.tcl- [to send reports on channel]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81642#p81642"><![CDATA[
Hello friends..<br><br>I have this TCL script called Commands.TCL<br>perhaps you might know this..<br>OK<br><br>The thing is...<br>this dude reports with NOTICE, or PRIVATE MESAGGE<br>and I want to reports on channel..<br>i switched this code <div class="codebox"><p>Code: </p><pre><code>puthelp "NOTICE $nick</code></pre></div>for this code<div class="codebox"><p>Code: </p><pre><code>puthelp "MSG $chan</code></pre></div>but it doesn't work<br><br>When I switch this<div class="codebox"><p>Code: </p><pre><code>puthelp "NOTICE $nick</code></pre></div>for this<div class="codebox"><p>Code: </p><pre><code>puthelp "PRIVMSG $nick</code></pre></div>Works perfect<br><br>The entired code below:<div class="codebox"><p>Code: </p><pre><code>#### commands.tcl v1.2 - by strikelight ([sL] @ EFNet) (09/21/03)## For eggdrop1.1.5-eggdrop1.6.x## Contact:# - E-Mail: strikelight@tclscript.com# - WWW   : http://www.TCLScript.com# - IRC   : #Scripting @ EFNet##### Description:## This script will allow channel administrators to maintain a list of# available triggers for the channel, and allow users to view the list# of available triggers.##### History:## (09/21/03)/v1.2 - Cosmetic fixes## (10/20/02)/v1.1 - Fixed bug with error on startup: #                   "can't read 'eggversion': no such variable"#                   (Why didn't anyone else report this a long time ago?)#                 - Added option to change the trigger command## (5/27/02)/v1.0  - Initial Release##### Usage:## Edit the configuration below, and# type "!commands help" in a channel## (Modify '!commands help' with the trigger you choose below in the config)##### CONFIGURATION ### Trigger to use?set commands_trigger "!commands"# Flag required to add/remove triggersset commands_adminflag "m"## END OF CONFIG ##set commands_version "1.2"set eggversion [string trimleft [lindex $version 1] 0]bind pub - $commands_trigger commands:pubproc handisop {hand chan} {  return [expr {[validchan $chan] &amp;&amp; [isop [hand2nick $hand $chan] $chan]}]}if {($eggversion &gt;= 1030000)} {  proc matchchanattr {handle flags channel} { return [matchattr $handle |$flags $channel] }}proc isoporvoice {nick chan} {  return [expr {[validchan $chan] &amp;&amp; ([isop $nick $chan] || [isvoice $nick $chan])}]}proc handisoporvoice {hand chan} {  return [expr {[validchan $chan] &amp;&amp; [isoporvoice [hand2nick $hand $chan] $chan]}]}proc mymatchattr {hand flags {chan ""}} {  if {[regsub -all {[^&amp;|().a-zA-Z0-9@+#-]} $flags {} f]} {    putloglev o * "error: (matchattr): illegal character in flags: $flags"    return 0  }  regsub -all -- {[|&amp;]} $f {&amp;&amp;} f  regsub -all -- {#-} $f {-#} f  regsub -all -- {-} $f {!} f  regsub -all -- {#?[a-zA-Z0-9]} $f {(&amp;)} f  regsub -all -- {\(#([a-zA-Z0-9])\)} $f {[matchchanattr $hand \1 $chan]} f  regsub -all -- {\(([a-zA-Z0-9])\)} $f {[matchattr $hand \1]} f  regsub -all -- {\.} $f {1} f  regsub -all -- {@} $f {[handisop $hand $chan]} f  regsub -all -- {\+} $f {[handisoporvoice $hand $chan]} f  return [expr $f]}proc commands:load {} {  global commands  catch {unset commands}  if {![file exists "commands.dat"]} {    set outfile [open "commands.dat" w]    close $outfile  }  set infile [open "commands.dat" r]  set buffer [read $infile]  close $infile  set buffer [split $buffer "\n"]  foreach line $buffer {    if {$line != ""} {      set dline [split $line "|"]      set dchan [string tolower [lindex $dline 0]]      set dcmd [lindex $dline 1]      set ddesc [lindex $dline 2]      set commands($dchan,$dcmd) $ddesc    }  }  return 1}proc commands:save {} {  global commands  set outfile [open "commands.dat" w]  foreach item [array names commands *,*] {    set dchan [lindex [split $item ","] 0]    set dcmd [lindex [split $item ","] 1]    set ddesc $commands($item)    if {($dchan != "") &amp;&amp; ($dcmd != "") &amp;&amp; ($ddesc != "")} {      puts $outfile "$dchan|$dcmd|$ddesc"    }  }  close $outfile  return 1}proc commands:longestcmd {chan} {  global commands  set i 0  foreach item [array names commands [string tolower $chan],*] {    set ditem [join [lindex [split $item ","] 1]]    if {[string length $ditem] &gt; $i} { set i [string length $ditem] }  }  return $i}proc commands:iscommand {command chan} {  global commands  return [info exists commands([string tolower $chan],$command)]}proc commands:add {command desc chan} {  global commands  if {[commands:iscommand $command $chan]} { return 0 }  set commands([string tolower $chan],$command) "$desc"  return 1}proc commands:del {command chan} {  global commands  if {![commands:iscommand $command $chan]} { return 0 }  catch {unset commands([string tolower $chan],$command)}  return 1}proc commands:pub {nick uhost hand chan rest} {  global commands commands_adminflag commands_trigger  set cmd [string tolower [lindex [split $rest] 0]]  set chan [string tolower $chan]  switch $cmd {    help {      set tt $commands_adminflag      puthelp "NOTICE $nick :+- \002commands.tcl\002 help"      puthelp "NOTICE $nick :: [format %-39s "$commands_trigger"] - list of commands available in channel"      if {[mymatchattr $hand $tt|#$tt $chan]} {        puthelp "MSG $nick :: [format %-39s "$commands_trigger add {&lt;command&gt;} &lt;description&gt;"] - add a command to channel"        puthelp "NOTICE $nick :: [format %-39s "$commands_trigger del {&lt;command&gt;}"] - remove a command for channel"      }      puthelp "NOTICE $nick :+- end of help."      return    }    add {      set tt $commands_adminflag      if {![mymatchattr $hand $tt|#$tt $chan]} { return }      set command [lindex $rest 1]      set desc [join [lrange $rest 2 end]]      if {($command == "") || ($desc == "")} {        puthelp "NOTICE $nick :Usage: $commands_trigger add {&lt;command&gt;} &lt;description&gt;"        puthelp "NOTICE $nick :Eg.  : $commands_trigger add {/ctcp lamer test} does something"        return      }      set res [commands:add $command "$desc" $chan]      if {!$res} {        puthelp "NOTICE $nick :\002$command\002 is already marked as a command for $chan."        return      } else {        puthelp "NOTICE $nick :Added \002$command\002 as a command for $chan."        commands:save        return      }    }    del {      set tt $commands_adminflag      if {![mymatchattr $hand $tt|#$tt $chan]} { return }      set command [lindex $rest 1]      if {$command == ""} {        puthelp "NOTICE $nick :Usage: $commands_trigger del &lt;command&gt;"        return      }      set res [commands:del $command $chan]      if {!$res} {        puthelp "NOTICE $nick :\002$command\002 is not a command for $chan."        return      } else {        puthelp "NOTICE $nick :Deleted \002$command\002 as a command for $chan."        commands:save        return      }    }    default {      set lngth [commands:longestcmd $chan]      if {!$lngth} { return }      if {$lngth &lt; 8} { set lngth 8 }      puthelp "NOTICE $nick :+- commands for \002$chan\002:"      puthelp "NOTICE $nick :: \037[format %-${lngth}s "command\037"]  - \037description\037"      foreach item [lsort [array names commands $chan,*]] {        puthelp "NOTICE $nick :: \002[format %-${lngth}s "[lindex [split $item ","] 1]"]\002 - $commands($item)"      }      puthelp "NOTICE $nick :+- end of commands."      return    }  }}commands:loadputlog "commands.tcl v$commands_version by strikelight now loaded."</code></pre></div><br>Thank you for your helps<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9666">Exedore</a> — Wed Mar 12, 2008 4:14 pm</p><hr />
]]></content>
	</entry>
	</feed>
