Signup Now
Results 1 to 1 of 1

Thread: resupply

  1. #1
    Free User
    Join Date
    Apr 2014
    Posts
    11
    Reputation
    10
    Rep Power
    0

    Question resupply

    hello, I need help with a relifer.
    Bot should buy "X" (eg X = 700mana potion) but Bot buy only 100 mana potion. ;/



    Code:
    -- resupply
    
    if not islocation(3) then
        gotolabel('to_mshop')
    else
    	reachcreature('Asima') waitping()
        sellflasks()
    
        local itemsbuy = {
            {name = 'mana potion', count = items.manaMax, move = true},
            {name = items.healthName, count = items.healthMax, move = false}
        }
    
        for i, item in ipairs(itemsbuy) do
            local tobuy = item.count - itemcount(item.name)
    
            while tobuy > 0 and $tradeopen and $cap > iteminfo(item.name).weight + math.random(10, 20) do
                buyitems(item.name, tobuy) waitping(1, 1.5)
    
                if item.move then
                    while getcontainer(bp.supply).emptycount > 0 and itemcount(item.name, bp.main) > 0 do
                        moveitems(item.name, bp.supply) waitping(1, 1.4)
                    end
                end
    
                tobuy = tobuy - 100
            end
        end
    end
    Last edited by Bildziuk; 01-24-2019 at 05:02 PM.

 

 

Posting Permissions

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