XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 9 of 9

Thread: help ([XenoScript] Rook chain armor.lua: unexpected symbol near 'then')

  1. #1
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    help ([XenoScript] Rook chain armor.lua: unexpected symbol near 'then')

    [XenoScript] Rook chain armor.lua: unexpected symbol near 'then'

    PHP Code:
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

        
    MPotID 7876 --- mana potion ID
        MinMPots 
    10 ---- if less then script will exit spawn
        MPots 
    20 ----- amount to refill
        MPotprice 
    50 ---- price of 1 single mana pot

    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

    registerEventListener(WALKER_SELECTLABEL"onWalkerSelectLabel")

    function 
    onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if (Self.Cap() < MinCap) or ((Self.ItemCount(MPotID) < MinMPots)) then<- this one
                gotoLabelz
    (Leave)
            else
                
    gotoLabel('Keep Hunting')
        
    end 
        
        
    elseif (labelName == "Sell"then
            delayWalker
    (5000)
            
    Self.Say("hi")
            
    sleep(math.random(7001400))
            
    Self.ShopSellItem(itemsell)
            
    sleep(math.random(7001400))
        
    end 
    end

        
    elseif (labelName == "potions"then
                setWalkerEnabled
    (false)
                
    wait(9001200)
                
    Self.ShopSellItem(285sell)
                
    wait(9001200)
                
    buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID, (MPots-Self.ItemCount(MPotID)))
                
    wait(9001200)
                
    setWalkerEnabled(true)
        
    end 
    end 

  2. #2
    FrogWT's Avatar
    Join Date
    Jun 2012
    Location
    Brazil
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by desche188 View Post
    [XenoScript] Rook chain armor.lua: unexpected symbol near 'then'

    PHP Code:
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

        
    MPotID 7876 --- mana potion ID
        MinMPots 
    10 ---- if less then script will exit spawn
        MPots 
    20 ----- amount to refill
        MPotprice 
    50 ---- price of 1 single mana pot

    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

    registerEventListener(WALKER_SELECTLABEL"onWalkerSelectLabel")

    function 
    onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if (Self.Cap() < MinCap) or ((Self.ItemCount(MPotID) < MinMPots)) then<- this one
                gotoLabelz
    (Leave)
            else
                
    gotoLabel('Keep Hunting')
        
    end 
        
        
    elseif (labelName == "Sell"then
            delayWalker
    (5000)
            
    Self.Say("hi")
            
    sleep(math.random(7001400))
            
    Self.ShopSellItem(itemsell)
            
    sleep(math.random(7001400))
        
    end 
    end

        
    elseif (labelName == "potions"then
                setWalkerEnabled
    (false)
                
    wait(9001200)
                
    Self.ShopSellItem(285sell)
                
    wait(9001200)
                
    buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID, (MPots-Self.ItemCount(MPotID)))
                
    wait(9001200)
                
    setWalkerEnabled(true)
        
    end 
    end 
    PHP Code:
    if (Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPotsthen
       gotoLabel
    ('Leave'
    Try it.
    Last edited by FrogWT; 06-16-2012 at 01:13 PM.
    Regards,
    FrogWT.

  3. #3
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by FrogWT View Post
    PHP Code:
    if (Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPotsthen
       gotoLabel
    ('Leave'
    Try it.

    did not work [XenoScript] Rook chain armor.lua: unexpected symbol near 'then'
    PHP Code:
    function onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if (Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPotsthen <again did not work
                   gotoLabel
    ('Leave'then
            
    else
                
    gotoLabel('Keep Hunting')
        
    end 
    Last edited by desche188; 06-16-2012 at 02:58 PM.

  4. #4
    Lifetime Subscriber L!p3's Avatar
    Join Date
    Dec 2011
    Location
    Brazil
    Posts
    157
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by desche188 View Post
    did not work [XenoScript] Rook chain armor.lua: unexpected symbol near 'then'
    PHP Code:
    function onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if (Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPotsthen <again did not work
                   gotoLabel
    ('Leave'then
            
    else
                
    gotoLabel('Keep Hunting')
        
    end 
    You should delet the 'then' after gotoLabel('Leave').

    If X then
    do whatever
    else
    do whatever
    end

    PHP Code:
    function onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if (Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPotsthen
                gotoLabel
    ('Leave')
            else
                
    gotoLabel('Keep Hunting')
            
    end
        end
    end 
    Last edited by L!p3; 06-16-2012 at 04:14 PM.

  5. #5
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by L!p3 View Post
    You should delet the 'then' after gotoLabel('Leave').

    If X then
    do whatever
    else
    do whatever
    end

    PHP Code:
    function onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if (Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPotsthen
                gotoLabel
    ('Leave')
            else
                
    gotoLabel('Keep Hunting')
            
    end
        end
    end 
    I did delete the then but it says unexpected symbol near 'then' can you make a walker thing and test it

  6. #6
    Lifetime Subscriber L!p3's Avatar
    Join Date
    Dec 2011
    Location
    Brazil
    Posts
    157
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I've edited the file(.lua) from your first post and It worked here.

    PHP Code:
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

        
    MPotID 7876 --- mana potion ID
        MinMPots 
    10 ---- if less then script will exit spawn
        MPots 
    20 ----- amount to refill
        MPotprice 
    50 ---- price of 1 single mana pot

    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

    registerEventListener(WALKER_SELECTLABEL"onWalkerSelectLabel")

    function 
    onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if ((Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPots)) then
                gotoLabel
    ("Leave")
            else
                
    gotoLabel("Keep Hunting")
            
    end 
        
    elseif (labelName == "Sell"then
            delayWalker
    (5000)
            
    Self.Say("hi")
            
    sleep(math.random(7001400))
            
    Self.ShopSellItem(itemsell)
            
    sleep(math.random(7001400)) 
        elseif (
    labelName == "potions"then
            setWalkerEnabled
    (false)
            
    wait(9001200)
            
    Self.ShopSellItem(285sell)
            
    wait(9001200)
            
    buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID, (MPots-Self.ItemCount(MPotID)))
            
    wait(9001200)
            
    setWalkerEnabled(true)
        
    end 
    end 
    Check if it works now.

  7. #7
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    this thing doesnt buy potions



    PHP Code:
        elseif (labelName == "potions"then
            setWalkerEnabled
    (false)
            
    Self.SayToNpc("hi")
        
    wait(9001200)
            
    Self.SayToNpc("trade")
        
    wait(9001200)
        
    Self.ShopSellItem(2850)
            
    wait(9001200)
            
    BuyPots(MPotID, (MPots-Self.ItemCount(MPotID)))
            
    wait(9001200)
            
    setWalkerEnabled(true)
        
    end 
    end  

    function BuyPots(itemcount)
        
    count tonumber(count) or 1
        repeat
            local amnt 
    math.min(count10)
            if(
    Self.ShopBuyItem(itemamnt) == 0)then
                
    return printf("ERROR: failed to buy item: %s"tostring(item))
            
    end
            wait
    (200,500)
            
    count = (count amnt)
        
    until count <= 0
    end 

  8. #8
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by L!p3 View Post
    I've edited the file(.lua) from your first post and It worked here.

    PHP Code:
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

        
    MPotID 7876 --- mana potion ID
        MinMPots 
    10 ---- if less then script will exit spawn
        MPots 
    20 ----- amount to refill
        MPotprice 
    50 ---- price of 1 single mana pot

    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------

    registerEventListener(WALKER_SELECTLABEL"onWalkerSelectLabel")

    function 
    onWalkerSelectLabel(labelName)
        if (
    labelName == "Checker"then
            
    if ((Self.Cap() < MinCap) or (Self.ItemCount(MPotID) < MinMPots)) then
                gotoLabel
    ("Leave")
            else
                
    gotoLabel("Keep Hunting")
            
    end 
        
    elseif (labelName == "Sell"then
            delayWalker
    (5000)
            
    Self.Say("hi")
            
    sleep(math.random(7001400))
            
    Self.ShopSellItem(itemsell)
            
    sleep(math.random(7001400)) 
        elseif (
    labelName == "potions"then
            setWalkerEnabled
    (false)
            
    wait(9001200)
            
    Self.ShopSellItem(285sell)
            
    wait(9001200)
            
    buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID, (MPots-Self.ItemCount(MPotID)))
            
    wait(9001200)
            
    setWalkerEnabled(true)
        
    end 
    end 
    Check if it works now.
    all of it worked but it doesnt buy potions and i want it to buy potions untill 20

  9. #9
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    can anyone help

Posting Permissions

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