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 

excempt certain nicks from this to trigger

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


Joined: 22 Mar 2015
Posts: 204

PostPosted: Mon May 29, 2017 11:07 am    Post subject: excempt certain nicks from this to trigger Reply with quote

is there a way to add exemption for certain nick:

in this small tcl:

Code:
set chanlevels "qaoh"
bind mode - {% +*} help:admins
proc help:admins {nick uhost hand chan mc targ} {
         if {[isbotnick $nick]} { return 0 }
   #putlog "mode change on $chan: $mc"
   # if {$mc ne "+q" && $mc ne "+a" && $mc ne "+o" && $mc ne "+h"} { return 0 }
   if {$mc ni {+q +a +o +h}} {return 0}
   if {[isbotnick $targ]} { return 0 }
   putserv "PRIVMSG $targ :since you  are now $mc"
   putserv "PRIVMSG $targ :Commands to be used by channel admins are:"
    putserv "PRIVMSG $targ : to see banlist !blist"
    putserv "PRIVMSG $targ : to see banlist !banlist"
   putserv "PRIVMSG $targ : to kick !k"
   putserv "PRIVMSG $targ : to kickban !b"
   putserv "PRIVMSG $targ : to un-ban !uban nick!ident@host"
   putserv "PRIVMSG $targ : to un-ban !ub"
   putserv "PRIVMSG $targ : to kickban !kb"
   putserv "PRIVMSG $targ : to mute !m"
    putserv "PRIVMSG $targ : to clear all channel bans !c"
    putserv "PRIVMSG $targ : to clear all channel bans !cb"
   putserv "PRIVMSG $targ : to add akick !akick add ...addhere.."
   putserv "PRIVMSG $targ : to add akick !ak add ...addhere.."
   putserv "PRIVMSG $targ : to add akick !ak47 add ...addhere.."
   putserv "PRIVMSG $targ : to op !o"
   putserv "PRIVMSG $targ : to de-op !do"
   putserv "PRIVMSG $targ : to voice !v"
   putserv "PRIVMSG $targ : to de-voice !dv"
   putserv "PRIVMSG $targ : to protect !p"
   putserv "PRIVMSG $targ : to de-protect !dp"
   putserv "PRIVMSG $targ : to owner !ow"
   putserv "PRIVMSG $targ : to de-owner !dow"
   putserv "PRIVMSG $targ : to UP !u"
   putserv "PRIVMSG $targ : to DOWN !d"
   putserv "PRIVMSG $targ : to KICK USER FOR BAD BEHAVIOUR !bh nick"
   putserv "PRIVMSG $targ : to KICK USER FOR BAD NAME !n nick"
    putserv "PRIVMSG $targ : to kick for bad nick !nick"
    putserv "PRIVMSG $targ : to kick adds/spam !add"
    putserv "PRIVMSG $targ : to kick adds/spam !spam"
    putserv "PRIVMSG $targ : to kick adds/spam !pm"
    putserv "PRIVMSG $targ : to BAN characters in nick like (incase of abuse):  `^\-_0123456789 !bchar"
   putserv "PRIVMSG $targ : to MASS VOICE EVERYONE ON CHANNEL !mv"
   putserv "PRIVMSG $targ : 08,01  to use services commands: like !b !kb !ak !m  and such dont use colors/bold/underline or anything type commands in plain letters stripped from any code else it wont trigger "
}

 
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Mon May 29, 2017 6:30 pm    Post subject: Reply with quote

i tried this but i was wondering is this the proper way to do it?

Code:
set excnick {
    "chanserv"
    "simo"
}


set chanlevels "qaoh"
bind mode - {% +*} help:admins
proc help:admins {nick uhost hand chan mc targ} {
 global excnick
    foreach exceptnicks [string tolower $excnick] {
   if {[string match $exceptnicks [string tolower $nick]]} {
                return 0
    }
    }
        if {[isbotnick $nick]} { return 0 }
   #putlog "mode change on $chan: $mc"
   # if {$mc ne "+q" && $mc ne "+a" && $mc ne "+o" && $mc ne "+h"} { return 0 }
   if {$mc ni {+q +a +o +h}} {return 0}
   if {[isbotnick $targ]} { return 0 }
   putserv "PRIVMSG $targ :since you  are now $mc"
   putserv "PRIVMSG $targ :Commands to be used by channel admins are:"
    putserv "PRIVMSG $targ : to see banlist !blist"
    putserv "PRIVMSG $targ : to see banlist !banlist"
   putserv "PRIVMSG $targ : to kick !k"
   putserv "PRIVMSG $targ : to kickban !b"
   putserv "PRIVMSG $targ : to un-ban !uban nick!ident@host"
   putserv "PRIVMSG $targ : to un-ban !ub"
   putserv "PRIVMSG $targ : to kickban !kb"
   putserv "PRIVMSG $targ : to mute !m"
    putserv "PRIVMSG $targ : to clear all channel bans !c"
    putserv "PRIVMSG $targ : to clear all channel bans !cb"
   putserv "PRIVMSG $targ : to add akick !akick add ...addhere.."
   putserv "PRIVMSG $targ : to add akick !ak add ...addhere.."
   putserv "PRIVMSG $targ : to add akick !ak47 add ...addhere.."
   putserv "PRIVMSG $targ : to op !o"
   putserv "PRIVMSG $targ : to de-op !do"
   putserv "PRIVMSG $targ : to voice !v"
   putserv "PRIVMSG $targ : to de-voice !dv"
   putserv "PRIVMSG $targ : to protect !p"
   putserv "PRIVMSG $targ : to de-protect !dp"
   putserv "PRIVMSG $targ : to owner !ow"
   putserv "PRIVMSG $targ : to de-owner !dow"
   putserv "PRIVMSG $targ : to UP !u"
   putserv "PRIVMSG $targ : to DOWN !d"
   putserv "PRIVMSG $targ : to KICK USER FOR BAD BEHAVIOUR !bh nick"
   putserv "PRIVMSG $targ : to KICK USER FOR BAD NAME !n nick"
    putserv "PRIVMSG $targ : to kick for bad nick !nick"
    putserv "PRIVMSG $targ : to kick adds/spam !add"
    putserv "PRIVMSG $targ : to kick adds/spam !spam"
    putserv "PRIVMSG $targ : to kick adds/spam !pm"
    putserv "PRIVMSG $targ : to BAN characters in nick like (incase of abuse):  `^\-_0123456789 !bchar"
   putserv "PRIVMSG $targ : to MASS VOICE EVERYONE ON CHANNEL !mv"
   putserv "PRIVMSG $targ : to MASS DE-VOICE EVERYONE ON CHANNEL !mdv"
   putserv "PRIVMSG $targ : 08,01  to use services commands: like !b !kb !ak !m  and such dont use colors/bold/underline or anything type commands in plain letters stripped from any code else it wont trigger "
}

Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3401
Location: Area 51

PostPosted: Tue May 30, 2017 12:44 am    Post subject: Reply with quote

First off don't use return inside a loop. The proper way to break it is to ... yeah, exactly use break. Razz

Second, instead of the foreach loop you could use:
Code:

if {[lsearch -nocase $excnick $nick] != -1} return

_________________
You may say anything about me, but don't misspell my name.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Tue May 30, 2017 11:01 am    Post subject: Reply with quote

great tnx caesar
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