mIRC Home    About    Download    Register    News    Help

Print Thread
safe to use $event in an alias ? #212704 31/05/09 01:12 AM
Joined: Mar 2008
Posts: 44
N
Nightstorm Offline OP
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!

Re: safe to use $event in an alias ? [Re: Nightstorm] #212705 31/05/09 01:21 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
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.

Re: safe to use $event in an alias ? [Re: RusselB] #212706 31/05/09 02:28 AM
Joined: Mar 2008
Posts: 44
N
Nightstorm Offline OP
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.
Re: safe to use $event in an alias ? [Re: Nightstorm] #212708 31/05/09 03:33 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
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

Re: safe to use $event in an alias ? [Re: genius_at_work] #212709 31/05/09 04:51 AM
Joined: Mar 2008
Posts: 44
N
Nightstorm Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 44
Thankyou for clearing that up ! ! !