XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 5 of 5

Thread: how to make it work with lever when it right or left? ( right : 2773 ) ( left : 2772)

  1. #1
    Yamo's Avatar
    Join Date
    Feb 2013
    Location
    My PC
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to make it work with lever when it right or left? ( right : 2773 ) ( left : 2772)

    Code:
    --[[--
    
        NAME: HIDDEN BRIMSTONE BUGS FOR KNIGHTS
        AUTHOR: LUKE FISHER
        CREATE DATE: 28.05.2012
        
        CURRENT VERSION: 1.1
        UPDATE DATE: 05.06.2012
    
    --]]--
    --Settings---------------------------------------
    PotID = 268 --- mana potion ID
    MinPots = 120 ---- if less then script will exit spawn
    PotCost = 50 ---- cost of mana potion
    Pots = 800 ----- amount of mana potions to refill
    hPotID = 7643 --- health potion ID
    hPotCost = 320 ---- cost of health potion
    hPots = 60 ----- amount to refill
    MinCap = 150 ---- if less then script will exit spawn
    --END OF SETTINGS--------------------------------
    --- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
    dofile("Forgee.lua")
    function SellVials()
    		Self.SayToNpc("hi")
            sleep(math.random(2000, 3000))
    		Self.SayToNpc("flask")
    		sleep(math.random(2000, 3000))
            if ((Self.ItemCount(283)+Self.ItemCount(284)+Self.ItemCount(285)) > 0) then
                    repeat
                         Self.SayToNpc("yes")
    					 sleep(math.random(2000, 3000))  
                    until ((Self.ItemCount(283)+Self.ItemCount(284)+Self.ItemCount(285)) == 0)
            end
    		sleep(math.random(2000, 3000))
    		Self.SayToNpc("bye")
    end
    Self.ReachNpc = function(name, tries)
            local npc = Creature.GetByName(name)
            if (npc:DistanceFromSelf() > 3) then
                    tries =  tries or 15
                    repeat
                            local npos = npc:Position()
                            Self.UseItemFromGround(npos.x, npos.y, npos.z)
                            wait(1500,2000)
                            tries = tries - 1
                    until (npc:DistanceFromSelf() <= 3) or (tries == 0)
            end
    end  
    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 
    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
    function onWalkerSelectLabel(labelName)
    	  if (labelName == "check") then
                delayWalker(1000)
                setWalkerEnabled(false)
                if (Self.ItemCount(PotID) <= MinPots) or (Self.Cap() < MinCap) then
                    setWalkerEnabled(true)
                    gotoLabel("Refill")
                else
                    setWalkerEnabled(true)
                    gotoLabel("KeepHunting")
                end
            sleep(math.random(100,5000))
    	elseif (labelName == "Target&Loot") then
    		setLooterEnabled(true) 
    		setTargetingEnabled(true)
    	elseif (labelName == "targetoff") then
    		setTargetingEnabled(false)
    		setLooterEnabled(false) 
    	elseif (labelName == "targeton") then
    		setLooterEnabled(true) 
    		setTargetingEnabled(true)
    	elseif (labelName == "deposit gold") then
    		setWalkerEnabled(false)
    		NpcConv("hi","deposit all","yes","balance")
    		wait(15000,19000)
    		setWalkerEnabled(true)
    	elseif (labelName == "BankCheck") and (Self.ItemCount(3031) > 0) then
    		gotoLabel("Shopping Time")
    	elseif (labelName == "Deposit Items") then
    		setWalkerEnabled(false)
    		local dprandomise = (math.random(1,2))
    			if ((dprandomise) ~=1) then
    				Self.DepositItems(5904, 11702, 3032, 11703, {10305, 1}, {10315, 1}, {9640, 2}, {3055, 3}, {3049, 3})
    				wait(1500,1900)
    				setWalkerEnabled(true)
    			else
    				Self.DepositItems({3049, 3}, {3055, 3}, {9640, 2}, {10315, 1}, {10305, 1}, 11703, 3032, 11702, 5904)
    				wait(1500,1900)
    				setWalkerEnabled(true)
    			end
    	elseif (labelName == "poxcheck") then
    		setWalkerEnabled(false)
    			if (Self.ItemCount(9640) > 0) then
    				gotoLabel("dp2")
    				setWalkerEnabled(true)
    			else
    				gotoLabel("ToSpawn")
    				setWalkerEnabled(true)
    			end
    	elseif (labelName == "poxcheck2") then
    		setWalkerEnabled(false)
    			if (Self.ItemCount(9640) > 0) then
    				gotoLabel("dp1")
    				setWalkerEnabled(true)
    			else
    				gotoLabel("ToSpawn")
    				setWalkerEnabled(true)
    			end
    	elseif (labelName == "ResetBP") then
    		setWalkerEnabled(false)
    		resetBackpacks()
    		wait(1500,1900)
    		setWalkerEnabled(true)
    	elseif (labelName == "Withdraw") then
    		setWalkerEnabled(false)
    		Self.SayToNpc("hi")
            sleep(math.random(2400, 3000))
    	local moneytoget1 = (Pots-Self.ItemCount(PotID))*PotCost
    	local moneytoget2 = (hPots-Self.ItemCount(hPotID))*hPotCost
    	local softcost = Self.ItemCount(6530)*10500
    	local moneytoget = moneytoget1+softcost+moneytoget2
    	local moneytogetfin = (math.ceil((moneytoget/1000)))*1000
    		sleep(math.random(5000, 7000))
    			repeat
    				Self.SayToNpc("withdraw " .. moneytogetfin)
    				sleep(math.random(2400, 3000))
    				Self.SayToNpc("Yes")
    				sleep(math.random(2400, 3000))
    			until ((Self.ItemCount(3031) + (Self.ItemCount(3035) * 100) + (Self.ItemCount(3043) * 10000)) >= moneytogetfin)
    		Self.SayToNpc("bye")
    		sleep(math.random(2400, 3000))
    		setWalkerEnabled(true)
    	elseif (labelName == "buypots") then
    		setWalkerEnabled(false)
    		Self.SayToNpc("hi")
            sleep(math.random(2000, 3000))
    		Self.SayToNpc("trade")
            sleep(math.random(2400, 3000))
    		Self.BuyItemsUpTo(PotID, Pots)
    		sleep(math.random(9400, 12000))
    		Self.BuyItemsUpTo(hPotID, hPots)
    		sleep(math.random(3400, 4800))
    		Self.SayToNpc("bye")
    		setWalkerEnabled(true)
    	elseif (labelName == "flask") then
    		setWalkerEnabled(false)
    		SellVials()
    		setWalkerEnabled(true)
    	elseif (labelName == "potcheck") and (Self.ItemCount(PotID) < (Pots-20)) then
    		gotoLabel("Shopping Time")
    	elseif (labelName == "DoorEast") then
            setWalkerEnabled(false)
            wait(500)
            Self.OpenDoor(Self.Position().x + 1, Self.Position().y, Self.Position().z)
            setWalkerEnabled(true)  
    	elseif (labelName == "DoorWest") then
            setWalkerEnabled(false)
            wait(500)
            Self.OpenDoor(Self.Position().x - 1, Self.Position().y, Self.Position().z)
            setWalkerEnabled(true) 
    	elseif (labelName == "DoorSouth") then
            setWalkerEnabled(false)
            wait(500)
            Self.OpenDoor(Self.Position().x, Self.Position().y + 1, Self.Position().z)
            setWalkerEnabled(true)
    	elseif (labelName == "DoorNorth") then
            setWalkerEnabled(false)
            wait(500)
            Self.OpenDoor(Self.Position().x, Self.Position().y - 1, Self.Position().z)
            setWalkerEnabled(true)
    	elseif (labelName == "ExaniUP") then
            setWalkerEnabled(false)
    		wait(500)
            Self.Say("exani hur up")
    		sleep(math.random(700, 1400))
            setWalkerEnabled(true)
    	elseif (labelName == "ExaniDOWN") then
            setWalkerEnabled(false)
    		wait(500)
            Self.Say("exani hur down")
    		sleep(math.random(700, 1400))
            setWalkerEnabled(true)
    	elseif (labelName == "LeverEast") then
            setWalkerEnabled(false)
            wait(500)
            Self.UseLever(Self.Position().x + 1, Self.Position().y, Self.Position().z, 2773)
    		setWalkerEnabled(true)
     end
    end
    how to make it work with lever when it right or left? ( right : 2773 ) ( left : 2772)

  2. #2
    Retired Staff Member HolmaN's Avatar
    Join Date
    Dec 2010
    Location
    Göteborg, Sweden.
    Posts
    3,149
    Mentioned
    164 Post(s)
    Tagged
    0 Thread(s)
    @Infernal Bolt perhaps? =)

  3. #3
    Yamo's Avatar
    Join Date
    Feb 2013
    Location
    My PC
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    he is offline now

  4. #4
    Senior Member Neant's Avatar
    Join Date
    Jun 2012
    Location
    Stockholm, Sweden
    Posts
    1,848
    Mentioned
    50 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by yamo148 View Post
    he is offline now
    Had you given a proper description I woulda fixed it for you. I'll try and help you as much as I can though:

    Code:
        
    elseif (labelName == "label") then
    local item = Map.GetTopUseItem(x, y, z) 
    if (item.id == (ID of either left/right)) then  
    Self.UseItemFromGround(x, y, z)
    wait(500, 1000)
    Self.UseItemFromGround(x, y, z)
    else
    Self.UseItemFromGround(x, y, z)
    wait(500, 1000)
    Self.UseItemFromGround(x, y, z)
    Remove one of the "Self.UseItemFromGround(x, y, z)" depending on if you want it turned to the right or the left.

    Code:
    Right: 2773
    Left: 2772

  5. #5
    Yamo's Avatar
    Join Date
    Feb 2013
    Location
    My PC
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all , i fixed it .. i added more labels with the other ID to can work

    Thanks For 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
  •