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

Timers, is it possible?

Would it be possible to have an egg timer type of script/ device that the DM could start and stop? (counting down or up) I am specifically looking to speed up combat decisions, and I think a visual reminder to the players (even with no specific limit imposed) would foster a sense of urgency.
Excellent idea.
1392602270
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
<a href="https://app.roll20.net/forum/post/154950/script-ho" rel="nofollow">https://app.roll20.net/forum/post/154950/script-ho</a>...
1392602794
Lithl
Pro
Sheet Author
API Scripter
Sure, that's no problem. Something along these lines ought to work: on('chat:message', function(msg) { if (msg.type == 'api' && msg.content.indexOf('!timer') == 0) { var parts = msg.content.split(' '); if (parts.length &gt; 1) { var start = parseInt(parts[1]); var timer = setInterval(function() { start--; if (start == 0) { sendChat('TIMER', 'Beeeep!'); clearInterval(timer); } else if (start % 5 == 0) { sendChat('TIMER', start + ' seconds remaining!'); } }, 1000); } } }); This one's pretty simple, simply posting messages to the chat window every five seconds. You could get fancy by using an image on the board of a clock or something, or setting it up to sensibly handle multiple timers at once.
1392609820
Konrad J.
Pro
API Scripter
That was the first script I worked on looks like 9 months ago. I'd have to go through it and clean it up and modernize it a bit. I'll maybe work on it this week if I can find some time. Probably much better ways to do it now. It was a timer, stop watch, etc. Visual clues, etc.