avatar
Untitled

Guest 136 10th May, 2024

MARKUP 0.71 KB
                                           
                         macro(10, "Stack Items", function()
  local containers = g_game.getContainers()
  local toStack = {}

  for index, container in pairs(containers) do
    if not container.lootContainer then
      for i, item in ipairs(container:getItems()) do
        if item:isStackable() and item:getCount() < 1000 then
          local stackWith = toStack[item:getId()]
          if stackWith then
            local stackCount = math.min(1000 - stackWith[2], item:getCount())
            g_game.move(item, stackWith[1], stackCount)
            return
          end
          toStack[item:getId()] = { container:getSlotPosition(i - 1), item:getCount() }
        end
      end
    end
  end
end)
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes
Ta strona używa plików cookie w celu usprawnienia i ułatwienia dostępu do serwisu oraz prowadzenia danych statystycznych. Dalsze korzystanie z tej witryny oznacza akceptację tego stanu rzeczy.
Wykorzystywanie plików Cookie
Jak wyłączyć cookies?
ROZUMIEM