02-17-2015, 12:38 AM
Cichard,
This is also available in the repo I sent you.
I was trying to implement a Return to Option to eventually suggest blending in with your INN option but I am having a bit of trouble.
I got it to work if I use the MultiBot COM Server Console
both work. I still need to do a bit of work to interrupt a path if I change my mind. The problem is that the mb.ReceivedMsg is not lining up and even though it states it is sending the same data it isn't firing. My guess is there is some translation on the mb.ReceivedMsg I need to do for an exact match (something like its actually sending % instead.
Let me know any thoughts you have. This is just a first go to try and get more familiar with the LUA and API but I am trying.
This is also available in the repo I sent you.
I was trying to implement a Return to Option to eventually suggest blending in with your INN option but I am having a bit of trouble.
I got it to work if I use the MultiBot COM Server Console
Code:
sendc <channel> 11;WakingSands
sendc <channel> 11;RisingStones
both work. I still need to do a bit of work to interrupt a path if I change my mind. The problem is that the mb.ReceivedMsg is not lining up and even though it states it is sending the same data it isn't firing. My guess is there is some translation on the mb.ReceivedMsg I need to do for an exact match (something like its actually sending % instead.
Let me know any thoughts you have. This is just a first go to try and get more familiar with the LUA and API but I am trying.
Code:
--==================Set Return Mode=======================
ctrl.AddComboBox("Return To Location","RETURN","Settings","RisingStones, WakingSands")
function compileReturnMessage()
return "11;".._G["CONTROLLERUI_RETURN"]
end
local handlerReturnTo = {
evaluate = function ()
if (mb.ReceivedID == 11) then
return true
end
return false
end,
execute = function ()
local destid = 0
local message = mb.ReceivedMsg
if (message == "RisingStones") then
destid = 351
elseif (message == "WakingSands") then
destid = 212
end
if (Player.localmapid == destid) then
return false
else
local bestMap = 0
bestMap = destid
if (bestMap ~= 0) then
if (gBotRunning == "1") then
ml_task_hub.ToggleRun()
end
ml_task_hub.shouldRun = true
gBotRunning = "1"
ml_task_hub:ClearQueues()
local task = ffxiv_task_movetomap.Create()
task.destMapID = bestMap
task.task_complete_execute = function()
ml_task_hub.ToggleRun()
end
ml_task_hub:Add(task, LONG_TERM_GOAL, TP_ASAP)
end
end
end,
}
mb.AddHandler(handlerReturnTo)
local action = function ()
local destid = 0
local message = mb.ReceivedMsg
if (message == "RisingStones") then
destid = 351
elseif (message == "WakingSands") then
destid = 212
end
if (Player.localmapid == destid) then
return false
else
local bestMap = 0
bestMap = destid
if (bestMap ~= 0) then
if (gBotRunning == "1") then
ml_task_hub.ToggleRun()
end
ml_task_hub.shouldRun = true
gBotRunning = "1"
ml_task_hub:ClearQueues()
local task = ffxiv_task_movetomap.Create()
task.destMapID = bestMap
task.task_complete_execute = function()
ml_task_hub.ToggleRun()
end
ml_task_hub:Add(task, LONG_TERM_GOAL, TP_ASAP)
end
end
end
ctrl.AddInitiator("Return To", compileReturnMessage, action)