mIRC Home    About    Download    Register    News    Help

Print Thread
Halt script triggering with timer? #189946 14/11/07 12:58 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Code:
menu query { 
  Message Forwarding
  .Enable:/set %message_forwarding on | /echo -a 4Message forwarding enabled.
  .Disable:/set %message_forwarding off | /echo -a 4Message forwarding disabled.
}

on *:TEXT:*:?:{
  if (%message_forwarding == on) {
    /msg $nick I am not here at the moment. You may join my channel to leave a message for me.
    /invite $nick #channel
  }
  else halt
}


Is there a way to set that to not respond if the same person has triggered it again within 5 minutes? IE, I have the script on, and then someone sends it a message. It auto responds. If they send another message, it will not respond to them again for five minutes. HOWEVER, it will respond to someone else. I can't think of how to do this with a timer.

Re: Halt script triggering with timer? [Re: Mpot] #189948 14/11/07 01:03 AM
Joined: Dec 2002
Posts: 2,023
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,023

Code:

menu query {
  Message Forwarding
  .Enable:/set %message_forwarding on | /echo -a 4Message forwarding enabled.
  .Disable:/set %message_forwarding off | /echo -a 4Message forwarding disabled.
}

on *:TEXT:*:?:{
  if ((%message_forwarding == on) && (!$eval($+(%,msgfwd.,$nick),2))) {
    set -eu300 $+(%,msgfwd.,$nick) $true
    /msg $nick I am not here at the moment. You may join my channel to leave a message for me.
    /invite $nick #channel
  }
}