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 

@ lists

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Fri Aug 05, 2011 3:01 pm    Post subject: @ lists Reply with quote

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


Joined: 12 Feb 2010
Posts: 146

PostPosted: Thu Aug 11, 2011 10:56 am    Post subject: Reply with quote

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


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Fri Aug 12, 2011 1:07 am    Post subject: Reply with quote

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 Very Happy
Back to top
View user's profile Send private message
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Fri Aug 12, 2011 11:24 am    Post subject: Reply with quote

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
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
Page 1 of 1

 
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