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 ➜ VBscript ➜ Counting down

Counting down

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


Posted by Xinphinity   USA  (26 posts)  Bio
Date Mon 08 Apr 2002 08:17 PM (UTC)
Message
Me again.

Okay here is the scenario. I get a message that says -

Roundtime: 6 seconds.

I know i can get, and am getting the numeric 6 into a var, but what I want to do is output to the screen in a countdown either

Roundtime: 6...5....4....3...2...1 Done.

Or, ick,
RoundTime: 6
5
4
3
2
1
Done

Any ideas or suggestions on this one?

~Xin
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #1 on Mon 08 Apr 2002 11:16 PM (UTC)
Message
From the main mushclient page, click on the link to 'all functions'. It's on the left side, near the bottom.

On the next page, click the link to list them all alphabetically.

Check out World.AddTimer and World.Note. There are some related timer functions that will be listed when you check out AddTimer.

The tools lie there for you to learn about and use. ...or you could wait for someone to write the script here for you. I don't have time right now.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 09 Apr 2002 12:24 AM (UTC)

Amended on Tue 09 Apr 2002 10:48 PM (UTC) by Nick Gammon

Message
You can use world.setstatus to put messages on the status line. This might be helpful here.

I would add a timer, that fires every second. This timer would query a variable (time to go), and draw on the status line. Then when the variable became negative, you would disable the timer.

eg.


dim secs
  secs = world.getvariable ("seconds")
  secs = secs - 1
  if secs < 0 then  
    world.setstatus "Done" 
    world.enabletimer "thistimer", false ' disable timer
  else
    world.setstatus "Time to go = " & secs & " seconds"
    world.setvariable "seconds", secs
  end if

- Nick Gammon

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

Posted by Xinphinity   USA  (26 posts)  Bio
Date Reply #3 on Tue 09 Apr 2002 03:39 PM (UTC)
Message
Nick that was just what I needed.

Except, *bops you*,
it's World.EnableTimer "timer", TRUE|FALSE!!
The code you posted crashed the Client...;)

No big deal the code was still just what i needed.


Thanks much.

~Xin
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #4 on Tue 09 Apr 2002 10:47 PM (UTC)
Message
Ah that will teach me to code without testing first. :)

I'll amend the post.

- Nick Gammon

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

Posted by Xinphinity   USA  (26 posts)  Bio
Date Reply #5 on Tue 09 Apr 2002 11:42 PM (UTC)
Message
Well dont do it for me, it was no big deal and a big help.

;)

~Xin
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.


20,466 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.