hi, my channel went opless, i need a "auto regainops tcl" that will make all bots part that sec and join back that sec, i did ".chanset #channel +cycle" but it is to slow..
@Sir_Fz:
Actually, the issue with your script is that it assumes there is only one bot remaining within the channel, whereas in this scenario there is 9.
The best approach to be sure that all bots leave the channel at the same time, would be to let all bots but one set the channel +inactive, let the last bot cycle (and regain ops), and then set their channel -inactive.
This would require a botnet-communicating script to function reliably.
You probably would'nt like to initialize this procedure until there is only known bots in the channel. "chanlist <channel> -b" might be useful for testing this.
I'm assuming that the parted nick haven't been removed from [chanlist $chan] yet, so the result of [llength [chanlist $chan]] would be 2 instead of 1 (no nicks left except the bot itself). That's why I've added -1 (for him to test it) to remove the extra counted nick from the list. In case you mean it's weird in terms of syntax, if-statements take expressions which are evaluated the same way as [expr] so you can freely use arithmetic expressions inside an if-statement.
I'm using netbots, and i have all bots in the channel but they are on and off random, i need it to work when a user part like changes 1 to 9 but they are off and on, is there anyway to do it?
The big problem here, is that as soon as your bot detects that it has left the channel (assuming you did'nt remove the channel or set it +inactive), it will rejoin it, leaving little time to syncronize the cycling of a whole botnet, especially if they're connected to multiple irc-servers..
As stated before, you'd have best chances of a successful cycling if all bots but one set the channel +inactive, wait for the last one to cycle and regain ops, then set it -inactive (and rejoin).
i know that but that but this "if {![botisop $chan] && ([llength [chanlist $chan]]-1 == 1)} { " i need all bots in there but they are off and on so changing 1 to 9 wont work is there anyway to ignore botnet in channel or something? and this is only on efnet too.
You could always test for flags, such as -b when doing the chanlist.
Also, it "feels" more intuitive to use "[llength ....] <= 2" rather than "[llength ...]-1 == 1"...
i mean like cycle it parts all bots with out having to set a number is there any way to ignore all bots in nicklist and when all users part then it parts and joins for op? like theres 2 bots off line now if i set 9 it won't work.