local StartSlot = ITEM_1 local MaxSlot = 255 local StartItem = myHero:getInventorySlot(StartSlot) local LastSlot = StartSlot local LastTried = StartSlot local NextTick = 0 local Delay = GetLatency() * 4 local ValidSlots = {} if StartItem == 0 then print("Start Slot Invalid") return else print("Slots Testing - Start") end function OnTick() if LastTried >= MaxSlot then if DoTick then print("Done") DoTick = nil OnUnload() ValidSlots = {} end else DoTick() end end function DoTick() if GetTickCount() < NextTick then if myHero:getInventorySlot(LastTried) == StartItem and LastSlot ~= LastTried then ValidSlots[LastTried] = true print("Moved "..LastSlot.." to "..LastTried) LastSlot = LastTried end else LastTried = LastTried + 1 if LastTried ~= LastSlot then MoveItem(LastSlot, LastTried) NextTick = GetTickCount() + Delay end end end function MoveItem(from, to) local P = CLoLPacket(0x20) local from = from >= 4 and from - 4 or 0 local to = to >= 4 and to - 4 or 0 P.dwArg1 = 1 P.dwArg2 = 0 P:EncodeF(myHero.networkID) P:Encode1(from) P:Encode1(to) SendPacket(P) end function OnUnload() local ValidSlotsOrdered = {} for i, _ in pairs(ValidSlots) do table.insert(ValidSlotsOrdered, i) end table.sort(ValidSlotsOrdered) for _,i in ipairs(ValidSlotsOrdered) do print(i.." is a valid slot.") end print("Slots Testing - End") end