mIRC Home    About    Download    Register    News    Help

Print Thread
$trigger for ON *:OPEN:*: #157742 28/08/06 06:06 AM
Joined: Dec 2002
Posts: 213
T
Talon Offline OP
Fjord artisan
OP Offline
Fjord artisan
T
Joined: Dec 2002
Posts: 213
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....

Re: $trigger for ON *:OPEN:*: #157743 28/08/06 10:32 AM
Joined: Jul 2003
Posts: 655
Om3n Offline
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I think i made a comment or suggestion about an 'event location' identifier at one point also, i would find this quite useful too.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Re: $trigger for ON *:OPEN:*: #157744 28/08/06 10:46 PM
Joined: Oct 2003
Posts: 25
Z
Zerg Offline
Ameglian cow
Offline
Ameglian cow
Z
Joined: Oct 2003
Posts: 25
i'm not completely awake right now, but can $window().type help you ?

Last edited by Zerg; 28/08/06 10:46 PM.
Re: $trigger for ON *:OPEN:*: #157745 29/08/06 04:41 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
unless I mistake what you want:

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

Does that help?


Those who fail history are doomed to repeat it
Re: $trigger for ON *:OPEN:*: #157746 29/08/06 05:06 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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
}

Re: $trigger for ON *:OPEN:*: #157747 29/08/06 05:47 AM
Joined: Feb 2005
Posts: 342
R
Rand Offline
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
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.)

Re: $trigger for ON *:OPEN:*: #157748 30/08/06 01:06 AM
Joined: Apr 2004
Posts: 218
P
PhantasyX Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 218
I still agree that the $trigger event should work for the on OPEN/CLOSE events. Returning the appropriate information.


Live to Dream & Dream for Life
Re: $trigger for ON *:OPEN:*: #157749 30/08/06 06:07 AM
Joined: Sep 2004
Posts: 14
I
IAmParadox Offline
Pikka bird
Offline
Pikka bird
I
Joined: Sep 2004
Posts: 14
Am I just being silly by suggesting you use signals and the aforementioned = ? and ! to create your own $trigger signal(s)?