mIRC Home    About    Download    Register    News    Help

Print Thread
#212059 09/05/09 10:35 PM
Joined: Jan 2003
Posts: 31
J
jh20001 Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2003
Posts: 31
Is there is a simple way to respond to a specific set of keys pressed? Kind of like how javascript can via eventlistener?

For example, if someone (anywhere within mirc) types "a" "b" "o" "u" "t" it will bring up the script's about screen?

I know it will be stupid since it would happen when if they are trying to use about in a sentence while chatting but I wan't to give it a crazy trigger so that it won't just happen on a normal word. There is a method to my madness lol.

Thanks smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If the person entering that word has the script, then you need to encode an ON INPUT event.
If they don't, then the script can only be triggered by the person in a common channel and/or via pm to the client that has the script, and you need to encode an ON TEXT event.

For the ON INPUT event, you have to do a comparison of $1- and the letters "about"

For the ON TEXT event, you can specify the term "about" in the matchtext section of the event.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
there is ON KEYDOWN but that only responds in custom windows

The only other way to do it is to use a keyhook dll which can capture key events globally in windows



- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I think he is talking about getting the key that have been pressed in the keyboard.
Not an on input event because a key can be pressed in a window that do not have an editbox.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2003
Posts: 31
J
jh20001 Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2003
Posts: 31
Ya I am talking on on keydown events not input. I guess I will have to limit it only from a custom window or something smirk


Link Copied to Clipboard