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.

chanlist doesn't work on join event

Help for those learning Tcl or writing their own scripts.
Post Reply
b
boehmi
Voice
Posts: 14
Joined: Sat Apr 11, 2009 7:55 am
Location: Germany

chanlist doesn't work on join event

Post by boehmi »

Hi there,

my problem is, that

Code: Select all

	set users [chanlist $channel]
	putlog [llength $users]
shows zero, when it's called in the join-bind procedure of the bot's join.

Even a utimer of 1 second, called in the join-handler procedure doesn't work

What can i do ?

Thanks for your help
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

A join bind triggers immediately a user joins one of the bots channels and therefore does not give time for the bot to update a chanlist for the channel.

You could use a utimer within the join binds's proc which calls a second user defined proc in a few seconds, thus giving time for the chanlist to be updated. One second is not really enough. Then use your chanlist code in the second proc. You will also have to pass all the other arguments you need from the join bind proc to the second user defined proc.

The exact same thing happens when testing to see if a nick that newly joined the channel has op status. The join bind would not give time for channel services to op nick.
I must have had nothing to do
b
boehmi
Voice
Posts: 14
Joined: Sat Apr 11, 2009 7:55 am
Location: Germany

Post by boehmi »

Thank you... it works with a 10 seconds timer
Is there a possibility to quicken the update?
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Not that I know of, other than ensuring resources are not wasted on extensive pointless tasks. I think you will need an expert on the inner working of eggdrop to give a definitive answer though.

If all you are doing is logging the channel numbers in the partyline, I wouldn't have thought it warranted any sort of special effort.
I must have had nothing to do
b
boehmi
Voice
Posts: 14
Joined: Sat Apr 11, 2009 7:55 am
Location: Germany

Post by boehmi »

No, thats not the task.. it was just an example ;)

We have an authorization-system and the bot is part of it.
If he restarts for any reason, he just shall kill all users in the channel, so they have to reconnect und re-auth with the bot.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

try bind the raw event of the /names or /who reply from the channel, since it takes a while for it to show on the dcc party line, eggdrop should request this information when it first joins the channel.
Post Reply