mIRC Home    About    Download    Register    News    Help

Print Thread
#94134 14/08/04 03:18 AM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
I have a quote system on my bot, where people can add quotes or what not, but i'm trying to figure out how you would stop it from adding the same quote twice. I'm sure you would use the if then else statment, and i've looked through the help file on that, and couldnt find anything that might help me with this, maybe i'm just missing somthing?

Code:
on *:TEXT:.quote*:#:{
  /write quotes.txt $2- 12 Added By $nick $+ .
  $read(quotes.txt, s, $2-)
  /msg # Quote Number: $readn added.
}

Is there a way i can stop people from adding the same quote, excluding the "added by $nick" because then the way I see it, it would have only stopped that nick, but in reality i need it from everyone. Please help if your willing..

#94135 14/08/04 05:51 AM
Joined: Feb 2003
Posts: 83
L
Babel fish
Offline
Babel fish
L
Joined: Feb 2003
Posts: 83
Quote:

code:--------------------------------------------------------------------------------on *:TEXT:.quote*:#:{ /write quotes.txt $2- 12 Added By $nick $+ . $read(quotes.txt, s, $2-) /msg # Quote Number: $readn added.}

--------------------------------------------------------------------------------



try

code:--------------------------------------------------------------------------------
on *:TEXT:.quote*:#:{
if ($read(quotes.txt ,s, $2- ) != $null) { msg $nick Sorry Quote already added. | halt }
write quotes.txt $2- 12 Added By $nick $+ .
$read(quotes.txt, s, $2-)
msg # Quote Number: $readn added.
}

--------------------------------------------------------------------------------

**Note this is not tested and im on a pc i jus got so im tired from setting it up , but if it doesnt work right, /help $read
and u should figure it from my ex.




Last edited by LO_KEY; 14/08/04 05:56 AM.

any help would make me happy
#94136 14/08/04 02:49 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
It works perfect, thanks smile


Link Copied to Clipboard