Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26

    Supply List Based Item Withdrawer

    So i just make this action for my friend but seems like many people still have problems with withdrawing so I'm giving it to public
    Let me know if you will find anything wrong.

    The things you need to do to make it work are:
    1. Go to supply tab
    2. Add all needed supplies that you would like to withdraw.
    3. Setup to each of them a category rule value and destination. (if you wish taking item directly to your equipment slot just put it's object string representation like: 'rhand')
    (rules available are UpToCount or DownToCap)

    After doing all mentioned above you can paste the script and setup it's variables which are:
    1. category: category of item from supply list (you can combine multiple categories i.e: 'abc')
    2. depotNumber: as the name says, number of depot from where you're gonna take the stuff


    -- SCRIPT VERSION: 1.0.1

    local category = 'a'
    local depotNumber = 3

    -- DO NOT EDIT ANYTHING BELOW
    local function isDepotBoxOpen(index) -- little workaround.. (depots are still bugged)
    local name, cont = itemname(depotindextoid(index)):lower()
    for i = 15, 0, -1 do
    cont = getcontainer(i)

    if cont.name:lower() == name and cont.isopen then
    return true
    end
    end

    return false
    end

    local depotName = itemname(depotindextoid(depotNumber))
    while not isDepotBoxOpen(depotNumber) do
    if windowcount('depot chest') > 0 then
    openitem(depotName)
    waitping()
    else
    opendepot(depotNumber)
    waitping()
    end
    end

    local RULE_DOWN_TO_CAP = 2
    local function getAmountNeeded(s)
    local amount = s.uptocount - itemcount(s.id, s.destination)

    if s.rule == RULE_DOWN_TO_CAP then
    amount = math.floor(($cap - s.rulevalue) / s.weight)
    end

    return amount
    end

    local needMoreItems = false
    while true do
    foreach supplyitem s category do
    local amount = getAmountNeeded(s)

    while amount > 0 and itemcount(s.id, depotName) > 0 do
    moveitems(s.id, s.destination, depotName, amount)
    waitping()

    amount = getAmountNeeded(s)
    end

    needMoreItems = amount > 0
    end

    local depotCont = getcontainer(depotName)
    local hasNextPage = depotCont.itemcount >= depotCont.maxcount

    if needMoreItems and hasNextPage then
    nextpage(depotCont.name)
    waitping()
    else
    break
    end

    waitping()
    end
    Last edited by mistgun; 07-10-2016 at 11:18 AM.

  2. #2
    Free User Elgu's Avatar
    Join Date
    Feb 2015
    Location
    Trade
    Posts
    367
    Reputation
    32
    Rep Power
    19
    good job mate, always helpful!

  3. #3
    Free User
    Join Date
    Feb 2016
    Location
    Poland
    Posts
    56
    Reputation
    10
    Rep Power
    17
    great job! works good but it doesn't works when depot is opened after depositing loot. You have to close the window before or approaches to depo again
    Sorry if my English is incomprehensible. Please correct me, I will know for the future. Five years without any training of language... idioms, phrases, grammar sometimes (jeeeeaa... frequently) makes me problem

  4. #4
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Quote Originally Posted by Vexus View Post
    great job! works good but it doesn't works when depot is opened after depositing loot. You have to close the window before or approaches to depo again
    Thanks for info, should be working now

  5. #5
    Free User
    Join Date
    Feb 2016
    Location
    Poland
    Posts
    56
    Reputation
    10
    Rep Power
    17
    Quote Originally Posted by mistgun View Post
    Thanks for info, should be working now
    working !
    Sorry if my English is incomprehensible. Please correct me, I will know for the future. Five years without any training of language... idioms, phrases, grammar sometimes (jeeeeaa... frequently) makes me problem

  6. #6
    Free User
    Join Date
    May 2015
    Posts
    1
    Reputation
    10
    Rep Power
    0
    hello my brother send coins as warm and donot receive my script souleater my name is ason sune

  7. #7

  8. #8
    Free User
    Join Date
    Sep 2016
    Posts
    5
    Reputation
    10
    Rep Power
    0
    hi @mistgun
    your action works great, but to me it would be a bit more useful if it could withdraw the items from the inbox inside the depot, is there any way to make it happen?
    thanks in advance, and great job

  9. #9
    Free User
    Join Date
    Dec 2016
    Posts
    13
    Reputation
    10
    Rep Power
    0
    hello dude, i really like it, however it does not take the items, i noticed that in the script the category is set as "s", however even if i set the supply category as "s", it doesnt take it, any hints?
    thanks

  10. #10
    Free User
    Join Date
    Dec 2016
    Posts
    13
    Reputation
    10
    Rep Power
    0
    nevermind...it was my mistake, it works great dude, thanks a lot.

 

 

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
  •