posadist-revolution / 5E-BattleMaster

A roll20 API Script for DND 5e combat across the board.
5 stars 3 forks source link

Compatibility with CombatTracker #5

Open Wolfeye3275 opened 6 years ago

Wolfeye3275 commented 6 years ago

I added some code on my game to make this run alongside the CombatTracker script. I can't figure out how to put this into a pull request so I am putting the code I wrote here.

The following code goes at the end of the HandleInput function inside the first switch statement.

        //CombatTracker Compatability
        case '!ct':
            switch(args[1]){
                case 'next':
                    var timer = setTimeout(function() {
                        if(bInCombat) {
                            TurnChange();
                        }
                    }, 1000);
                break;
                case 'start':
                    StartCombat();
                    var timer = setTimeout(function() {
                        if(bInCombat) {
                            TurnChange();
                        }
                    }, 1000);
                break;
                case 'stop':
                    StopCombat();
                    var timer = setTimeout(function() {
                        if(bInCombat) {
                            TurnChange();
                        }
                    }, 1000);
                break;
                //default: break;
            }break;