w9s66v09c8x5o1fl3p0

Rifbot Heal Friends

Jan 11th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. --[[
  2.     Script Name:        Heal Friends
  3.     Description:        Heal friends and/or party members with exura sio or uh. Required Rifbot v1.31
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local MAIN_DELAY = {400, 1200}              -- time in miliseconds between reading main loop
  8. local UHID = 3160                           -- ultimate healing rune id
  9. local HEAL_PARTY = true                     -- heal party members true/false
  10. local FRIENDS = {"friend1", "friend2"}      -- list of friends
  11. local HEALTH_PERCENT = 60                   -- heal below 60% hp.
  12. local HEAL_WITH_UHS = true                  -- heal with uh rune
  13. local HEAL_WITH_SIO = true                  -- heal with exura sio, when HEAL_WITH_UHS = true and uhs not found use sio.
  14.  
  15. -- DON'T EDIT BELOW THIS LINE
  16.  
  17. FRIENDS = table.lower(FRIENDS) -- convert table to lower strings.
  18.  
  19. Module.New("Heal Friends", function (mod)
  20.     for i, player in pairs(Creature.iPlayers(7, false)) do  -- get only players on screen
  21.         local var = (HEAL_PARTY and (Creature.isPartyMember(player) or Creature.isPartyLeader(player))) or table.find(FRIENDS, string.lower(player.name))
  22.         if var and player.hpperc < HEALTH_PERCENT then
  23.             if HEAL_WITH_UHS then
  24.                 local item = Container.FindItem(UHID)
  25.                 if not item then
  26.                     if HEAL_WITH_SIO then
  27.                         Self.CastSpell("exura sio \"" .. player.name, 60) -- cast exura sio when no uhs found.
  28.                     end
  29.                 else
  30.                     Container.UseItemWithCreature(item.index, item.slot, item.id, player, math.random(1500, 2200)) -- use uh
  31.                 end
  32.             elseif HEAL_WITH_SIO then
  33.                 Self.CastSpell("exura sio \"" .. player.name, 60) -- cast exura sio when no uhs found.
  34.             end
  35.             break -- end loop
  36.         end
  37.     end                            
  38.     mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2])                
  39. end)
Add Comment
Please, Sign In to add comment