XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 10 of 24

Thread: Improved Items Mover ( multi items )

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Join Date
    Jan 2014
    Posts
    183
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Improved Items Mover ( multi items )

    Hello, now ive just had a need to make better item mover, so i'd like to share with community

    I did not made optional backpack where pots firstly are because usually people want to sort items after magic shop. So thats why it sorting from first backpack( usually main ).

    Also you don't have to loop this function:
    reason of looping such function is that when you move item, the next indexes are lowered by 1 and for loop just goes ahead.
    There is no such problem cause this is recursive function so if it will move item its looping itself.

    I hope You enjoy

    PHP Code:
     toSort = {
        {
    id Item.GetID('mana potion'), bp 'brocade backpack'},
        {
    id Item.GetID('health potion'), bp 'demon backpack'}
        }
    function 
    moveItems(table)
        
    local fromBP Container.GetFirst()
        for 
    spotitem in fromBP:iItems() do
            for 
    _data in pairs(table) do
                if 
    item.id == data.id then
                    local toBP 
    Container.New(data.bp)
                    
    fromBP:MoveItemToContainer(spottoBP:Index(), 0)
                         
    wait(Self.Ping() + 100Self.Ping() + 300)
                    return 
    moveItems(table)
                
    end
            end
        end
    end
    Module
    .New('ImprovedItemMover', function(this)
        
    moveItems(toSort)
        
    this:Stop()
        
    end
    Last edited by kamilqq; 03-29-2016 at 08:24 PM. Reason: update

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •