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.

Rejoin script

Old posts that have not been replied to for several years.
Locked
A
Altor

Rejoin script

Post by Altor »

hello all,

I'd need a script to perform upon connection to a network the following things:

1. the bot sets all channels +inactive (channel set #name +inactive) but I wouldn't know how to extract the channel names from the channel file (grep?) and loop them (prolly for ... next)
2. rejoin all channels (+inactive) with a 2 sec interval (I tried pause, but that didn't work... so I guess a timer is needed or so...)

any help would be appreciated...

The pause is essential in the script, so it's not just cycling...

*MOD* this is what I have allready, after some research:

Code: Select all

set chan {}
foreach chan {#chan1 #chan2} {
        channel set $chan +inactive
}

after 1500

foreach chan {#chan1 #chan2} {
        after 1500
        channel set $chan -inactive
}
Now I just need a way to extract the channames from the channel file, instead of hard-coding them, and I guess it's possible to store them in one list, so I can replace {#chan1 #chan2} with one variable...?
A
Altor

Post by Altor »

Code: Select all

putlog "Leaving channels"
set chan {}

foreach chan [channels] {
        channel set $chan +inactive
}

putlog "Rejoining channels"

foreach chan [channels] {
        after 2000
        channel set $chan -inactive
        putlog "Rejoining $chan"
}

putlog "Rejoin.tcl executed"
This should rejoin a chan in the list every 2 seconds... however, I noticed that the channel set commands are executed after the script is finished, all after another, so I still have the same problem (the putlogs were in there to see if it worked...)

anyone has ANY idea how to solve this?

I also tried this for the second part:

Code: Select all

set i 0
foreach chan [channels] {
        incr i 2000
        after $i {
        channel set $chan -inactive
        putlog "Rejoining $chan"
        }
}
But then it tries to join the last chan in the list as many times as there are channels...
Locked