SRL Archive - OSR Help

Need help with a function?


Joepetey

2012-05-05 11:43:07

How would I write a function that would check to see if an npc is currently in combat or not? Please help because for the life of me can not seem to figure it out.


:garfield:

masterBB

2012-05-05 11:48:42

When you found the coordinates of the npc, check if the colors of a health bar can be found above it.

Joepetey

2012-05-05 11:57:29

I really do not understand that. :duh:

:garfield:

putonajonny

2012-05-05 12:09:13

This function returns the location of all the HP bars on screen, you could use it to find an NPC without one…
Function ReturnHPBars : array of TPoint;
Var
P1, P2 : array of TPoint;
RedOnRight, AllGreen : integer;
begin

RedOnRight := DTMFromString('m6wAAAHic42ZgYDgHxJux4FdYcA0QVwFxNZRdC8R1OMSs2ZkYGDQYMDBIHB3/ZyAeMJKAkQAATQ0RqQ==');
AllGreen := DTMFromString('m6wAAAHic42ZgYDgHxJux4FdYcA0QVwFxNZRdC8R1OMSs2ZkYGDQYiML/GYgHjCRgJAAAD8gRHQ==');
FindDTMs(RedOnRight, P1, MSX1, MSY1, MSX2, MSY2);
FindDTMs(AllGreen, P2, MSX1, MSY1, MSX2, MSY2);
CombineTPAWrap(P1, P2, Result);
FreeDTM(RedOnRight);
FreeDTM(AllGreen);

end;

Joepetey

2012-05-05 12:10:31

Thank you so much, do I have permission to add this to my script?

putonajonny

2012-05-05 12:23:00

From: Joepetey
Thank you so much, do I have permission to add this to my script?


Of course :) if you want to credit me then feel free but it's quite simple so I won't be bothered, if you apply for SRL members with it some people might be bothered if you don't credit it

Joepetey

2012-05-05 12:26:51

Ok, thank you very much. :spot:


:garfield: