Advertisement
w9s66v09c8x5o1fl3p0

Rifbot Random UH

Jan 11th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. --[[
  2.     Script Name:        Random UH
  3.     Description:        Heal your character with Uh's using random delay mode
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local MAIN_DELAY = {300, 1100}      -- random delay for heal action.
  8. local RUNE_DELAY = {1500, 2200}     -- delay for UH is default 1000ms we set a little bit higher.
  9. local HEAL_BELOW = 90               -- when your hpperc is below o equal this value character will use uh rune.
  10. local RUNEID = 3160                 -- UH id
  11.  
  12. -- DONT'T EDIT BELOW THIS LINE
  13.  
  14. local mainDelay, mainTime = 0, 0
  15.  
  16. Module.New("Random UH", function ()
  17.     if Self.HealthPercent() <= HEAL_BELOW then
  18.         if mainTime == 0 then
  19.             mainDelay = math.random(MAIN_DELAY[1], MAIN_DELAY[2])/1000
  20.             mainTime = os.clock() -- we using clock to get timer precision
  21.         end
  22.         if (mainTime > 0 and os.clock() - mainTime >= mainDelay) then
  23.             Self.UseItemWithMe(RUNEID, math.random(RUNE_DELAY[1], RUNE_DELAY[2]))
  24.         end
  25.     else
  26.         mainTime = 0 -- rest timer
  27.     end            
  28. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement