Results 1 to 13 of 13

Thread: GetColor is returning wrong color.

  1. #1
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default GetColor is returning wrong color.

    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...

  2. #2
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    might be because the coords are off?

  3. #3
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    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.

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    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.

  5. #5
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by djborec View Post
    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 ^

  6. #6
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    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 ?
    Oh Hai Dar

  7. #7
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    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.

  8. #8
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    just took 2 seconds and tested it out on my own.
    here was my script:
    Simba Code:
    program new;
    {$I SRL/SRL.simba}

    begin
      setupsrl;
      writeln(tostr(getcolor(563, 55)));
    end.
    here was the debug:
    Code:
    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.
    Last edited by x[Warrior]x3500; 07-21-2012 at 08:26 PM.

  9. #9
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    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.

  10. #10
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    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.
    Simba Code:
    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.
    Code:
    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...

  11. #11
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

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


    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

  12. #12
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

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

  13. #13
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by djborec View Post
    Finally resolved ,I had monitor in 16bit Color and Simba loaded 32bit Color...
    I'm surprised Simba worked at all.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •