| View previous topic :: View next topic |
| Author |
Message |
Sydneybabe Op
Joined: 27 Apr 2007 Posts: 106 Location: Philippines
|
Posted: Fri Aug 05, 2011 3:01 pm Post subject: @ lists |
|
|
| Hi anyone can help me a script that deop a user when his nick is not on the list of eggdrop upon joining the channel thanks in advance. |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Thu Aug 11, 2011 10:56 am Post subject: |
|
|
This sort of thing can be handled with channel flags, normally. Or, is your bot opping people as they join? If so, it's likely either a script you have doing it, or it's an eggdrop setting... if not, can try something like this I suppose. Untested:
| Code: |
bind join - * check
proc check {nick host hand chan} {
bind mode - "% +o" deop
}
proc deop {nick host hand chan mode victim} {
if {[string equal -nocase "ChanServ" $nick] && ![validuser [nick2hand $victim $chan]]} {
pushmode -o $chan $victim
}
unbind mode - "% +o" deop
}
|
|
|
| Back to top |
|
 |
Sydneybabe Op
Joined: 27 Apr 2007 Posts: 106 Location: Philippines
|
Posted: Fri Aug 12, 2011 1:07 am Post subject: |
|
|
Hi Luminous, thanks for the script but what i wanted is a script that you can save a nick on script like this:
| Quote: | set oplist(ops) {
"nick1"
"nick2"
"nick3"
"andsoon"
}
bind - * on join
bind -* on nickchange
#if nick is not on the list of oplist(ops) bot will deop/ban the nick
#if the nick change and not on the oplist(ops) the bot will deop/ban the nick |
Thanks in advance sir  |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Fri Aug 12, 2011 11:24 am Post subject: |
|
|
Ah, okay, I wasn't quite sure what you wanted. Let me see...
| Code: |
set oplist {
""
""
""
""
}
bind join - * check
bind nick - * isop
proc check {nick host hand chan} {
if {![info exists deop]} {
bind mode - "% +o" deop
}
}
proc isop {nick host hand chan newnick} {
if {![info exists deop]} {
bind mode - "% +o" deop
}
}
proc deop {nick host hand chan mode victim} {
set host [getchanhost $victim $chan]
set mask [lindex [split $host @] 1]
set host "*!*@*.[join [lrange [split $mask .] 2 end] .]"
foreach o $oplist {
if {![string equal -nocase [join $o] $victim]} {
putquick "MODE $chan -o+b $victim $host"
putserv "KICK $chan $victim :You are not permitted to have ops on this channel."
}
}
unbind mode - "% +o" deop
}
|
Again, untested... You'll need to fill in the nicks, obviously. I didn't know what kind of banmask you needed, so I just went with the generic domain ban.
FYI: after thinking about this, all you need is just a single mind for mode changes. Reason why I was doing it like that above is because if you try to have your bot check for ops as soon as someone joins or changes nick, they may have have +o yet and therefore the proc might not work. So, you can do this to toggle the op check on when someone joins or changes nick, or you can do this the even easier way:
| Code: |
set oplist {
""
""
""
""
}
bind mode - "% +o" deop
proc deop {nick host hand chan mode victim} {
set host [getchanhost $victim $chan]
set mask [lindex [split $host @] 1]
set host "*!*@*.[join [lrange [split $mask .] 2 end] .]"
foreach o $oplist {
if {![string equal -nocase [join $o] $victim]} {
putquick "MODE $chan -o+b $victim $host"
putserv "KICK $chan $victim :You are not permitted to have ops on this channel."
}
}
}
|
Does pretty much the same thing, but that will check -all- mode changes to +o. Seems more appropriate for you. |
|
| Back to top |
|
 |
|