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

	<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>2003-09-24T15:09:14-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-24T15:09:14-04:00</updated>

		<published>2003-09-24T15:09:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27528#p27528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27528#p27528"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27528#p27528"><![CDATA[
you cannot, you have to globalize the channel var in order to match it to the whois.<br><br>guess you want to do that because you don't want it to cause errors whenever the bot does a whois on anyone (for other reasons than the !+chan command). But I guess you can tolerate a little error from time to time, it won't harm you  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> .<br><br>Also, I would say that <strong class="text-strong">unset ad_addchannel</strong> instead of <strong class="text-strong">set ad_addchannel ""</strong> would be better.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Sep 24, 2003 3:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-24T13:09:28-04:00</updated>

		<published>2003-09-24T13:09:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27521#p27521</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27521#p27521"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27521#p27521"><![CDATA[
Here is my actual script, so you should see what i would do:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!+chan" ad:addchanbind raw - "319" ad:whoisset ad_addchannel ""proc ad:addchan { nick host handle chan text } {  global ad_addchannel  set ad_addchannel $text  putserv "WHOIS $nick"}proc ad:whois {from keyword text} { global ad_addchannel if {$ad_addchannel != ""} {  putserv "PRIVMSG [lindex $text 1] :Ich bearbeite momentan bereits eine Anfrage, bitte versuch es gleich nochmal!"  return } set i 0 foreach channel [channels] { incr i } if {$i &gt;= 10} {  putserv "PRIVMSG [lindex $text 1] :Es tut mir leid, aber ich bin schon in zu vielen Channels ($i)"  set ad_addchannel ""  return }foreach channel $text {   if {$ad_addchannel == [string trimleft $channel ":+@!"]} {     if { [string first "@" $channel] != "-1" } {       channel add $ad_addchannel       putserv "PRIVMSG [lindex $text 1] :Da bin ich!"       break     } else {     putserv "PRIVMSG [lindex $text 1] :Du musst Op in $ad_addchannel sein, damit ich komme!"     }   } } set ad_addchannel ""}</code></pre></div>So the visitors could say the bot that he should join the channel they said. For example !+chan #kitchenhost-test .<br><br>But the bot should only join the channel if the user, which requestet the join is an op in this channel.<br><br>And the question is: how could i du that whithout using the global variable $ad_addchannel and without using the command isop. because then the bot must join the channel first.<p>Statistics: Posted by Guest — Wed Sep 24, 2003 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-24T09:57:09-04:00</updated>

		<published>2003-09-24T09:57:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27519#p27519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27519#p27519"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27519#p27519"><![CDATA[
Calling the $text variable in the ad:whois.. got that part, but what do you want to do with it there?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Sep 24, 2003 9:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-24T09:11:49-04:00</updated>

		<published>2003-09-24T09:11:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27518#p27518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27518#p27518"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27518#p27518"><![CDATA[
I want to use the variable $text in ad:whois but WITHOUT making $text a global variable because i dont like them very much.<p>Statistics: Posted by Guest — Wed Sep 24, 2003 9:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-24T07:00:40-04:00</updated>

		<published>2003-09-24T07:00:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27511#p27511</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27511#p27511"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27511#p27511"><![CDATA[
What exactly do you want to do? Call globaly the text variable from ad:addchan in to ad:whois?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Sep 24, 2003 7:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-24T06:52:50-04:00</updated>

		<published>2003-09-24T06:52:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27509#p27509</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27509#p27509"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27509#p27509"><![CDATA[
yes, that is, what i mean with "transfer", to have the value of $text also available in ad:whois. But is there a posibility to do that without using a global variable?<p>Statistics: Posted by Guest — Wed Sep 24, 2003 6:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-09-24T06:24:37-04:00</updated>

		<published>2003-09-24T06:24:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27508#p27508</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27508#p27508"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27508#p27508"><![CDATA[
Why to to transfer it when you can do the stuff in the ad:whois proc? Call globaly the name of the channel and do your stuff there..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Sep 24, 2003 6:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-24T04:36:31-04:00</updated>

		<published>2003-09-24T04:36:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27504#p27504</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27504#p27504"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27504#p27504"><![CDATA[
It works, thanks, but is there also a posibility to get the info if someone is an op in a specific channel without joining that channel first?<br><br>I thought that could be done with whois. Heres the testscript i wrote:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!+chan" ad:addchanbind raw - "319" ad:whoisproc ad:addchan { nick host handle chan text } { putserv "WHOIS $nick"}proc ad:whois {from keyword text} { set text [split $text] set nick [lindex $text 1] putserv "PRIVMSG Mangi :nick=$nick"}</code></pre></div>It works so far, but now the problem is, how i could "transfer" the variable $text from ad:addchan to ad:whois to check the right channel? But, if that works, without using global variables, i dont like them very much.<p>Statistics: Posted by Guest — Wed Sep 24, 2003 4:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-23T11:33:58-04:00</updated>

		<published>2003-09-23T11:33:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27474#p27474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27474#p27474"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27474#p27474"><![CDATA[
well, that's because the bot is not on $text <span style="text-decoration:underline">yet</span> so he can't know if nick isop on that channel unless he joins the channel. so what you want is:<div class="codebox"><p>Code: </p><pre><code>bind pub - !+chan ad:addchan proc ad:addchan { nick host handle chan text } {  channel add $text utimer 5 [list channel:check $nick $text]}proc channel:check {nick text} { if {[isop $nick $text]} {  set i 0   foreach channel [channels] {     incr i 1   }   if {$i &gt; 10} {   channel remove $text  putserv "PRIVMSG $nick :exceeded maximum number of channels allowed"  } elseif {![isop $nick $text]} {  channel remove $text  putserv "PRIVMSG $nick :Es tut mir leid, aber ich bin schon in zu vielen Channels!"   }  } }</code></pre></div>this probably should do it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Tue Sep 23, 2003 11:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-23T05:13:03-04:00</updated>

		<published>2003-09-23T05:13:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27461#p27461</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27461#p27461"/>
		<title type="html"><![CDATA[Problem with Public +chan - script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27461#p27461"><![CDATA[
Hi!<br>I have the following problem: i would like to add an public command, which would give the users in my channel the ability to let the bot join new channels (maximum is 10). The clue is, that these users mus be an OP in the channel, which the bot should join.<br><br>Here is my script:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "!+chan" ad:addchanproc ad:addchan { nick host handle chan text } {  if {[isop $nick $text]} {  set i 0  foreach channel [channels] {    incr i 1  }  if {$i &lt; 10} {  channel add $text  } else {    putserv "PRIVMSG $nick :Es tut mir leid, aber ich bin schon in zu vielen Channels!"  }}}</code></pre></div>But everytime, i say this command followed by a channel (for example !+chan #kitchenhost-test) , the bot says (in the partyline):<br><div class="codebox"><p>Code: </p><pre><code>Tcl error [ad:addchan]: illegal channel: #kitchenhost-test</code></pre></div>I hope, you can say me, what is wrong.<p>Statistics: Posted by Guest — Tue Sep 23, 2003 5:13 am</p><hr />
]]></content>
	</entry>
	</feed>
