mIRC Home    About    Download    Register    News    Help

Print Thread
#242533 29/07/13 11:48 PM
A
Avunit
Avunit
A
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,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
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.

A
Avunit
Avunit
A
Thanks a lot for the help, works a treat!


Link Copied to Clipboard