SRL Archive - RS3 Help

NPC Hover Detect


Yago

2014-03-07 17:05:46

I haven't scripting in a while. I'm getting used to the library. Is there a function that detects the interface popup thing you see when you hover(not click, not the weakness) over an attackable npc.

Thanks

Foundry

2014-03-07 17:22:14

From: Yago
I haven't scripting in a while. I'm getting used to the library. Is there a function that detects the interface popup thing you see when you hover(not click, not the weakness) over an attackable npc.

Thanks


Are you talking about mouseover text? Everything to do with that is located here.

sdf

2014-03-07 21:13:48

From: Foundry
Are you talking about mouseover text? Everything to do with that is located here.


There's a compact version of the mouse over info you get when you are attacking an NPC. I think he wants that.

Turpinator

2014-03-07 22:46:35

i now not what you speak of… Pics please. :)

Clarity

2014-03-07 23:22:35

All I see is normal mouseover text when hovering over attackable NPCs.

Foundry

2014-03-08 00:48:28

From: Clarity
All I see is normal mouseover text when hovering over attackable NPCs.


Yeah, same here. Is it in the options or something?

sdf

2014-03-08 01:35:34

It doesn't appear over every attackable NPC. But when it does it looks like this:

http://i.imgur.com/MjUWsx6.png

Notice how the mouse over text is only "Attack" not "Attack NPCNAMEHERE". Actually, for this one it looks like the standard in-combat interface, but there's also another variation of it that happens on some NPC's. Pretty sure these are just bugs that Jagex never got around to fixing.

Clarity

2014-03-08 06:47:53

And that's different from just
isMouseOverText['Attack']
?

Or are you referring to the HP bar/weakness/etc. over the NPC? Cause I don't think anything for that exists.

Yago

2014-03-11 22:12:55

I think I tried isMouseOverText with no results. And I am talking about the picture sdf posted. however, this specific npc shows the full name and level. But now that I notice, there are two interface things open in the picture. I am referring to the one without an hp bar.

Clarity

2014-03-11 22:22:55

From: Yago
I think I tried isMouseOverText with no results. And I am talking about the picture sdf posted. however, this specific npc shows the full name and level. But now that I notice, there are two interface things open in the picture. I am referring to the one without an hp bar.

That is what isMouseOverText is supposed to recognize.

If it doesn't work try a varying search like
isMouseOverText['Attack','oblin','ck G']
etc.

Olly

2014-03-12 00:40:34

Debug should tell you what mouse-over text finds.

Yago

2014-03-13 18:14:51

Ok I figured it out. Do we have a function that gets the bounds of the box with the monster's hp in it? The box that contains the weakness?

Clarity

2014-03-13 18:57:28

From: Yago
Ok I figured it out. Do we have a function that gets the bounds of the box with the monster's hp in it? The box that contains the weakness?

I don't believe we do, although that would probably speed things up. Right now I just use findDTM with mainscreen.getBounds() which has worked out fine.


{FUNCTION -- areWeFighting
Purpose: Checks if we are fighting a brother.
Comments: None.}
function areWeFighting: boolean;
var
x, y, tries: integer;
begin
if not isLoggedIn then
exit;
result := false;
isAkrisae := false;
ClarityDebug('Checking to see if we are in combat.');
while tries < 4 do
begin
if findDTM(earthWeakness, x, y, mainScreen.getBounds()) or
findDTM(airWeakness, x, y, mainScreen.getBounds()) or
findDTM(rangedWeakness, x, y, mainScreen.getBounds()) or
findDTM(rangedWeaknessAlt, x, y, mainScreen.getBounds()) or
findDTM(fireWeakness, x, y, mainScreen.getBounds()) or
findDTM(stabWeakness, x, y, mainScreen.getBounds()) or
findDTM(waterWeakness, x, y, mainScreen.getBounds()) or
findDTM(boltWeakness, x, y, mainScreen.getBounds()) then
begin
if findDTM(boltWeakness, x, y, mainScreen.getBounds()) then
begin
isAkrisae := true;
ClarityDebug('We are fighting Akrisae!');
end;
result := true;
ClarityDebug('Currently in combat with a brother.');
exit;
end
else
inc(tries);
end;
end;
Looking at it again actually, it would probably be a lot nicer to have a combatInfo.getBounds() or something.

Yago

2014-03-13 23:30:59

Yea it would give me some search box params for my npc to make the script pretty. But, i'm using the red ring as an extra check for safety.

Thanks guys