mIRC Home    About    Download    Register    News    Help

Print Thread
.timer and $read not working together? #252037 16/03/15 08:07 PM
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
I have a bit of script, set to read a file X seconds after one message is sent and then send what is in that file. However, it's not sending the correct message. It's not reading the amount (ie $10.00)

If I don't use the timer everything works fine. But I'd like the timer.

Code:
if (%1 == recentdonor.txt) {
          set %recentdonor msg # /me $read(recentdonor.txt,n)
          msg # /me Incoming...
          .timerRecentDonor 1 10 %recentdonor
        }


The rest of the entire script works perfectly fine, and as I said this works fine without a timer. I've also tried without the "/me" and I've tried with just reading the file. For some reason, it won't read the amount no matter what if it's not a variable... At least, from what I've tried. But, I'm not worried about that. I just want it to be on a bit of a delay for the chat. Any help with it would be great. If it's not do-able that'd be great to know too. As well as why it won't if possible.

Last edited by Bramzee; 16/03/15 08:09 PM.
Re: .timer and $read not working together? [Re: Bramzee] #252038 17/03/15 12:26 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
What does a $ normally do in mirc?

Re: .timer and $read not working together? [Re: Belhifet] #252039 17/03/15 08:07 AM
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
detects which parameter? But, with ", n" in the $read it should treat the file as plain text. Correct? I mean, it works. As long as I don't use a timer.

Re: .timer and $read not working together? [Re: Bramzee] #252040 17/03/15 08:16 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Try use this code:

Code:
if (%1 == recentdonor.txt) {
  var %recentdonor = msg # /me $replace($read(recentdonor.txt,n),$chr(36),$chr(36) $+ !)
  msg # /me Incoming...
  .timerRecentDonor 1 10 %recentdonor
}


Help details: /help $!

Re: .timer and $read not working together? [Re: Bramzee] #252041 17/03/15 08:18 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Originally Posted By: Bramzee
detects which parameter? But, with ", n" in the $read it should treat the file as plain text. Correct? I mean, it works. As long as I don't use a timer.


If the n switch is specified then the line read in will not be evaluated and will be treated as plain text.

More details: /help $read

Re: .timer and $read not working together? [Re: Belhifet] #252042 17/03/15 08:21 AM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Originally Posted By: Belhifet
What does a $ normally do in mirc?


The $ character specify an mIRC identifier like $mircexe you can use your custom like:

More details: /help $

Usage: //echo -a IS: $test

Code:
alias test { return TEST-MESSAGE }

Re: .timer and $read not working together? [Re: westor] #252043 17/03/15 08:25 AM
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
thank you westor, it works. Glad to have this working, really helps with letting chat catch up to stream a bit so it's more of an all at once reaction. Also, for some reason every time I read that help file I read it as the file would be treated as plain text. Not the line itself. Thanks for pointing that out smile

Re: .timer and $read not working together? [Re: Bramzee] #252044 17/03/15 11:26 AM
Joined: Jan 2004
Posts: 1,275
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,275
The line was read as plain text, but the timer evaluated that text again.