Rewrite task queue and action queue

This commit is contained in:
2020-03-29 15:30:15 +03:00
parent 3b7b86fa11
commit c6e535856a
9 changed files with 206 additions and 82 deletions

View File

@ -1,9 +1,11 @@
import Action from './Action';
import { Args } from '../Common';
import { TryLaterError } from '../Errors';
export default class UpgradeBuildingAction extends Action {
static NAME = 'upgrade_building';
async run(args): Promise<any> {
async run(args: Args): Promise<any> {
const btn = jQuery(
'.upgradeButtonsContainer .section1 button.green.build'
);
@ -11,6 +13,7 @@ export default class UpgradeBuildingAction extends Action {
btn.trigger('click');
} else {
console.log('NO UPGRADE BUTTON');
throw new TryLaterError(60);
}
return null;
}