Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function do_autoquaff ()
- if (os.time () - autoquaff_lastfired) > 3 then -- if we've fired within 3 seconds, don't bother with other checks, do nothing
- DebugNote("Auto Quaff Checking time since last quaff")
- if autoquaff and enabled then -- if not enabled, don't do anything
- DebugNote("Auto Quaff Checking if Enabled")
- if char_status.state == "8" then -- if fighting
- DebugNote("Auto Quaff Checking Combat Status")
- if tonumber ((tonumber(gmcpval("vitals.hp"))/tonumber(gmcpval("maxstats.maxhp"))*100)) < tonumber (quaffautohp) then -- if HP in trouble
- DebugNote("HP below threshold - Disabling casting and quaffing")
- pausecast = true
- EnableGroup("triggers", false)
- EnableTimer("spellcast", false)
- EnableTimer("navicast", false)
- Execute("dinv consume big heal")
- autoquaff_lastfired = os.time ()
- return
- else
- if pausecast then
- pausecast = false
- EnableGroup("triggers", true)
- EnableTimer("spellcast", true)
- ResetTimer("spellcast")
- DebugNote("HP above limit - Enabling timers and triggers. Health is at " .. tonumber(gmcpval("vitals.hp")))
- end
- end -- end HP check
- end -- end if fighting
- end -- end if enabled check
- end -- end 3 second time check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement