mIRC Homepage
Posted By: Gord10 Detecting "knocks" in remote scripts - 07/04/11 08:20 PM
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!
Posted By: RusselB Re: Detecting "knocks" in remote scripts - 07/04/11 11:08 PM
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.
Posted By: Gord10 Re: Detecting "knocks" in remote scripts - 08/04/11 08:51 PM
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.
Posted By: Riamus2 Re: Detecting "knocks" in remote scripts - 08/04/11 09:01 PM
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.
Posted By: Gord10 Re: Detecting "knocks" in remote scripts - 08/04/11 09:18 PM
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.
Posted By: RoCk Re: Detecting "knocks" in remote scripts - 08/04/11 09:34 PM

What network are you on?
Posted By: Tomao Re: Detecting "knocks" in remote scripts - 08/04/11 11:39 PM
Code:
on *:notice:*knock*:*:{
This works for me. The issue may have been that you use #. It's better to use *
Posted By: Riamus2 Re: Detecting "knocks" in remote scripts - 09/04/11 12:35 AM
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.
Posted By: RoCk Re: Detecting "knocks" in remote scripts - 09/04/11 12:45 AM

There also could be a NOTICE event before it that is catching it?
Posted By: jaytea Re: Detecting "knocks" in remote scripts - 09/04/11 06:20 AM
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 }
Posted By: Gord10 Re: Detecting "knocks" in remote scripts - 10/04/11 01:40 PM
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.
© mIRC Discussion Forums