mIRC Home    About    Download    Register    News    Help

Print Thread
#162753 22/10/06 04:07 PM
Joined: Oct 2006
Posts: 10
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Oct 2006
Posts: 10
Uhm, i need help..

I'm making a script and i want to have it like
if someone says "hi" i want to say "hi there, $nick $+ !"
but i want it so that it can't be used for 30 secs..
a little example:

12.00:00) hi, ShadoW!
12.00:01) hi there, nick!
12.00:25) hi!!
12.00:55) hi there, nick!

something like that... i know it's useless... but i just want to know how....

#162754 22/10/06 05:07 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:hi:#:{
if !$($+(%,hi,$address),2) {
.msg $chan Hi there, $nick $+ !
}
else {
set -u30 $+(%,hi,$address) $true
}
}

#162755 22/10/06 05:35 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
the normal anti flood I guess would be to set a var to expire in 30 seconds and just check that before the script replys, if the var exists - do nothing - else reply blah

reading your post over I came up with this, mutiple requests will get dumped and only the last one will get a reply and only after a 30 second delay has expired from the last reply from the script

<Bob> Hi Mike
<Mike> Hi Bob.
<bob> Got coffee yet?
<bob> did you sleep good?
(30 seconds from "hi mike")
<mike> yes slept good

note the coffe question got skipped, and there is a reply for it

Code:
on *:text:*:#:{
  if (hi* iswm $1-) { var %reply = Hi $nick $+ . } 
  if (*how are you* iswm $1-) { var %reply = peachy, and you $nick $+ ? }
  if (*sleep good* iswm $1-) { var %reply = rocks should be as rested as I am }
  if (*got coffee* iswm $1-) { var %reply = hey! who drank all my coffee?!? -looks- at $nick }
  if (!%stop.flooders) { 
    msg # %reply 
    set -u30 %stop.flooders sponge
  }
  else { .TIMER.delay 1 31 msg # %reply }
}


#162756 22/10/06 08:22 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
no else needed in there dude smile

Code:
on *:text:hi:#:{
  if !$($+(%,hi,$address),2) {
    .msg $chan Hi there, $nick $+ !
    set -u30 $+(%,hi,$address) $true
  }
}


Link Copied to Clipboard