PDA

View Full Version : swap when low on supplies



PandoraNyx
06-26-2016, 07:38 PM
I a attempting to make a simple script that will equip a jagged sword when my spear count is too low.. this is about what I have.... Is there some feature to assist with making simple scripts? (like elfbot's creation wizard)

MeleeWeapon = "Jagged Sword",
DistanceWeapon = "Spear",
MinDistanceWeapon = 2

Module("Swap", function
if count.DistnceWeapon > MinDistanceWeapon, then
Self.Equip(DistanceWeapon, "Spear")
else Self.Equip(MeleeWeapon, "Jagged Sword")
end
selfdelay(1500)
end)

it gives me an error at line 2, something unexpected too close to the =

Merre
06-27-2016, 01:21 PM
Try this one
local MeleeWeapon = "Jagged Sword"
local DistanceWeapon = "Spear"
local MinDistanceWeapon = 2

Module.New("Lambo", function(mod)
if Self.ItemCount(DistanceWeapon) <= MinDistanceWeapon and Self.Weapon() ~= MeleeWeapon then
Self.Equip(MeleeWeapon, "weapon")
mod:Delay(500)
else
Self.Equip(DistanceWeapon, "weapon", 100)
mod:Delay(500)
end
mod:Delay(1000)
end)


Easiest way to make script with xenobot is
http://xenobot.wikia.com/wiki/XenoBot_Wiki
Checking other peoples scripts who doesn't camouflage them
or open up the folder where xenobot is installed, Data > xb.*****************.lua (the most recent one) and there's most of the functions xenobot have to offer

PandoraNyx
06-29-2016, 07:21 PM
Thank you, this seems to be working!