mIRC Homepage
Posted By: iScripters on OPEN doesn't do what I want - 04/03/13 08:02 PM
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.
Posted By: hixxy Re: on OPEN doesn't do what I want - 04/03/13 08:47 PM
How are you opening the query window, by double clicking the nickname in the nicklist?
Posted By: Scakk Re: on OPEN doesn't do what I want - 04/03/13 09:45 PM
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.
Posted By: Deega Re: on OPEN doesn't do what I want - 04/03/13 11:12 PM
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) }
}

Posted By: iScripters Re: on OPEN doesn't do what I want - 04/03/13 11:36 PM
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.
Posted By: Deega Re: on OPEN doesn't do what I want - 05/03/13 12:18 AM
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.
Posted By: iScripters Re: on OPEN doesn't do what I want - 05/03/13 02:37 AM
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
Posted By: hixxy Re: on OPEN doesn't do what I want - 05/03/13 07:05 PM
I was going to suggest changing options (Alt+O / Mouse) to a custom alias, but replacing the /query command works better actually smile
© mIRC Discussion Forums