egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

auto regain op..
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Fri May 11, 2007 3:40 pm    Post subject: auto regain op.. Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri May 11, 2007 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Fri May 11, 2007 7:01 pm    Post subject: Reply with quote

Sir_Fz wrote:
Quote:
.chanset #channel need-op putquick "part $chan"

You can use anything instead of "part $chan" (e.g. something like "ChanServ Surprisedp #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
View user's profile Send private message
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Sat May 12, 2007 8:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat May 12, 2007 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Sat May 12, 2007 4:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat May 12, 2007 6:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat May 12, 2007 6:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat May 12, 2007 7:32 pm    Post subject: Reply with quote

@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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat May 12, 2007 7:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Mon May 14, 2007 7:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon May 14, 2007 8:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Mon May 14, 2007 8:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon May 14, 2007 8:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
sdays
Halfop


Joined: 21 Oct 2006
Posts: 98

PostPosted: Tue May 15, 2007 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber