Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Hourglass, Stopwatch, etc.

1368404515
Konrad J.
Pro
API Scripter
Edit: here is a video of the script in action showing all the various visuals included. <a href="http://www.youtube.com/watch?v=WtfOj1HcpNA" rel="nofollow">http://www.youtube.com/watch?v=WtfOj1HcpNA</a> OK, I think I figured out GitHub. &nbsp;So I'm posting my first official script. &nbsp;Its a timer for games that need to keep track of time. If anyone wants to see it in action PM me and I'll send you a link to a test campaign with the script running. I'll write up documentation soon. :) &nbsp;But here is some info. You need to name one token "clock.timer". &nbsp;Thats all the setup you need to do. &nbsp;I found an hourglass graphic and used it in my test campaign, but you can use a picture of a clock, anything you want! cu is for counts up and cd is for counts down. &nbsp;The rest of the commands are for visuals and logging. &nbsp;logchat will post messages when the timer is started, ended, etc in the chat window. &nbsp;Rotate will rotate the timer token as it ticks. &nbsp;Statusmarkers will turn the statusmarkers on in succession. Aura will turn varying colours and sizes of the aura. &nbsp;When you have the timer token selected it will show you the time counting down in the three bars. &nbsp;ANd finally when the timer stops it puts up a red X over the token. Note: there is one global object called timerGlobal so if you have any scripts with this same name you will get errors. &nbsp;Also the script uses the "On(chat:message.." event so if you have any scripts using this as well you would need to incorporate the two together to make it work. &nbsp;This should be fairly easy and obvious, but if you need help with that just ask and I'll explain. !t cu hh mm ss !t cd hh mm ss !t rotate on|off !t logchat on|off !t statusmarkers on|off !t aura on|off You can of course set macros for all these commands. <a href="https://github.com/morval/Roll20_Timer/blob/master/Timer.txt" rel="nofollow">https://github.com/morval/Roll20_Timer/blob/master/Timer.txt</a>
Neat! Looking at this, I think I need to add some stuff on my end of things so that if you call a bunch of individual set() commands on an object one right after another, it executues them all together instead of separately...right now your script is sending like 10 different commands to each client for each "second" of the stopwatch, when really it should just send one. I'll work on that soon, you don't need to change anything in your script... Anyway, nice job! Yet another thing I never would have thought of :P
1368459460
Konrad J.
Pro
API Scripter
Riley D. said: Neat! Looking at this, I think I need to add some stuff on my end of things so that if you call a bunch of individual set() commands on an object one right after another, it executues them all together instead of separately...right now your script is sending like 10 different commands to each client for each "second" of the stopwatch, when really it should just send one. I'll work on that soon, you don't need to change anything in your script... Anyway, nice job! Yet another thing I never would have thought of :P When I first thought up the script I did worry that it might bog things down. &nbsp;Things seem to be fine, but I'm not using it in an actual game or anything. I also need to add testing the system time instead of relying on the interval for time. &nbsp;Although it does seem to be close enough for a timer. :)