Results 1 to 11 of 11

Thread: RC Script

  1. #1
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default RC Script

    I'm making an Astral Script, and it can't find the Altar..

    I'm using Mat's OBJFinder by Color Tolerance.. :O

    It keeps not being able to find it.. is there a way I can add multiple color choices?
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  2. #2
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    FindObjCustom(); should work. It allows you to find objects using multiple colors and multiple uptexts.

    Or if you know how to use it, FindObjTPA();

  3. #3
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just use find obj ex works great

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

    Default

    Use ACA? cant be that hard to get a color

  5. #5
    Join Date
    Dec 2011
    Posts
    353
    Mentioned
    3 Post(s)
    Quoted
    8 Post(s)

    Default

    Color I used for astral altar: 8551552 tolerance:15

  6. #6
    Join Date
    Feb 2011
    Location
    Earth
    Posts
    1,784
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    For runecrafting altars I've found it good to use a DTM, might want to use FindDTMRotated.

    Currently: Working on Defending&Attacking in my Castle-Wars Script
    Project Rebuild: 90M/170M

  7. #7
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    is it not finding that colour at all, or just finding so much of that colour it doesn't know which is the alter?

  8. #8
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Put this before your finder function so that it searches from the center out. That should speed it up if speed is the issue.

    x := MSCX
    y := MSCY

  9. #9
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    29
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Been using this code for my upcoming astral script

    Simba Code:
    function AltarColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.00, 0.25);

      if not (FindColorsTolerance(arP, 8818061, MSX1, MSY1, MSX2, MSY2, 2)) then
      begin
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    end;

    Function FindObjEx_F(ColorA, ColorB, Tol, Bounds, sX, sY: Integer; UpText: TStringArray; Var X, Y: Integer): Boolean;
    var
      B: TBox;
      TPA: TPointArray;
      L,i,CTS: Integer;
      ATPA,ATPA2: T2DPointArray;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(sX, sY, TPA, ColorA, MSX1, MSY1, MSX2, MSY2, Tol);
      if Length(TPA) < 1 then
      begin
        ColorToleranceSpeed(CTS);
        Exit;
      end;
      ATPA := TPAtoATPAEx(TPA, Bounds, Bounds);
      L := High(ATPA);
      SetArrayLength(ATPA2, L+1);
      for i := 0 to L do
      begin
        B := GetTPABounds(ATPA[i]);
        with B do
        begin
          FindColorsSpiralTolerance(sX, sY, ATPA2[i], ColorB, B.X1-Bounds, B.Y1-Bounds, B.X2+Bounds, B.Y2+Bounds, Tol);
          ColorToleranceSpeed(CTS);
          if Length(ATPA2[i]) > 0 then
          begin
            MiddleTPAEx(ATPA2[i], X, Y);
            MMouse(X, Y, 5, 5);
            if WaitUpTextMulti(UpText, 150) then
            begin
              Result := True;
              GetMousePos(X, Y);
              Exit;
            end;
          end;
        end;
      end;
    end;

    function FindAltar: Boolean;
    var
      x, y, i: Integer;
    label
      Start;
    begin
      Gametab(tab_Inv);

      Start:
      if FindObjEx_F(6514535, 10133921, 15, 10, MSCX+50, MSCY, ['Craft','rune','Altar'], X, Y) then
      begin
        HumanMMouse(x, y, 10, 10);
        ClickMouse2(true);
        Wait(RandomRange(600, 800));
        Result := true;
        if did not DidRedClick then
          goto Start;
      end else if FindObjTPA(x, y, AltarColor, 15, 2, 105, 105, 3, ['raft', 'Craft']) then
      begin
        HumanMMouse(x, y, 10, 10);
        ClickMouse2(true);
        Wait(RandomRange(600, 800));
        Result := true;
        if did not DidRedClick then
          goto Start;
      end else
      begin
        Inc(i);
        if i > 3 then
        begin
          Writeln('Failed to find altar');
          Exit;
        end else
          goto Start;
      end;
    end;

  10. #10
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    If your using my altar finding then it was very bad :P ACA with a FindObjTPA.
    DTM's would be quite good as Pat said.
    Mat



    ^^

  11. #11
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    29
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh that was from you . I found a post where flight quoted part of that code. Just wondering why you think its bad, ive been using it past few days and it pretty much finds the altar every time in one click

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
  •