Guest User

Auto Seraph's Embrace v1.0

a guest
Dec 21st, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. --[[
  2.  
  3.     Auto Seraph's Embrace
  4.     by x7x/Anonymous
  5.  
  6. ]]
  7.  
  8. local SEslot = nil
  9. local player = GetMyHero()
  10.  
  11. function OnLoad()
  12.     ASEConfig = scriptConfig("Auto Seraphs Embrace","AutoSE")
  13.     ASEConfig:addParam("useSE", "Use Seraph's Embrace", SCRIPT_PARAM_ONOFF, true)
  14.     ASEConfig:permaShow("useSE")
  15.     PrintChat(">> Auto Seraph's Embrace loaded!")
  16. end
  17.  
  18. function OnUnload()
  19.     PrintChat(">> Auto Seraph's Embrace unloaded!")
  20. end
  21.  
  22. function OnTick()
  23.     if GetInventoryHaveItem(3040, player) then
  24.         SEslot = GetInventorySlotItem(3040)
  25.         SEReady = (SEslot ~= nil and myHero:CanUseSpell(SEslot))
  26.         if SEReady then
  27.             if player.health < (player.maxHealth*0.2) then
  28.                 if player:CanUseSpell(SEslot) then
  29.                     CastSpell(SEslot)
  30.                 end
  31.             end
  32.         end
  33.     end
  34. end
  35.  
  36. function OnDraw()
  37.   SC__OnDraw()
  38. end
  39.        
  40. function OnWndMsg(msg,key)
  41.   SC__OnWndMsg(msg,key)
  42. end
  43.        
  44. function OnSendChat(msg)
  45.   TargetSelector__OnSendChat(msg)
  46.   ts:OnSendChat(msg, "pri")
  47. end
Advertisement
Add Comment
Please, Sign In to add comment