I'm quite a beginner to mIRC scripting so...

I need a command that has a cooldown to prevent people from spamming it, if the command is on cooldown, it has to reply to them how long they have to wait to use the request again.

Also I need a command for moderators so they can reset a person's cooldown.

This is what I have so far, the !cd command is not working, !request replies 'You have recently requested, try again inseconds.' without showing the time.

Code:
on *:TEXT:*!request*:#: {
  if (!%xrequest. [ $+ [ $nick ] ]) {
    ; set -u20 %xrequest. $+ $nick 1
    set -z %xrequest. $+ $nick 60
    msg $chan $2- has been added to the playlist.
    /write requests.txt $nick , $2
  }
  else {
    if (!%xspamfilter. [ $+ [ $nick ] ]) {
      set -z %xspamfilter. $+ $nick 10
      msg $chan [ You have recently requested, try again in ] $+ [ %xrequest ] $+ [ seconds. ]
    }
  }
}

on *:TEXT:*!cd*:#: {
  if (!%xrequest. [ $+ [ $nick ] ]) {
    set -z %xrequest. $+ $2 1
    msg $2 , your cooldowns have been reset.
  }
}

Last edited by Fattyshow; 01/10/15 02:04 PM.