0 then
timeLeft = remaining
skill = memoryReadRepeat("int", getProc(), orb.Address + pawnCastID_offset)
end
end
end
end
-- If so and it doesnt have correct buff, do an ExtraAction with correct color
player:target(dev.Address)
if skill ~= 0 then
local action = castToAction[skill]
local duration, remaining = api:GetExtraActionCooldown(action.key)
if remaining == 0 and not dev:hasBuff{622710,622711} then
api:UseExtraAction(action.key)
yrest(150)
end
end
yrest(50)
end
cprintf(cli.red,"Game done!\n")
end
function getAvailableDevice()
-- Find the devices
local found, devs = player:findNearestNameOrId(id_device)
if not found then
cprintf(cli.red,"We couold not find the devices!\n")
return
end
-- Check if they are in use
for k,obj in pairs(devs) do
local device = CPawn(obj.Address)
local found, orbs = player:findNearestNameOrId(id_energy, 0, function(addr, obj) return distance(obj, device) < 200; end)
if not found then
return obj
end
end
-- None found
return nil
end
]]>
0 then
ChoiceOptionByName(t_usetprune)
o_useTP = o_useTP - 1
end
-- We go again?
if player:hasBuff(id_gotkey) then
-- Select an available device
local device
repeat
device = getAvailableDevice()
if not device then
yrest(secondsToTimer(10))
end
until device ~= nil
-- Use device found
local wp = __WPL:getNearestWaypoint(device.X, device.Z, device.Y)
__WPL:setWaypointIndex(wp)
else
error("All done for now!")
end
]]>