This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

isop dumb question

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

isop dumb question

Post by droolin »

Im putting together a script for a IRC radio channel, and I was doing a check on the status of a nick to see if they were an oper in any of the radio channels that this nick would be valid for. This command was issued with a msg, which required the logic of the script to loop through a list of channels to see if this nick was an oper on any of them.

Because it has been awhile sence I have done any tcl, I am stopping and starting the bot alot as I work my way through stupid errors.

When the nick(me, owner of the channel) issues the command to the bot after it joins the channel. The 'isop' returns a value of 0. But, if I hop the channel after the bot joins. I receive a status of 1. I just wondered if anyone knew why this is so?
* Joins: ozzy (ozzy@AwesomeChatter-2229ACBA.awesomechat.net)
* ChanServ sets mode: +o ozzy
-Absolutely.AwesomeChat.Net- *** Notice -- Client connecting at OWC.Awesomechat.Net: scrawl27 (fathic@data.searchirc.org)
-Absolutely.AwesomeChat.Net- *** Notice -- Client exiting at OWC.Awesomechat.Net: scrawl27!fathic@data.searchirc.org (Outrageously Wicked Chat at AwesomeChat.Net scrawl27)
-> *ozzy* -djtime [censored] yea
<@ozzy> xxxxxx xxxxxxDexter
<@ozzy> Checking channel oper status
<@ozzy> Check channels in foreach for Dexter on #DextersLaboratory
<@ozzy> this is returning 0
<@ozzy> bot has a status of 1
<@ozzy> returned back from sub routine is
* Attempting to rejoin channel #DextersLaboratory
* Rejoined channel #DextersLaboratory
* Set by droolin on Mon Aug 13 20:54:00
* ChanServ sets mode: +oq Dexter Dexter
-> *ozzy* -djtime [censored] yea
-ozzy- You have 1 note waiting.
-ozzy- For a list: /MSG ozzy NOTES <pass> INDEX
<@ozzy> xxxxx xxxxx Dexter
<@ozzy> Checking channel oper status
<@ozzy> Check channels in foreach for Dexter on #DextersLaboratory
<@ozzy> this is returning 1
<@ozzy> bot has a status of 1
<@ozzy> Dexter is oppered in channel #DextersLaboratory
<@ozzy> returned back from sub routine is 1
Thanks in advance

droolin
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

When the bot immediately joins, it needs time to update its internal channel-memberlist. If you immediately on join execute that script it would return some false values (some ops, would not be detected as ops), it has happened with my bot on a few occasions.

This is rare however and is mostly more favourable on channels which have large usercounts, so it takes the bot time to update the memberlist.

So my conclusion for this would be, not to immediately execute the command after the bot connects to the server and starts joining its channels.

- Give a small delay of 5-10 seconds after you execute the command --> If you restarted the bot (bot connected to irc server and rejoined the channel)
- You normally don't need to give a delay if you made the bot cycle the channel.

Hence, on connect if the bot has alot of channels to join it takes time for it to retrieve channel modes, memberlists and can hence sometimes not-detect ops/voices if you immediately request something from it after it joins.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Post Reply