XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Problems whit bot cant talk to NPC

  1. #1
    craigmag's Avatar
    Join Date
    Jan 2013
    Location
    Mexico
    Posts
    54
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Problems whit bot cant talk to NPC

    Yesterday I put 2 scripts and none of the two work and do not speak with the NPC only stop at the store or at the bank and move and goes to lvl with no pot

    I Load the settings and the scripts.... Plz Helpme i have windows 7

  2. #2

    Join Date
    Jan 2013
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same here. I've followed all instructions that I've seen myself.

    Anyone that can lend us a helping hand in the matter please?

  3. #3
    strumpaa's Avatar
    Join Date
    May 2012
    Location
    Sweden
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well look into other scripts ".lua" files and maby you learn something. Ive been doing scripts all on my own but learned it from other script makers

  4. #4
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    please paste your script so we can see it or we cannot help you.
    Bought 193 RP from theefidyzed

    view my All Paladin Project.


  5. #5
    craigmag's Avatar
    Join Date
    Jan 2013
    Location
    Mexico
    Posts
    54
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    [code=lua]---------------------------------
    -----Yalahar Mutated Humans------
    ----By Xiaospike & Joshwa534-----
    ------------Enjoy!!!-------------
    ---------------------------------

    --------- BP SETUP ----------
    -- [BP 1] - Main Backpack
    -- [BP 2] - Loot & Products Backpack
    -- [BP 3] - Gold Backpack (Cascaded)

    --------- DP SETUP ----------
    local RAREDP = 0
    local STACKDP = 1

    ------ REFILL SETTINGS ------
    local ManaID = 268 --- Which mana potions are you using?
    local MinMana = 150 --- How many mana potions until you leave the hunt.
    local MaxMana = 400 --- How many mana potions you begin the hunt with.
    local ManaPrice = 50 --- What is the price of your selected mana potions?

    local HealthID = 266 --- Which health potions are you using?
    local MinHealth = 10 --- How many health potions until you leave the hunt.
    local MaxHealth = 50 --- How many health potions you begin the hunt with.
    local HealthPrice = 100 --- What is the price of your selected mana potions?

    local MinCap = 50 --- Leaves spawn when character reaches this cap.

    ----- LOCATION SETTINGS -----
    local Mountain = true --- Do you want to hunt the moutain?
    local StayMountain = true --- Do you want to stay on the mountain?


    --------------------------------------------------------------------
    --------------------------------------------------------------------
    --------------------------------------------------------------------
    -------------------- DO NOT TOUCH THIS CODE ------------------------
    ---------------------- IF YOU DO NOT KNOW --------------------------
    ---------------------- WHAT YOU ARE DOING --------------------------
    --------------------------------------------------------------------
    --------------------------------------------------------------------
    --------------------------------------------------------------------

    registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

    print([[
    Yalahar Mutated Humans by Xiaospike & Joshwa534]])
    wait(5000)

    function onWalkerSelectLabel(labelName)

    if (labelName == "Checker") then
    setWalkerEnabled(false)
    if (Self.ItemCount(ManaID) <= MinMana) or (Self.Cap() < MinCap) or (Self.ItemCount(HealthID) <= MinHealth) then
    gotoLabel("Leave")
    else
    gotoLabel("keepHunting")
    end
    setWalkerEnabled(true)

    elseif (labelName == "Checker1") then
    setWalkerEnabled(false)
    if (Self.ItemCount(ManaID) <= MinMana) or (Self.Cap() < MinCap) or (Self.ItemCount(HealthID) <= MinHealth) then
    gotoLabel("Leave")
    else
    gotoLabel("keepHunting1")
    end
    setWalkerEnabled(true)

    elseif (labelName == "Checker2") then
    setWalkerEnabled(false)
    if (Self.ItemCount(ManaID) <= MinMana) or (Self.Cap() < MinCap) or (Self.ItemCount(HealthID) <= MinHealth) then
    gotoLabel("Leave")
    else
    gotoLabel("keepHunting2")
    end
    setWalkerEnabled(true)

    elseif (labelName == "CheckMountain") then
    setWalkerEnabled(false)
    if (Mountain) then
    gotoLabel("HuntMountain")
    else
    gotoLabel("SkipMountain")
    end
    setWalkerEnabled(true)

    elseif (labelName == "StayMountain") then
    setWalkerEnabled(false)
    if (StayMountain) and (Self.ItemCount(ManaID) > MinMana) and (Self.Cap() > MinCap) and (Self.ItemCount(HealthID) > MinHealth) then
    gotoLabel("StayMountain2")
    else
    gotoLabel("LeaveMountain")
    end
    setWalkerEnabled(true)

    elseif (labelName == "checkstuff") then
    local ESTMana = (MaxMana-20)
    setWalkerEnabled(false)
    if (Self.ItemCount(ManaID) < ESTMana) or (Self.ItemCount(HealthID) < MaxHealth) then
    gotoLabel("resupply")
    else
    gotoLabel("ToHunt")
    end
    setWalkerEnabled(true)

    elseif (labelName == "bank") then
    local withdrawManas = (MaxMana-(Self.ItemCount(ManaID)-5))*ManaPrice
    local withdrawHealths = (MaxHealth-Self.ItemCount(HealthID))*HealthPrice
    setWalkerEnabled(false)
    Self.SayToNpc({"hi", "deposit all", "yes"}, 65)
    if (withdrawManas > 0) then
    Self.SayToNpc({"withdraw " .. withdrawManas, "yes"}, 65)
    end
    if (withdrawHealths > 0) then
    Self.SayToNpc({"withdraw " .. withdrawHealths, "yes",}, 65)
    end
    Self.SayToNpc({"balance"}, 65)
    setWalkerEnabled(true)
    wait(2000)

    elseif (labelName == "deposit") then
    setWalkerEnabled(false)
    Self.ReachDepot()
    Self.DepositItems({7386, RAREDP}, {8072, RAREDP}, {3428, RAREDP})
    Self.DepositItems({9053, STACKDP},{10308, STACKDP},{9054, STACKDP},{9055, STACKDP}, {9668, STACKDP}, {3033, STACKDP}, {5894, STACKDP}, {9662, STACKDP})
    setWalkerEnabled(true)

    elseif (labelName == "SellFlasks") then
    setWalkerEnabled(false)
    Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "trade"}, 65)
    wait(2000)
    setWalkerEnabled(true)

    elseif (labelName == "potions") then
    setWalkerEnabled(false)
    if (Self.ItemCount(ManaID) < MaxMana) or (Self.ItemCount(HealthID) < MaxHealth) then
    Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
    wait(2000)
    if (Self.ItemCount(ManaID) < MaxMana) then
    buyItems(ManaID, MaxMana)
    wait(500)
    end
    if (Self.ItemCount(HealthID) < MaxHealth) then
    buyItems(HealthID, MaxHealth)
    wait(500)
    end
    wait(200, 500)
    end
    setWalkerEnabled(true)

    elseif (labelName == "resetbp") then
    setBotEnabled(false)
    resetBackpacks(1)
    setBotEnabled(true)
    end
    end


    ----------------------- Functions ----------------------
    function sellItems(item) -- item = item ID
    wait(300, 1700)
    Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
    wait(900, 1200)
    end

    function buyItems(item, count) -- item = item id, count = how many you want to buy up to
    wait(900, 1200)
    if (Self.ItemCount(item) < count) then
    Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
    wait(200, 500)
    end
    end

    function resetBackpacks(reset)
    setWalkerEnabled(false)
    local open = {} -- Create a table to hold backpack list
    local close = {}
    local indexes = Container.GetIndexes() -- Get ids of open backpacks.
    if reset then
    if reset > 0 and reset < #indexes then
    for i = (#indexes-reset)+1, #indexes do
    table.insert(open, indexes[i])
    end
    else
    for i = 2, #indexes do -- If 'reset' is above the number of open backpacks we should reset all.
    table.insert(open, indexes[i])
    end
    end
    else
    for i = 2, #indexes do -- If 'reset' is nil (empty argument) we should reset all backpacks.
    table.insert(open, indexes[i])
    end
    end
    local tries = 3 -- Give the script 3 tries to achieve a successful reset.
    repeat
    if reset then
    if reset > 0 and reset < #indexes then
    closeBackpacks(unpack(open)) -- Close selected backpacks
    else
    Self.CloseContainers() -- Close all backpacks.
    end
    else
    Self.CloseContainers() -- Close all backpacks
    end
    wait(600, 800) -- wait a little while
    local reopen = openBackpacks(unpack(open)) -- I store the return from openBackpacks, true if successfull, false otherwise
    if tries == 0 then -- Check how many tries the function has left
    print("BackpackReset failed!") -- Tell the user that reset has failed
    return false
    end
    tries = tries - 1 -- One try has been spent
    wait(100,200)
    until reopen -- If reopen is true it means all backpacks were opened successfully and function is done
    setWalkerEnabled(true)
    return true
    end

    function closeBackpacks(...)
    local backpacks = {...}
    local indexes = Container.GetIndexes()
    if #backpacks > 0 then
    for i = #backpacks, 1, -1 do
    if type(backpacks[i]) == "string" then
    tmpBP = Container.GetByName(backpacks[i])
    elseif backpacks[i] < 18 then
    tmpBP = Container.GetFromIndex(backpacks[i])
    else
    tmpBP = Container.GetByName(Item.GetName(backpacks[i]))
    end
    tmpBP:Close()
    wait(200, 500)
    end
    else
    Self.CloseContainers()
    end
    end

    function openBackpacks(...)
    local backpacks = {...} -- List of backpacks to open.
    local open = Container.GetIndexes() -- List of already open backpacks.
    local main = Container.GetFirst() -- First open container is assumed to be main backpack (will be 0 if no container is open).
    local toOpen = #backpacks -- Number of backpacks we need to open (used to check success).
    local defaultOpen = {} -- A place to store the backpacks to open by container:OpenChildren(), if any.
    local bps = {} -- A place to store the backpacks to open by container:UseItem(), if any. Why not always use :OpenChildren()? This way I can open bps by their relative position instead of id, so you don't have to worry about colours anymore.
    if main:ID() == 0 then -- If no backpack is open, we need to open main.
    if backpacks[1] ~= Self.Backpack().id then
    toOpen = toOpen + 1
    end
    repeat -- Open main backpack.
    wait(200, 600)
    until Self.UseItemFromEquipment("backpack") > 0
    wait(500)
    main = Container.GetFirst()
    end
    for i = 1, #backpacks do
    if type(backpacks[i]) == "table" then
    if backpacks[i][1] > 16 then
    if backpacks[i][2] ~= main:Index() then
    main = Container.GetFromIndex(backpacks[i][2])
    for spot = 0, main:ItemCount()-1 do
    local item = main:GetItemData(spot)
    if Item.isContainer(item.id) then
    table.insert(bps, spot)
    end
    end
    main:UseItem(bps[backpacks[i][1]])
    wait(500, 900)
    end
    elseif backpacks[i][1] ~= main:ID() then
    main = Container.GetFromIndex(backpacks[i][2])
    main:OpenChildren(backpacks[i][1])
    wait(500, 900)
    end
    elseif backpacks[i] < 16 then
    if i == 1 then
    for spot = 0, main:ItemCount()-1 do
    local item = main:GetItemData(spot)
    if Item.isContainer(item.id) then
    table.insert(bps, spot)
    end
    end
    for _, num in ipairs(backpacks) do
    main:UseItem(bps[num])
    wait(500, 900)
    end
    break
    end
    elseif backpacks[i] ~= main:ID() then
    table.insert(defaultOpen, backpacks[i])
    end
    end
    if #defaultOpen > 0 then
    main:OpenChildren(unpack(defaultOpen))
    end
    wait(400)
    if #open + toOpen == #Container.GetIndexes() then
    return true
    end
    return false
    end

    function getOpenBackpacks()
    local indexes = Container.GetIndexes() -- Find index for all open backpacks
    local open = {} -- Create a place to store our open backpacks
    for i = 1, #indexes do -- Search all open backpacks
    tmpBP = Container.GetFromIndex(indexes[i])
    table.insert(open, tmpBP:ID()) -- Store this backpack
    end
    return open -- Return found backpacks
    end

    Self.ReachDepot = function (tries)
    local tries = tries or 3
    setWalkerEnabled(false)
    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
    setWalkerEnabled(true)
    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
    [/code]




    [THIS IS THE SCRIPT]
    Last edited by Spectrus; 01-18-2013 at 12:38 AM. Reason: Wrapped in [code] tags.

  6. #6
    craigmag's Avatar
    Join Date
    Jan 2013
    Location
    Mexico
    Posts
    54
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    @Messed Around Plz help me

  7. #7
    Banned
    Join Date
    Jan 2013
    Posts
    386
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by craigmag View Post
    @Messed Around Plz help me
    Noone will, this community is to greedy to help others.. there is no step by step tutorial over how you make etc refiller... the only tutorial there is how you make waypoints, like it's that hard... You probably gonna wait a year for a respons, i've made a thread and when it got to the tricky part noone answer.
    Last edited by Xparn; 01-22-2013 at 09:24 AM.

  8. #8
    Senior Member
    Join Date
    Dec 2011
    Posts
    718
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Xparn View Post
    Noone will, this community is to greedy to help others.. there is no step by step tutorial over how you make etc refiller... the only tutorial there is how you make waypoints, like it's that hard... You probably gonna wait a year for a respons, i've made a thread and when it got to the tricky part noone answer.
    this community is not to greedy, he has just not taken into count to try and ask the makers of the script in their forum post on how to fix this issue.
    Bought 193 RP from theefidyzed

    view my All Paladin Project.


  9. #9
    Super Moderator Infernal Bolt's Avatar
    Join Date
    Dec 2011
    Location
    Skellefteċ, Sweden
    Posts
    2,880
    Mentioned
    217 Post(s)
    Tagged
    2 Thread(s)
    He was trying to execute the settings file after the script file which caused the setting file to turn off the script leading to not speaking with npcs.

  10. #10
    Banned
    Join Date
    Jan 2013
    Posts
    386
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by desche188 View Post
    this community is not to greedy, he has just not taken into count to try and ask the makers of the script in their forum post on how to fix this issue.
    So he can't ask for help in the help board? That's the reason why he shouldn't get any help ?

    I guess you are a experienced xenobot user, help me on this thread http://forums.xenobot.net/showthread...ith-LUA-config!

    If you could by any chance help me, please do it. Prove that people could actually help even if it's a tricky one.

Tags for this Thread

Posting Permissions

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