mIRC Home    About    Download    Register    News    Help

Print Thread
triggering "on" processing of certain events #221563 24/05/10 04:15 PM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36

I'm trying to restrict the ability of a user to initiate or accept certain actions by trapping the "on" event, but have not been able to trigger any of my attempted script snippets.

In particular, I wish to trap all DCC requests from a remote user, as well as INVITEs and new QUERY windows.

I recognize that I may not quite correctly understand the access levels for DCC and OPEN events, and may have misinterpreted the functioning of these triggers, so bear with my mistakes.

Here are samples of the non-working script snippets:

;;-- triggered by incoming QUERY
on *:open:?:*:{
.echo on OPEN $1-
close -m $nick
halt
}

;;-- triggered by incoming DCC chat
on *:open:=:{
.echo on OPEN $1-
dcc reject
close -ic $nick
halt
}

;;-- triggered by incoming DCC SEND requests
ctcp *:send:?:{
.echo ctcp SEND $1-
dcc reject
close -is $nick
halt
}

In no case do the echos display, which is the basis for my question about how the events are triggered, when, and why.

thanks in advance

Re: triggering "on" processing of certain events [Re: Richard_B] #221568 24/05/10 05:10 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You can use the Ignore list to block many different kinds of requests such as those you are talking about.

Alt-B > Control. Choose Ignore from the drop down menu and click Add. Select the items to ignore and put the address mask to ignore.

As far as just halting events like you were trying to do, you'll need to use ^ in the event line. Note that not all events can be halted this way. See /help halting default text for details.

Last edited by Riamus2; 24/05/10 05:43 PM.

Invision Support
#Invision on irc.irchighway.net
Re: triggering "on" processing of certain events [Re: Riamus2] #221579 24/05/10 06:59 PM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36
thanks, I clearly missed the use of the caret to suppress default text, but I'm still not seeing an event trigger... I'm pretty sure that no previous "on" events would stop the events from triggering, but I will rearrange and grep for others.

If that doesn't clear the issue, any other suggestions about what and how events are triggered?

Richard

Re: triggering "on" processing of certain events [Re: Richard_B] #221581 24/05/10 07:11 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You cannot prevent events from triggering except by ignoring those events as I mentioned above. You can only hide the text, close any windows that open, etc. I believe it mentions that in the help file where I pointed you. So you're really left with either ignoring the events for various address masks which will prevent them from triggering. Or you can halt the default text, close any windows that open, etc. which will still trigger the event but will appear as though it wasn't triggered.


Invision Support
#Invision on irc.irchighway.net
Re: triggering "on" processing of certain events [Re: Riamus2] #221582 24/05/10 07:18 PM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36
I'm clearly missing something, as the first thing in every event process routine during debugging mode is an echo statement that identifies which routine was entered and displays the contents of $1- and these are NOT being executed. PLUS the default text is NOT being halted.

Richard

Last edited by Richard_B; 24/05/10 07:26 PM.
Re: triggering "on" processing of certain events [Re: Richard_B] #221583 24/05/10 07:33 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Using . before a command (such as echo) will silence it. Therefore, you'd never see the echo. As far as halting the default text, use haltdef in combination with ^. Halt will just halt the script.


Invision Support
#Invision on irc.irchighway.net
Re: triggering "on" processing of certain events [Re: Riamus2] #221587 24/05/10 08:19 PM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36

interesting... removing the "." command prefix has no effect whatsoever on the result -- the following snippet does NOT work as expected:

;;-- triggered for incoming DCC chat requests
;;
on ^*:OPEN:=:{
echo on OPEN $1-
dcc reject
close -ic $nick
halt
}

...that is, NO echo of "on OPEN" no obvious result from "dcc reject" and the DCC chat window remains open.

Also, curiously, this snippet does work as I'd expected:

on *:INVITE:#:{
.echo on INVITE # $1
describe # has been invited to #
halt
}

...that is, on receiving an INVITE, the following is displayed:
-- in the client status window --
on INVITE <channel-name>
-- in the active channel window of the client and remote --
<nickname> has been invited to <channel-name>

and I'm using mIRC 6.35

Re: triggering "on" processing of certain events [Re: Richard_B] #221627 25/05/10 11:52 PM
Joined: Jun 2003
Posts: 994
C
CtrlAltDel Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
I may be all wet here, but aren't you supposed to have a place to echo TO (echo $active <sometext>) or (echo #channel <sometext>) ??
and .. dcc chat window should be =$nick


I refuse to engage in a battle of wits with an unarmed person. wink
Re: triggering "on" processing of certain events [Re: CtrlAltDel] #221631 26/05/10 12:40 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you don't specify a location in the echo command, then the echo command sends to the status window by default.

Re: triggering "on" processing of certain events [Re: RusselB] #221632 26/05/10 02:52 AM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
to the active window*


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: triggering "on" processing of certain events [Re: Richard_B] #221633 26/05/10 02:52 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Your snippet works as expected here.

It echoes "on OPEN" in the status window.

Then the /dcc reject command does nothing because of this: /help /dcc reject

Then the /close -ic $nick does nothing because the dcc window isn't inactive.

And there is nothing left to halt by the end of the script.

-genius_at_work

Re: triggering "on" processing of certain events [Re: genius_at_work] #221707 28/05/10 01:44 AM
Joined: May 2010
Posts: 36
R
Richard_B Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: May 2010
Posts: 36
thanks for the comments... I finally discovered what may be the main reason that events were not being triggered: I misunderstood the sequence of events when receiving a DCC request, expecting that the event would be triggered when the window is actually opened, rather than [apparently] when the connection is established. I also have some connection issues with DCCs that are giving me fits (despite following all the advice given elsewhere.) This is curious to me, as if the window can't be closed using "-i" that implies it's not inactive, so the event should have been triggered already, no?

Clearly more experimentation is needed.

Thanks to all for the replies.

Richard


Re: triggering "on" processing of certain events [Re: Riamus2] #221717 28/05/10 06:25 AM
Joined: Apr 2003
Posts: 342
M
MeStinkBAD Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
Originally Posted By: Riamus2
Using . before a command (such as echo) will silence it. Therefore, you'd never see the echo. As far as halting the default text, use haltdef in combination with ^. Halt will just halt the script.


Just to clarify... not all events need the ^ prefix. Some events (such as logon) treat ^ entirely differently.


Beware of MeStinkBAD! He knows more than he actually does!
Re: triggering "on" processing of certain events [Re: MeStinkBAD] #221725 28/05/10 07:41 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
For further clarification; a list of events that can /haltdef (or /halt) with a ^ prefix can be found at:

/help Halting Default Text

Any event that uses the ^ prefix but is not listed there (like ON LOGON, or ON HOTLINK) will use it for different purpose, as mentioned. In general, "^" means "triggers before" (before the regular non-prefixed event), but in some cases there is no "default text" to halt/haltdef.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"