forked from Zewx1776/HordeDev
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Leoc76101111/ZEWX-HORDE-OVERHAUL
Integrate alfred
- Loading branch information
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
local plugin_label = "infernal_horde" -- change to your plugin name | ||
|
||
local settings = require 'core.settings' | ||
-- need use_alfred to enable | ||
-- settings.use_alfred = true | ||
|
||
local status_enum = { | ||
IDLE = 'idle', | ||
WAITING = 'waiting for alfred to complete', | ||
} | ||
local task = { | ||
name = 'alfred_running', -- change to your choice of task name | ||
status = status_enum['IDLE'] | ||
} | ||
|
||
local function reset() | ||
PLUGIN_alfred_the_butler.pause(plugin_label) | ||
-- add more stuff here if you need to do something after alfred is done | ||
task.status = status_enum['IDLE'] | ||
end | ||
|
||
function task.shouldExecute() | ||
if settings.use_alfred and PLUGIN_alfred_the_butler then | ||
local status = PLUGIN_alfred_the_butler.get_status() | ||
-- add additional conditions to trigger if required | ||
if status.enabled and | ||
status.inventory_full and | ||
(status.sell_count > 0 or status.salvage_count > 0) | ||
then | ||
return true | ||
elseif task.status == status_enum['WAITING'] then | ||
return true | ||
end | ||
end | ||
return false | ||
end | ||
|
||
function task.Execute() | ||
if task.status == status_enum['IDLE'] then | ||
PLUGIN_alfred_the_butler.resume() | ||
-- PLUGIN_alfred_the_butler.trigger_tasks(plugin_label,reset) | ||
PLUGIN_alfred_the_butler.trigger_tasks_with_teleport(plugin_label,reset) | ||
task.status = status_enum['WAITING'] | ||
end | ||
end | ||
|
||
if settings.enabled and settings.use_alfred and PLUGIN_alfred_the_butler then | ||
-- do an initial reset | ||
reset() | ||
end | ||
|
||
return task |