SRL Archive - OSR Help

srl_infight (osr-srl) broken?


Hoodz

2013-03-31 13:44:00

does srl_infight in osr-srl works? because my script keeps attacking other npcs even its in a fight :/
need answer asap

Wetish

2013-03-31 13:44:47

Are you using one within the OSR include?

Hoodz

2013-03-31 13:48:23

From: Wetish
Are you using one within the OSR include?


(*
srl_InFight
~~~~~~~~~~~

.. code-block:: pascal

function srl_InFight: Boolean;

Checks whether player currently is in a fight, using mainscreen
HP bar presence detection. Returns True if Player's HP bar is detected.
Idea for improvement: Also check using PixelShift(); to see whether Player
is performing fighting animations to further improve the certainty of results.

.. note::

by Narcle

Example:

.. code-block:: pascal

while srl_InFight do
begin
CheckHP;
EatFood;
end;

*)
Function srl_InFight: Boolean;
begin
Result := InRange(Length(GetFightBarTPA(MFBox)), 30, 240);
end;

procedure Proc_WorldSwitcherEnabled;
begin
WorldSwitcherEnabled := WorldSwitcherEnabled;
end;

got this out from: https://github.com/SRL/SRL-OSR/blob/master/SRL/core/globals.simba

Ashaman88

2013-03-31 23:22:07

Try testing it out - attack something and have the script so if infight then writeln something repeating until false - it worked fine in testing and works fine for combat randoms