I don't know if I'm posting in the correct section but I know that here I can have a huge Visibility please help me with this action:
init start
-- local SCRIPT_VERSION = '1.0.0'
local waterloots = {281, 282, 3026, 3029, 3032, 9303}
init end
auto(200)
--fish only if there are no bodies to be looted on the screen and you're not currently targeting anything
if $lootsaround == 0 and $targetingtarget.hppc == 0 then
--count how many of each item you have currently
local count = {}
for index,id in ipairs(waterloots) do
count[index] = itemcount(id)
end
if fishspots(9582) > 0 then
fish(9582)
wait(800) --if fished a body, it gets here... wait 1 second, to give time for the item to arrive in your backpack
--make a new count, and compare the new count with the previous values
for index,id in ipairs(waterloots) do
local newcount = itemcount(id)
if (newcount > count[index]) then
--if the value changed, increase the amount looted on loot counter
increaseamountlooted(id, newcount-count[index])
end
end
else
--pauses the walker if there are any water elementals on the screen
while fishspots(4037) > 10 do
pausewalking(500)
wait(300)
end
pausewalking(0)
end
end
the problem is:
12:28:01 error in Cavebot script FishWaterElemental:
["for k, v in ipairs(self) do"]:LucasTerra.lua:759 bad argument #1 to 'ipairs' (table expected, got number)
stack traceback:
["for k, v in ipairs(self) do"]:LucasTerra.lua:759 in function ["function table:find(value, argument)"]:LucasTerra.lua:758
["elseif (type(self.id) == 'number' and self.id == cur.id) or ..."]:LucasTerra.lua:2625 in function ["function FISHSPOTS:update(id)"]:LucasTerra.lua:2609
["FISHSPOTS:update(n)"]:LucasTerra.lua:2714 in function ["function fishspots(n)"]:LucasTerra.lua:2711
["if fishspots(9582) > 0 then"]:FishWaterElemental:16 in user script
HEEELPP MEEE