Walk on monster soul
#64
This will walk on monster souls when added to map.
local iPos = nil
local iID = 34132
macro(500, "Walk on Monster Soul", function()
if iPos then
autoWalk(iPos, 100, { ignoreNonPathable = true })
end
end)
UI.Button("Clear Position", function()
iPos = nil
end)
onAddThing(function(tile, thing)
if thing:getId() == iID then
local tmpPosition = tile:getPosition()
local pPosition = pos()
if tmpPosition and pPosition then
if tmpPosition.z == pPosition.z and getDistanceBetween(pos(), tmpPosition) <= 7 then
iPos = tmpPosition
return
end
end
end
end)
onRemoveThing(function(tile, thing)
if thing:getId() == iID then
if tmpPosition and pPosition then
if tmpPosition.z == pPosition.z and getDistanceBetween(pos(), tmpPosition) <= 7 then
iPos = nil
return
end
end
end
end)
- remove | + add
14 Oct 2021