What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » "Variable" in toast

"Variable" in toast
Author: Message:
Addenorw
New Member
*


Posts: 5
Joined: Nov 2007
O.P. Huh?  "Variable" in toast
I've got a little question. I want to make the toast use different words in the text. For example:
Person has just arrived in his/hers car

And I want the car-word to be many diffrent things. What will i need to write in then?

And one more question:
In the script, I have wrote this for the toast:
function OnEvent_ContactSignin(Email){
var contacmail = Email;
signedincontact = Messenger.MyContacts.GetContact(contactemail);
      if(signedincontact.Blocked!=true){
{
        var Message = signedincontact.Name+ "has just arrived in is/hers car"+.;
        Message = MsgPlus.RemoveFormatCodes(Message);
        MsgPlus.DisplayToast("", Message);
}

But it says that it is wrong in the var message thin. What is wrong?

Thanks in advance:)
11-04-2007 11:41 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: "Variable" in toast
code:
var Words = new Array("Car","something", "etc");

function OnEvent_ContactSignin(contactemail){
    signedincontact = Messenger.MyContacts.getContact(contactemail)
    if(signedincontact.Blocked===false){
        var Message = MsgPlus.RevoveFormatCodes(signedincontact.Name+" has just arrived in his/her "+RandomWord())
        MsgPlus.DisplayToast("",Message);
    }
}

function RandomWord(){
    var x = Math.floor(Math.random()*Words.length)
    return Words[x];
}

<Eljay> "Problems encountered: shit blew up" :zippy:
11-04-2007 12:21 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: "Variable" in toast
The bit where it went wrong is that you placed a period outside the quotes:
code:
var Message = signedincontact.Name+ "has just arrived in is/hers car"+.;
You should place it between the quotes, and thus there's no need for the plus operator. Oh, and maybe you want a space before "has"? :)
code:
var Message = signedincontact.Name+ " has just arrived in is/hers car.";

Of course, if you simply use Spunky's code, you have everything you need. :P

This post was edited on 11-04-2007 at 03:53 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
11-04-2007 03:53 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


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