PDA

View Full Version : Health Addon


DeathStalker908
06-04-2010, 11:44 PM
Now you can see other people's health! /OMGGASP

Instructions:

1) Make a new file from Notepad/Wordpad (or anything similar to those 2) and call it HP.lua.

2) Paste the code below into HP.lua and save it under Crowns of Power -> Main -> Addons


function onLoaded()
-- Writes a msg when you first log in
status("HP bar loaded.");
end


addChatCommand("hp");

function chatcmd_hp()
showDialog("HealthAddon")
end
3) Now in the Addons folder, make a new folder called Ui if it doesn't already exist

4) Make a new file and name it HealthAddon.gui

5) Copy + paste the code below into the HealthAddon.gui and save it in Crowns of Power -> Main -> Addons -> Ui

//--- OBJECT WRITE BEGIN ---
new GuiControl(HealthAddon) {
canSaveDynamicFields = "0";
Profile = "GuiModelessDialogProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "640 480";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";

new GuiWindowCtrl(HealthWindow) {
canSaveDynamicFields = "0";
Profile = "GuiWindowProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "190 50";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "Health Addon";
maxLength = "1024";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "1";
canMinimize = "1";
canMaximize = "1";
minSize = "50 50";
closeCommand = "Canvas.popDialog(HealthAddon); cancel($TehUpdate);";

new GuiTextCtrl(TargetNameText) {
canSaveDynamicFields = "0";
Profile = "GuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "43 41";
Extent = "97 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
text = "";
maxLength = "1024";
};
new GuiProgressCtrl(healthBar) {
canSaveDynamicFields = "0";
Profile = "GuiProgressProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "33 27";
Extent = "119 13";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
maxLength = "1024";
};
};
};
//--- OBJECT WRITE END ---

function HealthAddon::onWake(%this)
{
HealthAddon.updateFields(%this);
}

function HealthAddon::updateFields(%this)
{
%zyf = getLocalPlayer().getControllingClient().getSelecte dObject().getMaxHP();
%xfa = getLocalPlayer().getControllingClient().getSelecte dObject().getCurrentHP();
%bas = getLocalPlayer().getControllingClient().getSelecte dObject().getShapeName();

TargetNameText.text = "Target Name:" SPC %bas;
//TargetHealth.text = %currHP;
healthBar.setValue(%xfa/%zyf);
healthBar.text = %xfa SPC "/" SPC %zyf SPC "(" @ roundNumber(%xfa/%zyf*100) @ "%)";

$TehUpdate = %this.schedule(100, updateFields);
}

6) Log into CoP, type /hp, and enjoy :O


PS: When you don't have a selected target, it is normal for the HP bar/target name to flicker with weird text

Edit 2: Now the command doesn't have to be capitalized, so you can just type /hp rather than /HP

monaro
06-05-2010, 12:28 AM
Excellent addon DS, great job! Works great, now i know who to gank in pvp/pve gear ;).

Just as a reference, if you find the flickering annoying when you dont have a target, just close it, and type /HP when you need to see somebody's hp etc.

keysx
06-05-2010, 12:47 AM
I'm wondering if we could add support for .lua files to be posted on the forum. That would make it very easy to keep a collection of addons right here in the forum maybe in a sticky thread. I'll see if this would be possible.

spiker8420
06-05-2010, 06:09 PM
u meant in the ui file under main right? There is no ui folder under addons

DeathStalker908
06-05-2010, 06:13 PM
u meant in the ui file under main right? There is no ui folder under addons

No. Make a new folder called ui under the Addon folder if it isn't already there...apparently I made that folder for myself immediately when the last patch came out, so I kinda forgot about it lol. Gonna update the post w/ that info

spiker8420
06-05-2010, 06:17 PM
No. Make a new folder called ui under the Addon folder if it isn't already there...apparently I made that folder for myself immediately when the last patch came out, so I kinda forgot about it lol. Gonna update the post w/ that info

Fixed ds great job as always man

davebatista
06-27-2010, 11:14 AM
hello,

Yes it will really help many people. i will also try for it and if i get any good and more infomration.

thanks!!

_______________
Pharmacy (http://www.oneclickpharmacy.co.uk/)

bobsapp1
06-28-2010, 06:48 AM
i will also try for it and if i get any good and more infomration.


ok if you try for it and get good and more information let us know bro

Xzan
07-01-2010, 11:52 PM
it says i dont have permission to save somthing in the addon folder. can you help me

Atomic
07-02-2010, 12:39 AM
it says i dont have permission to save somthing in the addon folder. can you help me

Yes, you need to save it to a normal location somewhere, then move it to the correct location in the cop folder. Pretty sure everyone has experienced this so far.

yneos
07-02-2010, 09:12 AM
i havn't lol it worked fine for me.

Bignate
10-21-2010, 07:12 PM
Anyone else have a problem, after all the files are saved, and cop is loaded it says hp bar loaded but when you type /hp it has no effect?

KingApocalypse
10-21-2010, 07:19 PM
Anyone else have a problem, after all the files are saved, and cop is loaded it says hp bar loaded but when you type /hp it has no effect?

try capitals: /HP

ps: i like crows hp bar more

Bignate
10-21-2010, 07:21 PM
try capitals: /HP

ps: i like crows hp bar more

No, caps doesnt work either.

KingApocalypse
10-21-2010, 07:29 PM
No, caps doesnt work either.

hmmm weird....thats how i got it to work....

Well try crows....its kick ass...typ /hpshow and it shows its hp inside the health bar.

moosier89
10-21-2010, 08:26 PM
just type /hpshow then hit enter and press up arrow then hit enter once again and it shows

frankecko
01-18-2011, 05:49 PM
got a downloadable link for crow's hp addon i tried this one and i cant get it to work

PUSSYCATDOLLSZ
01-28-2011, 08:03 AM
Peanut butter jelly time?