XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 3 of 3

Thread: Help with my .lua file (newb)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Join Date
    Mar 2012
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with my .lua file (newb)

    Hey, I get this error message.

    10:19 XenoScript Error:
    Script: Smuggler Pit Version 1.lua
    Line #: 55
    Chunk: C:\Users\Michael\Documents\XenoBot\Scripts\Smuggle r Pit Version 1.lua
    Error: '<eof>' expected near 'end'
    This is an error with user-input and should not be reported as a bug with XenoBot.
    The .lua is:

    Code:
    -- Smuggler Pit Version 1 by Rhinocort --
    --===========##[CONFIGURATION]##===========--
    
    local MinCap = 10 				-- Cap to deposit on.
    local MinMana = 5 				-- Manas to deposit on.
    
    local MaxMana = 10				-- Amount of manas to buy.
    
    local ManaId = 268				-- Id of Mana Potion.
    local ManaPrice = 50				-- How much Mana Potions cost.
    
    local GoldBP = 2872				-- Id of Gold Backpack
    
    local RareDP = 0 				-- BP in DP to put Non-Stackable Items Into
    local StackDP = 1				-- BP in DP to put Stackable Items Into
    -- (0 = first backpack, 1 = second and so on...) --
    
    --- DON'T CHANGE ANYTHING BELOW THIS LINE ---
    
    print("Smuggler Pit version 1 \nby Rhinocort")
    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
    
    function onWalkerSelectLabel(labelName)
    	if (labelName == "ManaCap") then
    		print("Current Manas: " .. Self.ItemCount(268))
    		if (Self.Cap() > MinCap and Self.ItemCount(ManaId) > MinMana) then
    			gotoLabel("Start")
    		end
    	
    	elseif (labelName == "Bank") then
    		local amount = (MaxMana-Self.ItemCount(ManaId))*ManaPrice
    	    delayWalker(2000)
    		setWalkerEnabled(false)
    		Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
    		if (amount > 0) then
    			Self.SayToNpc({"withdraw " .. amount, "yes", "balance"}, 65)
    		end
    		setWalkerEnabled(true)
    	elseif (labelName == "BuyManas") then
    		local manaCount = (MaxMana-Self.ItemCount(ManaId))
    	    delayWalker(2000)
    		setWalkerEnabled(false)
    		Self.SayToNpc({"hi", "vials", "yes", "trade"}, 65)
    		wait(2000, 3700)
    		while (Self.ItemCount(ManaId) < MaxMana) do
    			Self.ShopBuyItem(ManaId, manaCount)
    			wait(200, 500)
    		end
    	elseif (labelName == "DepositAll") then
    		delayWalker(2000)
    		setWalkerEnabled(false)
    		Self.SayToNpc({"hi", "deposit all", "yes", "balance"}, 65)
    		end
    	end
    end
    This is my first attempt at making a 100% afk script, so I am still learning. I copied a few things from other .lua files(@Infernal Bolt) I had and tried to glue all together, probally messed up somewhere.

    Help would be awsome!

    (I expect it to be an 'end' too much, or too few)

    Tnx
    Last edited by Rhinocort; 08-13-2012 at 08:37 AM.

Posting Permissions

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