mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2013
Posts: 3
I
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.

Joined: Sep 2005
Posts: 2,881
H
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?

Joined: Oct 2009
Posts: 24
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.

Joined: Oct 2012
Posts: 164
D
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) }
}


Joined: Mar 2013
Posts: 3
I
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.

Joined: Oct 2012
Posts: 164
D
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.
Joined: Mar 2013
Posts: 3
I
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

Joined: Sep 2005
Posts: 2,881
H
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


Link Copied to Clipboard