Try use this code:
ON *:TEXT:!key:*: {
var %f = C:\Users\Owner\AppData\Roaming\mIRC\keys.txt
if (!$isfile(%f)) { msg $nick Error: File Not exist! | return }
if (!$lines(%f)) { msg $nick Error: File is empty! | return }
var %r = $read(%f,nt,1)
var %rn = $readn
if (%r) {
msg $nick %r
write -dl $+ %rn $qt(%f)
}
elseif (!%r) { msg $nick There is NOT any key available! }
}
That actually works really well! The "There is NOT any key available!" does not work if the file is empty though, but besides that, it works
How can I add a cooldown to this command that lasts even if the mirc chat is closed and re-opened? Say a week cooldown or so?
Thanks again, you're awesome!