Remove got to building action
This commit is contained in:
parent
473e3572e3
commit
23f3743599
@ -1,12 +0,0 @@
|
|||||||
import ActionController from './ActionController';
|
|
||||||
import { Args } from '../Common';
|
|
||||||
import { Task } from '../Storage/TaskQueue';
|
|
||||||
|
|
||||||
export default class GoToBuildingAction extends ActionController {
|
|
||||||
static NAME = 'go_to_building';
|
|
||||||
|
|
||||||
async run(args: Args, task: Task): Promise<any> {
|
|
||||||
window.location.assign('/build.php?id=' + args.id);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
import { markPage, sleepShort, timestamp } from './utils';
|
import { markPage, sleepShort, timestamp } from './utils';
|
||||||
import UpgradeBuildingTask from './Task/UpgradeBuildingTask';
|
import UpgradeBuildingTask from './Task/UpgradeBuildingTask';
|
||||||
import GoToBuildingAction from './Action/GoToBuildingAction';
|
|
||||||
import UpgradeBuildingAction from './Action/UpgradeBuildingAction';
|
import UpgradeBuildingAction from './Action/UpgradeBuildingAction';
|
||||||
import { TryLaterError } from './Errors';
|
import { TryLaterError } from './Errors';
|
||||||
import { TaskQueue, TaskList, Task, TaskId } from './Storage/TaskQueue';
|
import { TaskQueue, TaskList, Task, TaskId } from './Storage/TaskQueue';
|
||||||
@ -120,9 +119,6 @@ export default class Scheduler {
|
|||||||
private createActionControllerByName(
|
private createActionControllerByName(
|
||||||
actonName: string
|
actonName: string
|
||||||
): ActionController | undefined {
|
): ActionController | undefined {
|
||||||
if (actonName === GoToBuildingAction.NAME) {
|
|
||||||
return new GoToBuildingAction();
|
|
||||||
}
|
|
||||||
if (actonName === UpgradeBuildingAction.NAME) {
|
if (actonName === UpgradeBuildingAction.NAME) {
|
||||||
return new UpgradeBuildingAction(this);
|
return new UpgradeBuildingAction(this);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import Scheduler from '../Scheduler';
|
import Scheduler from '../Scheduler';
|
||||||
import GoToBuildingAction from '../Action/GoToBuildingAction';
|
|
||||||
import UpgradeBuildingAction from '../Action/UpgradeBuildingAction';
|
import UpgradeBuildingAction from '../Action/UpgradeBuildingAction';
|
||||||
import { Command } from '../Common';
|
import { Args, Command } from '../Common';
|
||||||
import { Task } from '../Storage/TaskQueue';
|
import { Task } from '../Storage/TaskQueue';
|
||||||
import TaskController from './TaskController';
|
import TaskController from './TaskController';
|
||||||
import GoToPageAction from '../Action/GoToPageAction';
|
import GoToPageAction from '../Action/GoToPageAction';
|
||||||
@ -18,11 +17,14 @@ export default class UpgradeBuildingTask extends TaskController {
|
|||||||
|
|
||||||
run(task: Task) {
|
run(task: Task) {
|
||||||
console.log('RUN', UpgradeBuildingTask.NAME, 'with', task);
|
console.log('RUN', UpgradeBuildingTask.NAME, 'with', task);
|
||||||
const args = { ...task.cmd.args, taskId: task.id };
|
const args: Args = { ...task.cmd.args, taskId: task.id };
|
||||||
this.scheduler.scheduleActions([
|
this.scheduler.scheduleActions([
|
||||||
new Command(GoToPageAction.NAME, { ...args, path: '/dorf1.php' }),
|
new Command(GoToPageAction.NAME, { ...args, path: '/dorf1.php' }),
|
||||||
new Command(CheckBuildingRemainingTimeAction.NAME, args),
|
new Command(CheckBuildingRemainingTimeAction.NAME, args),
|
||||||
new Command(GoToBuildingAction.NAME, args),
|
new Command(GoToPageAction.NAME, {
|
||||||
|
...args,
|
||||||
|
path: '/build.php?id=' + args.id,
|
||||||
|
}),
|
||||||
new Command(UpgradeBuildingAction.NAME, args),
|
new Command(UpgradeBuildingAction.NAME, args),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ import Scheduler from './Scheduler';
|
|||||||
import Dashboard from './Dashboard';
|
import Dashboard from './Dashboard';
|
||||||
import TxtVersion from '!!raw-loader!./version.txt';
|
import TxtVersion from '!!raw-loader!./version.txt';
|
||||||
|
|
||||||
|
console.log('TRAVIAN AUTOMATION', TxtVersion);
|
||||||
|
|
||||||
const md = new ModeDetector();
|
const md = new ModeDetector();
|
||||||
if (md.isAuto()) {
|
if (md.isAuto()) {
|
||||||
md.setAuto();
|
md.setAuto();
|
||||||
|
Loading…
Reference in New Issue
Block a user