Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. function do_autoquaff ()
  2. if (os.time () - autoquaff_lastfired) > 3 then -- if we've fired within 3 seconds, don't bother with other checks, do nothing
  3. DebugNote("Auto Quaff Checking time since last quaff")
  4. if autoquaff and enabled then -- if not enabled, don't do anything
  5. DebugNote("Auto Quaff Checking if Enabled")
  6. if char_status.state == "8" then -- if fighting
  7. DebugNote("Auto Quaff Checking Combat Status")
  8. if tonumber ((tonumber(gmcpval("vitals.hp"))/tonumber(gmcpval("maxstats.maxhp"))*100)) < tonumber (quaffautohp) then -- if HP in trouble
  9. DebugNote("HP below threshold - Disabling casting and quaffing")
  10. pausecast = true
  11. EnableGroup("triggers", false)
  12. EnableTimer("spellcast", false)
  13. EnableTimer("navicast", false)
  14. Execute("dinv consume big heal")
  15. autoquaff_lastfired = os.time ()
  16. return
  17. else
  18. if pausecast then
  19. pausecast = false
  20. EnableGroup("triggers", true)
  21. EnableTimer("spellcast", true)
  22. ResetTimer("spellcast")
  23. DebugNote("HP above limit - Enabling timers and triggers. Health is at " .. tonumber(gmcpval("vitals.hp")))
  24. end
  25. end -- end HP check
  26. end -- end if fighting
  27. end -- end if enabled check
  28. end -- end 3 second time check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement