Signup Now
Results 1 to 6 of 6
  1. #1
    Free User drobr's Avatar
    Join Date
    May 2015
    Location
    USA
    Posts
    31
    Reputation
    14
    Rep Power
    0

    Check if supplytobuy?

    Hi,

    i need a action to check if i have the amount of supply i configured to buy.

    Example:

    the "resupply(a)" action will buy 100ghp and 800mp. OK
    what i want is, is there a action to check if i have that exact same amount in my bp? the 100ghp and 800mp?

    if i had something like 99ghp or 799mp it would go back and resupply again?

    Thanks.

  2. #2
    Moderator RoxZin xD's Avatar
    Join Date
    Dec 2013
    Location
    Rio de Janeiro
    Posts
    4,911
    Reputation
    109
    Rep Power
    32
    You could use setsetting() to change the values at a specific point of your script, if it's that what you want. Or list the supplies again with another category and check supplies at city with that category.



    Troubled Animals Quest [100+]
    ALL
    Feyrist Animals Surface [160+]
    RP
    Feyrist Silencers Underground X1 [180+]
    RP | EK
    Feyrist Silencers Underground X2 [200+]
    RP | EK
    Feyrist Silencers Surface [210+]
    RP | EK
    Rathleton Sewers [240+]
    RP
    Glooth Fairy [350+]
    ED/MS
    Hardcore Draken Walls [400+]
    EK

  3. #3
    Free User drobr's Avatar
    Join Date
    May 2015
    Location
    USA
    Posts
    31
    Reputation
    14
    Rep Power
    0
    Quote Originally Posted by RoxZin xD View Post
    You could use setsetting() to change the values at a specific point of your script, if it's that what you want. Or list the supplies again with another category and check supplies at city with that category.
    ok, i didnt understand ehehe

    i currently use this action to check supplies:
    ---check
    if needresupply(10, 'a') then
    gotolabel('LeaveEasy', 'Leave')
    end

    ok... but this only checks the "supplies to leave", not the "supplies to buy" =/

  4. #4
    Free User
    Join Date
    Aug 2014
    Location
    Rio de Janeiro - Brazil
    Posts
    356
    Reputation
    66
    Rep Power
    20
    This might work:


    init start
    local maxmanas = getuseroption('mpstobuy')
    local minmanas = getuseroption('mpstoleave')
    init end

    auto(1000)
    if $wptsection == 'city' then
    setsetting('Supplies/Items/mana potion/LeaveAt', maxmanas)
    else
    setsetting('Supplies/Items/mana potion/LeaveAt', minmanas)
    end


    And then replace your mpstobuy/mpstoleave to your setted options on cavebot/settings, replace the 'city' part of the wptsection to your wptsection you want to have the check for the supplies.

    Surely it could be better done using "foreach ... something about item category and such", but I'm a noobie, gotta search it on windbot docs =)

    I think this way it could work anyway.

  5. #5
    Free User drobr's Avatar
    Join Date
    May 2015
    Location
    USA
    Posts
    31
    Reputation
    14
    Rep Power
    0
    Thanks ill test this.

  6. #6
    Free User xinxs's Avatar
    Join Date
    Sep 2014
    Posts
    50
    Reputation
    18
    Rep Power
    20
    Man you can just use something like it:

    local mp = 'mana potion' ---
    local mptobuy = 800 ---
    local hp = 'great health potion' ---
    local hptobuy = 100 ---you can use getuseroption here too ^^

    if itemcount(mp) < mptobuy or itemcount(hp) < hptobuy then
    gotolabel('buypotions', 'City') --- edit this to your waypoints name
    end

    put this action before hunt waypoints or after the supply buyer
    Last edited by xinxs; 06-19-2015 at 10:04 PM.

 

 

Posting Permissions

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