| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 29, 2017 11:07 am Post subject: excempt certain nicks from this to trigger |
|
|
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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon May 29, 2017 6:30 pm Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue May 30, 2017 12:44 am Post subject: |
|
|
First off don't use return inside a loop. The proper way to break it is to ... yeah, exactly use break.
Second, instead of the foreach loop you could use:
| Code: |
if {[lsearch -nocase $excnick $nick] != -1} return
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue May 30, 2017 11:01 am Post subject: |
|
|
| great tnx caesar |
|
| Back to top |
|
 |
|