(12-14-2014, 05:41 PM)Ace Wrote: ffxiv_task_assist.add vs ffxiv_task_assist:add
i had it ffxiv_task_assist:add
Code:
function wim.ModuleInit()
d(TableSize(ffxiv_task_assist.process_elements)) -- prints 0
ke_ntcne = ml_element:create( "ntcne", c_ntcne, e_ntcne, 28)
ffxiv_task_assist:add( ke_ntcne, ffxiv_task_assist.process_elements)
d(TableSize(ffxiv_task_assist.process_elements)) -- prints 1
end
it is added.
but its never checked or used?
im guessing this is where it checks the cne list:
Code:
function ml_cne_hub.eval_elements(elementList)
for k, elem in pairs( elementList ) do
if (gLogCNE == "1") then
ml_debug( "Evaluating:" .. tostring( elem.name ) )
end
elem.eval = elem:evaluate()
if (gLogCNE == "1") then
ml_debug( elem.name .. " evaluation result:" .. tostring( elem.eval ) )
end
end
end
i dont know Lua at all but it looks to me
this function is called once only with the instanced version of the object.
Code:
function ml_task:Process()
if (TableSize(self.process_elements) > 0) then
ml_cne_hub.clear_queue()
ml_cne_hub.eval_elements(self.process_elements) -- <<< here
ml_cne_hub.queue_to_execute()
ml_cne_hub.execute()
return false
else
ml_debug("no elements in process table")
end
end
in this thread a dev said he added specific code. i dont see it ?
Is there a new way to do it ?
EDIT:
btw i used to add it like this
Code:
init_ntcne = false
function wim.doPulse( Event, ticks )
if ml_task_hub:CurrentTask() and not init_ntcne then
ke_ntcne = ml_element:create( "ntcne", c_ntcne, e_ntcne, 28)
ml_task_hub:CurrentTask():add(ke_ntcne, ml_task_hub:CurrentTask().process_elements)
init_ntcne = true
end
end
which is basically waiting for a task to be created ( by press bot enabled etc.. )
and then add it to that.
but i would much rather have the solution the dev mentioned in this thread