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

	<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-04-14T18:21:46-04:00</updated>

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

		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-14T18:21:46-04:00</updated>

		<published>2015-04-14T18:21:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103819#p103819</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103819#p103819"/>
		<title type="html"><![CDATA[Read private message ChanServ bot ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103819#p103819"><![CDATA[
I got back to my house and as I promised I will share the code.<div class="codebox"><p>Code: </p><pre><code>bind pub oa|n !fieladd add_fanbind pub oa|n !djadd add_djbind pub a|n !adminadd add_adminbind pub n|n !rootadd add_root#bind msgm &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;, The CHaN bot mask is *!-@-#bind msgm - *!-@- fiel:registro bind msgm - *!-@- dj:registro bind msgm - *!-@- admin:registro bind msgm - *!-@- root:registro set canal_radio #channel1set canal_djs #channel2set canal_admin #channel3proc add_fan {nick uhost hand chan text} {  global canal_radio canal_djs  canal_admin   if {$text == ""} {putmsg $chan "You must enter the nick of the fan to add!";return }   set fan [join [lindex [split $text] 0]]  set faninv "$ndj[join !*@*]"  putserv "PRIVMSG chan :access $canal_radio add $fan 100"if {![file exists regfiel]} {set fs [open "regfiel" w+]puts $fs 0close $fsset temp [open "regfiel" r]set reg [gets $temp]set nickreg [lindex $reg 0]close $temp} else { if {[file exists regfiel]} {    set temp [open "regfiel" r]    set reg [gets $temp]set nickreg [lindex $reg 0]    close $temp}} if {$nickreg == 1} { putmsg $chan "Can not add to staff a nick NO Signup!";return}   if {$nickreg == 0 } { .................more stuff...........proc add_dj {nick uhost hand chan text} {.......Similar lines to the above process........if {![file exists regdj]} {set fs [open "regdj" w+]puts $fs 0close $fsset temp [open "regdj" r]set reg [gets $temp]set nickreg [lindex $reg 0]close $temp} else { if {[file exists regdj]} {    set temp [open "regdj" r]    set reg [gets $temp]set nickreg [lindex $reg 0]    close $temp}} if {$nickreg == 1} { putmsg $chan "Can not add to staff a nick NO Signup!";return}   if {$nickreg == 0 } { .................more stuff...........proc add_admin {nick uhost hand chan text} {.......Similar lines to the above process........if {![file exists regadm]} {set fs [open "regadm" w+]puts $fs 0close $fsset temp [open "regadm" r]set reg [gets $temp]set nickreg [lindex $reg 0]close $temp} else { if {[file exists regadm]} {    set temp [open "regadm" r]    set reg [gets $temp]set nickreg [lindex $reg 0]    close $temp}} if {$nickreg == 1} { putmsg $chan "Can not add to staff a nick NO Signup!";return}   if {$nickreg == 0 } { .................more stuff...........proc add_root {nick uhost hand chan text} {.......Similar lines to the above process........if {![file exists regroot]} {set fs [open "regroot" w+]puts $fs 0close $fsset temp [open "regroot" r]set reg [gets $temp]set nickreg [lindex $reg 0]close $temp} else { if {[file exists regroot]} {    set temp [open "regroot" r]    set reg [gets $temp]set nickreg [lindex $reg 0]    close $temp}} if {$nickreg == 1} { putmsg $chan "Can not add to staff a nick NO Signup!";return}   if {$nickreg == 0 } { .................more stuff...........#procname &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;text&gt; The user@host of bot CHaN is CHaN!-@- #proc fiel:registro {nick CHaN!-@- hand text} { if {[string match -nocase "*only contain registered nicknames*" $text]} {  set fs [open "regfiel" w+]  puts $fs 1  close $fs  return  } else { set fs [open "regfiel" w+]  puts $fs 0  close $fs }} proc dj:registro {nick uhost hand text} { if {[string match -nocase "*only contain registered nicknames*" $text]} {  set fs [open "regdj" w+]  puts $fs 1  close $fs  return  } else { set fs [open "regdj" w+]  puts $fs 0  close $fs }}proc admin:registro {nick uhost hand text} { if {[string match -nocase "*only contain registered nicknames*" $text]} {  set fs [open "regadm" w+]  puts $fs 1  close $fs  return  } else { set fs [open "regadm" w+]  puts $fs 0  close $fs }}  proc root:registro {nick uhost hand text} { if {[string match -nocase "*only contain registered nicknames*" $text]} {  set fs [open "regroot" w+]  puts $fs 1  close $fs  return  } else { set fs [open "regroot" w+]  puts $fs 0  close $fs }}</code></pre></div>The problems that have arisen me are obvious:<br>Adding a fan, dj, admin or root, the 4 <em class="text-italics">bind msgm</em> events simultaneously triggers , because the 4 events used the same mask (*!-@-).<br>That makes who 4 files (<em class="text-italics">regfiel, regdj, regadm and regroot</em>) change their values, when wish who only one of them, change the value.<br><br>The code works fine, if only one of bot operators, adds a certain staff. i.e !addfan or !addj etc...<br><br>But, if simultaneously, several operators adds staff at the same time, a conflict is generated.<br><br>Is there any way that <em class="text-italics">bind msgm</em> events triggers individual for each level of staff adding?<br><br>Example:<br>While the operator <strong class="text-strong">A</strong> adds a DJ, only trigger event <em class="text-italics">bind msgm - *!-@- dj:registro </em>.<br>While the operator <strong class="text-strong">B</strong> adds simutaneamente <strong class="text-strong">A</strong> a ADMIN, only trigger event <em class="text-italics">bind msgm - *!-@- admin:registro </em>.<br><br>Reason Edit: add an example.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Tue Apr 14, 2015 6:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-14T14:17:14-04:00</updated>

		<published>2015-04-14T14:17:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103817#p103817</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103817#p103817"/>
		<title type="html"><![CDATA[Read private message ChanServ bot ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103817#p103817"><![CDATA[
Thanks<strong class="text-strong"> Get_A_Fix</strong> for this new idea, it will be very useful. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I was trying to read the private messages sent by the bot CHaN directly:<blockquote class="uncited"><div> bind msgm - CHaN!*@*  process: reg</div></blockquote>Then in the <em class="text-italics">process :reg</em>, seeks the words "only contain registered nicknames" and store the result in a <em class="text-italics">file</em> (0 if the nick is registered and 1 if the nick is not registered).<br>These values stored in the file, will consult when adding a user to the staff.  <br>Now I'm at work when I get home, I will publish the complete solution, if it's any help to other users.<br><br>Sorry for mi bad english   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Tue Apr 14, 2015 2:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Get_A_Fix]]></name></author>
		<updated>2015-04-14T09:43:33-04:00</updated>

		<published>2015-04-14T09:43:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103816#p103816</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103816#p103816"/>
		<title type="html"><![CDATA[Read private message ChanServ bot ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103816#p103816"><![CDATA[
This is a simple little 'autovoice' script I made for someone, who ONLY wanted to voice Registered User's on their network. You may have to do some checking of your own, just to make sure that the RAW numeric used in this example script is the same on the IRCd you and your bot are using.<br><div class="codebox"><p>Code: </p><pre><code>bind raw - 307 auth_check bind join - * join_routine  setudef flag authcheck  proc join_routine {nick uhost hand chan arg} {   if {![channel get $chan authcheck]} {return}   if {![isbotnick $nick] &amp;&amp; ![validuser [nick2hand $nick]]} {     putserv "WHOIS $nick"   } }  proc auth_check {from keyword args} {   if {![string match "*is a registered nick*" $args]} {return}   set nick [lindex [split $args] 1]    foreach chan [channels] {     if {![onchan $nick $chan] &amp;&amp; ![channel get $chan authcheck] &amp;&amp; [validuser [nick2hand $nick]] &amp;&amp; [isop $nick $chan] &amp;&amp; [isvoice $nick $chan]} {return}     putquick "MODE $chan +v $nick"   } }</code></pre></div>If you are able to see the method to this concept, then you should have no problem using the RAW and a procedure to check /whois and match the string "*is a registered nick*".<br><br>This also uses a setudef (user defined setting) of 'authcheck'. This means that you can use .chanset in DCC/Telnet/Partyline to enable/disable the code on a channel by channel basis. It's always smart to be able to turn things on|off <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=6204">Get_A_Fix</a> — Tue Apr 14, 2015 9:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[juanamores]]></name></author>
		<updated>2015-04-12T13:29:17-04:00</updated>

		<published>2015-04-12T13:29:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103796#p103796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103796#p103796"/>
		<title type="html"><![CDATA[Read private message ChanServ bot ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103796#p103796"><![CDATA[
This is another idea that occurred to me to know if a nick is registered in the network, when adding it to the staff.<br><br>When trying to add unregistered nick, at a channel of a network, the CHaN bot send this private message: <blockquote class="uncited"><div>The channel access list should only contain registered nicknames.</div></blockquote>I need, my bot read the private message that sends CHaN and it search any of those words ('only contain nicks registered ').<br><br>If you find any of these words means the nick you are trying to add to the staff of the bot, it is not registered on the network.<br><br><div class="codebox"><p>Code: </p><pre><code>bind pub o|o !fanadd add_fanset chan_radio "#myradio"proc add_fan {nick uhost hand chan text} {global chan_radio  if {$text == ""} {putmsg $chan "You must enter the nick of the fan to add!";return 0} set fan [join [lindex [split $text] 0]]# The following command adds a nick level 100 IRC IRCu Networkputserv "PRIVMSG CHaN :access $chan_radio add $fan 100"###HERE I need, my bot read the private message that sends CHaN and it search any of those words ('only contain nicks registered ').. ### If the bot found some of those words means that the nick is not registered on the network. { putmsg $chan "Can not add to staff a nick NO Signup!";return 0  } else {continue..............</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12499">juanamores</a> — Sun Apr 12, 2015 1:29 pm</p><hr />
]]></content>
	</entry>
	</feed>
