Post by moinphyst on Aug 16, 2020 14:34:47 GMT
Working with easyLOU v1.0.0.33. Will require runStraight function from the Tools thread. The runebook and deposit functions are tailored to my needs but there are some great examples in the ... examples folder ... that will get you going in the right direction.
require "utils"
permLoop = {
{ x = permaXCoord1 , y = permaYCoord1 , z = permaZCoord1 , id = permaId1 },
{ x = permaXCoord2 , y = permaYCoord2 , z = permaZCoord2 , id = permaId2 } --,
-- ....
}
function gatherPerms(permLoop,tool)
while true do
for i=1,tableLength(permLoop) do
FindPermanent(permLoop[i]["id"])
sleep(500)
local state = string.match(FINDPERMACOLOR[1],";")
if state == nil then
runStraight(permLoop[i]["x"],permLoop[i]["y"],permLoop[i]["z"])
sleep(750)
rightHandCheck(tool) -- Equip() after checking that RIGHTHANDID doesn't have a matching item already equipped, wasn't sure what order FindItem() searched for a matching item and I carry an extra pick with me.
Macro(28) -- the 'q' key
sleep(200)
TargetPermanent(permLoop[i]["id"])
startTime = TIME
timeout = 120 -- infinite loops are bad, mmmkay
while ((state == nil) and ((TIME - startTime) < timeout) and (RIGHTHANDID ~= "N/A")) do
sleep(2000)
FindPermanent(permLoop[i]["id"])
state = string.match(FINDPERMACOLOR[1],";")
rightHandCheck("pick")
end
print(TIME .. ": Rock #" .. i .. " Depleted.")
if ((tonumber(CHARWEIGHT) > (maxCapacity - 5)) or (RIGHTHANDID == "N/A"))then
print("Time to go home")
sleep(2000)
runebookToHouse() -- navigates to the House runepage and casts portal
depositRocksOutsideHouse(chestId) -- put the goods in the chest and noone gets hurt!
restock() -- picks up regs and pick if needed
sleep(2000)
print("Time to go back to work")
runebookToBreca() -- navigates to the Mine runepage and casts portal
end
else
print("Skipping Rock #".. i .. ".")
end
end
end
end
gatherPerms(permLoop,"Pick")