Advertisement
w9s66v09c8x5o1fl3p0

Rifbot SD Enemies

Jan 11th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. --[[
  2.     Script Name:        SD Enemies
  3.     Description:        Shoot Sudden Death Rune in enemies depent on heal percent.
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local USE_DELAY = {2000, 3000}          -- we can use rune each 2s
  8. local SHOOT_BELOW = 30                  -- shoot sd below 30%
  9. local ENEMIES = {"enemy1", "enemy2"}    -- add enemies with Capital letter
  10. local RUNEID = 3155                     -- sd rune
  11.  
  12. -- DONT'T EDIT BELOW THIS LINE
  13.  
  14. local useTime, useDelay = 0, 0
  15.  
  16. Module.New("SD Enemies", function ()
  17.     if os.clock() - useTime < useDelay then -- check for time
  18.         return
  19.     end    
  20.     for i, player in pairs(Creature.iPlayers(7)) do
  21.         if table.find(ENEMIES, player.name) then
  22.             if player.hpperc <= SHOOT_BELOW then
  23.                 Self.UseItemWithCreature(player, RUNEID)
  24.                 useTime = os.clock()
  25.                 useDelay = math.random(USE_DELAY[1], USE_DELAY[2])/1000 -- set new random delay
  26.                 break -- end loop
  27.             end    
  28.         end
  29.     end
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement