Shoutbox

[REQUEST]Need help on a personal script! - 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]Need help on a personal script! (/showthread.php?tid=85603)

[REQUEST]Need help on a personal script! by MattyEFC on 08-26-2008 at 01:53 AM

Right, Hi, first post here, a bit of a Newbie when it comes to scripting.
Right, What I want my script to do is, when I type '/Flash', I want it to type FLASHBANG! and close the conversation (/close).
Right, my question is, How on Earth, would I script it, so that, when I type /flash it does these things, I have got the hang of the rest, I just need help on this bit.

code:
function notify(msg){
    msg = MsgPlus.RemoveFormatCodes(msg);
    MsgPlus.DisplayToast("Flashbang Script!", msg, "");
}

function OnEvent_ChatWndSendMessage(ChatWnd,Message){

if(Message=="/flash"){

        <MESSAGES GO HERE>

        notify("You have just Flashbanged those Mofo's.")

        return'';

    }
   
}   

Thanks in advance, Guys! :)
RE: [REQUEST]Need help on a personal script! by MeEtc on 08-26-2008 at 01:58 AM

You shouldn't even need a script for this, just use an autotext


RE: [REQUEST]Need help on a personal script! by MattyEFC on 08-26-2008 at 02:00 AM

quote:
Originally posted by MeEtc
You shouldn't even need a script for this, just use an autotext
SCRAP WHAT I JUST PUT.
Thanks mate, really appriciated, I just clicked on to what you meant, Thanks! :D:)
RE: [REQUEST]Need help on a personal script! by MeEtc on 08-26-2008 at 02:05 AM

[Image: flashbang.png]


RE: [REQUEST]Need help on a personal script! by MattyEFC on 08-26-2008 at 02:08 AM

quote:
Originally posted by MeEtc
[Image: flashbang.png]
I clicked on after I posted.
Thanks for your help mate! :)
RE: [REQUEST]Need help on a personal script! by matty on 08-26-2008 at 04:36 AM

However if you wanted to script it

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
    if( sMessage === '/flash' ){
        if( pChatWnd.EditChangeAllowed === true ) {
            pChatWnd.SendMessage('FLASHBANG!');
            Interop.Call( 'user32', 'SendMessageW', pChatWnd.Handle, 0x10 /* WM_CLOSE */, 0, 0 );
            return '';
        }
    }
}