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

	<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-11-21T02:59:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2003-11-21T02:59:22-04:00</updated>

		<published>2003-11-21T02:59:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30466#p30466</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30466#p30466"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30466#p30466"><![CDATA[
nevermind, im stupid. I should have used $x as a variable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Fri Nov 21, 2003 2:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2003-11-20T18:10:51-04:00</updated>

		<published>2003-11-20T18:10:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30433#p30433</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30433#p30433"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30433#p30433"><![CDATA[
Alright, thanks for the help. Its working now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Now, there's another problem..<br><br>I want to store all channels the bot will send a message to, to a text file, seperated by spaces, on one line. <br>But when i use "lappend" to add the channel to the list, it wont add it, although it does write the already existing channels to the file.<br><br>Here's the code:<br><div class="codebox"><p>Code: </p><pre><code>proc statchans {arg channel} {    global statsfile    if {$arg == "r"} {      set fs [open $statsfile r]         gets $fs x        set statchans $x      close $fs      return $statchans  } elseif {$arg == "a"} {      set fs [open $statsfile r]        gets $fs x        set statchans $x      lappend statchans $channel      close $fs      set fs [open $statsfile w]        puts $fs $statchans      close $fs  }}</code></pre></div>... and yes, $channel is a working variable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Thu Nov 20, 2003 6:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-20T15:37:13-04:00</updated>

		<published>2003-11-20T15:37:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30421#p30421</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30421#p30421"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30421#p30421"><![CDATA[
The problem is in this line: <blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>utimer 10 [check_op $nick $channel $host]</code></pre></div></div></blockquote> ...which will, because of command substitution, be executed right at that moment and the return value from check_op will be executed 10 seconds later. This problem has been discussed before and a quick forum <a href="http://forum.egghelp.org/search.php" class="postlink">search</a> should give you some working examples.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Nov 20, 2003 3:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2003-11-20T15:09:38-04:00</updated>

		<published>2003-11-20T15:09:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30419#p30419</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30419#p30419"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30419#p30419"><![CDATA[
alright, here we go <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>This is not the entire script, but i think this is the most relevant part..:<br><div class="codebox"><p>Code: </p><pre><code>proc addstats {nick host hand chan arg} {  global file handle channel statchans  set handle $hand  set channel [lindex $arg 0]  if {[validchan $channel]} {     putserv "NOTICE $nick :I already have a record for that channel.."    return 0  }  channel add [string tolower $channel]  utimer 10 [check_op $nick $channel $host]}proc check_op {nick channel host} {  global file  if {![isop $nick $channel]} {     channel remove $channel    putserv "NOTICE $nick :You must be an OP in $channel to request me!"    return 0  } else {      set fs [open $file a+]         puts $fs "### Channel added by $nick ($host) ###"         puts $fs "&lt;channel=\"$channel\"&gt;"        puts $fs "  Logfile=\"/home/aron/jabot/mel/logs/[string trim $channel ?#?].log\""        puts $fs "  Format=\"mIRC\""        puts $fs "  Network=\"quakenet\""        puts $fs "  OutputFile=\"/home/aron/public_html/[string trim $channel #].html\""        puts $fs "&lt;/channel&gt;"        puts $fs " "      close $fs      mel_add +chan [string tolower $channel]      lappend statchans "$channel"  }}</code></pre></div>Just for clearification, the problem is that the bot doesnt see the specified user as an OP when he joins the channel, which is why i wanted to create a delay, after which it will check. This is done with a 10 second utimer, but somehow, it wont work.<br><br>Thanks in advance <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>-A<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Thu Nov 20, 2003 3:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-20T14:11:47-04:00</updated>

		<published>2003-11-20T14:11:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30410#p30410</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30410#p30410"/>
		<title type="html"><![CDATA[Re: sorry for bumping...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30410#p30410"><![CDATA[
<blockquote class="uncited"><div>I tried timers, but it wont work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"></div></blockquote>How are we supposed to correct your code when you don't show it to us? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>Did you try a raw bind with that RPL_ENDOFWHO numeric I suggested?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Nov 20, 2003 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2003-11-20T13:50:51-04:00</updated>

		<published>2003-11-20T13:50:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30406#p30406</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30406#p30406"/>
		<title type="html"><![CDATA[sorry for bumping...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30406#p30406"><![CDATA[
Excuse my bumping, but i just can't figure out how to make a working delay... I tried timers, but it wont work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Thu Nov 20, 2003 1:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2003-11-19T03:44:28-04:00</updated>

		<published>2003-11-19T03:44:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30301#p30301</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30301#p30301"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30301#p30301"><![CDATA[
yeah i already tried something with a delay (timers) , but it was the first time i actually used timers, and well.... the delay didnt work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>I figure it must be about one line of code, but i cant seem to get a working delay.. Any ideas?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Wed Nov 19, 2003 3:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-18T19:13:02-04:00</updated>

		<published>2003-11-18T19:13:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30280#p30280</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30280#p30280"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30280#p30280"><![CDATA[
That's probably because you're checking [isop $the_dude] before the bot has recieved the entire /WHO list. (Triggered by a join bind?) Eggdrop does '/WHO #chan' upon joining a new channel to get its info about the people there and doesn't care about the /NAMES recieved <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>You can either wait a few moments for the RPL_ENDOFWHO (318), and then use [isop] or parse every RPL_NAMREPLY (353) recieved. (You get those no matter what and they arrive before the /WHO is even sent in most cases)<br>OR you could do it the lazy way and just add a slight delay after joining. (ugly hack IMO)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Nov 18, 2003 7:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Aron]]></name></author>
		<updated>2003-11-18T17:35:32-04:00</updated>

		<published>2003-11-18T17:35:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=30276#p30276</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=30276#p30276"/>
		<title type="html"><![CDATA[Joining a channel, then checking if the user is an op.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=30276#p30276"><![CDATA[
Im working on a script that allows users to type a certain trigger (!trigger &lt;channel&gt;, after which the bot joins the specified channel, and checks if the user is an OP.<br><br>If the user isnt an OP, the bot leaves again. The problem is that it wont recognize anyone as an OP, even though they are opped. <br><br>Thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2858">Aron</a> — Tue Nov 18, 2003 5:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
