mIRC Home    About    Download    Register    News    Help

Print Thread
#227201 31/10/10 04:15 PM
Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
I find the behavior of the on open command weird. It only triggers when someone queries me and not when I open a query window. The on close event triggers whether someone queried me or I opened the window myself. I feel the on open should trigger when I open a query with someone. Any one know if there is something behind this?

on *:open:?:*:echo -s Just opened $target query window
on *:close:?: echo -s closed $target query window


http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
if I remember from ages ago, if you did something like:

on me:*:open:?:*:echo -s Just opened $target query window

I remember there's a ton of commands that ME works for but NOT all by any means. I tried a search for "on me" going back 5 years over the whole board and got nothing though a few years ago I talked about it a lot, tho I fell out of IRC and now only keep it installed for some tinkering here and there. As for close working both ways, it doesnt matter who OPENED it, but who CLOSED it


Those who fail history are doomed to repeat it
Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
I tried that and it doesn't work. Which makes sense, since me should be included when using * for the event.


http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
If you can't capture the open event, do what you need to do when you open the window.

Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
DJ_Sol what you said makes no sense to me.


http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
If you need to know when you open a window and the open event doesn't cover it, then pay attention to when you open it.

Code:
{
query $$1
;I just opened a query window.
if ($query($$1)) { echo $$1 Query window is open with $$1 }

}

Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
so you're saying put some code where ever I open a new query window? the code you posted doesn't really clarify things either.

if that is your suggestion that'd be a pain. since I'd have to account for lots of things.

I guess i can just add on text and on input for query windows. Then as soon as either of us speak what I want to happen will happen.


http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
The code I showed was just to explain what I meant. You didn't really say what you wanted to do, just that you wanted to know when you opened a query window. If you ever want to check if a query window is open, you can use $query($nick).

What do you want to accomplish? There are probably more than one way to go about it.

Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
The gist of what i'm doing is the following

on *:open:?:*: { set $+(%,ison_,$network) $addtok($($+(%,ison_,$network),2),$nick,5)

When a query is opened I want to add the other persons nick to a variable, so I can track currently open queries. So the on open event is perfect, except that it doesn't trigger when I open a query window (which is lame).

So far the only other simple solution so far is to use on text/input to see when something is said in a query window. But then I have to check if they are already added each time something is said, thus why the on open is the best method.

Last edited by pball; 03/11/10 01:23 PM.

http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Using $addtok will handle the situation you are describing, since it automatically will not add a token (in this case, nick) that already exists in the variable.

From /help $addtok
Quote:
Adds a token to the end of text but only if it is not already in text.



Link Copied to Clipboard