Shoutbox

scrips that don't work - 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: scrips that don't work (/showthread.php?tid=79890)

scrips that don't work by paddysteed on 12-10-2007 at 07:25 PM

i have made a script and don't know why it doesn't work can someone please help me

code:
function OnEvent_ChatWndSendMessage(chat_created)
{
SendMessage("/usay hi" + MyName);

}

also i don't know what the brackets after OnEvent_ChatWndSendMessage are for (i made the ones there up as a guess)
RE: scrips that don't work by ArkaneArkade on 12-10-2007 at 08:57 PM

I think what you really need to do is study a little more.  You're missing some of the obvious stuff.  I don't really understand what you're trying to script - can you maybe give a little more information and maybe you could get some more help.  I'd recommend you try to download the Scripting Doc from the scripts database.

Regarding your query about the brackets, they contain the actual data extracted from your function (in this case OnEvent_ChatWndSendMessage)

[string] OnEvent_ChatWndSendMessage( [object] ChatWnd, [string] Message );

OnEvent_ChatWndSendMessage - This is your function - will be called when you send a message.

ChatWnd - This will be the chat window ID - this is unique for each window, and so refers specifically to the window which called the event.

Message - This is simply the message you sent.


So, if your intention is to pretend to be your contact for every message you send the script would be similar to this:

function OnEvent_ChatWndSendMessage(ChatWnd, SentMessage)
{
  ChatWnd.SendMessage("/usay " + SentMessage)
}


(For the better scripters out there... please feel free to explain better - or more importantly correct me if I'm wrong - I'm really not too sure about any of this myself :S)


RE: scrips that don't work by markee on 12-11-2007 at 07:39 AM

code:
function OnEvent_ChatWndCreated(ChatWnd){
   ChatWnd.SendMessage("/usay hi "+Messenger.MyName);
}

This is the code you are after I do believe.  You have to use the Messenger object to get out your name.  I'm sure you will pick it up quickly ;)
RE: scrips that don't work by paddysteed on 12-11-2007 at 05:17 PM

cool thanks
so are the brackets for what group the action is in

p.s. is it possible to open files i know you can open .js files but i want to open other ones