SRL Archive - SRL Bugs

CurrentWorld / IsTextInAreaEx


honeyhoney

2012-05-20 09:02:09

Wasn't sure where to post this, but I'm having trouble with the SRL function; "function CurrentWorld: Integer;".

I've narrowed it down (or so I believe), to this line;

  if (IsTextInAreaEx(635, 205, 727, 226, TextX, TextY, 'RuneSca', 5,
SmallChars, False, False, 0, 0, 3381759)) then

IsTextInAreaEx (found in simba.simba) is unable to identify the string 'RuneSca' even when it is present. I've managed to identify it with GetTextAtWrapEx and also managed to get IsTextInAreaEx find Rune, or une, or Sca, or S but not the 'eS' string… (I may have had to twiddle a few values, not sure if the max spacing was set properly and the xs and xe values were out of whack I think).

Edit: just wondering why you couldn't use
Result := StrToInt(GetTextAtWrapEx(xs, ys, xe, ye, 0, 5, 2, 3381759, 0, SmallChars))
I'm sure there's a reason - just want to hear it :P

Anyway, hoping someone can confirm or deny that this is indeed a bug and I'm not doing something stupid and address the issue.

litoris

2012-05-20 10:02:45

Capital letters tend to cause problems. Just put 'cape' or 'une' instead of 'RuneSca', should work.

honeyhoney

2012-05-20 11:00:19

From: litoris
Capital letters tend to cause problems. Just put 'cape' or 'une' instead of 'RuneSca', should work.


As explained in my original post, it can find the capital letter if it has no letters preceeding it. I am well aware of a few ways to work around it, however, seeing as it is a problem related to the functioning of srl I reported it so it get's fixed for everyone.

Abu

2012-05-21 11:17:51

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

As you can add the colour of the text. Also, make sure you're selecting the correct font to search for.

honeyhoney

2012-05-22 17:50:08

From: abu_jwka
…


From: honeyhoney
I am well aware of a few ways to work around it


I even demonstrated that in the first post!

I am perfectly capable of creating my own CurrentWorld function, but seeing as the one in the SRL include is broken I am reporting it.:fiery:

NCDS

2012-05-22 19:21:08

From: honeyhoney
I even demonstrated that in the first post!

I am perfectly capable of creating my own CurrentWorld function, but seeing as the one in the SRL include is broken I am reporting it.:fiery:


Lol, reading through the thread I can understand your frustration.

I'll have a look at this today. Thanks for reporting. :)

Justin

2012-05-24 06:45:14

From: NCDS
Lol, reading through the thread I can understand your frustration.

I'll have a look at this today. Thanks for reporting. :)


AFAIK Home submitted a pull request with this fixed.

Kyle Undefined

2012-05-24 09:28:36

But his fix is more of a complete change.

Abu

2012-05-25 11:30:07

Just to answer your question on why you can't use:
Result := StrToInt(GetTextAtWrapEx(xs, ys, xe, ye, 0, 5, 2, 3381759, 0, SmallChars))

The result would get the text, not read it.

We want to confirm that the text 'RuneSca' is in a specified area.

Yes you could use the above function, but not as the result.

honeyhoney

2012-05-25 20:10:13

From: abu_jwka
Just to answer your question on why you can't use:
Result := StrToInt(GetTextAtWrapEx(xs, ys, xe, ye, 0, 5, 2, 3381759, 0, SmallChars))

The result would get the text, not read it.

We want to confirm that the text 'RuneSca' is in a specified area.

Yes you could use the above function, but not as the result.


Just set xs ys xe and ye to be the coordinates around the world number.

Edit: and because StrToInt is used it will return an integer.
It's what I'm using out works fine.

I was hoping for an explanation as to why the current function appears so contrived.

Edit #2: To clarify, I was more than aware what GetTextAtWrapEx returns