SRL Archive - OSR Help

prayer points help me find a way


Verfy

2014-08-11 19:06:11

Hi guys!

I'm making myself a script and I came across a problem. I can't find any function that would return pray points. I tried searching reflection functions but found nothing too.

If anyone knows something to help me I'd be halpy :)
Thanks in advance

Sk1nyNerd

2014-08-11 20:17:22

(*
GetHitPointsMM
~~~~~~~~~~~~

.. code-block:: pascal

function GetHitpointsMM: integer;

Returns the HitPoints on the MM Toggle

.. note::

by Flight

Example:

.. code-block:: pascal

*)
function GetHitPointsMM: integer;
var
tpa : TPointArray;
begin
tpa := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(522,56,541,69));
result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
end;

(*
QuickPray
~~~~~~~~~~~~

.. code-block:: pascal

QuickPray(Pray: Boolean): Boolean;

Turns the Quick Prayers on or off using the Prayer Toggle on the MiniMap

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickPray(Pray: Boolean): Boolean;
var
CCountPurple, CCountWhite: integer;

begin
Result := False;
CCountPurple := CountColorTolerance(5056052, 550, 95, 565, 108, 45);
CCountWhite := CountColorTolerance(9723486, 550, 95, 565, 108, 22);

if ((CCountPurple < 1) and (CCountWhite < 1)) then
begin
Exit;
end;

if (Pray) then
begin
if (CCountWhite < 1) then
MouseBox(550, 95, 565, 108, mouse_left);
Result := True;
end else
begin
if (CCountWhite > 1) then
MouseBox(550, 95, 565, 108, mouse_left);
Result := True;
end;

end;

(*
GetPrayerPointsMM
~~~~~~~~~~~~

.. code-block:: pascal

function GetPrayerPointsMM: integer;

Returns the Prayer Points on the MM Toggle

.. note::

by Flight

Example:

.. code-block:: pascal

*)
function GetPrayerPointsMM: integer;
var
tpa : TPointArray;
begin
tpa := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(522,100,541,112));
result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
end;

(*
QuickPrayAt
~~~~~~~~~

.. code-block:: pascal

function QuickPrayAt(PrayerPoints: integer): Boolean;

Toggles the Prayer icon on the MiniMap if the Prayer Points are greater than
or equal to the PrayerPoints

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickPrayAt(PrayerPoints: integer): Boolean;
var
CP: integer;

begin
Result := False;
CP := GetPrayerPointsMM;

if (CP >= PrayerPoints) then
begin
if QuickPray(True) then
Result := True;
end;
end;

(*
QuickRun
~~~~~~~~~~~~

.. code-block:: pascal

QuickRun(Run: Boolean): Boolean;

Sets Run on or off using the Run Toggle on the MiniMap

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickRun(Run: Boolean): Boolean;
var
CCountGold, CCountGrey: integer;

begin
Result := False;
CCountGold := CountColorTolerance(105406, 574, 133, 590, 144, 23);
CCountGrey := CountColorTolerance(9411739, 574, 133, 590, 144, 36);

if ((CCountGold < 1) and (CCountGrey < 1)) then
Exit;

if (Run) then
begin
if (CCountGold < 1) then
begin
MouseBox(574, 133, 590, 144, mouse_left);
Result := True;
end;
end else
begin
if (CCountGold > 1) then
begin
MouseBox(574, 133, 590, 144, mouse_left);
Result := True;
end;
end;

end;

(*
GetRunEnergyMM
~~~~~~~~~~~~

.. code-block:: pascal

function GetRunEnergyMM: integer;

Returns the Run percentage on the MM Run Toggle

.. note::

by Flight

Example:

.. code-block:: pascal

*)
function GetRunEnergyMM: integer;
var
tpa : TPointArray;
begin
tpa := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(546,136,566,148));
result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
end;

(*
QuickRunAt
~~~~~~~~~

.. code-block:: pascal

function QuickRunAt(EnergyPercent: integer): Boolean;

Toggles the Run icon on the MiniMap if the Energy is greater than or equal
to the EnergyPercent

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickRunAt(EnergyPercent: integer): Boolean;
var
CR: integer;

begin
Result := False;
CR := GetRunEnergyMM;

if (CR >= EnergyPercent) then
begin
if QuickRun(True) then
Result := True;
end;
end;

havent played in quite awhile but functions like these are how you determine colors and letters/numbers. these are for the minimap. i know there are functions in the include you could use to get these from the gametab

i think theyre in one of the includes by now but idk tbh and idk if these are still valid

Verfy

2014-08-12 05:10:06

From: Sk1nyNerd
(*
GetHitPointsMM
~~~~~~~~~~~~

.. code-block:: pascal

function GetHitpointsMM: integer;

Returns the HitPoints on the MM Toggle

.. note::

by Flight

Example:

.. code-block:: pascal

*)
function GetHitPointsMM: integer;
var
tpa : TPointArray;
begin
tpa := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(522,56,541,69));
result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
end;

(*
QuickPray
~~~~~~~~~~~~

.. code-block:: pascal

QuickPray(Pray: Boolean): Boolean;

Turns the Quick Prayers on or off using the Prayer Toggle on the MiniMap

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickPray(Pray: Boolean): Boolean;
var
CCountPurple, CCountWhite: integer;

begin
Result := False;
CCountPurple := CountColorTolerance(5056052, 550, 95, 565, 108, 45);
CCountWhite := CountColorTolerance(9723486, 550, 95, 565, 108, 22);

if ((CCountPurple < 1) and (CCountWhite < 1)) then
begin
Exit;
end;

if (Pray) then
begin
if (CCountWhite < 1) then
MouseBox(550, 95, 565, 108, mouse_left);
Result := True;
end else
begin
if (CCountWhite > 1) then
MouseBox(550, 95, 565, 108, mouse_left);
Result := True;
end;

end;

(*
GetPrayerPointsMM
~~~~~~~~~~~~

.. code-block:: pascal

function GetPrayerPointsMM: integer;

Returns the Prayer Points on the MM Toggle

.. note::

by Flight

Example:

.. code-block:: pascal

*)
function GetPrayerPointsMM: integer;
var
tpa : TPointArray;
begin
tpa := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(522,100,541,112));
result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
end;

(*
QuickPrayAt
~~~~~~~~~

.. code-block:: pascal

function QuickPrayAt(PrayerPoints: integer): Boolean;

Toggles the Prayer icon on the MiniMap if the Prayer Points are greater than
or equal to the PrayerPoints

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickPrayAt(PrayerPoints: integer): Boolean;
var
CP: integer;

begin
Result := False;
CP := GetPrayerPointsMM;

if (CP >= PrayerPoints) then
begin
if QuickPray(True) then
Result := True;
end;
end;

(*
QuickRun
~~~~~~~~~~~~

.. code-block:: pascal

QuickRun(Run: Boolean): Boolean;

Sets Run on or off using the Run Toggle on the MiniMap

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickRun(Run: Boolean): Boolean;
var
CCountGold, CCountGrey: integer;

begin
Result := False;
CCountGold := CountColorTolerance(105406, 574, 133, 590, 144, 23);
CCountGrey := CountColorTolerance(9411739, 574, 133, 590, 144, 36);

if ((CCountGold < 1) and (CCountGrey < 1)) then
Exit;

if (Run) then
begin
if (CCountGold < 1) then
begin
MouseBox(574, 133, 590, 144, mouse_left);
Result := True;
end;
end else
begin
if (CCountGold > 1) then
begin
MouseBox(574, 133, 590, 144, mouse_left);
Result := True;
end;
end;

end;

(*
GetRunEnergyMM
~~~~~~~~~~~~

.. code-block:: pascal

function GetRunEnergyMM: integer;

Returns the Run percentage on the MM Run Toggle

.. note::

by Flight

Example:

.. code-block:: pascal

*)
function GetRunEnergyMM: integer;
var
tpa : TPointArray;
begin
tpa := returnTPAExceptColors([4938344, 0], [20, 0], intToBox(546,136,566,148));
result := strToIntDef(getTextATPA(clusterTPAEx(tpa,1,10), 5, 'StatChars07'), 0);
end;

(*
QuickRunAt
~~~~~~~~~

.. code-block:: pascal

function QuickRunAt(EnergyPercent: integer): Boolean;

Toggles the Run icon on the MiniMap if the Energy is greater than or equal
to the EnergyPercent

.. note::

by Sk1nyNerd

Example:

.. code-block:: pascal

*)
function QuickRunAt(EnergyPercent: integer): Boolean;
var
CR: integer;

begin
Result := False;
CR := GetRunEnergyMM;

if (CR >= EnergyPercent) then
begin
if QuickRun(True) then
Result := True;
end;
end;

havent played in quite awhile but functions like these are how you determine colors and letters/numbers. these are for the minimap. i know there are functions in the include you could use to get these from the gametab

i think theyre in one of the includes by now but idk tbh and idk if these are still valid




Thanks for your response :) I'll look for a good function and try but I think these don't work anymore.

EDIT: I managed to get prayer point simply by declaring an integer and using it with GetPrayerPoints. It outputs integer (obv) of current prayer points.

var
pp: integer;

pp := GetPrayerPoints;

Eduard

2014-08-20 13:27:16

Every Function that you call will have a return value. In this case, GetPrayerPoints returns an integer containing the current prayer points.

Remember to use these functions by having a failsafe / if statement:
For example:


Function LowPrayerPoints: boolean;
var
iPrayerPoints: integer;
begin
iPrayerPoints:= GetPrayerPoints;
if(iPrayerPoints < 5) then
begin
result:= true;
end else
result:= false;
end;

begin
if(LowPrayerPoints) then
DrinkPrayerPot;
end.