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.

@ lists

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

@ lists

Post by Sydneybabe »

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.
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

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: Select all

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
}
S
Sydneybabe
Op
Posts: 106
Joined: Fri Apr 27, 2007 3:31 am
Location: Philippines

Post by Sydneybabe »

Hi Luminous, thanks for the script but what i wanted is a script that you can save a nick on script like this:
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 :D
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Ah, okay, I wasn't quite sure what you wanted. Let me see...

Code: Select all

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: Select all

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