mIRC Home    About    Download    Register    News    Help

Print Thread
#215715 03/10/09 02:39 AM
Joined: Oct 2009
Posts: 5
M
Mittens Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2009
Posts: 5
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.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
on *:TEXT:*:?:.timer $+ $me 1 300 echo 7 -a Don't forget about $me $+ , woman!
on *:INPUT:?:.timer $+ $me off

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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

Last edited by Wims; 03/10/09 05:45 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2009
Posts: 5
M
Mittens Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2009
Posts: 5
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2009
Posts: 5
M
Mittens Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2009
Posts: 5
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
add a . to a command to turn off the output of this command, use ".timer" instead of "timer"


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2009
Posts: 5
M
Mittens Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2009
Posts: 5
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.

Joined: Oct 2009
Posts: 5
M
Mittens Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2009
Posts: 5
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
}

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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)
}


Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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"


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard