[request] Hotkey /all |
Author: |
Message: |
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. [request] Hotkey /all
Can someone make a script please that so when i push, for example, f6, or something, it automatically adds "/all" to the begging of all my messages.
I would like use one of the the Fkeys, and when i get my new G15 keyboard, i may want to use a new Gkey.
Many Thanks
This post was edited on 01-09-2007 at 03:30 PM by Jimbo.
|
|
01-09-2007 08:05 AM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: [request] Hotkey /all
I think it's actually more effort to reach up the keyboard to the F keys than it is to just type /all... why not just press / and then wait a split second then press enter?
<Eljay> "Problems encountered: shit blew up"
|
|
01-09-2007 04:02 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
RE: [request] Hotkey /all
Well, in fact that's not hard at all and since we know Jimbodude I'll give you a not-tested-but-should-work-if-I-didn't-forgot-anything (=NTBSHIIDFA ) script:
code: var Active = false;
//This will toggle the script when you press F6 (keycode 0x75) in a chat window
function OnEvent_ChatWndEditKeydown(ChatWnd, KeyCode, CtrlKeyDown, ShiftKeyDown) {
if(KeyCode == 0x75 && !CtrlKeyDown && !ShiftKeyDown) {
Active = !Active;
}
}
//This will add '/all' in front of a message when the script is active and the message is not a command
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if(Active && !/^\/[^\/\s\n\t]+([\/\s\n\t]|$)/.test(Message)) return "/all "+Message;
}
|
|
01-09-2007 05:34 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: [request] Hotkey /all
quote: Originally posted by Mattike
var Active = false;
//This will toggle the script when you press F6 (keycode 0x75) in a chat window
function OnEvent_ChatWndEditKeydown(ChatWnd, KeyCode, CtrlKeyDown, ShiftKeyDown) {
if(KeyCode == 0x75 && !CtrlKeyDown && !ShiftKeyDown) {
Active = !Active;
}
}
//This will add '/all' in front of a message when the script is active and the message is not a command
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if(Active && !/^\/[^\/\s\n\t]+([\/\s\n\t]|$)/.test(Message)) return "/all "+Message;
}
Sorry but that code doesn't work
i press f6, then type a message, then it doesn't send oall chat winodws
|
|
01-09-2007 07:19 PM |
|
|
vaccination
Veteran Member
Posts: 2513 Reputation: 43
32 / / –
Joined: Apr 2005
|
RE: [request] Hotkey /all
quote: Originally posted by Jimbodude
and when i get my new G15 keyboard, i may want to use a new Gkey.
Umm, when you get a G15, you won't need a script, just set one of the G keys to be '/all'
|
|
01-09-2007 07:28 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [request] Hotkey /all
F6 is not a detectable key. F6 is a key widely used to switch to the default edit box. For instance if you are using Firefox or Internet Explorer and press F6 it takes you to the address bar. In the contact list it takes you to the contact quick search. In a conversation window it takes you to the edit text box. (Click the chat history then press F6).
If you want to use F5 simply change :
code: KeyCode == 0x74
|
|
01-09-2007 07:37 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: [request] Hotkey /all
quote: Originally posted by Matty
F6 is not a detectable key. F6 is a key widely used to switch to the default edit box. For instance if you are using Firefox or Internet Explorer and press F6 it takes you to the address bar. In the contact list it takes you to the contact quick search. In a conversation window it takes you to the edit text box. (Click the chat history then press F6).
If you want to use F5 simply change :
code: KeyCode == 0x74
Thanks, the code sort of works now, but it sends the message about 20 times
|
|
01-09-2007 07:53 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [request] Hotkey /all
code: function OnEvent_ChatWndEditKeydown(oChatWnd, nKeyCode, bCtrlKeyDown, bShiftKeyDown) {
if (nKeyCode == 0x74 && !bCtrlKeyDown && !bShiftKeyDown){
if (oChatWnd.EditChangeAllowed === true){
if (oChatWnd.EditText.indexOf('/all ') === -1){
oChatWnd.EditText = '/all '+oChatWnd.EditText;
}
}
}
}
|
|
01-09-2007 08:17 PM |
|
|
Jimbo
Veteran Member
Posts: 1650 Reputation: 18
32 / /
Joined: Jul 2006
|
O.P. RE: [request] Hotkey /all
This post was edited on 01-09-2007 at 08:22 PM by Jimbo.
|
|
01-09-2007 08:21 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [request] Hotkey /all
ok your not making any sense. The code is going to add /all to your current message and when you send the message it will send it to everyone. Thats what you anted right?
|
|
01-09-2007 09:23 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|