• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Auto fishing script

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:
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:
Hello, trying to make script to fish water elemental body


Lua:
macro(1000, "Auto Fish water elemental", function()
  for _, tile in ipairs(g_map.getTiles(posz())) do
    if table.contains({9582}, tile:getTopUseThing():getId()) and getDistanceBetween(pos(), tile:getPosition()) <= 4 then
      useWith(3483, tile:getTopUseThing())
    end
  end
end)

can someone help me make it work ? now it kicks me out of client and doesnt work properly
 
I love this code. How can i use multiple ids in the "if table.contains({here}......"? Can u help me guys? There my code:

Lua:
if type(storage.corpseToCatch) ~= "table" then
  storage.corpseToCatch = {}
end

local corpseContainer = UI.Container(function(widget, items)
  storage.corpseToCatch = items
end, true)
corpseContainer:setHeight(35)
corpseContainer:setItems(storage.corpseToCatch)

macro(100, "Auto Catch", function()
  local corpsesToCatch = storage.corpseToCatch
  for _, tile in ipairs(g_map.getTiles(posz())) do
      for _, corpseId in ipairs(corpsesToCatch) do
          if table.contains(corpseId, tile:getTopUseThing():getId()) and getDistanceBetween(pos(), tile:getPosition()) <= 5 then
              useWith(19559, tile:getTopUseThing())
          end
      end
  end
end)
 
Back
Top