diff --git a/src/Action/GrabHeroAttributesAction.ts b/src/Action/GrabHeroAttributesAction.ts deleted file mode 100644 index 2980062..0000000 --- a/src/Action/GrabHeroAttributesAction.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ActionController, registerAction } from './ActionController'; -import { Args } from '../Command'; -import { Task } from '../Queue/TaskQueue'; -import { ActionError } from '../Errors'; -import { getNumber } from '../utils'; - -@registerAction -export class GrabHeroAttributesAction extends ActionController { - async run(args: Args, task: Task): Promise { - const healthElement = jQuery('#attributes .attribute.health .powervalue .value'); - if (healthElement.length !== 1) { - throw new ActionError(task.id, 'Health dom element not found'); - } - - const text = healthElement.text(); - let normalized = text.replace(/[^0-9]/g, ''); - - const value = getNumber(normalized); - // this.state.set('hero', { health: value }); - } -} diff --git a/src/Queue/TaskQueue.ts b/src/Queue/TaskQueue.ts index 5782a79..e7f0fdd 100644 --- a/src/Queue/TaskQueue.ts +++ b/src/Queue/TaskQueue.ts @@ -18,6 +18,7 @@ function uniqTaskId(): TaskId { } else { idSequence = 1; } + lastTimestamp = ts; return 'tid.' + ts + '.' + String(idSequence).padStart(4, '0') + '.' + uniqId(''); } diff --git a/src/Task/SendOnAdventureTask.ts b/src/Task/SendOnAdventureTask.ts index 60ff961..d187775 100644 --- a/src/Task/SendOnAdventureTask.ts +++ b/src/Task/SendOnAdventureTask.ts @@ -2,7 +2,6 @@ import { Args, Command } from '../Command'; import { Task } from '../Queue/TaskQueue'; import { TaskController, registerTask } from './TaskController'; import { GoToPageAction } from '../Action/GoToPageAction'; -import { GrabHeroAttributesAction } from '../Action/GrabHeroAttributesAction'; import { CompleteTaskAction } from '../Action/CompleteTaskAction'; import { SendOnAdventureAction } from '../Action/SendOnAdventureAction'; import { ClickButtonAction } from '../Action/ClickButtonAction'; @@ -17,7 +16,6 @@ export class SendOnAdventureTask extends TaskController { ...args, path: path('/hero.php'), }), - new Command(GrabHeroAttributesAction.name, args), new Command(GoToPageAction.name, { ...args, path: path('/hero.php', { t: 3 }),