What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [HELP] Adding a timer using var as interval (read for more details)

[HELP] Adding a timer using var as interval (read for more details)
Author: Message:
Kriogenic
Junior Member
**

I own all.

Posts: 15
34 / Male / Flag
Joined: Aug 2007
O.P. [HELP] Adding a timer using var as interval (read for more details)
Hey.

Ok I am adding a timer and I am using a variable as the interval but I want to do some maths to it IE times it by 60000 to get it into milisecond format...

My script you enter the minutes into a box and click ok so lets say 1 it executes this...

code:
var Time = config.GetControlText("IntervalTime");
AddTimer("updatepm", Time * 60000 );


This gives me an error basically its meant to go Time (Usually 1 or similar) gets times by 60000 to give how many miliseconds...

Help please >.<

Thanks,
Kriogenic.
08-10-2007 03:23 PM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [HELP] Adding a timer using var as interval (read for more details)
If you'd have posted the error, we could've seen much faster what's wrong. AddTimer is a child function of the MsgPlus object, so you need to use:
code:
var Time = config.GetControlText("IntervalTime");
MsgPlus.AddTimer("updatepm", Time * 60000 );
;)

This post was edited on 08-10-2007 at 03:27 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!
08-10-2007 03:27 PM
Profile E-Mail PM Web Find Quote Report
Kriogenic
Junior Member
**

I own all.

Posts: 15
34 / Male / Flag
Joined: Aug 2007
O.P. RE: [HELP] Adding a timer using var as interval (read for more details)
I do that all the time... Always forget that... Then I always think the problem is something else >.<

My 2 biggest errors... Forgetting MsgPlus. and forgetting its cap sensative...

Thanks for your help.
Kriogenic.
08-10-2007 03:31 PM
Profile E-Mail PM Web Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: [HELP] Adding a timer using var as interval (read for more details)
A suggestion: If you keep doing this, you might want to just create a function:

code:
function AddTimer(TimerId, Interval){
    MsgPlus.AddTimer(TimerId, Interval);
}

This post was edited on 08-10-2007 at 10:47 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
08-10-2007 10:46 PM
Profile PM Web Find Quote Report
LifelesS
Full Member
***


Posts: 115
Reputation: 4
32 / Male / Flag
Joined: Dec 2006
RE: [HELP] Adding a timer using var as interval (read for more details)
What I usually do is a function like

code:
function Timer(Id, TimeSec)
{
          return MsgPlus.AddTimer(Id, TimeSec*1000)
}


Or I just change the number of zeros, depending of what I want, to keep things easy
Best Regards,
Joćo Godinho
08-11-2007 12:49 AM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [HELP] Adding a timer using var as interval (read for more details)
quote:
Originally posted by roflmao456
A suggestion: If you keep doing this, you might want to just create a function:

code:
function AddTimer(TimerId, Interval){
    MsgPlus.AddTimer(TimerId, Interval);
}


why not just AddTimer=MsgPlus.AddTimer?
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
08-11-2007 01:23 AM
Profile PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: [HELP] Adding a timer using var as interval (read for more details)
quote:
Originally posted by roflmao456
A suggestion: If you keep doing this, you might want to just create a function:

code:
function AddTimer(TimerId, Interval){
    MsgPlus.AddTimer(TimerId, Interval);
}

You are better off just doing this to the whole lot
code:
with(MsgPlus){
   //put your code here
   AddTimer("updatepm", Time * 60000 );
   //put some more code here
}

This code is also very helpful if you are using the same object quite a few times in a small area, it just saves you writing it out all the time.

This post was edited on 08-11-2007 at 01:59 AM by markee.
[Image: markee.png]
08-11-2007 01:58 AM
Profile PM Find Quote Report
Kriogenic
Junior Member
**

I own all.

Posts: 15
34 / Male / Flag
Joined: Aug 2007
O.P. RE: [HELP] Adding a timer using var as interval (read for more details)
Hmm thanks. These ideas will help.

Thanks again people,
Kriogenic.
08-11-2007 06:41 AM
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