Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Timer and script

Timer and script

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Wed 31 Jul 2002 08:12 AM (UTC)
Message
The addtimer call looks wrong, check out the examples on the functions web page.

You probably need two timers, one is the "main" one, and another that ticks every 10 minutes, which can do a gettimerinfo on the main one, to find how long until the main one expires.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Exodus   (14 posts)  Bio
Date Reply #1 on Wed 31 Jul 2002 08:38 AM (UTC)
Message
is it possible to substitute numbers for the timer via variables?
World.addtimer "my_timer", 0, 0, 1, "go north", 5, ""

Where the '0', '0' and '1' are numbers based on variables
I tried..
World.addtimer "my_timer", " & Var1 & ", " & Var2 & ", " & Var3 & ", "go north", 5, ""
But it doesn't work
Top

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #2 on Wed 31 Jul 2002 05:34 PM (UTC)

Amended on Wed 31 Jul 2002 05:35 PM (UTC) by Shadowfyr

Message

>World.addtimer "my_timer", " & Var1 & ", " & Var2 & ", " & Var3 & ", "go north", 5, ""
                            ^ ^      ^ ^  ^ ^      ^ ^  ^ ^      ^ ^

Try eliminating the characters marked above.. Your trying to pass the strings " & Var1 & ", " & Var2 & " and " & Var3 & " to the command instead of the value inside them.

Also & only works for string concatination and performs like "a" + "b" = "ab" (i.e. "a" & "b" = "ab"). It isn't needed for numbers and may do something unpredictable used that way, however in this case you A) didn't use them right and B) used strings where you needed to only use the variable names.
Top

Posted by Exodus   (14 posts)  Bio
Date Reply #3 on Wed 31 Jul 2002 09:22 PM (UTC)
Message
sweet!..

Thanks a million!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,013 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.