mIRC Home    About    Download    Register    News    Help

Print Thread
on OPEN doesn't do what I want #240892 04/03/13 08:02 PM
Joined: Mar 2013
Posts: 3
I
iScripters Offline OP
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Mar 2013
Posts: 3
When reading the /help, my understanding of on OPEN is that it will be triggered when a window is opened. However, using this line:
Code:
on *:OPEN:?:*:/beep

does not trigger when I open a query window myself. Can this even be done?

What I was trying to make is a script that shows the last 10 lines of the logfile (if exists) for that nickname when a query window gets opened. Not just when someone is querying me, but also when I open the query window to them.

Re: on OPEN doesn't do what I want [Re: iScripters] #240893 04/03/13 08:47 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
How are you opening the query window, by double clicking the nickname in the nicklist?

Re: on OPEN doesn't do what I want [Re: hixxy] #240894 04/03/13 09:45 PM
Joined: Oct 2009
Posts: 24
Scakk Offline
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2009
Posts: 24
On open does not trigger if you open the query window yourself. You would need to use on input if you are wanting it trigger if you opened it and entered text.

Re: on OPEN doesn't do what I want [Re: iScripters] #240896 04/03/13 11:12 PM
Joined: Oct 2012
Posts: 164
D
Deega Offline
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
mIRC has a 'Reload logs' option in Options \ IRC \ Logging
You can't set how many lines to reload though.

Another option is to use a custom /query alias.
Code:
alias query {
  !query $$1
  if ($file($window($1).logfile)) { loadbuf 10 $1 $qt($window($1).logfile) }
}


Re: on OPEN doesn't do what I want [Re: hixxy] #240898 04/03/13 11:36 PM
Joined: Mar 2013
Posts: 3
I
iScripters Offline OP
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Mar 2013
Posts: 3
Originally Posted By: hixxy
How are you opening the query window, by double clicking the nickname in the nicklist?


Yes.

@Deega: Thanks, but this would only be triggered when I use /query, not whenever a query window gets opened. I could create a script that uses your script for every possible way a query windows is opened but I'd rather just have it in 1 statement like the on OPEN. If this is not possible I will go with the first option tho.

Re: on OPEN doesn't do what I want [Re: iScripters] #240901 05/03/13 12:18 AM
Joined: Oct 2012
Posts: 164
D
Deega Offline
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
That will work when you open a query window by double clicking the nickname also. /query is what that action triggers (by default). It will also trigger if you use the default /q alias.

Check it in Options / Mouse smile

Edit:
You will also need it in an open event if you want the lines added when you receive a message.

Last edited by Deega; 05/03/13 12:32 AM.
Re: on OPEN doesn't do what I want [Re: Deega] #240904 05/03/13 02:37 AM
Joined: Mar 2013
Posts: 3
I
iScripters Offline OP
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Mar 2013
Posts: 3
Originally Posted By: Deega
That will work when you open a query window by double clicking the nickname also. /query is what that action triggers (by default). It will also trigger if you use the default /q alias.

Check it in Options / Mouse smile

Edit:
You will also need it in an open event if you want the lines added when you receive a message.


You are my new hero smile

Re: on OPEN doesn't do what I want [Re: iScripters] #240911 05/03/13 07:05 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I was going to suggest changing options (Alt+O / Mouse) to a custom alias, but replacing the /query command works better actually smile