Shoutbox

[request] Hotkey /all - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [request] Hotkey /all (/showthread.php?tid=70498)

[request] Hotkey /all by Jimbo on 01-09-2007 at 08:05 AM

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


RE: [request] Hotkey /all by Spunky on 01-09-2007 at 04:02 PM

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?


RE: [request] Hotkey /all by Matti on 01-09-2007 at 05:34 PM

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 :P) 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;
}


RE: [request] Hotkey /all by Jimbo on 01-09-2007 at 07:19 PM

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:(
RE: [request] Hotkey /all by vaccination on 01-09-2007 at 07:28 PM

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' 8-)

RE: [request] Hotkey /all by matty on 01-09-2007 at 07:37 PM

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

RE: [request] Hotkey /all by Jimbo on 01-09-2007 at 07:53 PM

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 :(

RE: [request] Hotkey /all by matty on 01-09-2007 at 08:17 PM

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;
            }
        }
    }
}

RE: [request] Hotkey /all by Jimbo on 01-09-2007 at 08:21 PM

quote:
Originally posted by Matty
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;
            }
        }
    }
}
Now i get nothing :( Nothing happens :(
That code is now again, sending about 20 messages :(

RE: [request] Hotkey /all by matty on 01-09-2007 at 09:23 PM

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?


RE: [request] Hotkey /all by Jimbo on 01-10-2007 at 04:36 PM

quote:
Originally posted by Matty
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?
Yes, but instead of just sending the message once, it sends it about 20 times
RE: [request] Hotkey /all by foaly on 01-10-2007 at 04:47 PM

quote:
Originally posted by Jimbodude
quote:
Originally posted by Matty
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?
Yes, but instead of just sending the message once, it sends it about 20 times
I didn't try it but I think that is because when it sends it to another contact it adds /all again...
RE: [request] Hotkey /all by Jimbo on 01-10-2007 at 04:58 PM

I did a test:

If your theroy works, if there are 5 converesations open, it should send the message 5 times

Result :
Sent it over 20 times :(


RE: [request] Hotkey /all by matty on 01-10-2007 at 05:09 PM

Blah I just tried it. I typed test and pressed F5 so it appeared as /all test. When I pressed send, it sent the message once to all the conversation windows. It is impossible for the way I did it to do it otherwise.


RE: [request] Hotkey /all by Jimbo on 01-10-2007 at 05:17 PM

quote:
Originally posted by Matty
Blah I just tried it. I typed test and pressed F5 so it appeared as /all test. When I pressed send, it sent the message once to all the conversation windows. It is impossible for the way I did it to do it otherwise.
So, you typed "test" then pushed f5, because ive been pushing f5 then typing
RE: [request] Hotkey /all by foaly on 01-10-2007 at 05:23 PM

quote:
Originally posted by Mattike
code:
//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;
}


JimboDude if you have this portion still in your code remove it...
because this will cause it to keep sending...
RE: [request] Hotkey /all by Jimbo on 01-10-2007 at 05:24 PM

I use the coded posted here by Matty