Script de mining


11371_1460009926

Recommended Posts

33 minutos atrás, Pedro Barbalho disse:

Também estou com o mesmo problema no OTClient. Tentei usar os scripts do tópico "[Scripts] OTClient", mas depois dessa atualização não funcionou. Quando abro o terminal fica subindo uma mensagem vermelha de erro.

exatamente, tentei de todas formas, no terminal da essa msg vermelha, no script simplesmente no acontece nada, msm se colocar um em cada espaço ou msm se colocar os 3 num espaço só.  

 

Agradeço muito quem puder ajudar.

  • Like 1
Link to comment
Share on other sites

Testa esse :v

cycleEvent(function()   
    moneyruneID = 3193   
    pickId = 3456   
    desintegrate = {1792, 1780, 1782, 3041, 3039, 3038, 3037, 3036, 1781}   
    wallIds = {5643, 5638, 5644, 5642, 5641, 5639, 5651, 5645, 5640, 5653}   
    trash = {3147, 3207}    

    local function isInArray(table, value)     
        for k, v in ipairs(table) do       
            if v == value then         
                return k       
            end     
        end     
        return false   
    end    
    
    local function openNextBackpack(openedbackpack)     
        for k, item in ipairs(openedbackpack:getItems()) do       
            if item:isContainer() then         
                g_game.open(item)         
                g_game.close(openedbackpack)         
                break       
            end     
        end   
    end    

    local function getOpenedContainer()     
        for i = 0, 3 do       
            if g_game.getContainer(i) then         
                return g_game.getContainer(i)       
            end     
        end     
        return false   
    end     

    if g_game.isOnline() then              
        player = g_game.getLocalPlayer()     
        playerPos = player:getPosition()     
        backpack = getOpenedContainer()   

        if not backpack then       
            local mainBack = player:getInventoryItem(InventorySlotBack)       
            g_game.open(mainBack)     
        end      

        if backpack then       
            itemCount = #backpack:getItems()        
            for i = 1, #trash do         
                item = player:getItem(trash[i])         
                if item ~= nil then           
                    g_game.move(item, playerPos, item:getCount())           
                    itemCount = itemCount - 1         
                end       
            end        

            for i = 1, #desintegrate do         
                item = player:getItem(desintegrate[i])         
                if item ~= nil then           
                    g_game.useInventoryItemWith(moneyruneID, item)           
                    itemCount = itemCount - 1         
                end       
            end        

            if itemCount >= backpack:getCapacity() then         
                return openNextBackpack(backpack)       
            end        

            for x = -1, 1 do         
                for y = -1, 1 do           
                    pos = {x = playerPos.x + x, y = playerPos.y + y, z = playerPos.z}           
                    tile = g_map.getTile(pos)           topThing = tile:getTopThing()           
                    if topThing ~= nil and topThing:isItem() then             
                        if isInArray(wallIds, topThing:getId()) then              
                            g_game.useInventoryItemWith(pickId, topThing)               
                            break             
                        end           
                    end         
                end       
            end     
        end   
    end 
end, 200)

 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
Em 18/09/2020 at 12:08, ThiagoMetal disse:

Testa esse :v


cycleEvent(function()   
    moneyruneID = 3193   
    pickId = 3456   
    desintegrate = {1792, 1780, 1782, 3041, 3039, 3038, 3037, 3036, 1781}   
    wallIds = {5643, 5638, 5644, 5642, 5641, 5639, 5651, 5645, 5640, 5653}   
    trash = {3147, 3207}    

    local function isInArray(table, value)     
        for k, v in ipairs(table) do       
            if v == value then         
                return k       
            end     
        end     
        return false   
    end    
    
    local function openNextBackpack(openedbackpack)     
        for k, item in ipairs(openedbackpack:getItems()) do       
            if item:isContainer() then         
                g_game.open(item)         
                g_game.close(openedbackpack)         
                break       
            end     
        end   
    end    

    local function getOpenedContainer()     
        for i = 0, 3 do       
            if g_game.getContainer(i) then         
                return g_game.getContainer(i)       
            end     
        end     
        return false   
    end     

    if g_game.isOnline() then              
        player = g_game.getLocalPlayer()     
        playerPos = player:getPosition()     
        backpack = getOpenedContainer()   

        if not backpack then       
            local mainBack = player:getInventoryItem(InventorySlotBack)       
            g_game.open(mainBack)     
        end      

        if backpack then       
            itemCount = #backpack:getItems()        
            for i = 1, #trash do         
                item = player:getItem(trash[i])         
                if item ~= nil then           
                    g_game.move(item, playerPos, item:getCount())           
                    itemCount = itemCount - 1         
                end       
            end        

            for i = 1, #desintegrate do         
                item = player:getItem(desintegrate[i])         
                if item ~= nil then           
                    g_game.useInventoryItemWith(moneyruneID, item)           
                    itemCount = itemCount - 1         
                end       
            end        

            if itemCount >= backpack:getCapacity() then         
                return openNextBackpack(backpack)       
            end        

            for x = -1, 1 do         
                for y = -1, 1 do           
                    pos = {x = playerPos.x + x, y = playerPos.y + y, z = playerPos.z}           
                    tile = g_map.getTile(pos)           topThing = tile:getTopThing()           
                    if topThing ~= nil and topThing:isItem() then             
                        if isInArray(wallIds, topThing:getId()) then              
                            g_game.useInventoryItemWith(pickId, topThing)               
                            break             
                        end           
                    end         
                end       
            end     
        end   
    end 
end, 200)

 

Vlws camarada vou testar e te retorno, mas já agradeço. 

Link to comment
Share on other sites

Em 18/09/2020 at 12:08, ThiagoMetal disse:

Testa esse :v


cycleEvent(function()   
    moneyruneID = 3193   
    pickId = 3456   
    desintegrate = {1792, 1780, 1782, 3041, 3039, 3038, 3037, 3036, 1781}   
    wallIds = {5643, 5638, 5644, 5642, 5641, 5639, 5651, 5645, 5640, 5653}   
    trash = {3147, 3207}    

    local function isInArray(table, value)     
        for k, v in ipairs(table) do       
            if v == value then         
                return k       
            end     
        end     
        return false   
    end    
    
    local function openNextBackpack(openedbackpack)     
        for k, item in ipairs(openedbackpack:getItems()) do       
            if item:isContainer() then         
                g_game.open(item)         
                g_game.close(openedbackpack)         
                break       
            end     
        end   
    end    

    local function getOpenedContainer()     
        for i = 0, 3 do       
            if g_game.getContainer(i) then         
                return g_game.getContainer(i)       
            end     
        end     
        return false   
    end     

    if g_game.isOnline() then              
        player = g_game.getLocalPlayer()     
        playerPos = player:getPosition()     
        backpack = getOpenedContainer()   

        if not backpack then       
            local mainBack = player:getInventoryItem(InventorySlotBack)       
            g_game.open(mainBack)     
        end      

        if backpack then       
            itemCount = #backpack:getItems()        
            for i = 1, #trash do         
                item = player:getItem(trash[i])         
                if item ~= nil then           
                    g_game.move(item, playerPos, item:getCount())           
                    itemCount = itemCount - 1         
                end       
            end        

            for i = 1, #desintegrate do         
                item = player:getItem(desintegrate[i])         
                if item ~= nil then           
                    g_game.useInventoryItemWith(moneyruneID, item)           
                    itemCount = itemCount - 1         
                end       
            end        

            if itemCount >= backpack:getCapacity() then         
                return openNextBackpack(backpack)       
            end        

            for x = -1, 1 do         
                for y = -1, 1 do           
                    pos = {x = playerPos.x + x, y = playerPos.y + y, z = playerPos.z}           
                    tile = g_map.getTile(pos)           topThing = tile:getTopThing()           
                    if topThing ~= nil and topThing:isItem() then             
                        if isInArray(wallIds, topThing:getId()) then              
                            g_game.useInventoryItemWith(pickId, topThing)               
                            break             
                        end           
                    end         
                end       
            end     
        end   
    end 
end, 200)

 

 

10 horas atrás, wellkina disse:

Vlws camarada vou testar e te retorno, mas já agradeço. 

testei e funfa que é uma blz vlws msm amigo 

  • Like 1
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...