mIRC Home    About    Download    Register    News    Help

Print Thread
#149883 25/05/06 12:52 AM
Joined: Nov 2005
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Nov 2005
Posts: 4
Greetings.

My BlackJack Bot sends lots of messages into the channel, and consequently the messages need to be spaced apart by 2 second delay timers to prevent flooding and auto-ignores from clients.

This works satisfactory.

However, a message the Bot sends indicates how much a Player has won or lost. A typical message might be:

Quote:
Joe wins, and the House grungingly pays out $10.


The problem is this is a command for a timer:

Code:
 Timer 1: 1 Delay, 1 seconds until execution of /say Joe wins, and the House grungingly pays out $10. command.


As a command, mIRC obviously find this to be some sort of passed value or an identifier. In my case, I need for it to be a literal string.

That's the background. So my question is:

Is there a way to force the timer to see the command as a string literal -or- is there a way to escape the $ sign?

I have tried all sorts of things, evaluation brackets, $eval(), \$, $$, but in the end, the timer command ends up to be the same above.

Your guidance would be honored.

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Instead of $10, use $!10 or $+($chr(36),10)

Joined: Nov 2005
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Nov 2005
Posts: 4
Awesome, the ! worked first try. I honor you.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
you would need to make it 2 !'s

$10 is the tenth token passed to what ever script your running

so
alias example { timer 1 0 echo -a result1 $10 }
^ $10 is evaluated when the timer is created
/example a b c d e f g h i j k
result1 j

vs

alias example { timer 1 0 echo -a result2 $!10 }
^ $!10 is evaluated to $10 when the timer is created to be $10, and $10 is evaluated when the timer goes off, becoming $null
/example a b c d e f g h i j k
result2

vs

alias example { timer 1 0 echo -a result3 $!!10 }
^ $!!10 is evalauted when the timer is created to be $!10, and $1!10 is evalaueted when the timer goes off, becoming $10
/example a b c d e f g h i j k
result3 $10


Link Copied to Clipboard