mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2008
Posts: 44
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 44
hi,
Is it safe to use $event in an alias ? - I have oether events in the script like an Input event & text event to respond to channel triggers. - So I was wondering if its possible that like an input event would change the $event identifier whose original value was 'text' by the time the alias evaluated it.

Thanks!

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It would depend on how the identifier was being used in the alias.
Thinking quickly, if you're worried about the identifier changing value before the alias finished executing, there's little to no chance of that happening due to mIRC's single thread processing.
Of course, if you're really worried about it, you could pass the value of the $event identifier as a parameter to the alias.

Joined: Mar 2008
Posts: 44
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 44
RusselB wrote. .
Quote:
It would depend on how the identifier was being used in the alias.
its being used in an if statement & the value am expecting is from the original event , say in this case a text event

RusselB wrote. . .
Quote:
Thinking quickly, if you're worried about the identifier changing value before the alias finished executing, there's little to no chance of that happening due to mIRC's single thread processing.


Like say am typing stuff in one window..(events may be captured in this window like an 'Input' event) - at the same time events(text for e.g)are being captured at the same time in the background in other open channel windows.

Thanks for the feedback.
-

Last edited by Nightstorm; 31/05/09 02:31 AM.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The value of $event will be valid/set until the event (including all called aliases) are finished executing. It may seem like several events can occur at once, but they are actually dealt with one at a time by mIRC, so the value of $event will not change within a single event.

-genius_at_work

Joined: Mar 2008
Posts: 44
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 44
Thankyou for clearing that up ! ! !


Link Copied to Clipboard