XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 10 of 16

Thread: Some help would be appreciated.

Threaded View

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

    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, The script is almost complete. The only thing that is missing is a way for the bot to pick a depot on its own. But I have been searching and it seems that is not possible, am I correct?

    I guess I can paste the script here...

    I just it is all that bad, since some people here seems to have a problem with people that havent been scripting for more then a total of 10 hours...

    Well, here it goes.

    Code:
    -- [RP, Yalahar, Cemetery, (Zombie, Nightstalker, Lich) 60+ by DjimmaJIm]  --
    
    
    local chkcap = 70 					-- Deposit on cap.
    local chkmanas = 40 					-- Manas to deposit on.
    local random = 0						-- Amount to fill out amount < 0.
    
    
    local bpspears = 25					-- Amount of spears to bring to hunt.
    local spearID = 7378					-- The type of spear to hunt with.
    local spearprice = 15					-- The price of the spears in use.
    
    local bpmanas = 100					-- The amount of manas you want to buy (your amount in backpack)
    local mpID = 237						-- The type of Mana Potion in use.
    local manaprice = 80					-- Price of Strong Mana Potion.
    
    
    local goldbp = 2871					-- ID Gold Backpack (Golden BP ID)
    local rarebp = 5949					-- ID Rare Backpack (Pirate BP ID)
    local stackbp = 2872					-- ID Stack Backpack (Como BP ID)
    
    local dpstack = 0 						-- stack itmes deposited in dp
    local dprare = 1						-- rare items deposited in dp
    
    
    
    
    
    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
    
    
    
     function NpcConv(...)
         for _, str in ipairs(arg) do
             wait((tostring(str):len() / 125) * 60000 * math.random(1.1, 1.8))
             Self.SayToNpc(str)
         end
     end
    
     dofile("Forgee.lua")
    function onWalkerSelectLabel(labelName)
    	if
    			(labelName == "capcheck") then
    			delayWalker(1000)
    			setWalkerEnabled(false)
    		if
    				(Self.Cap() <= chkcap)
    				or
    				(Self.ItemCount(spearID) <= 7)
    				or
    				(Self.ItemCount(mpID) <= 15)
    				then -- check Cap, Royal Spears, Strong Manas
    				setWalkerEnabled(true)
    				gotoLabel("stophunt")
    			else
    				gotoLabel("starthunt")
    				delayWalker(1000)
    				setWalkerEnabled(true)
    			end
    			elseif
    				(labelName == "sellshop") then
    				delayWalker(2000)
    				setWalkerEnabled(false)
    				Self.SayToNpc({"hi", "trade"}, 65)
    				wait(2000, 3700)
    				Self.ShopSellItem(3351, Self.ShopGetItemSaleCount(3351))
    				wait(2000, 3700)
    				Self.SayToNpc({"bye", "hi", "trade"}, 65)
    				wait(2000, 3700)
    				Self.ShopSellItem(3269, Self.ShopGetItemSaleCount(3269))
    				wait(900, 1200)
    				setWalkerEnabled(true)
    			end
    			if
    				(labelName == "atbank") then
    				local withdrawmanas = (bpmanas-Self.ItemCount(mpID))*manaprice -- Shows requested amount of Manas for hunt, counts manas in backpack,.
    				local withdrawspear = (bpspears-Self.ItemCount(spearID))*spearprice -- same as above, but with Spears.
    				local goldamount = (withdrawmanas + withdrawspear) -- Adding the Gold you need to be able to buy the defined amont of Manas and Spears into one variable.
    				delayWalker(9000)
    				Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
    
    			if (true == true) then
    				Self.SayToNpc({"withdraw " .. goldamount, "yes", "balance"}, 65) -- The total amount of gold to withdraw for Manas and Spears.
    			end
    			elseif
    				(labelName == "finddepot") then
    				delayWalker(15000)
    				Self.DepositItems(
    
                   {3055, dprare},  	-- p-ammy
                   {10196, dpstack} 	-- white pearl
    
    			elseif
    				(labelName == "bpopen") then -- Resets the backpack
    				setWalkerEnabled(false)
    				Self.ResetBackpacks()
    				delayWalker(15000)
    				setWalkerEnabled(true)
    			elseif
    				(labelName == "buymanas") then-- The Mana Buyer
    				local manaCount = (bpmanas-Self.ItemCount(mpID))
    				delayWalker(8000)
    				Self.SayToNpc({"hi", "vials", "yes", "trade"}, 65)
    				wait(2000)
    			while
    				(Self.ItemCount(mpID) < bpmanas) do
    				Self.ShopBuyItem(mpID, manaCount)
    				wait(200, 500)
    			end
    			elseif
    				(labelName == "buyspears") then -- The Spear Buyer
    				local spearCount = (bpspears-Self.ItemCount(spearID))
    				delayWalker(8000)
    				Self.SayToNpc({"hi", "trade"}, 65)
    				wait(2000)
    			while
    				(Self.ItemCount(spearID) < bpspears) do
    				Self.ShopBuyItem(spearID, spearCount)
    			wait(200, 500)
    			end
    		end
    end
    I hope it is something that can be of use to someone else.

    Kind Regards,
    DjimmaJIm
    Last edited by DjimmaJIm; 08-03-2012 at 11:05 PM.

Posting Permissions

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