View Full Version : Picking Up Spears!
Cheeze17
11-18-2012, 04:36 PM
hello guys,I've been hacked on my other character so i decided to make an new and this time a paladin.
So i need a script who pick up a amout of spears...For example when i have under 10 spears it picks up from ground/ monsters (ground if it's possible)
But when i use this script
elseif (labelName == "Spear") then
setWalkerEnabled(false)
Self.Equip(3277, 'weapon', 10)
setWalkerEnabled(true)
It comes like this!
17:31 XenoScript Error:
Script: Spear.lua
Line #: 1
Chunk: C:?Users?Username?Documents?XenoBot?Scripts?Spear. lua
Error: '<eof>' expected near 'elseif'
This is an error with user-input and should not be reported as a bug with XenoBot.
Thanks in advice
urs Cheeze
Druvan Thias
12-14-2015, 06:37 PM
dosent work for me. can you make a working Lua and load it up?
Alizenos
12-16-2015, 03:51 PM
So, the error you get is solely based on the fact that you have an elseif and nothing else. elseif is a condition that is questioned only if an if in front of it is not considered.
for example:
if Self.Name() == "Cheeze 17" then
print("I Am Cheeze 17")
elseif Self.Name() == "Alizenos" then
print("I Am Alizenos")
end
So considered I am Alizenos, It won't print your name but mine.
Other thing, the Self.Equip function only works on things that you have on your equipment, so it will only wear spears you have and since you used a labelname, it will only wear them when the walker hits that name, not when you have less than 10 spears.
I am working on paladin tools and will post a link to it here when I finish it unless some of the OX guys help you first.
dinmamma
12-16-2015, 07:26 PM
Container = name of the bag/bp you will put spear into
DistanceWeapon = name of stuff u wanna pick up
PickUp = true/false aka enable/disable
Cap = if cap lower than this it will stop to pick up
local config = {
Container = "Red Backpack",
DistanceWeapon = {"Spear", "Small Stone"},
PickUp = true,
Cap = 470
}
while true do
for i = 0, #Container.GetIndexes() - 1 do
local c = Container.GetFromIndex(i)
if c:isOpen() and (c:Name():find("The") or c:Name():find("Demonic") or c:Name():find("Split") or c:Name():find("Dead") or c:Name():find("Slain") or c:Name():find("Dissolved") or c:Name():find("Remains") or c:Name():find("Elemental")) then
for s = 0, c:ItemCount() - 1 do
local item = Item.GetName(c:GetItemData(s).id):titlecase()
if config.PickUp and table.contains(config.DistanceWeapon, item) and Self.Cap() > config.Cap then
local destCont = Container.GetByName(config.Container)
c:MoveItemToContainer(s, destCont:Index(), math.min(destCont:ItemCount() + 1, destCont:ItemCapacity() - 1))
wait(600, 890)
break
end
end
end
end
wait(50)
end
Cheeze17
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.