mIRC Home    About    Download    Register    News    Help

Print Thread
#173674 27/03/07 02:37 PM
H
HuMoR
HuMoR
H
Hi there.
I have a var with:

Code:
set %var Good morning MrFood|BNC


If I use msg, work fine:

Code:
.msg # %var


But, if I use into a timer:

Code:
.timer 1 1 .msg # %var


I recieve the message: BNC Unknow Command. 'Coz take the | like a separator...

Suggestions?

Cya!.-

#173675 27/03/07 03:34 PM
Joined: Dec 2002
Posts: 1,999
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,999
I would report it as a timer bug because it shouldn't (IMO)
behave that way as long as the | is not standing alone.

#173681 27/03/07 03:56 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
With the exact variable you've given here that shouldn't happen, and I'm unable to reproduce that behaviour. However, if the variable value is "Good morning MrFood | BNC" (with spaces around the "|") then it is because it is being treated as a command separator. To get around that issue you need to prevent the %msg variable from being evaluated when the timer is set so that it is only evaluated when the timer goes off and knows to treat it as plain text.

Code:
.timer 1 1 .msg # $+(%,var)

H
HuMoR
HuMoR
H
Yes, with a space between |. I get a google results and when i try to show the results that happen.
For example, search TyC and the result is: TyC | Sports...
Now i'll try your code...
Thx.

Cya!.-

EDIT: Works! Thx...

Last edited by HuMoR; 27/03/07 04:23 PM.
Joined: Mar 2003
Posts: 612
B
Pan-dimensional mouse
Offline
Pan-dimensional mouse
B
Joined: Mar 2003
Posts: 612
yeah timer evaluations are a pain. Isn't there a, e.g.

/!timername x x stuff

usage too for evaluating on each occurance?

btk


billythekid
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Close..using your example it would be

/timername x x !stuff

Where stuff is normally (although not necessarily) an identifier.

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
To prevent evaluation of the entire command parameter of /timer you'd have to surround it with $eval(commands, 0).

ie.
Code:
timer 1 1 echo -t $time $asctime(ss)
becomes:
timer 1 1 $eval(echo -t $time $asctime(ss), 0)


Link Copied to Clipboard