mIRC Homepage
Posted By: Mittens Remote Script Help - 03/10/09 02:39 AM
Okay, so, I'm pretty new to all this scripting stuff, but learning, with some help. I've been trying to fashion a set of remote scripts that will be used to send me messages if I leave a PM window sitting without responding for 5 minutes. My current method of doing this is using two remote scripts, one to write a timer for every PM I get, one to stop that timer when I respond. However, The first one, to write the timer, doesn't -always- work (though it does sometimes) and also seems to work oddly if I change names. The second one simply does not do what I want it to do. Here are the scripts:

on *:TEXT:*:?:/timer $+ $nick 1 300 /echo 7 -a Don't forget about $+ $chr(32) $+ $nick $+ , woman!
on *:INPUT:?:/timer $+ $target off

Any ideas? Thanks in advance.
Posted By: Tomao Re: Remote Script Help - 03/10/09 05:20 AM
Code:
on *:TEXT:*:?:.timer $+ $me 1 300 echo 7 -a Don't forget about $me $+ , woman!
on *:INPUT:?:.timer $+ $me off
Posted By: Wims Re: Remote Script Help - 03/10/09 05:45 AM
I would use
Code:
on *:TEXT:*:?:.timer $+ $server $+ $nick 1 300 echo 7 -a Don't forget about $nick $+ , woman!
on *:INPUT:?:.timer $+ $server $+ $active off
Posted By: Mittens Re: Remote Script Help - 03/10/09 03:59 PM
Well, I've got the first part of the script working. I realized that the reason it wasn't always working was because it was an on TEXT script, and I had no on ACTION script. So now I have these, and they work fine:
Code:
on *:TEXT:*:?:/timer $+ $server $+ $nick 1 300 echo 7 -a Don't forget about $nick $+ , woman!
on *:ACTION:*:?:/timer $+ $server $+ $nick 1 300 echo 7 -a Don't forget about $nick $+ , woman!

However, the second part of the script still does not work. It also seems that a should-be-simple script that just says:
Code:
on *:INPUT:?:/echo 7 -a Hi.
doesn't work, so do I just have on INPUT format wrong, or something?
Thanks again.
Posted By: Wims Re: Remote Script Help - 03/10/09 04:19 PM
You probably have another similar definition of an on input event before this one in the file, try to put you on action/text/input event in a new file
Posted By: Mittens Re: Remote Script Help - 03/10/09 07:57 PM
That did it. Without the other input interfering, it now works fine.
However, every time I respond to the person a timer was started for, it gives me the message that the timer has been turned off. Unless someone knows how to silence this message so I don't have to see it in the PM window, I'm scrapping this idea for a script.
Posted By: Wims Re: Remote Script Help - 03/10/09 08:04 PM
add a . to a command to turn off the output of this command, use ".timer" instead of "timer"
Posted By: argv0 Re: Remote Script Help - 03/10/09 08:24 PM
Originally Posted By: mirc.hlp
If you want to force a command to perform quietly ie. without printing out any information, then you can prefix it with a "." full stop.
Posted By: Mittens Re: Remote Script Help - 03/10/09 09:15 PM
Oh, well then! I suppose I should have looked into that myself. :P
Thank you all for all the help, as far as I can tell the script works great now.
Posted By: Mittens Re: Remote Script Help - 04/10/09 04:22 AM
If anyone is interested in this script, here is the final product that works as well as I think is necessary. I may have missed something, however.
Code:
on *:TEXT:*:?: {
  .timer $+ $server $+ $nick 1 300 echo 7 -a Don't forget about $nick $+ !
  .set %rem. $+ $nick 1
}
on *:ACTION:*:?: {
  .timer $+ $server $+ $nick 1 300 echo 7 -a Don't forget about $nick $+ !
  .set %rem. $+ $nick 1
}
on *:NICK: {
  if ($($+(%,rem.,$nick),2) == 1) {
    .timer $+ $server $+ $nick off
    .timer $+ $server $+ $newnick 1 300 echo 7 -a Don't forget about $newnick $+ !
  }
}
on *:INPUT:?: {
  .timer $+ $server $+ $active off
  .set %rem. $+ $active 0
}
Posted By: RusselB Re: Remote Script Help - 04/10/09 05:41 AM
Suggested alternative
Code:
on *:TEXT:*:?: {
  .t $server $nick
}
alias -t {
  $+(.timer,$1,$2) 1 300 echo 7 -a Don't forget about $nick $+ !
  set $+(%,rem,$2) 1
}
on *:ACTION:*:?: {
  .t $server $nick
}
on *:NICK: {
  if ($($+(%,rem.,$nick),2) == 1) {
    $+(.timer,$server,$nick) off
    .t $server $newnick
  }
}
on *:INPUT:?: {
  $+(.timer,$server,$nick) off
  unset $+(%,rem,$nick)
}

Posted By: Wims Re: Remote Script Help - 04/10/09 05:38 PM
I don't understand why so often people do make (wrong in this case) reply when it's not needed, his code can be better because he could use $timer instead of dynamic global var, but I think he don't care about that when he said "final"
© mIRC Discussion Forums