Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. ^(.*?) mana stands at (\d+)\/(\d+)\.$
  2.  
  3.  
  4.  
  5.  
  6.  
  7. function round(num)
  8. return tonumber(string.format("%." .. 0 .. "f", num))
  9. end
  10.  
  11. local target_current = matches[3]
  12. local target_max = matches[4]
  13. local target_percent = round((target_current / target_max) * 100)
  14.  
  15. if target_percent <= 49 and mm.stats.currentpower >= 8 then
  16. cecho("<red> *** Target is at " .. target_percent .. "% mana! ***")
  17. send("starcall absolve " .. target)
  18.  
  19. elseif target_percent <= 49 and mm.stats.currentpower <= 8 then
  20. cecho("<red> *** Target is at " .. target_percent .. "% mana! ***")
  21. cecho("<magenta> *** WAITING FOR POWER *** WAITING FOR POWER ***")
  22. send("chant amissio " .. target)
  23.  
  24. elseif target_percent <= 60 then
  25. cecho("<magenta> *** Target is at " .. target_percent .. "% mana! ***")
  26. send("chant amissio " .. target)
  27.  
  28. elseif target_percent <= 80 then
  29. cecho("<yellow> *** Target is at" .. target_percent .. "% mana! ***")
  30. send("chant amissio " .. target)
  31.  
  32. else
  33. cecho("<green> *** Target is at " .. target_percent .. "% mana! ***")
  34. send("chant amissio " .. target)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement