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

	<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>2015-05-02T22:41:10-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-02T22:41:10-04:00</updated>

		<published>2015-05-02T22:41:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104004#p104004</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104004#p104004"/>
		<title type="html"><![CDATA[Re: What is wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104004#p104004"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div><blockquote class="uncited"><div>Look at the way I did it, in an earlier post here.</div></blockquote> And I added a timer, ...</div></blockquote><br>Post your code.  All of it.</div></blockquote> Friend, just I discovered the problem.<br>Two timers are needed, one after the add channel, and other before comparing the number of users.<br>The problem is that a variable depends on another and it becomes a vicious circle.<br>Thus is the code fails:<blockquote class="uncited"><div><strong class="text-strong">Tcl error [pub:go]: can't read "countuser": no such variable</strong></div></blockquote>This is because the 1st timer culminated not running the first proc (vericount0) and does not send the value to the second proc (vericount).<div class="codebox"><p>Code: </p><pre><code>bind pub a|n !go pub:goset canal_admin "#chan0"set canal_radio "#chan1"proc pub:go {nick host hand chan text} {   global canal_admin   if { $chan != $canal_admin} { return 0 }    set newchan [lindex [split $text] 0]     if {$newchan == ""} {      putmsg $canal_admin "$nick, Enter channel."      return 0   }      if {![validchan "$newchan"]} {##Add channel and join###          channel add $newchan          putquick "PRIVMSG $canal_admin :$nick Ok, join $newchan ..."##I must add a timer to allow time to recognize the newly added channel.   utimer 15 [list vericount0 $nick $canal_admin $newchan]proc vericount0 { nick canal_admin newchan}  {  set countuser 0  foreach n [chanlist $newchan] {  if {$countuser &gt;= 10} break   putquick "PRIVMSG $canal_admin :counting users of $newchan... COUNT value: $countuser"       putquick "PRIVMSG $canal_admin :$n ..."      set countuser [expr {$countuser + 1}]  putquick "PRIVMSG $canal_admin :contuser value now: $countuser"     }} utimer 30 [list vericount $nick $canal_admin $newchan $countuser]proc vericount { nick canal_admin newchan countuser} {putquick "PRIVMSG $canal_admin : countuser: $countuser"if {$countuser &gt;= 10 } {putquick "PRIVMSG $newchan :channel accepted, I came to stay :\)"putquick "PRIVMSG $canal_admin : \0032$newchan was verified and accepted has $count users.."  return 0} channel remove $newchanputquick "PRIVMSG $canal_admin :\0032$newchan was verified and NOT accepted has $count users.." return 0  }     } else { putquick "PRIVMSG $canal_admin : \002$newchan\002 has already been verified and is in my database.! "       return 0}}</code></pre></div><strong class="text-strong">EDIT:</strong> Solved I fixed timers<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sat May 02, 2015 10:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-05-02T22:04:43-04:00</updated>

		<published>2015-05-02T22:04:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104003#p104003</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104003#p104003"/>
		<title type="html"><![CDATA[Re: What is wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104003#p104003"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>Look at the way I did it, in an earlier post here.</div></blockquote> And I added a timer, ...</div></blockquote><br>Post your code.  All of it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat May 02, 2015 10:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-02T21:50:06-04:00</updated>

		<published>2015-05-02T21:50:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104002#p104002</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104002#p104002"/>
		<title type="html"><![CDATA[Re: What is wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104002#p104002"><![CDATA[
<blockquote class="uncited"><div>Look at the way I did it, in an earlier post here.</div></blockquote> And I added a timer, but can not count the number of channel users. :S<br>EDIT:<br>The strangest thing is that even NOT takes the value of zero with which was seted before.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sat May 02, 2015 9:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-05-02T21:37:57-04:00</updated>

		<published>2015-05-02T21:37:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104001#p104001</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104001#p104001"/>
		<title type="html"><![CDATA[Re: What is wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104001#p104001"><![CDATA[
<blockquote class="uncited"><div>When I add the channel to the bot and this <em class="text-italics">join</em> the room, use <blockquote class="uncited"><div>foreach users [chanlist $newchan]</div></blockquote> to count channel users.<br>The bot <em class="text-italics">part</em> channel immediately.<br>Why not take value <em class="text-italics">count </em>variable?<br>The value is always a blank.<br>You will need a timer before?:<blockquote class="uncited"><div>if {$count &gt;= 10 }</div></blockquote>while you are running the <em class="text-italics">while</em> ?<br></div></blockquote>Probably.<br><blockquote class="uncited"><div>I could not fix it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> </div></blockquote>Look at the way I did it, in an earlier post here.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat May 02, 2015 9:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-02T21:20:55-04:00</updated>

		<published>2015-05-02T21:20:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104000#p104000</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104000#p104000"/>
		<title type="html"><![CDATA[What is wrong?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104000#p104000"><![CDATA[
When I add the channel to the bot and this <em class="text-italics">join</em> the room, use <blockquote class="uncited"><div>foreach users [chanlist $newchan]</div></blockquote> to count channel users.<br>The bot <em class="text-italics">part</em> channel immediately.<br>Why not take value <em class="text-italics">count </em>variable?<br>The value is always a blank.<br>You will need a timer before?:<blockquote class="uncited"><div>if {$count &gt;= 10 }</div></blockquote>while you are running the <em class="text-italics">while</em> ?<br><br>I could not fix it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":?" title="Confused"> <br><div class="codebox"><p>Code: </p><pre><code>bind pub a|n !go pub:goset canal_admin "#chan0"set canal_radio "#chan1" proc pub:go {nick host hand chan text} {   global canal_admin   if { $chan != $canal_admin} { return 0 }    set newchan [lindex [split $text] 0]     if {$newchan == ""} {      putmsg $canal_admin "$nick, Enter channel."      return 0   }      if {![validchan "$newchan"]} {##Add channel and join###          channel add $newchan          putquick "PRIVMSG $canal_admin :$nick Ok, join $newchan ..."         set count 0##Counting users $newchan###        foreach users [chanlist $newchan] {  ####For debuggin purpose###     putquick "PRIVMSG $canal_admin :counting $newchan users..."         incr count     }##HERE $count not take value, is always a blank##if {$count &gt;= 10 } {putquick "PRIVMSG $newchan :channel accepted, I came to stay :\)"putquick "PRIVMSG $canal_admin : \0032$newchan was verified and accepted has $count users.."  return 0} else {channel remove $newchanputquick "PRIVMSG $canal_admin :\0032$newchan was verified and NOT accepted has $count users.." return 0 }} else {       putquick "PRIVMSG $canal_admin : \002$newchan\002 has already been verified and is in my database.! "      return 0   }}      </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sat May 02, 2015 9:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-02T18:53:43-04:00</updated>

		<published>2015-05-02T18:53:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103999#p103999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103999#p103999"/>
		<title type="html"><![CDATA[Bot managing services]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103999#p103999"><![CDATA[
<strong class="text-strong">willyw</strong> worked perfect! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> <br>Now, I'm working on another part of the code, when the bot joins the requested channel and does the counting of users.  <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=12499">juanamores</a> — Sat May 02, 2015 6:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-05-02T16:31:00-04:00</updated>

		<published>2015-05-02T16:31:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103996#p103996</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103996#p103996"/>
		<title type="html"><![CDATA[Bot managing services]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103996#p103996"><![CDATA[
Here is something more for you to experiment with.  I think it demonstrates some more of the things you are wanting to do.  <br><br><div class="codebox"><p>Code: </p><pre><code># May 2, 2015# http://forum.egghelp.org/viewtopic.php?t=19952bind pub n "!go" join_chanproc join_chan {nick uhost handle chan text} {        if {![llength [split $text]]} {                putserv "privmsg $chan :Syntax: !go #channel"                return 0        }        set chan_to_add [lindex [split $text] 0]        channel add $chan_to_add        #introduce a delay, to give bot time to get into channel, and        # get the list of users currently in the chan.        # You may be able to adjust this down some.        utimer 10 [list count_users $chan $chan_to_add ]}proc count_users {chan chan_to_add} {        set num_nicks [llength [chanlist $chan_to_add]]        putserv "privmsg $chan :Number of nicks on $chan_to_add is: $num_nicks"        set fname "scripts/added/experiment_for_somebody/list_of_bots.txt"        set fp [open $fname "r"]        set data [read -nonewline $fp]        close $fp        #set lines [split $data "\n"]        set bot_nicks_list [split $data]        putserv "privmsg $chan :list of bot nicks is: $bot_nicks_list"        set nick_counter 0        foreach n [chanlist $chan_to_add] {                if {[lsearch -nocase $bot_nicks_list $n] &gt; -1} {                        putserv "privmsg $chan :$n is in bots nick list"                } else {                        incr nick_counter                }        }        putserv "privmsg $chan :Number of nicks on $chan, not including nicks found in bots list is: $nick_counter"        set dupecounter 0        foreach n [chanlist $chan_to_add] {                foreach nn [chanlist $chan_to_add] {                        if {$n eq $nn} {                                break                        }                        if {[getchanhost $n $chan_to_add] eq [getchanhost $nn $chan_to_add]} {                                putserv "privmsg $chan :$n and $nn are have same hostmask"                                incr dupecounter                        }                }        }        putserv "privmsg $chan :dupe count is: $dupecounter"        putserv "privmsg $chan : "        putserv "privmsg $chan :Number of nicks, minus bots, and minus dupes is: [expr $nick_counter - $dupecounter]"}</code></pre></div>I hope this helps you with your efforts to put something together yourself. <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=10420">willyw</a> — Sat May 02, 2015 4:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-05-02T14:39:09-04:00</updated>

		<published>2015-05-02T14:39:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103995#p103995</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103995#p103995"/>
		<title type="html"><![CDATA[Bot managing services]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103995#p103995"><![CDATA[
<blockquote class="uncited"><div>...<br>The task to tailor the network to do it myself, <br>....</div></blockquote>Excellent!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>You have another thread here somewhere.   The below is related to it, so I'm sure you and figure out what is going on here.<br><br>Play with this, and you'll quickly see what it does.   Then you can adapt it to your needs.<br><div class="codebox"><p>Code: </p><pre><code># May 2, 2015# http://forum.egghelp.org/viewtopic.php?p=103991#103991set canal_admin "#channel"set canal_radio "#channel2"bind pub * !request ver_chanbind msgm - * info:channelproc ver_chan {nick uhost hand chan text} {global canal_admin canal_djs canal_radio        if {[llength $text] != 1} { putmsg $canal_radio "canal invalido XD"; return }        set canal [lindex [split $text] 0]        ##Send your query to the bot CHaN by the channel info.        putserv "PRIVMSG chan :info $canal"}proc info:channel {nick CHaN!-@- hand text} {global canal_admin        if {[lindex [split $text] 0] eq "Registrado:"} {                putserv "privmsg $canal_admin :Registrado is: $text"                set reg_date [lindex [split $text] 2]                putserv "privmsg $canal_admin :reg_date is: $reg_date"                putserv "privmsg $canal_admin :Reg days old is: [duration [expr [unixtime] - [clock scan $reg_date -format {%d/%b/%Y} -locale ES]  ]]"                set reg_date_unixtime [clock scan $reg_date -format {%d/%b/%Y} -locale ES]                putserv "privmsg $canal_admin :10 days ago was :[clock format [clock add [clock seconds] -10 day] -locale ES]"                set 10_days_ago_unixtime [clock add [clock seconds] -10 day -local ES ]                if {$10_days_ago_unixtime &gt; $reg_date_unixtime} {                        putserv "privmsg $canal_admin :Channel has been registered more than 10 days"                } else {                        putserv "privmsg $canal_admin :Channel has been registered less than 10 days"                }        }        return 0}</code></pre></div>Reference: <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/clock.htm" class="postlink">http://www.tcl.tk/man/tcl8.5/TclCmd/clock.htm</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat May 02, 2015 2:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-02T11:48:16-04:00</updated>

		<published>2015-05-02T11:48:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103991#p103991</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103991#p103991"/>
		<title type="html"><![CDATA[Bot managing services]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103991#p103991"><![CDATA[
<blockquote class="uncited"><div>This kind of script could easily be very specific to the network on which it will be used.<br><br>For anyone to be able to help you, they would need more info:<br>The network, and its address<br>The name of Channel Services.   Often it is Chanserv.<br>The name of Nick Services.  Often it is Nickserv.<br>Anything else that you can think of, that might be useful to the scripter.</div></blockquote><strong class="text-strong">willyw</strong> hello, you're right, without such data it is difficult to run a script. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>The task to tailor the network to do it myself, if I had at least one base of a code from another network, but not to do it from scratch.<br>Network: irc.chathispano.com or miranda.chathispano.com<br>Channel Services: CHaN<br>Nick Services: NiCK<br>I think it might be useful, the command for channel information, for example, founder, date of registration, etc.: <blockquote class="uncited"><div>/msg CHaN info #channel</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sat May 02, 2015 11:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2015-05-02T10:29:21-04:00</updated>

		<published>2015-05-02T10:29:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103990#p103990</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103990#p103990"/>
		<title type="html"><![CDATA[Bot managing services]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103990#p103990"><![CDATA[
This kind of script could easily be very specific to the network on which it will be used.<br><br>For anyone to be able to help you, they would need more info:<br>The network, and its address<br>The name of Channel Services.   Often it is Chanserv.<br>The name of Nick Services.  Often it is Nickserv.<br>Anything else that you can think of, that might be useful to the scripter.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sat May 02, 2015 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-05-01T17:30:00-04:00</updated>

		<published>2015-05-01T17:30:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103984#p103984</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103984#p103984"/>
		<title type="html"><![CDATA[Bot managing services]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103984#p103984"><![CDATA[
I want to create a TCL for managing mi future services radio bot.<br>I want in particular, that when a founder of a channel join at BOt channel, and for example write command:<blockquote class="uncited"><div>!Requests #channelx</div></blockquote><span style="text-decoration:underline">the bot checks two conditions</span>:<br><strong class="text-strong">a)</strong> the request is performing for #channelx founder, and<br><strong class="text-strong">b)</strong> the #channelx have minimum 10 days of registration in the network.<br>If both conditions are met, the bot will respond:<blockquote class="uncited"><div>'Requested service shortly an administrator will managing request'</div></blockquote>If any of the conditions is not met, the bot will respond:<blockquote class="uncited"><div>The request must be made by the founder of the channel,</div></blockquote> or<blockquote class="uncited"><div>The channel has NOT 10 days registration.</div></blockquote>Then, if two conditions are met, when the admin write command:<blockquote class="uncited"><div>!go #channelx</div></blockquote>the bot join to this channel and <span style="text-decoration:underline">verify that the channel has a minimum of x users</span> (<span style="text-decoration:underline">without bots</span>, here you can make a list of known bots and compare that, to remove them of count, and if possible, <span style="text-decoration:underline">not counting the clones</span>) and after verifying the requirements of users part this channel, if all OK, the bot will report to management channel and the admin will added this channel at bot and definitely send the bot to that channel.<br>You know any TCL, do those checks?<br>At least to have a basis to begin to modify it, and not work of zero.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Fri May 01, 2015 5:30 pm</p><hr />
]]></content>
	</entry>
	</feed>
