Post by feldoh on Dec 29, 2005 3:28:42 GMT -5
This is my first plugin so I know it's pretty rigid but it works. I'll update it later so you can change the percentage at which you are warned.
Basically what this does is it takes your HP and MP and runs it through checks. If your HP/MP percentage (Current/Total) is less than .3 (30%) then it will display a warning message at the bottom of the screen. This message stays there until you regen your hp/mp.
You might want to change the placement of the text, I use 1280x1024 so thats what it is set to.
Now since I am new there are a few things I was wanting to do with the script but couldn't. Some of them are commented out. Like I was looking for a way to put it in party chat that you were low on mp or hp but the if statement gets called every so often so the message would display multiple times. Is there any function where I can call Control.control_SendString() once?
Well anyways he's the code, sloppy, but it works...
Screenshot
Basically what this does is it takes your HP and MP and runs it through checks. If your HP/MP percentage (Current/Total) is less than .3 (30%) then it will display a warning message at the bottom of the screen. This message stays there until you regen your hp/mp.
You might want to change the placement of the text, I use 1280x1024 so thats what it is set to.
Now since I am new there are a few things I was wanting to do with the script but couldn't. Some of them are commented out. Like I was looking for a way to put it in party chat that you were low on mp or hp but the if statement gets called every so often so the message would display multiple times. Is there any function where I can call Control.control_SendString() once?
Well anyways he's the code, sloppy, but it works...
-----------------------------------------------
---------HP / MP Warning
---------Displays when low on HP or MP
---------Version 1.0
---------By Feldoh aka Assassin
-----------------------------------------------
--------------------------------------------------
--Create the text to be called later in the script
--------------------------------------------------
ManaText=Graphics.text_CreateObject()
Graphics.text_SetPosition(500,840,ManaText)
Graphics.text_SetColor(175,0,0,255,ManaText)
Graphics.text_SetFont("Arial Bold",20,ManaText)
Graphics.text_SetBold(false,ManaText)
--Graphics.text_SetBGBorderSize(3,ManaText)
--Graphics.text_SetBGColor(255,0,0,0,ManaText)
--Graphics.text_SetBGVisibility(0,ManaText)
Graphics.text_SetText("Warning: Low MP",ManaText)
HealthText=Graphics.text_CreateObject()
Graphics.text_SetPosition(500,820,HealthText)
Graphics.text_SetColor(175,255,0,0,HealthText)
Graphics.text_SetFont("Arial Bold",20,HealthText)
Graphics.text_SetBold(false,HealthText)
--Graphics.text_SetBGBorderSize(3,HealthText)
--Graphics.text_SetBGColor(255,0,0,0,HealthText)
--Graphics.text_SetBGVisibility(0,HealthText)
Graphics.text_SetText("Warning: Low HP",HealthText)
while true do
-------------
-- Variables
-------------
CurrentMP = FFXI.player_GetCurrentMP()
MaxMP = FFXI.player_GetMaxMP()
CurrentHP = FFXI.player_GetCurrentHP()
MaxHP = FFXI.player_GetMaxHP()
------------
--MP Checks
------------
if (CurrentMP/MaxMP) < .3 then
Graphics.text_SetVisibility(1,ManaText)
--Control.control_SendString("/party MP Low! <mp> (<mpp>)")
Windower.script_Sleep(1000)
end
if (CurrentMP/MaxMP) > .3 then
Graphics.text_SetVisibility(0,ManaText)
Windower.script_Sleep(1000)
end
-------------
-- HP Checks
-------------
if (CurrentHP/MaxHP) < .3 then
Graphics.text_SetVisibility(1,HealthText)
--Control.control_SendString("/party HP Low! <hp> (<hpp>)")
Windower.script_Sleep(1000)
end
if (CurrentHP/MaxHP) > .3 then
Graphics.text_SetVisibility(0,HealthText)
Windower.script_Sleep(1000)
end
Windower.script_Sleep(1000)
end
Screenshot