This is basically a nick checker that will check nicks who enter a channel. You can set an allowed person with "/SETALLOWED." It is useful when you want your friends to join a channel without a key (+k).
; Edited to fix mistakes on March 16, 2004
;
; |\ | **************************************
; | \ | * :: Development Box :: *
; | \ | * Code Example Taken From Hawkee.com *
; | \ | * Forum *
; | \| * VERSION: 1.0 *
; Nick **************************************
; Check
;
; Nick Check was to demonstrate the mIRC variable system
; and the $+ to remove the space. The code example has been
; taken from the Hawkee.com forum, but has, however, been
; modified for things
;
;************************************************
;* Edit the text variables below at your own *
;* needs. You can remove the powered by. *
;************************************************
; NOTE: Use $+ to remove the space.
ON !*:JOIN:#: {
%INFO.VERSION = 1.0
%INFO.NC = Nick Check
%TEXT.WELCOME = Welcome to $chan $+ ! (Powered by %INFO.NC $+ )
%TEXT.NONPERMIT = You are not permitted to be on this channel. (Powered by %INFO.NC $+ )
; Do not edit the rest of this.
if ($istok(%allowed,$nick,32)) {
msg $nick %TEXT.WELCOME
}
else {
mode $chan +b $address($nick,3)
kick $chan $nick %TEXT.NONPERMIT
}
}
; Documentation: Use /SETALLOWED to set an allowed person to be on a channel.
alias setallowed {
%allowed = %allowed $1
}
SupahNL, I don't suppose the author of this snippet is "alive" these days...probably gone for good. He was last seen active 7 years ago.
Anyway, here is the modification I made according to your request:
alias setallowed {
var %file = file.txt
if (!$read(%file,nw,$nick)) {
write %file $nick
}
else echo 4 -at The nickname already exists!
}
on @*:join:#:{
if ($read(file.txt,nw,$nick)) {
msg $nick Welcome to # $+ !
halt
}
inc $+(%,wk,$network,#,$site)
if ($($+(%,wk,$network,#,$site),2) > 3) {
ban -k # $nick 2
unset $+(%,wk,$network,#,$site)
}
elseif ($($+(%,wk,$network,#,$site),2) == 3) {
kick # $nick You're not permitted on this channel. $&
This is your last warning!
}
elseif ($($+(%,wk,$network,#,$site),2) == 2) {
kick # $nick You're not permitted on this channel.
}
else {
kick # $nick You're not permitted on this channel.
}
}
It's the same command as the original snippet here, enter /setallowed . Now, make sure you change "file.txt" in the code to the one of your choice. Place all the allowed nicknames in the chosen text file one after another vertically.