mIRC Homepage

$trigger for ON *:OPEN:*:

Posted By: Talon

$trigger for ON *:OPEN:*: - 28/08/06 06:06 AM

I realized I posted to the wrong forum a lil late.. so oh well, here is my request in the proper forum....

ON *:OPEN:*: { but ended up having to duplicate the same code a few times for each type... my problem is, theres no way to tell what is triggering that open, $target returns $me basically... so how do you know if its a dcc chat/fserve or query? well if $0 is > 0 then its a query, but still now how do you know if its a chat or an fserve? what if both are open, do you take a wild guess? I would like a $trigger that works in OPEN/CLOSE that returns the type of window that triggers the event, it should return @,!,=,? that way I can combine those into one remote rather than duplicating code....
Posted By: Om3n

Re: $trigger for ON *:OPEN:*: - 28/08/06 10:32 AM

I think i made a comment or suggestion about an 'event location' identifier at one point also, i would find this quite useful too.
Posted By: Zerg

Re: $trigger for ON *:OPEN:*: - 28/08/06 10:46 PM

i'm not completely awake right now, but can $window().type help you ?
Posted By: landonsandor

Re: $trigger for ON *:OPEN:*: - 29/08/06 04:41 AM

unless I mistake what you want:

on *:open:? <--- query
on *:open:! <-- fserve
on *:open:= <-- DCC Chat

Does that help?
Posted By: DaveC

Re: $trigger for ON *:OPEN:*: - 29/08/06 05:06 AM

quite right, and simple to use....

on *:open:?:on.open.a query $1-
on *:open:!:on.open.a fserve $1-
on *:open:=:on.open.a Chat $1-
alias on.open.a { var %type = $1 | tokenize 32 $2-
... remaining code here
}
Posted By: Rand

Re: $trigger for ON *:OPEN:*: - 29/08/06 05:47 AM

Indeed. That'd be the easiest way to do it. There's several ways to do it.

You could even make a: "first.open.mrc" file, and have that the first loaded file in your mIRC. With the contents of:

on *:open:?:{ set %_open query }
on *:open:=:{ set %_open chat }
...etc...

Then in another script:

on *:open:*:{ if (%_open == chat) { stuff } | unset %_open }


Personally, I prefer just using :#: :?: :=: in the on events, instead of a *, there's really no point of processing extra stuff (not that there's a noticeable difference, but still.)
Posted By: PhantasyX

Re: $trigger for ON *:OPEN:*: - 30/08/06 01:06 AM

I still agree that the $trigger event should work for the on OPEN/CLOSE events. Returning the appropriate information.
Posted By: IAmParadox

Re: $trigger for ON *:OPEN:*: - 30/08/06 06:07 AM

Am I just being silly by suggesting you use signals and the aforementioned = ? and ! to create your own $trigger signal(s)?
© 2021 mIRC Discussion Forums