SRL Archive - OSR Help

GetColor Not Returning Right Color?


YoHoJo

2013-03-05 08:28:19

Picked colour: 2070783 at (186, 36)


Writeln(IntToStr(GetColor(186, 36)));
Writeln(IntToStr(GetColor(186, 36+50)));
Writeln(IntToStr(GetColor(186, 36-50)));

5000782 NOPE
3358280 NOPE
1796428 NOPE

So what the heck?
More Info:
{$i SRL/srl.simba}
{$I P07Include.Simba}
{$i sps/sps.simba}
{.Include SRL\SRL\Misc\Debug.simba}





begin
SetupP07Include;
SetupSRL;
MouseSpeed:=30;
SetupWalker;
MarkTime(StartTime);
SRL_EnableNavBar;


Yet in my sample script with the EXACT SAME start to the mainloop, it works just fine.

x[Warrior]x3500

2013-03-05 08:36:28

Picked colour: 12502726 at (186, 36)

Writeln(IntToStr(GetColor(186, 36-20))) ;

12502726

YoHoJo

2013-03-05 08:52:33

From: x[Warrior]x3500
Picked colour: 12502726 at (186, 36)

Writeln(IntToStr(GetColor(186, 36-20))) ;

12502726



Thanks.
WHY?! What the hell is this -20 stuff.
Navbar was -50 before.

Also how come

program Walker;
{$i SRL/srl.simba}
{$I P07Include.Simba}
{$i sps/sps.simba}
{.Include SRL\SRL\Misc\Debug.simba}



begin
SetupP07Include;
SetupSRL;
MouseSpeed:=30;
SRL_EnableNavBar;
Writeln(IntToStr(GetColor(564, 446)));


end.

Works WITHOUT the -20?

What is the reason I must do -20.

Justin

2013-03-05 08:54:36

From: YoHoJo
Thanks.
WHY?! What the hell is this -20 stuff.
Navbar was -50 before.

Also how come

program Walker;
{$i SRL/srl.simba}
{$I P07Include.Simba}
{$i sps/sps.simba}
{.Include SRL\SRL\Misc\Debug.simba}



begin
SetupP07Include;
SetupSRL;
MouseSpeed:=30;
SRL_EnableNavBar;
Writeln(IntToStr(GetColor(564, 446)));


end.

Works WITHOUT the -20?

What is the reason I must do -20.


It's because you are calling 07Include THEN SetupSRL

Swap them around

(This has also been fixed in the SRL-OSR) ;)

YoHoJo

2013-03-05 08:56:59

Both scripts call the includes and the setups in the same order.
One works one doesn't. Why :/?
Thanks though Justin and Warrior.

I still have to do the -20 even when called in the same order you said Justin.
I'm just gonna get official SRLOCR.

x[Warrior]x3500

2013-03-05 09:01:15

SRL_EnableNavBar;
setupSRL;


its the nav bar update (that annoys me like crazy). this will make the coords normal.

YoHoJo

2013-03-05 09:38:57

Got SRL OCR from Git.
Sticking with that now.
<3


From: masterBB
You closed the thread before there was a real answer why. IIRC in SRL the difference is set to -20 because the navbar on the inlogscreen is only 20 pixels high. After logging in it is changed to -50, cause rs self got a bigger navbar. The -20 offset is set when you call SetupSRL since you normally start on the loginscreen.

Gr,
Bart