| View previous topic :: View next topic |
| Author |
Message |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Fri May 11, 2007 3:40 pm Post subject: auto regain op.. |
|
|
| 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.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri May 11, 2007 6:58 pm Post subject: |
|
|
| Quote: | | .chanset #channel need-op putquick "part $chan" |
You can use anything instead of "part $chan" (e.g. something like "ChanServ :op #channel $botnick").
I disagree about +cycle, it's not slow at all. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Fri May 11, 2007 7:01 pm Post subject: |
|
|
| Sir_Fz wrote: | | Quote: | | .chanset #channel need-op putquick "part $chan" |
You can use anything instead of "part $chan" (e.g. something like "ChanServ p #channel $botnick").
I disagree about +cycle, it's not slow at all. |
there are no chanserv on efnet. i tried cycle it just took forever :O |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Sat May 12, 2007 8:20 am Post subject: |
|
|
| And chanfix won't op us, so i need a script that part 9 bots and rejoin them right that sec, when the user all parts or quit. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 12, 2007 9:08 am Post subject: |
|
|
| Code: | bind part - * cycle:chan
proc cycle:chan {nick uhost hand chan arg} {
if {![botisop $chan] && [llength [chanlist $chan]] == 1} {
putquick "part $chan"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Sat May 12, 2007 4:15 pm Post subject: |
|
|
| Sir_Fz wrote: | | Code: | bind part - * cycle:chan
proc cycle:chan {nick uhost hand chan arg} {
if {![botisop $chan] && [llength [chanlist $chan]] == 1} {
putquick "part $chan"
}
} |
|
i tested it, it dose nothing.. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 12, 2007 6:05 pm Post subject: |
|
|
If your bot is oped, it won't cycle. If that's not the case, then try
| Code: | bind part - * cycle:chan
proc cycle:chan {nick uhost hand chan arg} {
if {![botisop $chan] && ([llength [chanlist $chan]]-1 == 1)} {
putquick "part $chan"
}
} |
I think there's an issue where the parting nick is still not removed from [chanlist] thus the [llength [chanlist $chan]] returns 2 instead of 1. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat May 12, 2007 6:15 pm Post subject: |
|
|
what's with the '[llength [chanlist $chan]]-1' ? (with the '-1' thing actualy) seems a bit weird like that.. have you tested it? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat May 12, 2007 7:32 pm Post subject: |
|
|
@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. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 12, 2007 7:34 pm Post subject: |
|
|
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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Mon May 14, 2007 7:32 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon May 14, 2007 8:45 pm Post subject: |
|
|
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). _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Mon May 14, 2007 8:51 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon May 14, 2007 8:54 pm Post subject: |
|
|
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"... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
sdays Halfop
Joined: 21 Oct 2006 Posts: 98
|
Posted: Tue May 15, 2007 8:30 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
|