Pesca OTCliente


Dudu :P

Recommended Posts

Feita com carinho, coloque no Ingame script editor:

 

 

-------Macro de Pescaria-------------------------------
local waterIds = {4597} -- IDs de onde você deseja pescar
local rodId = 3483 -- ID da vara de pescar
local useDistance = 3 -- Distância que você deseja lançar a vara
local moveDist = 3 -- Quão longe você está disposto a se mover

local function magmaVtr(positions)
    local closestWaterTile
    local closestWaterTileDistance = 99999
    for _, position in ipairs(positions) do
        local tileDist = getDistanceBetween(pos(), position)
        if tileDist < closestWaterTileDistance then
            closestWaterTile = position
            closestWaterTileDistance = tileDist
        end
    end
    if closestWaterTile then
        return closestWaterTile
    end
end

-- Declare fishingOn como global
fishingOn = macro(1000, "Fishing", function()
    local possibleFishingSpots = {}
    local foundFishingSpot = 0
    for i, tile in ipairs(g_map.getTiles(posz())) do
        if tile:getTopUseThing() ~= nil then
            local topID = tile:getTopUseThing():getId()
            local fishable = table.contains(waterIds, topID)
            if fishable then
                local distance = getDistanceBetween(pos(), tile:getPosition())
                if (distance <= useDistance) then
                    return usewith(rodId, tile:getTopUseThing())
                elseif distance > useDistance and distance <= moveDist then
                    if findPath(pos(), tile:getPosition(), moveDist, {ignoreNonPathable=true, precision=1}) then
                        table.insert(possibleFishingSpots, tile:getPosition())
                        foundFishingSpot = foundFishingSpot + 1
                    end
                end
            end
        end
    end
    if foundFishingSpot >= 1 then
        CaveBot.delay(2000)
        TargetBot.delay(2000)
        return autoWalk(magmaVtr(possibleFishingSpots), moveDist, {ignoreNonPathable=true, precision=1})
    end
end)

 

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...