mIRC Home    About    Download    Register    News    Help

Print Thread
#173674 27/03/07 02:37 PM
Joined: Mar 2007
Posts: 38
H
HuMoR Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Mar 2007
Posts: 38
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!.-


"if ($me ison $forum) { say Hello! }"
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
I would report it as a timer bug because it shouldn't (IMO)
behave that way as long as the | is not standing alone.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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)


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Mar 2007
Posts: 38
H
HuMoR Offline OP
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Mar 2007
Posts: 38
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.

"if ($me ison $forum) { say Hello! }"
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
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,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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)


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard