Results 1 to 4 of 4

Thread: Check Cap not working.

  1. #1
    iBot User AkumaIgneel's Avatar
    Join Date
    Apr 2013
    Location
    USA
    Posts
    47
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    12 Post(s)
    Reputation
    12
    Rep Power
    4

    Check Cap not working.

    Hello guys,

    So i need some help with my action, im trying to do a cap - health potion check, but it only checks the HP and ignores the CAP.

    -- Setup:

    -- Backpack Setup:
    MainBP = "Blue Backpack" -- The Main BP.
    LootBP = "Beach Backpack" -- Looting BP
    GoldBP = "Golden Backpack" -- BP to gold.
    MainDPBP = "Orange Backpack" -- Main backpack on DP.
    StackableDPBP = "Green Backpack" -- BP to deposit stackable loot on dp.
    LootDPBP = "Red Backpack" -- BP to deposit loot on dp.

    -- Potions Setup:
    MPname = "" -- Name of mana potion.
    MPprice = 0 -- Price of mana potion to buy.
    MPtobuy = 0 -- How many mana potions to buy?
    MPtoback = 0 -- How many potions to back reffil?
    HPname = "Health Potion" -- Name of health potion.
    HPprice = 45 -- Price of health potion to buy
    HPtobuy = 10 -- How many potions buy?
    HPtoback = 1 -- How many potions to back reffil?

    -- Hunt:
    Captoback = 20 -- How much cap to back reffil?




    Action that im using:
    if cap > Captoback and if itemcount(HPname) > HPtobuy then
    gotolabel("w54")
    else
    gotolabel("Refill")
    end



    If anyone could help me i would appreciate.

  2. #2
    iBot User Tobirama's Avatar
    Join Date
    Mar 2015
    Posts
    15
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    5 Post(s)
    Reputation
    13
    Rep Power
    2
    You cant have two "if" other than "elseif", but in this action you dont need "elseif". In order to work you need to replace the second "if" for "and or "or". But in this case, you already put "and" ("if cap > Captoback "and" if itemcount..."), so you just need to delete the second "if":

    if cap > Captoback and itemcount(HPname) > HPtobuy then
    gotolabel("w54")
    else
    gotolabel("Refill")
    end

  3. #3
    iBot User AkumaIgneel's Avatar
    Join Date
    Apr 2013
    Location
    USA
    Posts
    47
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    12 Post(s)
    Reputation
    12
    Rep Power
    4
    Quote Originally Posted by Tobirama View Post
    You cant have two "if" other than "elseif", but in this action you dont need "elseif". In order to work you need to replace the second "if" for "and or "or". But in this case, you already put "and" ("if cap > Captoback "and" if itemcount..."), so you just need to delete the second "if":

    if cap > Captoback and itemcount(HPname) > HPtobuy then
    gotolabel("w54")
    else
    gotolabel("Refill")
    end
    Thanks a lot Nidaime-sama

  4. #4
    Moderator Furieri's Avatar
    Join Date
    Jun 2012
    Location
    Vitoria - ES / Brasil
    Posts
    792
    Mentioned
    62 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    199 Post(s)
    Reputation
    158
    Rep Power
    7
    Quote Originally Posted by AkumaIgneel View Post
    Hello guys,

    So i need some help with my action, im trying to do a cap - health potion check, but it only checks the HP and ignores the CAP.

    -- Setup:

    -- Backpack Setup:
    MainBP = "Blue Backpack" -- The Main BP.
    LootBP = "Beach Backpack" -- Looting BP
    GoldBP = "Golden Backpack" -- BP to gold.
    MainDPBP = "Orange Backpack" -- Main backpack on DP.
    StackableDPBP = "Green Backpack" -- BP to deposit stackable loot on dp.
    LootDPBP = "Red Backpack" -- BP to deposit loot on dp.

    -- Potions Setup:
    MPname = "" -- Name of mana potion.
    MPprice = 0 -- Price of mana potion to buy.
    MPtobuy = 0 -- How many mana potions to buy?
    MPtoback = 0 -- How many potions to back reffil?
    HPname = "Health Potion" -- Name of health potion.
    HPprice = 45 -- Price of health potion to buy
    HPtobuy = 10 -- How many potions buy?
    HPtoback = 1 -- How many potions to back reffil?

    -- Hunt:
    Captoback = 20 -- How much cap to back reffil?




    Action that im using:
    if cap > Captoback and if itemcount(HPname) > HPtobuy then
    gotolabel("w54")
    else
    gotolabel("Refill")
    end



    If anyone could help me i would appreciate.
    If you are using iBot Plus just do it:

    Put yours supplies configured at:

    Settings > Suplies, configure id, value max and min quantity then to check use this code:

    Lua Code:
    if cap < Captoback and checksupplies() == false then
    gotolabel("w54")
    else
    gotolabel("Refill")
    end


    easy way and you dont need this many things at setup.

Posting Permissions

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