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

	<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>2007-03-04T13:13:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[et109]]></name></author>
		<updated>2007-03-04T13:13:40-04:00</updated>

		<published>2007-03-04T13:13:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70975#p70975</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70975#p70975"/>
		<title type="html"><![CDATA[Specific problems]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70975#p70975"><![CDATA[
In truth I did have 2 specific problems with the code.<br>You either saw the bind problem or sensed it. A careful reading of the quote you posted<br>brought me the solution to it. I had not included a host mask in the bind.<br>The second problem was with the timer, or rather the finding and killing of it.<br>The egghelp forum thread: Posted: Wed Jun 22, 2005 7:54 pm Post subject: Searching and killing timers<br>gave me the solution to that.<br>Thank you for your help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8745">et109</a> — Sun Mar 04, 2007 1:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-03-03T22:50:36-04:00</updated>

		<published>2007-03-03T22:50:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70952#p70952</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70952#p70952"/>
		<title type="html"><![CDATA[First try using namespace]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70952#p70952"><![CDATA[
You don't have to use [::channels] or [::chanlist], you can use simply [channels] and [chanlist] since these proc names are not overridden in your namespace.<br><br>Also:<blockquote class="uncited"><div>JOIN (stackable)<br>         bind join &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;<br>         procname &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;channel&gt;<br><br>         Description: triggered by someone joining the channel. The mask in<br>           the bind is matched against <strong class="text-strong">"#channel nick!user@host"</strong> and can<br>           contain wildcards.</div></blockquote>Try your code, don't ask here unless you have a specific problem that you need help with.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Mar 03, 2007 10:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[et109]]></name></author>
		<updated>2007-03-03T22:23:56-04:00</updated>

		<published>2007-03-03T22:23:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70950#p70950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70950#p70950"/>
		<title type="html"><![CDATA[binds innamespace at bottom]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70950#p70950"><![CDATA[
should I put the flag defs inside the namespace also?<br><br>Also I just added binds for the join event in my copy here.<br>I put them in the "firstpass" section of the Solobot::Execute proc<br>does this look copacetic?<div class="codebox"><p>Code: </p><pre><code>      #first pass through channels      if {$firstpass} {          variable firstpass 0          foreach chan [::channels] {            putlog "$::botnick beginning watch $chan [strftime "\[%H:%M:%S\]\(%a.\)%D"]"            #bind joins to channels on bots channel list            bind join - $chan Solobot::Chkjoin           }      }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8745">et109</a> — Sat Mar 03, 2007 10:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2007-03-03T18:12:02-04:00</updated>

		<published>2007-03-03T18:12:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70949#p70949</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70949#p70949"/>
		<title type="html"><![CDATA[First try using namespace]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70949#p70949"><![CDATA[
I would put the binds on the end of the script within the namespace and use<br><br>bind &lt;type&gt; &lt;flag&gt; &lt;cmd&gt; [namespace current]::myproc<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sat Mar 03, 2007 6:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[et109]]></name></author>
		<updated>2007-03-03T17:43:47-04:00</updated>

		<published>2007-03-03T17:43:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=70948#p70948</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=70948#p70948"/>
		<title type="html"><![CDATA[First try using namespace]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=70948#p70948"><![CDATA[
This is my first attempt at using namespaces, and I would really appreciate any comments or advice. (especially with the timer stuff)<br>TIA<br><div class="codebox"><p>Code: </p><pre><code>################################################################################################namespace Solobot#Checks for availability of bot's user's (on bot userlist with with appropriate channel flags#set) in IRC channels#scans channels for user availability using "WHOIS" command, adds '+A' flag to user attr if away#If all users in chan's list are away, bot is solo in channel and adds '+S' flag to channel#If channel is +S bot is to explain no live help currently available and  offer limited help to#guests joining channel i.e. access to bot's #help files, links to help sites etc.# TODO add binds and handlers for channel join events#################################################################################################system setup for namespacebind dcc - "startsolo" Solobot::Executebind dcc - "stopsolo" Solobot::Stopbind dcc - "nosolo" Solobot::Destroybind raw - "301" Solobot::Whoisreplybind raw - "318" Solobot::Whoisreplysetudef flag Asetudef flag Snamespace eval Solobot {    namespace export Execute Stop Destroy     variable bypass 0    variable timerid    variable firstpass 1    #####################################################################################    #scan channels list     #check for available users in each channel    #set timer to rescan     #####################################################################################    proc Execute {args} {      variable firstpass      variable timerid      #first pass through channels      if {$firstpass} {          variable firstpass 0          foreach chan [::channels] {           putlog "$::botnick beginning watch $chan [strftime "\[%H:%M:%S\]\(%a.\)%D"]"          }      }      #scan channels      foreach chan [::channels] {         putlog "$chan"         #scan channel user list         foreach user [::chanlist $chan n|m|l ] {           putquick "Whois $user"         }         #check for availability         Chkaides $chan      }      #kill timer if it exists      if { [set timr [timerexists timerid]] != "" } {          putlog "$timerid killed"              killutimer $timerid      }      # set new timer to rescan      set timerid [utimer 20 Solobot::Execute]      return 0     }         #####################################################################################    #stop channel scan    #####################################################################################    proc Stop {args} {       variable timerid       #kill timer if it exists       if { [set timr [timerexists timerid]] != "" } {          putlog "$timerid killed"              killutimer $timerid       }       killutimer $timerid       #notify operator that scanning has stopped       putlog "$::botnick ending watch for all channels [strftime "\[%H:%M:%S\]\(%a.\)%D"]"        }    #####################################################################################    #Remove namespace    #####################################################################################    proc Destroy {args} {       Stop       putlog "removing Solobot"       unbind dcc - "startsolo" Solobot::Execute       unbind dcc - "stopsolo" Solobot::Stop       unbind dcc - "nosolo" Solobot::Destroy       unbind raw - "301" Solobot::Whoisreply       unbind raw - "318" Solobot::Whoisreply       deludef flag A       deludef flag S       namespace delete ::Solobot         }        #####################################################################################    #process whois replies    #####################################################################################    proc Whoisreply {serv raw text} {        variable bypass        #parse reply        set tmp [split $text : ]        set tmp1 [split [lindex $tmp 0] ]        set aide [lindex $tmp1 1]        #if user away (301) set user 'A' flag and #set bypass flag to catch trailing code 318        #then return        if { $raw eq "301" } {            set bucket [chattr $aide +A]            set bypass 1            return 0            #catch trailing code 318, unset bypass flag           #then return                              } elseif {$bypass == 1} {                  set bypass 0                  return 0                 #318 flag only (no leading 301) - indicates user is not away                 #unset 'A' flag and return                                      } else {                          set bucket [chattr $aide -A]                         return 0                                             }        }        #####################################################################################    #check for bots 'solo' status    #####################################################################################    proc Chkaides {chan} {         set users 0         set away 0         #count users on chan list with appropriate flags         foreach user [::chanlist $chan m|n|l ] {              incr users              #if the user is also flagged away add them to user away count              if {[regexp -- {A} [chattr $user] ]} {                    incr away                 }         }         #if all the users are 'away' set the chan +S          if { $users == $away } {               channel set $chan +S               putlog "$::botnick solo in $chan"             } else {                      #if any users not flagged 'away' set channel -S                      channel set $chan -S                      putlog "$::botnick has help in $chan"                   }         }  #########################################################################################  ###########################         end namespace         ###############################  #########################################################################################}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8745">et109</a> — Sat Mar 03, 2007 5:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
