XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 4 of 4

Thread: Picking Up Spears!

  1. #1

    Join Date
    Nov 2012
    Posts
    4
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Picking Up Spears!

    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
    PHP Code:
        elseif (labelName == "Spear"then
            setWalkerEnabled
    (false)    
            
    Self.Equip(3277'weapon'10)
            
    setWalkerEnabled(true
    It comes like this!
    PHP Code:
    17:31 XenoScript Error:
               
    ScriptSpear.lua
               Line 
    #: 1
               
    ChunkC:?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

  2. #2
    Druvan Thias's Avatar
    Join Date
    Jun 2012
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dosent work for me. can you make a working Lua and load it up?

  3. #3

    Join Date
    Oct 2013
    Posts
    24
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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:
    PHP Code:
    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.
    Last edited by Alizenos; 12-16-2015 at 03:57 PM.

  4. #4
    Senior Member
    Join Date
    Sep 2012
    Posts
    1,070
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    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

    Code:
    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

Posting Permissions

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