Results 1 to 4 of 4

Thread: My First Object Finder - Help Please?

  1. #1
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default My First Object Finder - Help Please?

    I am trying to write a function that opens Lumbridge Chest Bank if you're standing next to it.

    I wrote a function that's derived from an autocolor. it basically takes what is one square east of player and uses it as a center of spiral for a FindColorsSpiralTolerance. Then, it does something I didn't understand (part with ColorXYZ, automatically generated by ACAv2) before returning each working color as a TIntegerArray.

    My questions are : is it any use to have more than one color? Second, how do I make sure the function is not clicking at the same spot on the chest everytime it runs?

    Thank yall and good scripting

    SCAR Code:
    function ChestFind_ColorFinder : TIntegerArray;
    var
      OneSqEast: TPoint;
      ArrayOfPoints: TPointArray;
      ArrayOfColors: TIntegerArray;
      i, ArrayLength: Integer;
      X, Y, Z: Extended;
    begin
      OneSqEast.x := MSCX + Round(50 * Cos(rs_GetCompassAngleRadians));
      OneSqEast.y := MSCY - Round(50 * Sin(rs_GetCompassAngleRadians));
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.08, 0.76);
      FindColorsSpiralTolerance(OneSqEast.x, OneSqEast.y, ArrayOfPoints, 6190467, MSX1, MSY1, MSX2, MSY2, 5);
      if (Length(ArrayOfPoints) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        Exit;
      end;
      ArrayOfColors := GetColors(ArrayOfPoints);
      ClearSameIntegers(ArrayOfColors);
      ArrayLength := High(ArrayOfColors);
      for i := 0 to ArrayLength do
      begin
        ColorToXYZ(ArrayOfColors[i], X, Y, Z);
        if (X >= 14.70) and (X <= 20.91) and (Y >= 15.24) and (Y <= 21.75) and (Z >= 10.13) and (Z <= 17.02) then
        begin
          Writeln(IntToStr(i));
          Result[i] := ArrayOfColors[i];
        end;
      end;
    end;
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    is it any use to have more than one color?

    Yes, more chances for success!

    Second, how do I make sure the function is not clicking at the same spot on the chest everytime it runs?

    Mouse(x, y, 4, 4, True);
    The "4, 4" represents randomness for both x, and y

  3. #3
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    OCR means optical character recognition by the way, I was like `WHAT!'
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  4. #4
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry Nava :/ I thought it was along the lines of generic object finding or something.

    If you want to edit title do it plz >.<
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

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
  •