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.

excempt certain nicks from this to trigger

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

excempt certain nicks from this to trigger

Post by simo »

is there a way to add exemption for certain nick:

in this small tcl:

Code: Select all

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 "
}

 
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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

Code: Select all

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 "
}

User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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

Second, instead of the foreach loop you could use:

Code: Select all

if {[lsearch -nocase $excnick $nick] != -1} return
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

great tnx caesar
Post Reply