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.

auto regain op..

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

auto regain op..

Post by sdays »

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..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

.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.
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

Sir_Fz wrote:
.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.
there are no chanserv on efnet. i tried cycle it just took forever :O
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind part - * cycle:chan

proc cycle:chan {nick uhost hand chan arg} {
 if {![botisop $chan] && [llength [chanlist $chan]] == 1} {
  putquick "part $chan"
 }
}
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

Sir_Fz wrote:

Code: Select all

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..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If your bot is oped, it won't cycle. If that's not the case, then try

Code: Select all

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.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

@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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

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?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

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.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

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.
Post Reply