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?
Any possible causes/solutions?
2010-05-12 18:41:18
2010-05-12 18:44:03
2010-05-12 18:49:06
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.
2010-05-12 19:17:05
2010-05-12 19:42:09
2010-05-12 19:43:18
2010-05-12 19:44:35
2010-05-12 19:48:08
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.
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?
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.
2010-05-12 19:55:28
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.
2010-05-12 20:03:08
2010-05-12 20:32:16
2010-05-12 20:45:34
{.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.
2010-05-12 20:54:26
From: IceFire908He is using Simba not SCAR.
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]
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.
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?
From: IceFire908
I thought he was getting the same problem with both?
2010-05-13 07:07:30
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.
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?
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?