What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » A newbie question

A newbie question
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: A newbie question
quote:
Originally posted by chrisb
function OnEvent_Timer("getTweets")    {
Messenger.MyPersonalMessage = Math.random();
}

Why is that not working?
A function definition has the following form:
js code:
function functionName(paramName1, paramName2) {
    // code goes here
}
The error in your code is that you're giving a value instead of a variable name where your parameters go. This is faulty programming logic and therefore invalid JScript and should be corrected like so:
js code:
function OnEvent_Timer(timerID) {
    if(timerID === "getTweets") {
        Messenger.MyPersonalMessage = Math.random();
    }
}
  1. The function receives its parameters and assigns the first parameter value to the variable "timerID".
  2. The "timerID" is checked against a string, to verify we're handling the right timer.
  3. When the "timerID" is checked, the personal message is set.
For more information, visit W3Schools - JavaScript functions.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
09-03-2009 05:00 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
A newbie question - by chrisb on 09-03-2009 at 10:58 AM
RE: A newbie question - by matty on 09-03-2009 at 12:19 PM
RE: A newbie question - by chrisb on 09-03-2009 at 02:43 PM
RE: A newbie question - by matty on 09-03-2009 at 03:00 PM
RE: A newbie question - by chrisb on 09-03-2009 at 03:28 PM
RE: A newbie question - by matty on 09-03-2009 at 03:32 PM
RE: A newbie question - by chrisb on 09-03-2009 at 03:34 PM
RE: A newbie question - by chrisb on 09-03-2009 at 03:45 PM
RE: A newbie question - by matty on 09-03-2009 at 03:48 PM
RE: A newbie question - by chrisb on 09-03-2009 at 03:50 PM
RE: A newbie question - by chrisb on 09-03-2009 at 04:11 PM
RE: A newbie question - by chrisb on 09-03-2009 at 04:37 PM
RE: A newbie question - by Matti on 09-03-2009 at 05:00 PM
RE: A newbie question - by chrisb on 09-03-2009 at 05:04 PM
RE: A newbie question - by chrisb on 09-03-2009 at 05:06 PM
RE: A newbie question - by chrisb on 09-05-2009 at 04:25 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