mIRC Home    About    Download    Register    News    Help

Print Thread
#242533 29/07/13 11:48 PM
Joined: Jul 2013
Posts: 2
A
Avunit Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Jul 2013
Posts: 2
Hey guys I'm a little bit stuck.

I've created a simple script that will add the users IRC nick to a text file when they run a certain command detailed below.

on *:TEXT:!giveaway enter:#: {
write giveaway.txt $nick
msg $chan $nick - you have been entered in to the giveaway! }

Is there a simple way to check if the users nick is already in the file and if so not add it again (and maybe inform them that they already entered)?

Thanks!

Last edited by Avunit; 29/07/13 11:49 PM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
on *:TEXT:!giveaway enter:#: {
if (!$read(giveaway.txt,nw,$nick)) {
write giveaway.txt $nick
msg $chan $nick - you have been entered in to the giveaway!
}
}

This tells mIRC if the nickname being added does not exist already. If one exists, mIRC will ignore him or her.

Joined: Jul 2013
Posts: 2
A
Avunit Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Jul 2013
Posts: 2
Thanks a lot for the help, works a treat!


Link Copied to Clipboard