mIRC Home    About    Download    Register    News    Help

Print Thread
Detecting "knocks" in remote scripts #231192 07/04/11 08:20 PM
Joined: Feb 2011
Posts: 6
G
Gord10 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Feb 2011
Posts: 6
Sometimes I need to change the mode of my channel to 'invited' in order to prevent troll attacks. We get "Knock <UserName> invite only" notifies whenever someone tries to enter and I am going to write a script that can respond to this notifies.

However, I couldn't find any remote event about these types of messages (in other words, I don't know what they are classified as).

Thanks in advance!

Last edited by Gord10; 07/04/11 08:20 PM.
Re: Detecting "knocks" in remote scripts [Re: Gord10] #231196 07/04/11 11:08 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
A quick test using my bot and a debug window indicates that the /knock command sends a Channel Notice, thus using the ON NOTICE event should work.

Re: Detecting "knocks" in remote scripts [Re: RusselB] #231218 08/04/11 08:51 PM
Joined: Feb 2011
Posts: 6
G
Gord10 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Feb 2011
Posts: 6
NOTICE didn't work for me, unfortunately. It can detect a /notice Gord10 Hello of another user perfectly, but nothing happens when my room is knocked on. Neither did snotice. I began to believe that it's something about the server.

And that server doesn't perceive the KNOCK command, as well.

Last edited by Gord10; 08/04/11 08:55 PM.
Re: Detecting "knocks" in remote scripts [Re: Gord10] #231219 08/04/11 09:01 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You're using # and not ? for the notice event, right?

Code:
on *:notice:*knock*:#: { }


You can put the channel name as well, but you need either * for everything or # for channel. ? is for private notices.


Invision Support
#Invision on irc.irchighway.net
Re: Detecting "knocks" in remote scripts [Re: Riamus2] #231221 08/04/11 09:18 PM
Joined: Feb 2011
Posts: 6
G
Gord10 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Feb 2011
Posts: 6
Yes, I know that '?' is for private notices. I have made it

on *:notice:*:*:{
;;Codes those work with /notice Gord10 Hi.
}

just to make it sure it gets detected, but nothing happens.

Re: Detecting "knocks" in remote scripts [Re: Gord10] #231223 08/04/11 09:34 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

What network are you on?

Re: Detecting "knocks" in remote scripts [Re: Gord10] #231225 08/04/11 11:39 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
on *:notice:*knock*:*:{
This works for me. The issue may have been that you use #. It's better to use *

Re: Detecting "knocks" in remote scripts [Re: Tomao] #231226 09/04/11 12:35 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
His example shows that he used *. smile

@Gord10:

Type: /debug @debug

Then, have someone knock. Look in the debug window and it will help you determine what is happening with that knock.

That or let us know the network so someone here can connect there and try for you.


Invision Support
#Invision on irc.irchighway.net
Re: Detecting "knocks" in remote scripts [Re: Gord10] #231228 09/04/11 12:45 AM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

There also could be a NOTICE event before it that is catching it?

Re: Detecting "knocks" in remote scripts [Re: Gord10] #231230 09/04/11 06:20 AM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
it's probably a server notice (knocks aren't handled by ChanServ, are they?), take a look at /help on SNOTICE

i've also seen knocks sent in the same format as joins and parts, ie. ":nick!user@host KNOCK #chan :msg", in which case you may use this to detect them:

Code:
raw KNOCK:*:{ ; $1 is #chan, $2- is the message }


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Re: Detecting "knocks" in remote scripts [Re: jaytea] #231267 10/04/11 01:40 PM
Joined: Feb 2011
Posts: 6
G
Gord10 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Feb 2011
Posts: 6
jaytea's suggestion has really worked!

Yes, I have learned that a KNOCK server message is used, after opening a debug window. What I needed was learning how to use the raw event.

Thanks jaytea and everyone else. I wish I could tell the name of the adult server I have been residing.

Last edited by Gord10; 10/04/11 01:41 PM.