SRL Archive - OSR Help

Checking for Combat


iBlank

2012-04-03 06:18:44

I need some suggestions on a procedure for checking in my player is in combat. I am using this for my LRC fisher so the area is very crowded and I am still getting false positives. This is currently what I have, and I am looking for something to cut down on the false positives! Thanks.


Procedure CheckFight;
begin;
if (InFight) then
begin;
Writeln('Checking pixelshift for fight...')
PBox := IntToBox(245, 130, 285, 195);
If (AveragePixelShift(PBox, 1000, 5000) > 1110) then
begin;
writeln('...looks like a fight, to bank!');
ToBank;
end;
Writeln('...no fight detected! Back to fishing.');
end else exit;
exit;
end;

Abu

2012-04-03 06:51:03

Looks like it should work fine, could you post the InFight function?

iBlank

2012-04-03 06:56:11

From: abu_jwka
Looks like it should work fine, could you post the InFight function?


I'm just using the one that is in the srl/srl/skill/fighting.simba. Guess I might have to accept that there will be some false positives!

Frement

2012-04-03 07:00:27

From: abu_jwka
Looks like it should work fine, could you post the InFight function?


InFight is actually just a wrapper for srl_InFight which is found in globals.simba.

Er1k

2012-04-03 09:45:03

Do you get hit often? If you do it might be good to check whether your HP actually decreased. It's an easy indicator as to whether you were in fight.

I think in Narcle's fast fighter there's also something called OtherInFight to reduce the chances of getting false positives.