mIRC Home    About    Download    Register    News    Help

Print Thread
#145388 22/03/06 04:25 PM
Joined: Jun 2004
Posts: 33
X
Xidus Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Jun 2004
Posts: 33
Hey is there a way to make an on *:text:*: {} script work only every 90 seconds? so people can't spam a bot?

#145389 22/03/06 08:08 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Example only:
Code:
 on *:text:*:#:{
if $($+(%,$address),2) != $1- {
set -u90 $+(%,$address) $1-
;execute rest of code for the on text event
}
else {
.notice $nick Please wait 90 seconds before using this command again
}
}
 

#145390 23/03/06 09:38 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on *:text:*:#:{
  tokenize 32 $strip($1-)
  if (!whatever * iswm $1-) {
    ;^ above is an example to match the text event, if u do this in the ON TEXT then this if can be removed, assume your now in the correct on text event
    ;
    if ($($+(%,$address),2) isnum) {
      .notice $nick Please wait $v1 seconds before using this command again.
      set -u $+ $v1 $+(%,$address) warned
    }
    elseif (!$($+(%,$address),2)) {
      set -z $+(%,$address) 90
      ;execute rest of code for the on text event
      ;
    }
  }
}

*code untested*

* this sets a 90 second count down var until it can be used again, if an attempt is made to use it again before hand u send a warning about how long to wait, following that no action is taken if they attempt it again before the 90 seconds.


Link Copied to Clipboard