Advertisement
w9s66v09c8x5o1fl3p0

Rifbot Custom Healer

Jan 11th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. --[[
  2.     Script Name:        Custom Healing
  3.     Description:        Heal your character using spells and runes.
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local MAIN_DELAY = {300, 500}                               -- loop reading values time
  8. local SPELL_DELAY = {500, 1000}                             -- time in miliseconds between cast spell
  9. local RUNE_DELAY = {1000, 2100}                             -- random time between using healing rune. You can use each 1s but..
  10.  
  11. local HEALING = {
  12.     {item = "exura vita", hpperc = 50, mana = 80},          -- More important healing comes first in the table.
  13.     {item = "exura gran", hpperc = 70, mana = 40},
  14.     {item = "exura", hpperc = 90, mana = 25}
  15.  
  16.  
  17.     -- {item = 'exura sio "Name', hpperc = 40, mana = 60},  -- example of exura sio not used already
  18.     -- {item = 3160, hpperc = 60, mana = 0},                 -- example of using uhs @item must be number.
  19. }
  20.  
  21. Module.New("Custom Healing", function (mod)
  22.     if Self.isConnected() then
  23.         local selfHpperc, selfMana = Self.HealthPercent(), Self.Mana()
  24.         for i, mode in pairs(HEALING) do
  25.             if selfHpperc <= mode.hpperc and selfMana >= mode.mana then
  26.                 if type(mode.item) == "string" then
  27.                     Self.CastSpell(mode.item, mode.mana, math.random(SPELL_DELAY[1], SPELL_DELAY[2])) -- use spell
  28.                     break    
  29.                 else
  30.                     if Self.UseItemWithMe(mode.item, math.random(RUNE_DELAY[1], RUNE_DELAY[2])) then -- check if use rune is valid when true break loop
  31.                         break
  32.                     end    
  33.                 end
  34.             end
  35.         end
  36.     end                    
  37.     mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement