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

Pages: (2): « First « 1 [ 2 ] Last »
A newbie question
Author: Message:
chrisb
New Member
*


Posts: 13
Joined: Sep 2009
O.P. RE: A newbie question
function OnEvent_Timer("getTweets")    {
Messenger.MyPersonalMessage = Math.random();
}

Why is that not working?
09-03-2009 04:11 PM
Profile E-Mail PM Find Quote Report
chrisb
New Member
*


Posts: 13
Joined: Sep 2009
O.P. RE: A newbie question
MsgPlus.AddTimer("getTweets", 5000)
09-03-2009 04:37 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / 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:
Javascript 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:
Javascript 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
chrisb
New Member
*


Posts: 13
Joined: Sep 2009
O.P. RE: A newbie question
Error: 'timerID' is undefined (code: -2146823279)
       File: file.js. Line: 22.
Function OnEvent_Timer returned an error. Code: -2147352567

I get this?
09-03-2009 05:04 PM
Profile E-Mail PM Find Quote Report
chrisb
New Member
*


Posts: 13
Joined: Sep 2009
O.P. RE: A newbie question
Oh I got why not :), false alarm. Thanks
09-03-2009 05:06 PM
Profile E-Mail PM Find Quote Report
chrisb
New Member
*


Posts: 13
Joined: Sep 2009
O.P. RE: A newbie question
I can't seem to find how to do an ini file save and load, could you give me an example?
09-05-2009 04:25 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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