SRL Archive - Bugs

Range Check/Out of Range errors


Renax

2010-05-12 18:41:18

I've been getting a lot of these range errors in common functions, usually when any FindColors function is called.

Any possible causes/solutions?

Sex

2010-05-12 18:44:03

You should provide some more information..code used, exact errors, etc.

bbri06

2010-05-12 18:49:06

Do the coordinates you're using form a box? Is that box's first point in the upper left corner and the second in the lower right? I used to get problems with that a lot. Not sure if it still causes problems.

Renax

2010-05-12 18:57:13

From: bbri06
Do the coordinates you're using form a box? Is that box's first point in the upper left corner and the second in the lower right? I used to get problems with that a lot. Not sure if it still causes problems.


Those are generally the parameters ;)

LoggedIn will call a range error, rsGetminimapAngleDegrees/Radians will call one as well.

All the functions are In SRL and Simba will give me lackluster commentary

"Exception: Range check error at line 73"

Wizzup?

2010-05-12 19:17:05

Using the latest Simba?

mastaraymond

2010-05-12 19:42:09

That is because the target isn't set right ;).

After every [Colour pick/minimize/maximize etc] you need to reset the target, as Runescape seems to get a new handle (a lot). Need to find out how to prevent this from happening, but I'm not sure if I can.. As RS just seems to be a bitch about it.

Renax

2010-05-12 19:43:18

version 666/668 ? I've had these issues popping up since 640 or so when I first downloaded It.

mastaraymond

2010-05-12 19:44:35

Also note, this is a Simba/SCAR problem before someone starts going frenzy @ Simba :p

Renax

2010-05-12 19:48:08

Hmm I thought that may be part of the issue, I've had a few out of bounds errors mid script running.. could the handle update and mess up a script after it has started?

Wizzup?

2010-05-12 19:48:42

From: mastaraymond
That is because the target isn't set right ;).

After every [Colour pick/minimize/maximize etc] you need to reset the target, as Runescape seems to get a new handle (a lot). Need to find out how to prevent this from happening, but I'm not sure if I can.. As RS just seems to be a bitch about it.


I've never had problems with the handle resetting. Only if you use Firefox with adblock on Windows.

After a colour pick, the client is _not_ reset. At least, that's not what Simba does. Simba remembers the set target and picking colours does not mess it up. (SCAR does reset it always)

If it happens, then blame either Runescape or Windows.

@Renax: Try with SMART or try not using adblock. (Perhaps the runescape.exe ``client''?)

mastaraymond

2010-05-12 19:49:57

From: Renax
Hmm I thought that may be part of the issue, I've had a few out of bounds errors mid script running.. could the handle update and mess up a script after it has started?

Well, unless you do some weird shit, no.

Especially if you're using Smart it's impossible for it to happen..

mastaraymond

2010-05-12 19:51:18

From: Wizzup?
I've never had problems with the handle resetting. Only if you use Firefox with adblock on Windows.

After a colour pick, the client is _not_ reset. At least, that's not what Simba does. Simba remembers the set target and picking colours does not mess it up. (SCAR does reset it always)

If it happens, then blame either Runescape or Windows.

That's what I said in my post Sherlock.. Runescape gets a new handle on a lot of occasions (has nothing do with Firefox/Adblock).. Try picking a color on smart for example (when in enabled mode), it will lose focus and get a new handle.

Renax

2010-05-12 19:55:28

Now why does it only seem to affect FindColors? I can replace it with a FindColor and have no range error.

Wizzup?

2010-05-12 19:57:57

From: Renax
Now why does it only seem to affect FindColors? I can replace it with a FindColor and have no range error.


That is technically not likely. It's probably just coincidence? :)

Renax

2010-05-12 20:03:08

Granted I've seen it on two instances of FindColors and one instance of FindColor.. so a coincidence is pretty likely.

Slightly off topic but what resolution settings are ideal for SRL?

Sex

2010-05-12 20:32:16

It doesn't matter really.
As long as RuneScape can fit your screen in Fixed/Safe size.

Wanted

2010-05-12 20:45:34

Run in SCAR 3.23 Beta Revision 80+

w/ Jagex Runescape client safe mode, fixed mode, low detail. Already logged in.

{.include SRL\SRL.scar}
{.include SRL\SRL\Misc\Debug.scar}

procedure TestHandle;
var
TPA: TPointArray;
begin
FindWindowBySize(766, 504);
Wait(500 + Random(250));
ActivateClient;
Wait(1000 + Random(1000));
FindColorsTolerance(TPA, clWhite, MMX1, MMY1, MMX2, MMY2, 421);
FilterPointsPie(TPA, 0, 360, 0, 75, MMCX, MMCY);
DeBugTPA(TPA, '');
end;

begin
TestHandle;
end.

Sex

2010-05-12 20:54:26

From: IceFire908
Run in SCAR 3.23 Beta Revision 80+

w/ Jagex Runescape client safe mode, fixed mode, low detail. Already logged in.

Code:
[LEFT]{.include SRL\SRL.scar}
{.include SRL\SRL\Misc\Debug.scar}

procedure TestHandle;
var
TPA: TPointArray;
begin
FindWindowBySize(766, 504);
Wait(500 + Random(250));
ActivateClient;
Wait(1000 + Random(1000));
FindColorsTolerance(TPA, clWhite, MMX1, MMY1, MMX2, MMY2, 421);
FilterPointsPie(TPA, 0, 360, 0, 75, MMCX, MMCY);
DeBugTPA(TPA, '');
end;

begin
TestHandle;
end.
[/LEFT]

He is using Simba not SCAR.

Wanted

2010-05-12 21:07:23

From: mastaraymond
Also note, this is a Simba/SCAR problem before someone starts going frenzy @ Simba :p


From: Sex
He is using Simba not SCAR.


I thought he was getting the same problem with both?

Wizzup?

2010-05-13 05:50:27

From: Renax
Granted I've seen it on two instances of FindColors and one instance of FindColor.. so a coincidence is pretty likely.

Slightly off topic but what resolution settings are ideal for SRL?


Use Safe mode. All graphics low. :)

SRL 5 may pick up support for other resolutions, but currently hasn't.

Nevertheless… We should try to reproduce the Out of Range error, as the error thrown should be something like ``Client does no longer exist'', Raymond.

From: IceFire908
I thought he was getting the same problem with both?


I didn't see him mentioning he used SCAR anywhere. ;)

Renax

2010-05-13 07:07:30

Using smart to test the script seems to have eliminated all the errors, once simba would click on the runescape window I had running in my browser (chrome) the client would change its handle and I'd get some ridiculous window size which caused the range errors.

Wizzup?

2010-05-15 08:16:01

From: Renax
Using smart to test the script seems to have eliminated all the errors, once simba would click on the runescape window I had running in my browser (chrome) the client would change its handle and I'd get some ridiculous window size which caused the range errors.


I wonder how other tools keep track of handles that constantly change… Aren't there some desktop-record tools that *can* keep track of the runescape handle in chrome?

ShowerThoughts

2010-05-15 08:36:42

From: Wizzup?
I wonder how other tools keep track of handles that constantly change… Aren't there some desktop-record tools that *can* keep track of the runescape handle in chrome?


I am not 100% sure where I am talking about, but since the data(of the handle) is allocated in the same space I assume you could use a pointer?

Frement

2010-05-15 08:51:34

From: Wizzup?
I wonder how other tools keep track of handles that constantly change… Aren't there some desktop-record tools that *can* keep track of the runescape handle in chrome?


I made something that got the RS handle from the browser.

Here: http://pastebin.com/f492fb9f3

I tried making it a plugin but failed for some reason (with SCAR).