UO.GetHP

From OpenEUO
Revision as of 17:18, 8 November 2010 by 98.225.1.8 (Talk) (Created page with " UO.GetHP ⇒ Returns the hit points of the targetted id as a percentage. I.E.: 100% Cheffe's code: <math>function GetHP(n) local i,nID,nHP,_ = 0 repeat _,_,_,_...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


UO.GetHP

⇒ Returns the hit points of the targetted id as a percentage.  I.E.: 100% 

Cheffe's code:

<math>function GetHP(n)

 local i,nID,nHP,_ = 0 
 repeat 
   _,_,_,_,_,_,nID,_,nHP = UO.GetCont(i) 
   i = i + 1 
 until nID==n or nID==nil 
 return nHP 

end


function Main()

 UO.TargCurs = true 
 while UO.TargCurs do 
   wait(1) 
 end 
 local hp = GetHP(UO.LTargetID) 
 if not hp then 
   UO.StatBar(UO.LTargetID) 
   wait(300) 
   hp = GetHP(UO.LTargetID) 
 end 
 if hp then 
   print("Target HP = "..hp.."%") 
 end 

end


Main()</math>