SRL Archive - SRL Bugs

GetColor is returning wrong color.


djborec

2012-07-20 12:50:58

Hello, when I try to use GetColor function , I pick manually color at position and when I use GetColor built in Simba I get totally different results.

Really hard to post some example or what. But I tried to add long wait before Simba picks color but still same…

Kasi

2012-07-20 12:58:35

might be because the coords are off?

djborec

2012-07-20 14:05:45

Hm ,not sure other functions are just working fine. Well I managed to fix my script with color its returning from GetColor function ,not from color I pick up manually ,well thats really weird.

riwu

2012-07-20 19:34:53

iirc wizzup stated that the color picker's coordinate will return the wrong value currently (due to the nav bar), its deviating 50 y-coordinate from the actual coordinate.

Getdropped

2012-07-20 20:05:52

From: djborec
Hm ,not sure other functions are just working fine. Well I managed to fix my script with color its returning from GetColor function ,not from color I pick up manually ,well thats really weird.


Im actually having the same problem for some reason, that is odd =/ I think its the nav bar 50 px

EDIT: what he said ;) ^

Main

2012-07-20 23:23:36

you might be using an unsupported color mode such as software. Also color at each pixel changes is always changing.

Also did you check if your screen area ?

djborec

2012-07-21 16:01:24

you might be using an unsupported color mode such as software. Also color at each pixel changes is always changing.

Also did you check if your screen area ?

No I am using safe mode. And I am using static color that never change. GetColor function is probably resulting wrong colors ,so it really hard to writte something that will work if basic function are not working.

x[Warrior]x3500

2012-07-21 16:19:36

just took 2 seconds and tested it out on my own.
here was my script:

program new;
{$I SRL/SRL.simba}

begin
setupsrl;
writeln(tostr(getcolor(563, 55)));
end.
here was the debug:

Picked colour: 1845292 at (563, 55)
Compiled successfully in 531 ms.
SRL Compiled in 0 msec
1845292
Successfully executed.

worked perfectly. something is happening on your end. either its not set up correctly(most likely), or you have a bad simba (unlikely)? maybe reinstall?

edit: as a side note, its rather stupid to report a 'bug' but provide no script + debug as proof that the bug even occurs.

P1ng

2012-07-21 20:34:24

It's definitely the navbar issue. I was trying to make a few functions with MouseBox in them yesterday and for the SmartGraphics include the co-ordinates were exactly the same as the colour picker. However, for MouseBox the co-ordinates needed to be offset to account for the navbar.

Just minus 50px or something along those lines and you will the get the colour at the spot you want. Maybe use MMouse(x,y,0,0); to check that the edited co-ordinate is the correct spot as well.

x[Warrior]x3500

2012-07-21 22:41:11

From: p1ng
It's definitely the navbar issue. I was trying to make a few functions with MouseBox in them yesterday and for the SmartGraphics include the co-ordinates were exactly the same as the colour picker. However, for MouseBox the co-ordinates needed to be offset to account for the navbar.

Just minus 50px or something along those lines and you will the get the colour at the spot you want. Maybe use MMouse(x,y,0,0); to check that the edited co-ordinate is the correct spot as well.


program new;
{$I SRL/SRL.simba}
var
x,y:integer;
begin
setupsrl;
mousebox(555, 263,574, 281,mouse_move);
getMousePos(x,y);
writeln(tostr(x)+' '+tostr(y));
end.

Compiled successfully in 639 ms.
SRL Compiled in 16 msec
568 273
Successfully executed.

you shouldnt need to offset it because you pass your coords…

djborec

2012-07-22 13:32:20

edit: as a side note, its rather stupid to report a 'bug' but provide no script + debug as proof that the bug even occurs.


As I said its really hard for me to provride it ,because it is special script for MTA ,whoever will have to try ,will need to do lot of tasks before it…

And I found out that other color functions are not working for me aswell ,for example FindCoulour

djborec

2012-07-22 13:35:38

Finally resolved ,I had monitor in 16bit Color and Simba loaded 32bit Color…

Wizzup?

2012-07-22 13:45:36

From: djborec
Finally resolved ,I had monitor in 16bit Color and Simba loaded 32bit Color…


I'm surprised Simba worked at all. ;)