The $chan identifier can be accessed within the events (the input or text message occur within a channel) and the alias started out of the event.
Now the timer you start in the alias will execute "outside of" the event definition and it doesn't carry all the identifier values along.
$network works for you because you started an online timer (no -o switch) and every online timer is associated with the respective server connection it was started at.
In your case it doesn't seem useful to store the identifier values somewhere else. Instead, you might
pass the required values to the alias and timer.
In the example below both $chan and $network are passed to the alias, and from within the alias to the timer. Passing to the alias is not needed (it executes within the event), passing to the timer is needed.
; pass network and chan to the _start alias
on *:TEXT:!start:#test: _start $network $chan
on *:INPUT:#test: if ($1 == !start) _start $network $chan
alias _start {
echo -a I can see both network $1 and chan $2 here
; forward $1=network and $2=chan to the timer as well
.timer 1 5 _test $1 $2
}
alias _test { echo -a And I can see both network $1 and chan $2 here as well }
...I hope you get the general idea.
But there's an important issue with this method you have to consider: Everything in the command part of a timer will be evaluated. In the code above, in the _start alias, $1 and $2 are filled with <networkname> and <channelname> - and these values will be evaluated in the timer: for example a channel name "#$me" will be evaluated to your nickname.
A "safe" alias is a good method to prevent this evaluation. The secured code would look like:
on *:TEXT:!start:#: _start $network $chan
on *:INPUT:#: if ($1 == !start) _start $network $chan
alias _start {
echo -a I can see both network $1 and chan $2 here
.timer 1 5 _test $safe($1 $2)
}
alias _test { echo -a And I can see both network $1 and chan $2 here as well }
; keep spacing in this alias as it is!
alias safe { return $!decode( $encode($1,m) ,m) }
__
Edit: Ouch I'm late with this reply...
