XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 3 of 3

Thread: Putting supplies into specific BP

  1. #1

    Join Date
    Jan 2016
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Putting supplies into specific BP

    Hello,

    Can you help me add function to the following script I made?

    After buying supreme health potions and mana potions I want bot to put it to PotionsBP instead of leaving it in MainBP. Would it also be possible to have next backpack inside PotionsBP for more place?

    Code:
    --- zmienne
    
    local LootBP = "Orange Backpack"
    local PotionsBP = "Red Backpack"
    local StacksBP = "Glooth Backpack"
    local LeaveCap = 50    --- Od ilu capa nasz bot ma wracać do dp.
    local LeaveManas = 600   --- od ilu potków nasz bot ma wracać do dp.
    local MaxManas = 1600   --- Ile potków ma kupić nasz bot zanim pójdzie expić.
    local MaxHealth = 400
    local LeaveHealth = 150
    
    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
    
    function onWalkerSelectLabel(labelName)
    
    --- reset bp
    
    if (labelName == "ResetBPs") then
    Walker.Stop()
    Self.CloseContainers()
    wait(500,1000)
    Self.OpenMainBackpack(true):OpenChildren({LootBP, true}, {StacksBP, true}, {PotionsBP, true})
    wait(500,1000)
    Container.GetFirst():Minimize()
    wait(200)
    Walker.Start()
    
     
    --- deponowanie itemow
    
    elseif labelName == "DepositItems" then
    wait(500, 600)
    Self.DepositItems({10413, 1} {9057, 1}, {21203, 1}, {281, 1}, {5880, 1}, {3032, 1}, {953, 1}, {3006, 0}, {10384, 0}, {3342, 0}, {7419, 0}, {7412, 0}, {811, 0}, {812, 0}, {830, 0}, {3324, 0}, {3038, 0}, {21178, 0}, {21164, 0}, {21179,0}, {21183, 0}, {3343, 0}, {21180, 0}, {7386, 0}, {21167, 0}, {813, 0}, {3037, 0}, {21165, 0}, {21170, 0}, {8082, 0}, {21171, 0}, {21168, 0}, {21169, 0}, {7452, 0}, {3342, 0}, {282, 1}, {814, 0})
    
    --- bank
    
    elseif labelName == 'Bank' then
    Self.SayToNpc({'hi', 'deposit all', 'yes', 'balance'})
    
    --- BUYING POTIONS I WANT IT TO GO TO POTIONSBP 
    
    elseif labelName == 'Buy' then
    Walker.Stop()
    Self.SayToNpc({'hi', 'trade'})
    Self.ShopBuyItem(268, (MaxManas-Self.ItemCount(268)))
    wait(500,1000)
    Self.ShopBuyItem(23375, (MaxHealth-Self.ItemCount(23375)))
    Walker.Start()
    
    --- sprawdzanie potow przed expem
    
    elseif (labelName == "CheckStuff") then
    Walker.ConditionalGoto((Self.ItemCount(268) < MaxManas or Self.ItemCount(23375) < MaxHealth), "Buy", "ToHunt")
    
    --- sprawdzanie potow na expie
    
    elseif labelName == 'CheckSupplies' then
    Walker.ConditionalGoto(Self.Cap() < LeaveCap or Self.ItemCount(268) < LeaveManas or Self.ItemCount(23375) < LeaveHealth, 'Refill','ContinueHunt')
    
    
    end
    
    end

  2. #2

    Join Date
    Nov 2014
    Posts
    5
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code:
    local items = {268, 23373}
    local MainBP = "Shopping Bag"
    local OtherBP = "Camouflage Backpack"
    
    	Module.New("Sort Supplies", function()
    		local bp1 = Container(MainBP)
    			for spot, item in bp1:iItems() do
    				if (table.contains(items, item.id)) then
    					bp1:MoveItemToContainer(spot, Container.New(OtherBP):Index())
    				break
    			end
    		end
    	end)
    here you go, just change bp,s

  3. #3

    Join Date
    Jan 2016
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eslu View Post
    Code:
    local items = {268, 23373}
    local MainBP = "Shopping Bag"
    local OtherBP = "Camouflage Backpack"
    
    	Module.New("Sort Supplies", function()
    		local bp1 = Container(MainBP)
    			for spot, item in bp1:iItems() do
    				if (table.contains(items, item.id)) then
    					bp1:MoveItemToContainer(spot, Container.New(OtherBP):Index())
    				break
    			end
    		end
    	end)
    here you go, just change bp,s
    Works perfectly, thank you my friend!

Posting Permissions

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