Cornwallis
Member
- Joined
- Jan 3, 2010
- Messages
- 480
- Reaction score
- 16
I'm using otclientv8 and i'm trying to make an auto fishing script but it's not working. here's there error: attempt to index local tile ( a nil value )
and the script:
fixed thanks to otclientv8 moderator Frosty:
and the script:
Code:
macro(250, "Auto fish", function()
local position = player:getPosition()
local positions = {z = position.z}
position.y = position.y - 3
position.x = position.x - 3
for i = 1, 7 do
position.x = position.x + 1
for n = 1, 7 do
position.y = position.y + 1
local tile = g_map.getTile(position)
local topItem = tile:getTopUseThing() // this is the line with the error
if topItem and topItem:getId() == 4597 then
useWith(3483, topItem)
break
else
positions = 0
end
end
end
end)
Post automatically merged:
fixed thanks to otclientv8 moderator Frosty:
Code:
macro(1000, "Auto Fish", function()
for _, tile in ipairs(g_map.getTiles(posz())) do
if table.contains({4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603}, tile:getTopUseThing():getId()) and getDistanceBetween(pos(), tile:getPosition()) <= 7 then
useWith(3483, tile:getTopUseThing())
end
end
end)
Last edited: