XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 4 of 4

Thread: Request Terra Amulet when certain hp

  1. #1

    Join Date
    Nov 2015
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Request Terra Amulet when certain hp

    looking for a script for using terra amulet at X % HP
    for example
    use terra if health % below 80

    i need for banuta ;d

  2. #2

    Join Date
    Jan 2015
    Posts
    201
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    If you want it to work faster lower the wait times at line 11 and 14
    Also I havnt been scripting for xb for a very long time now so try it safely, you could set the % to 99 and walk into a firebomb a couple of times and see if it equips it

    lua code:

    Amulet = "Terra Amulet" -- neck to equip
    HP = 80 -- % to equip at

    Self.HealthPercent = function ()
    return math.abs(Self.Health() / (Self.MaxHealth() * 0.01))
    end

    Module.New('amulethp', function(mod)
    if (Self.HealthPercent() <= HP) and (Self.Amulet() ~= Amulet) then
    Self.Equip(Amulet, "amulet")
    mod:Delay(10000)
    else
    Self.Dequip("amulet", 0)
    mod:Delay(2000)
    end
    end)
    Last edited by Merre; 12-31-2015 at 03:07 PM.

  3. #3
    Lifetime Subscriber Sharri's Avatar
    Join Date
    Dec 2011
    Posts
    77
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Naato1209 View Post
    looking for a script for using terra amulet at X % HP
    for example
    use terra if health % below 80

    i need for banuta ;d
    lua code:
    local HPPC = 80 -- health percent
    local CONDITIONAL_AMULET_NAME = "terra amulet" -- use if current hp < HPPC
    local DEFAULT_AMULET_NAME = "platinum amulet" -- use if current hp > HPPC

    function swap()
    if (Self.Health() / Self.MaxHealth() * 100 < HPPC) then
    if (Self.Amulet().id ~= Item.GetID(CONDITIONAL_AMULET_NAME) and Self.ItemCount(CONDITIONAL_AMULET_NAME) > 0) then
    Self.Equip(CONDITIONAL_AMULET_NAME, "amulet")
    wait(300,500)
    end
    else
    if (Self.Amulet().id == Item.GetID(CONDITIONAL_AMULET_NAME) and Self.ItemCount(DEFAULT_AMULET_NAME) > 0) then
    Self.Equip(DEFAULT_AMULET_NAME, "amulet")
    wait(300, 500)
    end
    end
    end

    Module.New("Equip Amulet", function(mod)
    swap()
    mod:Delay(1000)
    end)

  4. #4
    Senior Member Aristeus's Avatar
    Join Date
    Jun 2013
    Location
    Sweden
    Posts
    600
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    Only use wait in modules if it's between two actions, it puts everything else in the script on hold. Just use mod:delay instead.

Posting Permissions

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