mIRC Homepage
I'm having trouble getting timers to call an alias to print to the correct channel. For example, the following acts as an echo. It does not print to the channel I am currently in, instead it prints to the console.

Code:
alias test { msg $chan test called }
on *:TEXT:test:#: { /timerStartTest 1 2 /test  }


However, if I make the following change

Code:
;alias test { msg $chan test called }
on *:TEXT:test:#: { /timerStartTest 1 2 msg $chan hi}


I get the message 'hi' printed to the correct channel. Is there some sort of interaction I'm missing here? I appreciate any help!
$chan only resolves from an event, the timer is in a different scope. You need to pass the channel name to the alias.
Thanks! That does work! For future searchers, the following code should look like this:

Code:
alias test { msg $1 test called }
on *:TEXT:test:#: { /timerStartTest 1 2 /test $chan }
Unfortunately, that code is open to exploit, you can read more about it there http://www.zigwap.com/mirc/eval_injection and I recommend you use the $safe alias around $chan.
© mIRC Discussion Forums