SRL Archive - OSR Help

Help with grabbing text please :)


Rare Scripts

2015-05-24 19:52:09

Hello,
I'm trying to grab the text my main in trade screen but its not working

Can anyone help please? :)

Thx

username := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 2070783, 53, 'CharsTrade07');
writeln('Username: '+IntToStr(username));

Also when is CTRL + left click GetTextAtExWrap nothing pops up… ? :O

Pavement

2015-05-25 02:08:47

Do you change the colour tolerance speed at any stage because I think this sometimes causes text finding functions to break.

Also in you writeln the "inttostr(username)" I would have thought should just be "tostr(username)" because the username will be a string and intostr will give a type mismatch. Correct me if I'm wrong though :)

Harrier

2015-05-25 02:17:35

Did you look in the font files? CharsTrade07 are unfinished.

Rare Scripts

2015-05-25 08:53:43

From: Pavement
Do you change the colour tolerance speed at any stage because I think this sometimes causes text finding functions to break.

Also in you writeln the "inttostr(username)" I would have thought should just be "tostr(username)" because the username will be a string and intostr will give a type mismatch. Correct me if I'm wrong though :)


Close, :P

username := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 2070783, 53, 'UpChars07');
writeln('Username: '+String(username));

Was the correct one:)

Anyways the GetTextAtExWrap wont seem to open… I cant see what those numbers are….Lol, can some1 tell me please? :P

Pavement

2015-05-25 09:20:28

You mean this?

function GetTextAtExWrap(const xs,ys,xe,ye, minvspacing, maxvspacing, hspacing,color, tol: integer;const font: string): string;

Rare Scripts

2015-05-25 09:58:16

From: Pavement
You mean this?

function GetTextAtExWrap(const xs,ys,xe,ye, minvspacing, maxvspacing, hspacing,color, tol: integer;const font: string): string;


Yep, thanks!:)



I tried a sample with the HighScore loader ive found in the search part but its throwing errors (Loading name correctly!)

Error:

Username: <the name :P>
Overall: Verdana (wtf??)
Attack: html{margin: 0; padding: 0; height: 100%; overflow: hidden;}#content{position:absolute; left: 0; right: 0; bottom: 0; top: 0px;}</style><div id="content"><iframe width="100%" height="100%" frameborder="0" src="https://hiscore.runescape.com/error404.ws"></iframe></div>
<div style="font-weight: bold; color: #666666; font-size: large">404 - Page not found</div><hr width="300" align="left" /><p>Sorry
Error: Out Of Range at line 3029
The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap, 3, 4, 5, 6, 7, 8]




Code used:

username := GetTextAtExWrap(102,29,176,57, 0, 1, 1, 2070753, 53, 'UpChars07');
writeln('Username: '+String(username));


skillArr := ['Overall', 'Attack', 'Defence', 'Strength', 'Constitution', 'Ranged', 'Prayer', 'Magic'];

stats := parse();
for i := 0 to high(stats) do
begin
if i mod 2 <> 0 then
begin
setArrayLength(actualStats, length(actualStats)+1);
actualStats[length(actualStats)-1] := stats;
end;
end;


for i := 0 to high(skillArr) do
writeLn(skillArr+': '+actualStats);



Function used:

function Parse(): tStringArray;
var
page: string;
begin
page := GetPage('http://hiscore.runescape.com/index_lite.ws?player='+username);
result := explode(',', page);
end;



Edit: Fixed it, forgot it had rs3 highscores…. Changed to 07 now getting this:

Username: <the name :P>
Overall: Verdana
Attack: the page you were looking for was not found.</p><!–Padding for IEPadding Padding for IEPadding Padding for IEPadding Padding for IEPadding for IEPadding for IEPadding for IEPadding for IEPadding for IEPadding for IEPadding for IEPadding for IEPadding for IE–></body></html>

Error: Out Of Range at line 3030
The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap, 3, 4, 5, 6, 7, 8]

Pavement

2015-05-25 12:11:54

I'm not sure what you are trying to do now but some things to note with high-scores is that if you grab the username from in game then make sure spaces become '_' (dashes).

This is the link for oldschool highscores:
http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player=USERNAMEHERE

And what I mentioned above about the 'tostr(username)' is incorrect because you can just leave it as:
writeln('Username: '+username);

This should work because username will already be a string.

Edit: TY Baws. Funny side story here. Well while trying to grab a screenshot of a trade screen to help test this for you I traded some random guy (GuyX) 5k. GuyX took it ofcourse, I got my screenshot and GuyX asked for more. Another guy(GuyZ) nearby suddenly complained about how GuyX was begging after i gave GuyX stuff. Long story short GuyZ traded me 1.5m and said I deserved it. Ty baws wouldnt have got it without you :P

Edit2: I also can't get gettextatexwrap(); to work either :L

Rare Scripts

2015-05-25 13:15:01

From: Pavement
I'm not sure what you are trying to do now but some things to note with high-scores is that if you grab the username from in game then make sure spaces become '_' (dashes).

This is the link for oldschool highscores:
http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player=USERNAMEHERE

And what I mentioned above about the 'tostr(username)' is incorrect because you can just leave it as:
writeln('Username: '+username);

This should work because username will already be a string.

Edit: TY Baws. Funny side story here. Well while trying to grab a screenshot of a trade screen to help test this for you I traded some random guy (GuyX) 5k. GuyX took it ofcourse, I got my screenshot and GuyX asked for more. Another guy(GuyZ) nearby suddenly complained about how GuyX was begging after i gave GuyX stuff. Long story short GuyZ traded me 1.5m and said I deserved it. Ty baws wouldnt have got it without you :P

Edit2: I also can't get gettextatexwrap(); to work either :L


Thx gonna try that ^^

Also 1.5m free is always a ftw xD