XenoBot Forums - Powered by vBulletin

User Tag List

Page 7 of 10 FirstFirst ... 56789 ... LastLast
Results 61 to 70 of 91

Thread: 100% AFK Script Making

  1. #61

    Join Date
    Sep 2013
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Great guide man! One problem I'm getting though is

    Every second or third time on average (Its completely random) When resetting the bps, it will accidentally tries to exit the client.
    So then I get the option come up, do you really want to leave tibia.. And it will stay like that till u press no, but what that does is it means u cant buy manas because the trade window can't come up so he'll just log after 15mins of standing at the mana shop.

    I'm almost 100% sure it happens when resetting the bps, and might be a result of trying to minimize the bps?
    Not sure. Cheers for your guide and any advice would be awesome thanks again

  2. #62
    Moderator Nakuu's Avatar
    Join Date
    Feb 2013
    Location
    EU
    Posts
    5,194
    Mentioned
    642 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Lukeharper View Post
    Great guide man! One problem I'm getting though is

    Every second or third time on average (Its completely random) When resetting the bps, it will accidentally tries to exit the client.
    So then I get the option come up, do you really want to leave tibia.. And it will stay like that till u press no, but what that does is it means u cant buy manas because the trade window can't come up so he'll just log after 15mins of standing at the mana shop.

    I'm almost 100% sure it happens when resetting the bps, and might be a result of trying to minimize the bps?
    Not sure. Cheers for your guide and any advice would be awesome thanks again
    Move the panel with logout, quests etc buttons above the map or open ie. the skills window and put it between that panel and backpacks.

  3. #63

    Join Date
    Sep 2013
    Posts
    15
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Cheers much appreciated

  4. #64
    Coupa's Avatar
    Join Date
    Jul 2014
    Posts
    213
    Mentioned
    37 Post(s)
    Tagged
    0 Thread(s)
    If I wanted to add say...

    elseif (labelName == "BoatNPC") then
    Walker.Stop()
    Self.SayToNpc({"hi", "passage", "yes"}, 100)
    end

    How would I do about doing this?

    Im using notepad++

  5. #65
    XenoBot Scripts Developer Joshwa534's Avatar
    Join Date
    May 2012
    Location
    Texas, USA
    Posts
    4,890
    Mentioned
    517 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Coupa View Post
    If I wanted to add say...

    elseif (labelName == "BoatNPC") then
    Walker.Stop()
    Self.SayToNpc({"hi", "passage", "yes"}, 100)
    end

    How would I do about doing this?

    Im using notepad++
    Exactly as you have it actually, except I would slow down the words per minute, lol.

    lua code:

    if (labelName == 'BoatNPC') then
    Self.SayToNpc({'hi', 'passage', 'yes'}, 45)
    end

  6. #66
    Coupa's Avatar
    Join Date
    Jul 2014
    Posts
    213
    Mentioned
    37 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Joshwa534 View Post
    Exactly as you have it actually, except I would slow down the words per minute, lol.

    lua code:

    if (labelName == 'BoatNPC') then
    Self.SayToNpc({'hi', 'passage', 'yes'}, 45)
    end
    I assume the 100 (or in your case 45) after the Self.SayToNpc? Would you recommend to always use 45 or below?

    Cheers, Coupa.

  7. #67
    Tibiano's Avatar
    Join Date
    Oct 2014
    Location
    Spain
    Posts
    401
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Is it correct if I just deleted all Ammo things and I switch Health word by Rune?

    LIKE THIS:

    Code:
    ------ REFILL SETTINGS ------
    local LeaveMana = 50 --- How many mana potions until you leave the hunt?
    local BuyMana = 120 --- How many mana potions you begin the hunt with?
    
    local LeaveRune = 150 --- How many SD until you leave the hunt?
    local BuyRune = 500 --- How many SD you begin the hunt with?
    
    
    local LeaveCap = 100 --- Leaves spawn when character reaches this cap.
    local HideEquipment = false --- Do you want to minimize your equipment?
    local LogoutStamina = false --- Do you want to logout at 16 hours? (Inside the depot)
    
    -- Item ID's, if you don't want to use SHP and SMP, change these:
    
    local ManaName = "Great Mana Potion" 
    local ManaCost = 120
    local RuneName = "Sudden Death Rune" 
    local RuneCost = 108
    
    -- Backpack Configuration:
    
    local LootBP = "Fur Backpack"
    local GoldBP = "Jewelled Backpack"
    
    -- Spawn Options
    
    local HuntMiddle = false
    
    -- Here I'm gonna get the item ids, leave this as it is.
    
    local ManaID = Item.GetID(ManaName)
    local RuneID = Item.GetID(RuneName)
    
    -- These are the flask IDs, not worth changing since it will sell all flasks regardless of type.
    local FlaskID = 283
    local FlaskIDA = 284
    local FlaskIDB = 285
    
    -- local GoldBP = 5801 --- Item ID of your gold backpack.
    
    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
    
    function onWalkerSelectLabel(labelName)
    	if (labelName == "Checker") then
    		-- Check Supplies, Hunt or Leave
    		Walker.ConditionalGoto((Self.ItemCount(ManaID) <= LeaveMana) or (Self.Cap() < LeaveCap) or (Self.ItemCount(RuneID) <= LeaveRune), "Leave", "BeginHunt")
    
    	elseif (labelName == "Start") then
    		Walker.ConditionalGoto((Self.Position().z == 11), "BeginHunt", "ReachDepot")
    	
    	elseif (labelName == "DepositGold") then
    		-- Deposit Gold, check balance.
    		Walker.Stop()
    		Self.SayToNpc({"hi", "deposit all", "yes"}, 100)
    
    		local withdrawManas = math.max(BuyMana - Self.ItemCount(ManaID), 0)*ManaCost
    		local withdrawRunes = math.max(BuyRune - Self.ItemCount(RuneID), 0)*RuneCost
    		local total = math.abs(withdrawManas + withdrawRunes)
    
    		if total >= 1 then
    			Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
    		end
    		Walker.Start()
    
    	elseif (labelName == "DepositItems") then
    		-- Deposit Items
    		Walker.Stop()
    		Self.ReachDepot(5)
    		Self.DepositItems({5882, 1}, {3028, 1}, {3029, 1}, {5948, 1}, {11457, 1}, {5920, 1}, {5877, 1}, {3061, 1})
    		Self.DepositItems({3386, 0}, {3392, 0}, {7402, 0}, {7399, 0}, {3428, 0}, {3416, 0}, {3280, 0}, {3071, 0}, {7430, 0}, {3322, 0})
    		Walker.Start()
    
    	elseif (labelName == "BuyManas") then
    		-- Buy Mana Potions
    		Walker.Stop()
    		if (Self.ItemCount(ManaID) < BuyMana) or (Self.ItemCount(RuneID) < BuyRune) then
    			print("Buying manas or Runes")
    			Self.SayToNpc({"hi", "flasks"}, 100)
    			while (Self.ItemCount(FlaskID) >= 1) or (Self.ItemCount(FlaskIDA) >= 1) or (Self.ItemCount(FlaskIDB) >= 1) do
    				Self.SayToNpc("yes", 100)
    			end
    			wait(2000)
    			Self.SayToNpc("trade", 100)
    			wait(2000)
    			while (Self.ItemCount(ManaID) < BuyMana) do
    				Self.ShopBuyItemsUpTo(ManaID, BuyMana)
    				wait(500,800)
    			end
    			if (Self.ItemCount(RuneID) < BuyRune) then
    				Self.ShopBuyItemsUpTo(RuneID, BuyRune)
    				wait(500)
    			end
    			wait(200, 500)
    		end
    		Walker.Start()
    
    	elseif (labelName == "CheckGoneUp") then
    		-- Check we're on floor 3
    		Walker.ConditionalGoto((Self.Position().z == 7), "OpenSouth", "Leave")
    
    	elseif (labelName == "CheckGoneDown") then
    		-- Check we're on floor 7
    		Walker.ConditionalGoto((Self.Position().z == 11), "AmDown", "EnterResp")
    
    	elseif (labelName == "ResetBps") then
    		-- Reset Backpacks
    		Walker.Stop()
    		Self.CloseContainers()
    		Self.OpenMainBackpack(true):OpenChildren({LootBP, true}, {GoldBP, true})
    		Container.GetFirst():Minimize()
    		Walker.Start()
    	end
    end
    
    Self.ReachDepot = function (tries)
    	local tries = tries or 3
    	Walker.Stop()
    	local DepotIDs = {3497, 3498, 3499, 3500}
    	local DepotPos = {}
    	for i = 1, #DepotIDs do
    		local dps = Map.GetUseItems(DepotIDs[i])
    		for j = 1, #dps do
    			table.insert(DepotPos, dps[j])
    		end
    	end
    	local function gotoDepot()
    		local pos = Self.Position()
    		print("Depots found: " .. tostring(#DepotPos))
    		for i = 1, #DepotPos do
    			location = DepotPos[i]
    			Self.UseItemFromGround(location.x, location.y, location.z)
    			wait(1000, 2000)
    			if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
    				wait(5000, 6000)
    				if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
    					Walker.Start()
    					return true
    				end
    			else
    				print("Something is blocking the path. Trying next depot.")
    			end
    		end
    		return false
    	end
    	
    	repeat
    		reachedDP = gotoDepot()
    		if reachedDP then
    			return true
    		end
    		tries = tries - 1
    		sleep(100)
    		print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
    	until tries <= 0
    
    	return false
    end
    
    Map.GetUseItems = function (id)
        if type(id) == "string" then
            id = Item.GetID(id)
        end
        local pos = Self.Position()
        local store = {}
        for x = -7, 7 do
            for y = -5, 5 do
                if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
                    itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
                    table.insert(store, itemPos)
                end
            end
        end
        return store
    end
    
    
    
    
    
    
    ----------------  DO NOT TOUCH ANYTHING BELOW HERE  ---------------- 
    
    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
    function onWalkerSelectLabel(labelName)
    
    --   ALL "LEVITATE SPELLS" THAT CHARACTER WILL USE   --
    
    if (labelName == "Levitate up") and (Self.Position().x == 33027) and (Self.Position().y == 31551) and (Self.Position().z == 6) then --change to pos where character will stand to say the spell
    delayWalker(1000)
    setWalkerEnabled(false)
    Self.Say("exani hur up")
    wait(500)
    if (Self.Position().z == 5) then -- change to Z where you arrive after levitate, so it checks that u are up
    setWalkerEnabled(true)
    end
    else if (labelName == "Levitate down") and (Self.Position().x == 33008) and (Self.Position().y == 31554) and (Self.Position().z == 4) then --change to pos where character will stand to say the spell
    delayWalker(1500)
    setWalkerEnabled(false)
    Self.Say("exani hur down")
    wait(500)
    if (Self.Position().z == 5) then -- change to Z where you arrive after levitate, so it checks that u are down
    setWalkerEnabled(true)
    end
    --   ALL LEVERS THAT CHARACTER WILL USE   --
    
    elseif (labelName == "LeverE") then
    Self.UseLever(32994, 31547, 4, 2773)
    end
    if (labelName == "LeverEE") then
    Self.UseLever(32994, 31547, 4, 2772)
    end
    if (labelName == "LeverEEE") then
    Self.UseLever(33062, 31527, 10, 2773)
    end
    if (labelName == "LeverEEEE") then
    Self.UseLever(33062, 31527, 10, 2772)
    end
    if (labelName == "LeverX") then
    Self.UseLever(32992, 31539, 4, 2773)
    end
    if (labelName == "LeverXX") then
    Self.UseLever(32992, 31539, 4, 2772)
    end
    
    --   ALL DOORS THAT CHARACTER WILL CHECK/OPEN   --
    
    if (labelName == "OpenDoorE") then
    setWalkerEnabled(false)
    delayWalker(3000)
    Self.OpenDoor(32990, 31547, 4)
    wait(500, 1000)
    setWalkerEnabled(true)
    end
    
    if (labelName == "CheckManaDoor") then
    setWalkerEnabled(false)
    delayWalker(3000)
    Self.OpenDoor(33010, 31537, 10)
    wait(500, 1000)
    setWalkerEnabled(true)
    end
    
    if (labelName == "door") then -- Open door if closed, If opened just keep walking.
    setWalkerEnabled(false)
    delayWalker(2000)
    Self.OpenDoor(33061, 31529, 10)
    wait(500, 1000)
    setWalkerEnabled(true)
    end
    end
    end
    More threads:

    Selling:
    140 ED + 92 MS
    EK +72




    Trading History:

    114 EK + 57 ED Sold to @dambrian
    2 P.Scrolls Sold to @hfuryz
    1 P.Scroll Sold to @aprilwong
    64 RP Sold to @Perik1996
    Avatar Sold to @IronGatey

  8. #68
    wojewodzki12's Avatar
    Join Date
    Mar 2014
    Posts
    123
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)
    Sure ! just try it before, works fine here when i change it :P

  9. #69
    Tibiano's Avatar
    Join Date
    Oct 2014
    Location
    Spain
    Posts
    401
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XtrmJosh View Post
    Did you change the variable name in all places it was used? If there is a chance you missed one, you should search the script to double check. That sounds like the most likely candidate. Is that the entire banking transcript? Does it attempt to withdraw money at all?

    Also, it sounds to me like the banking system on the OT you're using doesn't accept the term "deposit all", in which case you will need to modify the script to cycle through all your gold backpacks and count how much you have, then deposit the whole lot at once. It's all rather tedious, and would take me probably an hour to code up, but right now I simply wouldn't have the time to do so.

    Thanks for the feedback regardless, hope it goes better for you once you follow these steps. Let me know if you have any further problems.
    This bug happens too to me when you dont deposit gold (0 gp on you) so after that even if you need supplys doesnt withdraw anything.

    Here is my post about that error: http://forums.xenobot.net/showthread...esnt-work-good
    More threads:

    Selling:
    140 ED + 92 MS
    EK +72




    Trading History:

    114 EK + 57 ED Sold to @dambrian
    2 P.Scrolls Sold to @hfuryz
    1 P.Scroll Sold to @aprilwong
    64 RP Sold to @Perik1996
    Avatar Sold to @IronGatey

  10. #70
    Senior Member XtrmJosh's Avatar
    Join Date
    Apr 2012
    Location
    Cambridge, England
    Posts
    1,324
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tibiano View Post
    This bug happens too to me when you dont deposit gold (0 gp on you) so after that even if you need supplys doesnt withdraw anything.

    Here is my post about that error: http://forums.xenobot.net/showthread...esnt-work-good
    You'll probably need to add some check:

    lua code:
    if (ItemCount("Gold Coin") == nil) then
    --- do stuff without that comparison
    else
    --- do stuff with that comparison
    end


    Shouldn't be too difficult to implement, given that the error message itself provides all the information you should need
    You cannot fail, so I'm lowering the standard.

Posting Permissions

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