PDA

View Full Version : Withdraw ammo from DP



danilotx
04-07-2020, 04:26 AM
Hi, im new to Xenobot and im trying to make my first script, i would like do get Diamond Arrows from DP to BP.

I made a label on my waypoints named "WitdrawAmmo" after a reach depot walker action, but i cant make it work, can someone help me please?

if (labelName == WithdrawAmmo) then

local AmmoUse = "Diamond Arrow"
local AmmoMax = 1800
local AmmoBp = "Brocade Backpack"
----------------------

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "WithdrawAmmo") then
Self.ItemCount(Item.GetID(AmmoUse) < AmmoMax)
AmmoToWithdraw = (AmmoMax - Self.ItemCount(AmmoUse))
Self.WithdrawItems(3, {Item.GetID(AmmoUse), AmmoBp, AmmoToWithdraw}) -- 0, Is the spot of bp on Depot.
end