Results 1 to 11 of 11

Thread: Need a function name

  1. #1
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need a function name

    Which was that function that you telled: if a color is Somewhere (x , y) then
    do something else.

  2. #2
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    function Getcolor(x, y): integer;

    That it?
    Interested in C# and Electrical Engineering? This might interest you.

  3. #3
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dunno but I´m not needing to get the color, I need to find one color in one place (specified) and then if found that color, do something else.

  4. #4
    Join Date
    Nov 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you trying to find the coordinates of a number? if so...
    Code:
    var
    x,y: Integer;
    
    begin
    findcolor(x,y, <color>,0,0,6000,6000
    end;
    Is that what you're looking for?

  5. #5
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    you make one.

    SCAR Code:
    if FindColor(x, y, {color}, {coord1 x}, {coord1 y}, {coord2 x}, {coord2 y}) then
    begin
      DOTHIS;
    end;




    EX.
    SCAR Code:
    {.include srl/srl.scar}
    var
     x, y : Integer;

    begin
      if FindColor(x, y, 0, 0, 0, 100, 100) then MMouse(x, y, 0, 0);
    end.
    //if it finds the color 0 in the box made by the coordinates then it will move the mouse to that location

  6. #6
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If I write it with my not-knowing knowledge, I think it´s something like this :
    If findcolor 2342340 on x,y then writeln(hi there); but it doesn´t works like this.

  7. #7
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Derek- View Post
    you make one.

    SCAR Code:
    if FindColor(x, y, {color}, {coord1 x}, {coord1 y}, {coord2 x}, {coord2 y}) then
    begin
      DOTHIS;
    end;




    EX.
    SCAR Code:
    {.include srl/srl.scar}
    var
     x, y : Integer;

    begin
      if FindColor(x, y, 0, 0, 0, 100, 100) then MMouse(x, y, 0, 0);
    end.

    O.K I think this will work tyvm.

  8. #8
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    but isnt there a function like this one:
    if Findcolor(3124324, [exact coordinate (12,543)] then
    begin
    writeln(need to do this);
    end;

  9. #9
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    You can do:

    SCAR Code:
    if (GetColor(x, y)=0) then
    begin
      writeln('need to do this');
    end;

    where x and y are the coords and 0 is the color

  10. #10
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I have one that I just made. All I ask is minor credits:

    SCAR Code:
    function GetColorAt(x,y,color: integer): integer;
    begin
      if (GetColor(x, y) = color) then
      begin
        Writeln('Found color.');
      end;
    end;

    Hope this helps

    Edit: Derek- you beat me to this lol!
    Formerly known as Cut em2 it

  11. #11
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks guys, this solved my problem

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. Any function that does this?
    By shadowpwner in forum OSR Help
    Replies: 2
    Last Post: 08-14-2007, 03:15 AM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 AM

Posting Permissions

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