Shoutbox

help me out writing a 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: help me out writing a script (/showthread.php?tid=68428)

help me out writing a script by Jarrod on 11-14-2006 at 07:09 AM

i've written a couple of js scripts for html files so i understand it a bit, i've read the scripting documents, but i want to write a script that adds a bunch of text like windows version tag and a gradient tag to the start and end of the message.
is there a tutorial or something to show me how to do something like that?


RE: help me out writing a script by matty on 11-14-2006 at 07:14 AM

Read: http://www.msgpluslive.net/scripts/view/13-Offici...ing-Documentation/

learn how to use: OnEvent_ChatWndSendMessage.


RE: help me out writing a script by Jarrod on 11-14-2006 at 07:20 AM

so it goes something like this?


[string] OnEvent_ChatWndSendMessage(
[object] ChatWnd,
[(!np)] [c=20] Message [/c=29]
  );


RE: help me out writing a script by NanaFreak on 11-14-2006 at 07:24 AM

no...

to make a script do what you want it is very simple

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
  Message = 'stuff you want before the massage'+Message+'stuff after the message';
  return Message;
}

RE: help me out writing a script by Jarrod on 11-14-2006 at 07:27 AM

thanx  so much
i'm still trying to uderstand it but i'll get there
btw are there any other tutorials on msg plus scripting?


RE: help me out writing a script by NanaFreak on 11-14-2006 at 07:29 AM

well msgplus scripting uses JScript 5.6 (:P Eljay i got it this time)

so you might be able to find tutorials on that but im sure you would be able to learn from the scripting documentation or even other peoples scripts

but dont steal their code just learn from it (how it works)


RE: help me out writing a script by Jarrod on 11-14-2006 at 07:59 AM

thanx it' working


RE: help me out writing a script by Jarrod on 11-14-2006 at 08:32 AM

could some1 tell me where to look for help on
or did i get it right?

if contact email = myemail
do function OnEvent_ChatWndSendMessage(ChatWnd, Message){
Message = '(!m)[c=4] \n'+Message+'[/c=12]';
return Message;
}


RE: help me out writing a script by NanaFreak on 11-14-2006 at 08:49 AM

umm what are you trying to do exactly???


RE: help me out writing a script by Jarrod on 11-14-2006 at 08:52 AM

i'm trying to get the contacts display name apear in the window when they talk to me.
i understand they will need to install the script but i use nicknames so their display name does not show up and i want to add the display name to the conversation

so i want something like
(code)

var contact=get_contact-email()



if
contact== myemail
do
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
Message = '(!m)[c=4] \n'+Message+'[/c=12]';
return Message;
}


RE: help me out writing a script by Spunky on 11-14-2006 at 11:31 AM

You're whole syntax is wrong for JScript

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
     var Contacts = Messenger.MyContacts;
     var e = new Enumerator(Contacts);
     for(; !e.atEnd(); e.moveNext()){
          var Contact = e.item();
               if(Contact.Email==="your@email.com"){
                    Message = "(!n)·$4\n"+Message;
               }
     }
     return Message
}

This method uses IRC colour tags as you don't need to add the close tag and older versions will still see the colours.

If statements must appear withing the functions just so you know for the future :p (it's not actually needed in this case)

(!n) will show you're contacts name.
·$4 Will turn all following text red
\n will start a new line
+Message will append what was actually sent by you to the text you have set in the script

As this is an Event, not just a function, it is called everytime a message is sent (in this example) and so does not need to be called by the user.


RE: help me out writing a script by Jarrod on 11-14-2006 at 11:36 AM

thanx spunky
wat i said i wanted though was a script my contact installs and then displays the message when they are talking to me but not someone else


RE: help me out writing a script by Spunky on 11-14-2006 at 11:39 AM

Edited previous post...


RE: help me out writing a script by Jarrod on 11-14-2006 at 11:41 AM

thanx soooooo much
your so clever