SRL Archive - OSR Help

Get Text from a spot.


Home

2010-12-20 16:01:40

Hello guys i would need a function what would get this specific Name and put it into a string.

Here is Pic..
I'm not very goot at getting text, i have tried.. But with zero results..

I can lend an account. And this is in Fist Of Guthix.

And if it is possible to do that in reflection then why not :)





Thanks.


~Home

Blumblebee

2010-12-20 16:19:59

well that font looks like the friends chat font ( I think ). If you do a little digging, Wizzup had a function in his Essence Miner v2 that grabbed text on the mainscreen and returned the co-ords (to find Aubury). Now I would suggest taking a look at this function, changing the font set, and then changing the search area and you should have your answer.

if you try and fail with that, I'll take a look into it.

Home

2010-12-20 16:34:01

I failed.. :/ Darn it.
I couldn't get it work. Sorry mate. : /


~Home

mormonman

2010-12-20 16:42:37

That could easily be done in reflection, you just need to find the right interface that contains that information.

Home

2010-12-20 16:45:56

From: mormonman
That could easily be done in reflection, you just need to find the right interface that contains that information.


Hmm. How, is there tuorial or something : /


I can lend an account if you are good with Ref. :)


~Home

Blumblebee

2010-12-20 17:06:23

go on IRC and I'll try to get it working via color.

Edit: Completed. I only had the picture you gave me, so you need to get the actual rs co-ordinates and put them in Area. The only thing is that the text detection is still somewhat off, it didn't quite get the name right, but it was close. I think if you need specifics you should use reflection, or else work on perfecting the system I used.

const
Text_Color = 6976375;

function GetPlayerName(Area: TBox; TextCol: Integer): string;
var
TPA: TPointArray;
B: TBox;
begin
FindColorsTolerance(TPA, TextCol, Area.x1, Area.y1, Area.x2, Area.y2, 3);
if Length(TPA) = -1 then
Exit;
B := GetTPABounds(TPA);
Result := Trim(GetTextAtExWrap(B.x1-1,B.y1,B.x2+1,B.y2,0,5,2,TextCol,0,FriendChars));
end;

Home

2010-12-20 17:43:49

From: Blumblebee
go on IRC and I'll try to get it working via color.

Edit: Completed. I only had the picture you gave me, so you need to get the actual rs co-ordinates and put them in Area. The only thing is that the text detection is still somewhat off, it didn't quite get the name right, but it was close. I think if you need specifics you should use reflection, or else work on perfecting the system I used.

const
Text_Color = 6976375;

function GetPlayerName(Area: TBox; TextCol: Integer): string;
var
TPA: TPointArray;
B: TBox;
begin
FindColorsTolerance(TPA, TextCol, Area.x1, Area.y1, Area.x2, Area.y2, 3);
if Length(TPA) = -1 then
Exit;
B := GetTPABounds(TPA);
Result := Trim(GetTextAtExWrap(B.x1-1,B.y1,B.x2+1,B.y2,0,5,2,TextCol,0,FriendChars));
end;

Thanks matey!
I'm working on Both ones :)

Thanks again

~Home

mormonman

2010-12-20 17:56:42

Just use the interface explorer with rsbot

Wanted

2010-12-20 18:18:18

Are those really FriendChars? I thought they would be the same as XPChars

Blumblebee

2010-12-20 18:35:17

From: IceFire908
Are those really FriendChars? I thought they would be the same as XPChars


FriendChars definitely worked for me. I recognized them because Nike used them to paint stats for one of his scripts if I recall

Wanted

2010-12-20 18:41:35

From: Blumblebee
FriendChars definitely worked for me. I recognized them because Nike used them to paint stats for one of his scripts if I recall


Hm maybe XPChars are the same as FriendChars then…

Blumblebee

2010-12-20 18:45:03

From: IceFire908
Hm maybe XPChars are the same as FriendChars then…


does xp chars have the shadow? I don't really even know where the xpchars are :/

Wanted

2010-12-20 18:55:33

From: Blumblebee
does xp chars have the shadow? I don't really even know where the xpchars are :/


XPChars are the characters from the numbers and XP when you open the XB Bar on the left side of the minimap.