mIRC Home    About    Download    Register    News    Help

Print Thread
non-named $regml() from event is cleared #269560 30/10/21 02:48 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
A line of code like this, involving non named $regml:
Code
//noop $regex(a,(a)) | echo -ag regml1: $regml(1) | .timer -ho 1 0 echo -ag Tregml1: $!regml(1)
Shows that $regml(1) works correctly when evaluated because of the timer executing its command.
But I was trying this from an on hotlink event and $regml is only working inside the event, is it $null when the timer fires:

Code
on $*:hotlink:/(a)b/:*:echo -ag regml: $regml(1) | .timer -ho 1 0 echo -ag Tregml: $!regml(1)
use "//echo -ag ab" to display ab in the active window and hover it with your mouse

I feel like this is a bug, not sure, but the inconsistency with how it works outside of an event is there.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: non-named $regml() from event is cleared [Re: Wims] #269562 30/10/21 08:12 PM
Joined: Dec 2002
Posts: 5,020
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,020
Thanks for your bug report. This has been discussed before. A $regml() that is unnamed is context-dependent. It is repeatedly cleared and reused in many different contexts. You need to use it in the context in which it was created.

Re: non-named $regml() from event is cleared [Re: Khaled] #269563 30/10/21 08:40 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
I cannot pass a name when the regex is created with the event definition, I'll have to use $unsafe($regml(1)) with the timer then.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net