XenoBot Forums - Powered by vBulletin

User Tag List

Page 20 of 36 FirstFirst ... 10181920212230 ... LastLast
Results 191 to 200 of 353

Thread: [Update] XenoBot Apophis v14.7.6.656 [10.50 & Apophis Global Release]

  1. #191
    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 lonatic View Post
    Hey guys since the update my backpackreset on scripts stopped working. any idea how i can fix this ?
    Show us the code.

  2. #192

    Join Date
    May 2014
    Posts
    80
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Sorry not sure how to fit it in coding hope this is what you need


    lua code:

    elseif (labelName == "ResetBps") then
    delayWalker(2000)
    setWalkerEnabled(false)
    Container.Close(goldBP)
    sleep(math.random(500, 1000))
    Container.GetFirst():OpenChildren(goldBP)
    sleep(math.random(500, 1000))
    setWalkerEnabled(true)

    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

    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
    Last edited by jo3bingham; 07-09-2014 at 12:08 AM.

  3. #193
    Moderator Nakuu's Avatar
    Join Date
    Feb 2013
    Location
    EU
    Posts
    5,194
    Mentioned
    642 Post(s)
    Tagged
    2 Thread(s)
    @lonatic
    Just try replacing this line:
    lua code:
    Container.GetFirst():OpenChildren(goldBP) 

    with:
    lua code:
    Self.OpenMainBackpack(true):OpenChildren({goldBP,true})

  4. #194
    Senior Member ppgab's Avatar
    Join Date
    Mar 2014
    Location
    Brazil
    Posts
    986
    Mentioned
    86 Post(s)
    Tagged
    0 Thread(s)
    lol that bp resetter tho >.<

  5. #195

    Join Date
    May 2014
    Posts
    80
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    That closed my backpacks, Disabled walker. Didnt re open any and enable walker again :/

  6. #196

    Join Date
    May 2014
    Posts
    80
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Nakuu View Post
    @lonatic
    Just try replacing this line:
    lua code:
    Container.GetFirst():OpenChildren(goldBP) 

    with:
    lua code:
    Self.OpenMainBackpack(true):OpenChildren({goldBP,true})
    Only closed my bps and disabled walker :/



    Nevermind its working now. Thanks alot

  7. #197
    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 lonatic View Post
    That closed my backpacks, Disabled walker. Didnt re open any and enable walker again :/
    Then something is missing in the code you posted, it's really messy. Contacting the guy who made the script would be best.

  8. #198
    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 Syntax View Post
    You have it backwards.
    The code shouldn't have worked very well at all on multiple lines, you're depositing into backpacks that have already been dug down into. That should be a clear sign that something is wrong.

    When the deposit function was first released everyone (mostly) used it properly. For some reason, now, it's being called multiple times in everyone's script. Anyways, Nick will fix the issue by adding a delay and closing the depot and depot backpacks.

    I do recommend you fix your scripts though. You can span the table across multiple lines and tab properly if you wish to distinguish the items, it's cleaner than multiple functions.

    lua code:
    Self.DepositItems(
    -- First Depot Backpack
    {7427, 0},
    {21175, 0},
    {3318, 0},
    {21174, 0},
    {3381, 0},
    -- Second Depot Backpack
    {21200, 1},
    {7443, 1},
    {5911, 1},
    {21201, 1},
    {5912, 1}
    )
    Changed it as you told - to call it only once - and it didn't deposit my rare items at all, dunno if it's any better sadly

    Deposited (stackable) items to first backpack in depo just fine (it had to go deeper into cascaded backpacks) then re-opened browse field (to open second backpack in depot) and got stuck here (as you can see on the screenshot) trying to do some crazy shit, eventually stopped trying and ran away.
    Here is the screenshot: http://i.imgur.com/Y1fdQl3.png
    Last edited by Nakuu; 07-08-2014 at 11:38 PM.

  9. #199

    Join Date
    Feb 2012
    Location
    Poland
    Posts
    400
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DarkstaR View Post
    I'll fix it to close the depot and sleep a bit after deposit, but it is probably better to fix the scripts.
    well, i think it should get count of containers opened before it starts to depositing. I am looting items to 6 different bps and when its going to depositer browse field window is 7th and loot bp 8th. When bot deposit items to one bp then its trying to open browse field again and its getting closed and open again. Then loot bp is moving to 7th spot and its trying to deposit items already deposited from 7th backpack. Its staying really long next to depot and finnaly when its leaving its not depositing items which bot should put to other bps. Items which should be deposited to first backpack are deposited fine, and then its moving items in this first bp on and on and not depositing anything else.

    Edit: It works same way with one function or multiple functions, same problem.
    Last edited by kubax36; 07-08-2014 at 11:43 PM.

  10. #200

    Join Date
    Dec 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please ADD link download 10.50 preview

Posting Permissions

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