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

	<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>2009-03-17T03:23:56-04:00</updated>

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

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-17T03:23:56-04:00</updated>

		<published>2009-03-17T03:23:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87902#p87902</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87902#p87902"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87902#p87902"><![CDATA[
You read the docs that those kind folk at Eggheads sent with the bot.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Tue Mar 17, 2009 3:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-16T22:47:35-04:00</updated>

		<published>2009-03-16T22:47:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87900#p87900</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87900#p87900"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87900#p87900"><![CDATA[
<blockquote class="uncited"><div>Here's one I prepared earlier.<br><br>Responds to pub or msg commands.<br><br>Note that the binds are 'global owner' only. Always a good idea if you are doing stuff like this.<br><div class="codebox"><p>Code: </p><pre><code>bind MSG n join prcJoinMsgJoinbind PUB n !join prcJoinPubJoinbind MSG n part prcPartMsgPartbind PUB n !part prcPartPubPartproc prcJoinMsgJoin {nick uhost hand txt} {  global botnick  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {![validchan $tchan]} {        channel add $tchan        savechannels        putserv "NOTICE $nick :created dynamic channel record $tchan"      } else {putserv "NOTICE $nick :error - a channel record for $tchan already exists"}    } else {putserv "NOTICE $nick :error - $tchan is not in the format of a valid channel name"}  } else {putserv "NOTICE $nick :error - correct syntax is /msg $botnick join &lt;#channel&gt;"}  return 0}proc prcJoinPubJoin {nick uhost hand channel txt} {  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {![validchan $tchan]} {        channel add $tchan        savechannels        putserv "PRIVMSG $channel :created dynamic channel record $tchan"      } else {putserv "PRIVMSG $channel :-error- ($nick) - a channel record for $tchan already exists"}    } else {putserv "PRIVMSG $channel :-error- ($nick) - $tchan is not in the format of a valid channel name"}  } else {putserv "PRIVMSG $channel :-error- ($nick) - correct syntax is !join &lt;#channel&gt;"}  return 0}proc prcPartMsgPart {nick uhost hand txt} {  global botnick  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {[validchan $tchan]} {        if {[isdynamic $tchan]} {          channel remove $tchan          savechannels          putserv "NOTICE $nick :deleted dynamic channel record $tchan"        } else {putserv "NOTICE $nick :error - only dynamic channels can be parted"}      } else {putserv "NOTICE $nick :error - a channel record for $tchan does not exist"}    } else {putserv "NOTICE $nick :error - $tchan is not in the format of a valid channel name"}  } else {putserv "NOTICE $nick :error - correct syntax is /msg $botnick part &lt;#channel&gt;"}  return 0}proc prcPartPubPart {nick uhost hand channel txt} {  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {[validchan $tchan]} {        if {[isdynamic $tchan]} {          channel remove $tchan          savechannels          if {![string equal -nocase $tchan $channel]} {            putserv "PRIVMSG $channel :deleted dynamic channel record $tchan"          }        } else {putserv "PRIVMSG $channel :-error- ($nick) - only dynamic channels can be parted"}      } else {putserv "PRIVMSG $channel :-error- ($nick) - a channel record for $tchan does not exist"}    } else {putserv "PRIVMSG $channel :-error- ($nick) - $tchan is not in the format of a valid channel name"}  } else {putserv "PRIVMSG $channel :-error- ($nick) - correct syntax is !part &lt;#channel&gt;"}  return 0}</code></pre></div></div></blockquote>how do i add some1 to global owner list<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Mon Mar 16, 2009 10:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-16T22:28:53-04:00</updated>

		<published>2009-03-16T22:28:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87899#p87899</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87899#p87899"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87899#p87899"><![CDATA[
Here's one I prepared earlier.<br><br>Responds to pub or msg commands.<br><br>Note that the binds are 'global owner' only. Always a good idea if you are doing stuff like this.<br><div class="codebox"><p>Code: </p><pre><code>bind MSG n join prcJoinMsgJoinbind PUB n !join prcJoinPubJoinbind MSG n part prcPartMsgPartbind PUB n !part prcPartPubPartproc prcJoinMsgJoin {nick uhost hand txt} {  global botnick  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {![validchan $tchan]} {        channel add $tchan        savechannels        putserv "NOTICE $nick :created dynamic channel record $tchan"      } else {putserv "NOTICE $nick :error - a channel record for $tchan already exists"}    } else {putserv "NOTICE $nick :error - $tchan is not in the format of a valid channel name"}  } else {putserv "NOTICE $nick :error - correct syntax is /msg $botnick join &lt;#channel&gt;"}  return 0}proc prcJoinPubJoin {nick uhost hand channel txt} {  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {![validchan $tchan]} {        channel add $tchan        savechannels        putserv "PRIVMSG $channel :created dynamic channel record $tchan"      } else {putserv "PRIVMSG $channel :-error- ($nick) - a channel record for $tchan already exists"}    } else {putserv "PRIVMSG $channel :-error- ($nick) - $tchan is not in the format of a valid channel name"}  } else {putserv "PRIVMSG $channel :-error- ($nick) - correct syntax is !join &lt;#channel&gt;"}  return 0}proc prcPartMsgPart {nick uhost hand txt} {  global botnick  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {[validchan $tchan]} {        if {[isdynamic $tchan]} {          channel remove $tchan          savechannels          putserv "NOTICE $nick :deleted dynamic channel record $tchan"        } else {putserv "NOTICE $nick :error - only dynamic channels can be parted"}      } else {putserv "NOTICE $nick :error - a channel record for $tchan does not exist"}    } else {putserv "NOTICE $nick :error - $tchan is not in the format of a valid channel name"}  } else {putserv "NOTICE $nick :error - correct syntax is /msg $botnick part &lt;#channel&gt;"}  return 0}proc prcPartPubPart {nick uhost hand channel txt} {  set tchan [string trim $txt]  if {[llength [split $tchan]] == 1} {    if {[regexp {^#} $tchan]} {      if {[validchan $tchan]} {        if {[isdynamic $tchan]} {          channel remove $tchan          savechannels          if {![string equal -nocase $tchan $channel]} {            putserv "PRIVMSG $channel :deleted dynamic channel record $tchan"          }        } else {putserv "PRIVMSG $channel :-error- ($nick) - only dynamic channels can be parted"}      } else {putserv "PRIVMSG $channel :-error- ($nick) - a channel record for $tchan does not exist"}    } else {putserv "PRIVMSG $channel :-error- ($nick) - $tchan is not in the format of a valid channel name"}  } else {putserv "PRIVMSG $channel :-error- ($nick) - correct syntax is !part &lt;#channel&gt;"}  return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Mar 16, 2009 10:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-16T22:07:23-04:00</updated>

		<published>2009-03-16T22:07:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87898#p87898</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87898#p87898"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87898#p87898"><![CDATA[
You have to use the commands<br><br>channel add $text<br><br>and<br><br>channel remove $text<br><br>to create/delete a dynamic channel record<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!join" join:procbind pub - "!part" part:procproc join:proc { nick host hand chan text } {  if {[string equal -nocase $nick "Dark_aaron"]} {   channel add $text  }}proc part:proc { nick host hand chan text } {  if {[string equal -nocase $nick "Dark_aaron"]} {   channel remove $text  }}</code></pre></div>I would probably add some code to the join proc to check that the bot didn't already have a channel record for $text before adding it. Likewise I would test if the channel record existed and if it was dynamic before attempting to part it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Mar 16, 2009 10:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-16T21:32:43-04:00</updated>

		<published>2009-03-16T21:32:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87896#p87896</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87896#p87896"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87896#p87896"><![CDATA[
<blockquote class="uncited"><div>so it should look like<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!join" join:procbind pub - "!part" part:procproc join:proc { nick host hand chan text } {  if {[string equal -nocase $nick "Dark_aaron"]} {   putserv "JOIN :$text"  }}proc part:proc { nick host hand chan text } {  if {[string equal -nocase $nick "Dark_aaron"]} {   putserv "PART $chan :$text"  }}</code></pre></div>???</div></blockquote>this works but...<br><br>here is logs from client and partyline<br><br><strong class="text-strong">client:</strong><br>[8:30:pm] &lt;~Dark_Aaron&gt; !join #q<br>[8:30:pm] * Eggy (<a href="mailto:Eggy@ServicesAdmin.TheBeagleClub.net">Eggy@ServicesAdmin.TheBeagleClub.net</a>) has joined #q<br>[8:30:pm] * Eggy (<a href="mailto:Eggy@ServicesAdmin.TheBeagleClub.net">Eggy@ServicesAdmin.TheBeagleClub.net</a>) has left #q<br><br><strong class="text-strong">partyline:</strong><br>[20:24] joined #q but didn't want to!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Mon Mar 16, 2009 9:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-16T21:26:43-04:00</updated>

		<published>2009-03-16T21:26:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87895#p87895</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87895#p87895"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87895#p87895"><![CDATA[
so it should look like<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!join" join:procbind pub - "!part" part:procproc join:proc { nick host hand chan text } {  if {[string equal -nocase $nick "Dark_aaron"]} {   putserv "JOIN :$text"  }}proc part:proc { nick host hand chan text } {  if {[string equal -nocase $nick "Dark_aaron"]} {   putserv "PART $chan :$text"  }}</code></pre></div>???<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Mon Mar 16, 2009 9:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-03-16T21:08:35-04:00</updated>

		<published>2009-03-16T21:08:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87894#p87894</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87894#p87894"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87894#p87894"><![CDATA[
You are using "pub" bindings, hence your procs ("functions") need to accept 5 arguments, corresponding to nickname, host, handle, channel, and text of the message that triggered the binding.<br><br>Next, this will fail utterly:<div class="codebox"><p>Code: </p><pre><code>if {[$nick == Dark_aaron]} {</code></pre></div>In fact, this will result in remote code exploits. [] are used for command substitutions. That is, take whatever is between the [], execute it as a separate command, and substitute the text (including the []) with whatever was returned by that command execution.<br>What you should do is this:<div class="codebox"><p>Code: </p><pre><code>if {[string equal -nocase $nick "Dark_aaron"]} {</code></pre></div>Here we execute the command "string" with the parameters "equal", "-nocase", the value of $nick, and "Dark_aaron". Checking the manpage for the string command, this tells us string will compare the two strings (equal) in a case-insensitive (-nocase) manner, and return true if they're the same, false otherwize.<br><br>Further,<br>You have this command-line:<div class="codebox"><p>Code: </p><pre><code>global part join</code></pre></div>The purpose of the global command, is to link local variables to their counterpart in the global namespace. Yet you do not make use either of those variables in either function. This will not cause an error, but it is bad practise, and may cause confusion as to which variables are actually in use. Also be aware of variable name collisions (such as two scripts using the same variable for different purposes).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Mar 16, 2009 9:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dark_Aaron]]></name></author>
		<updated>2009-03-16T20:47:34-04:00</updated>

		<published>2009-03-16T20:47:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87893#p87893</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87893#p87893"/>
		<title type="html"><![CDATA[remote join and part]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87893#p87893"><![CDATA[
here is my first script<div class="codebox"><p>Code: </p><pre><code>bind pub - "!join" join:procbind pub - "!part" part:procproc join:proc { chan text nick } {  global join part  if {[$nick == Dark_Aaron]} {   putserv "JOIN :$text"  }}proc part:proc { chan text nick } {  global part join  if {[$nick == Dark_Aaron]]} {   putserv "PART $chan :$text"  }}</code></pre></div>i am getting <br><div class="codebox"><p>Code: </p><pre><code>[19:39] Tcl error [join:proc]: wrong # args: should be "join:proc chan text nick"</code></pre></div>when i try to use it<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10550">Dark_Aaron</a> — Mon Mar 16, 2009 8:47 pm</p><hr />
]]></content>
	</entry>
	</feed>
