How to setup a Sync/Countdown Command?


#1

Hello,

I’m looking for a way to setup a simple countdown command. Something like:

!sync
5
4
3
2
1
Battle!

Thanks.


#2

Look at adventureSystem.js, the runStory() function. That essentially is a countdown.

        t = setInterval(function() {
            if (progress < story.lines.length) {
                line = replaceTags(story.lines[progress]);
                if (line != '') {
                    $.say(line.replace(/\(game\)/g, $.twitchcache.getGameTitle() + ''));
                }
            } else {
                endHeist();
                clearInterval(t);
            }
            progress++;
        }, 7e3);

Instead of dealing with lines, you would have a integer counting down backwards.