Results 1 to 8 of 8

Thread: Just a question

  1. #1
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Just a question

    Is this possible...

    Code:
    program new;
    var
      X, Y : Integer;
      A : TIntegerArray;
    begin
      A := [10800001, 28800000]
      FindColor(X, Y, A, 0, 50, 25, 75);
    end.
    I know it doesnt work but is there a similar way to call upon A as the color and it tries each of the colors?
    Still learning to code in Simba.

  2. #2
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Yup! Try loops; they're very helpful.

    pascal Code:
    var
      x, y, i: Integer;
      a: TIntegerArray;
    begin
      a := [10800001, 28800000];
      for i := 0 to Length(a) - 1 do
        if(FindColor(x, y, a[i], 0, 50, 25, 75))then
          Break;
      Writeln('Found color ' + ToStr(GetColor(x, y)) + ' at ' + ToStr(x) + ', ' + ToStr(y));

    Hope that helps. Loops are quite useful.
    Last edited by i luffs yeww; 12-09-2010 at 05:52 AM.

  3. #3
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I still get a type mismatch at the if(FindColor( part. Can you give me an example that works? Just so I can get an idea of how they work.
    Still learning to code in Simba.

  4. #4
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Yup! Try loops; they're very helpful.

    pascal Code:
    var
      x, y, i: Integer;
      a: TIntegerArray;
    begin
      a := [10800001, 28800000];
      for i := 0 to Length(a) - 1 do
        if(FindColor(x, y, a, 0, 50, 25, 75))then
          Break;
      Writeln('Found color ' + ToStr(GetColor(x, y)) + ' at ' + ToStr(x) + ', ' + ToStr(y));

    Hope that helps. Loops are quite useful.
    Think you missed a part there Ian. The brackets using the i as a integer. Here's the correction iirc.

    pascal Code:
    var
      x, y, i: Integer;
      a: TIntegerArray;
    begin
      a := [10800001, 28800000];
      for i := 0 to Length(a) - 1 do
        if(FindColor(x, y, a[i], 0, 50, 25, 75))then
          Break;
      Writeln('Found color ' + ToStr(GetColor(x, y)) + ' at ' + ToStr(x) + ', ' + ToStr(y));


    ~BraK

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  5. #5
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks that helps so much in my script.
    Still learning to code in Simba.

  6. #6
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Not a problem but you should check out TPAs and using Findcolors. It's a lot more accurate.

    ~BraK

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  7. #7
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Oh crap! Sorry. :x Yeah, it'd be a[i], as a is an array. >_<

    Thanks, BraK.

  8. #8
    Join Date
    Sep 2008
    Location
    My House
    Posts
    519
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nevermind if you saw the post that was here. I figured it out. And I use TTA's and Findcolors.
    Last edited by Death12652; 12-09-2010 at 06:06 AM.
    Still learning to code in Simba.

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
  •