Mining


PedroSalazar20

Recommended Posts

Boa tarde,

Segue abaixo em spoiler o script de mineração que eu uso, você pode editá-lo para não dropar as gemas que você quiser.

 

Spoiler

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)

 

Link to comment
Share on other sites

  • Teemo locked this topic
Guest
This topic is now closed to further replies.