12-17-2013, 12:36 AM
(12-16-2013, 11:49 PM)f3re Wrote: If you want your task to be queued, you would need to add a CNE that adds it as a subtask of whatever bot mode you want to use it from. You don't have to modify the Init() function of that task, you can insert them from an Init() function in your own module. Just add your cne to the task.process_elements() list or the task.overwatch_elements list. You want your module to be as independent of the main bot code as possible, so you want to avoid overriding/hooking/etc if at all possible.
So, if I understand you right, that would look something like this?
Code:
function SpecificHunting_task:Create()
local newinst = inheritsFrom(ffxiv_task_grind) -- changing this to inherit from the grind task, thus becomes a subtask?
--ml_task members
newinst.valid = true
newinst.completed = false
newinst.subtask = nil
newinst.auxiliary = false
newinst.process_elements = {}
newinst.overwatch_elements = {}
--ffxiv_task_killtarget members
newinst.name = "LT_SPECIFICHUNTING"
return newinst
end
function SpecificHunting_task:Init()
local ke_companion = ml_element:create( "Companion", c_companion, e_companion, 20 )
self:add( ke_companion, self.overwatch_elements)
local ke_companionstance = ml_element:create( "Companion Stance", c_companionstance, e_companionstance, 25 )
self:add( ke_companionstance, self.process_elements)
local ke_pethealassist = ml_element:create( "Pet Heal Assister", c_pethealassist, e_pethealassist, 15 )
self:add( ke_pethealassist, self.overwatch_elements)
self:AddTaskCheckCEs()
end