What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » create a button

create a button
Author: Message:
billyy
Full Member
***

Avatar

Posts: 103
Reputation: 1
36 / Male / Flag
Joined: Feb 2010
Status: Away
RE: create a button
Ahh in the scripts menu, well you could use:

JScript code:
 
function OnGetScriptMenu(Location)
{
     var scriptmenu = "<ScriptMenu>";
     scriptmenu += "<MenuEntry Id=\"[ID]\">[Text]</MenuEntry>";
     scriptmenu += "<MenuEntry Id=\"[ID2]\">[Text2]</MenuEntry>";
     scriptmenu += "<Separator/>";
     scriptmenu += "<MenuEntry Id=\"[ID3]\">[Text3]</MenuEntry>";
     scriptmenu += "</ScriptMenu>";
     //a blackslash infront of a " is invisable in the outcome but will forecome " ending the string.
}


fill in the ID it should return when clicked at [ID] and the text it should show at [Text].
Ofcourse removing the square brackets.
also you can use <Separator/> between Menu Entries to add a line between those entries.

The event called when the menu is clicked will be:
JScript code:
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
}


You could fill in like:
JScript code:
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
     switch (MenuItemId)
     {
          case "[ID]":
               MsgPlus.DisplayToast("Title", "That tickles!");
          break;
     }
}



Now we have a complete working script!
Ofcourse what it does IS pointless and it's NOT gunna turn you in to an ugly rat. Alltough if it does you should definately PM me O_o

JScript code:
/*****************************\
|           Warning!          |
|    Reading the following    |
|    script will turn you     |
|    in to a big ugly rat!    |
\*****************************/

 
function OnGetScriptMenu(Location)
{
     var scriptmenu = "<ScriptMenu>";
     scriptmenu += "<MenuEntry Id=\"[ID]\">[Text]</MenuEntry>";
     scriptmenu += "<MenuEntry Id=\"[ID2]\">[Text2]</MenuEntry>";
     scriptmenu += "<Separator/>";
     scriptmenu += "<MenuEntry Id=\"[ID3]\">[Text3]</MenuEntry>";
     scriptmenu += "</ScriptMenu>";
}
 
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
     switch (MenuItemId)
     {
          case "[ID]":
               MsgPlus.DisplayToast("Title", "That tickles!");
          break;
          case "[ID2]":
               MsgPlus.DisplayToast("Title", "You just had to try 2 huh?");
          break;
          case "[ID3]":
               MsgPlus.DisplayToast("Title", "Ok jokes over >:l");
          break;
     }
}


This is just simple, you could ofcourse make it check if you have clicked ID1 before and THAN give 2 and so on, but that is not what this example is about. (trying to keep it simple :))

And you could use xml to make like a nice preference window.
For that you could use Interface Writer, it is easy to make a pretty nice interface.

edit:
quote:
Originally posted by Yustme
Just to create one, not how to catch events and clicks etc. I'll figure that one out myself.
Couldn't help myself :(

Edit2:
Humz, changed the first part, adding them one by one just looks so cute :P
Alltough again mattys script is much more complicated and probably more helpfull...

This post was edited on 02-26-2010 at 06:42 PM by billyy.
I'm new at this, so don't expect me to be usefull any
time soon. But if i behaved you could rep me :P
02-26-2010 04:15 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
create a button - by Yustme on 02-26-2010 at 11:34 AM
RE: create a button - by djdannyp on 02-26-2010 at 12:18 PM
RE: create a button - by billyy on 02-26-2010 at 04:15 PM
RE: create a button - by matty on 02-26-2010 at 05:55 PM
RE: create a button - by Yustme on 02-26-2010 at 06:58 PM
RE: create a button - by Yustme on 02-26-2010 at 08:18 PM
RE: create a button - by djdannyp on 02-26-2010 at 09:28 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On