Is there a function that reads your hp? like
(If hp is lower than 30);
Logout;
?
Is there a function that reads your hp? like
(If hp is lower than 30);
Logout;
?
Oh Hai Dar






Use GetMMLevels to get the HP from the side of the minimap. Then just check if your HP is less than your set amount.
EDIT: Which is in GameTab.scar![]()
I am not very good at scar, so could you guys explain more?
If I want to Log out when hp is red (or a digit) in my script, what do I add?
I know I should call the GetAllLevels;, but what do I do after?
Oh Hai Dar

GetMMLevels;
If(HPPercent < 35) then
RunFromFight;
LogOut;
something like that?






SCAR Code:{*******************************************************************************
Function GetMMLevels(LevelType : String;var ColorSign : String): integer;
By: Raymond / Wizzup
Description: Returns the level shown next to the minimap.
Colorsign returns the color of the text (Green,Yellow,Orange,Red).
Returns -1 if failed.
*******************************************************************************}
You can use that function to 1. return the player's hp and 2. return the colour of the hp text. You can go about this in two ways:
1. If you just want to log out when the HP Text is red something like this should do:
SCAR Code:procedure LogOutWhenRed;
var
TextColour: string;
begin
GetMMLevels('hp', TextColour);
if (TextColor = 'Red') then
LogOut;
end;
2. Use GetMMLevels to check your HP as an amount:
SCAR Code:procedure LogOutWhenHPLow;
var
TextColour: string;
begin
if (GetMMLevels('hp', TextColour) < {SomeHPNumberHere}) then
LogOut;
end;
You can also use HPPercent to return the percent of HP the player has left.
Thanks!
I have couple more question:
#1 is the a procedure to check if it already prayed?(I'll check pray.scar)
EDIT: I don't really understand how to setup GetPrayerCoords, could some one use it in a sample script?
#2 is there a procedure that will allow the scar to ENABLE/ Disable smart it self?
Oh Hai Dar






1.
a.
SCAR Code:{*******************************************************************************
function PrayerActivated(Name: string): Boolean;
By: Nielsie95
Description: Returns true if the prayer is activated.
*******************************************************************************}
That function checks if a particular prayer is activated.
b. GetPrayerCoords stores the colour of a particular prayer and the coordinates of the box the prayer is in. Its used by the other prayer functions not necessarily needed directly by the scripter.
2. I tried looking for a procedure like that but I don't think SMART has one. Theres one to enable/disable the graphics and the debug and adjust the FPS rate though.
I'll try to mess around the prayer thing more, and LOL at the smart.
When the arrow goes up (on smart) fps goes higher or lower?
Also, my script execut it self at times..(not really MY SCRIPT) It doesn't had any error, it just executed it self..
Oh Hai Dar
I'd guess higher.
Ce ne sont que des gueux
k
Oh Hai Dar
There are currently 1 users browsing this thread. (0 members and 1 guests)