Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Script Name: Random UH
- Description: Heal your character with Uh's using random delay mode
- Author: Ascer - example
- ]]
- local MAIN_DELAY = {300, 1100} -- random delay for heal action.
- local RUNE_DELAY = {1500, 2200} -- delay for UH is default 1000ms we set a little bit higher.
- local HEAL_BELOW = 90 -- when your hpperc is below o equal this value character will use uh rune.
- local RUNEID = 3160 -- UH id
- -- DONT'T EDIT BELOW THIS LINE
- local mainDelay, mainTime = 0, 0
- Module.New("Random UH", function ()
- if Self.HealthPercent() <= HEAL_BELOW then
- if mainTime == 0 then
- mainDelay = math.random(MAIN_DELAY[1], MAIN_DELAY[2])/1000
- mainTime = os.clock() -- we using clock to get timer precision
- end
- if (mainTime > 0 and os.clock() - mainTime >= mainDelay) then
- Self.UseItemWithMe(RUNEID, math.random(RUNE_DELAY[1], RUNE_DELAY[2]))
- end
- else
- mainTime = 0 -- rest timer
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement