Results 1 to 6 of 6

Thread: Bugging Around

  1. #1
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default Bugging Around

    So this Function should find a Object.. But all what does it do is mess up...

    SCAR Code:
    function NearestObjMT(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
    var
      TPA: TPointArray;
      O: Integer;
      Start : Boolean;
      x, y, a, b, c, i, x1, y1, x2, y2 : Integer;
    begin
     if (not(LoggedIn)) then
      Exit;
       for b := 0 to (GetArrayLength(Color)-1) do
      begin
      if FindColorsTolerance(TPA, Color[b], MSX1, MSY1, MSX2, MSY2, tolerance) or ScanMMAreaColorExactTolerance(x, y, MSX1, MSY1, MSX2, MSY2, Color[b], tolerance) or ScanMMAreaColorExactTolerance(x, y, MSX1, MSY1, MSX2, MSY2, Color[b],tolerance) then
      begin
          Start := True;
          Break;
        end;
      end;
      if(Start)then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if (not (Loggedin)) then
            break;
          a := a + 1;
          if (a = 1) then
            c := c + 1;
          if (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 21;
              x2 := x2 + 21;
            end;
            if (a = 2) then
            begin
              y1 := y1 - 14;
              y2 := y2 - 14;
            end;
            if (a = 3) then
            begin
              x1 := x1 - 21;
              x2 := x2 - 21;
            end;
            if (a = 4) then
            begin
              y1 := y1 + 14;
              y2 := y2 + 14;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
          for b := 0 to (GetArrayLength(Color)-1) do
            begin
            if FindColorsTolerance(TPA, Color[b], MSX1, MSY1, MSX2, MSY2, tolerance) or (FindColorTolerance(x, y, Color[b], x1, y1, x2, y2, tolerance)) or (FindColorTolerance(x, y, Color[b], x1, y1, x2, y2, tolerance)) then
            begin
              For O := 0 To High(TPA) Do
             Begin
            MMouse(TPA[O].x, TPA[O].y,0,0);
              cx:=x;cy:=y;
              if IsUptextMultiCustom(Text) then
              begin
                Result := True;
                Break;
                end;
              end;
            end;
          end;
        end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
         end;
     end;

  2. #2
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    LOLOLOLOLO...me confused, Why you do such a big math? AMi right if i say that function makes you lagg hard?

    Skip the math, make TPA to ATPA with SplitTPA or or TPAtoATPA etc...

    So...lololol
    After that do SrotATPAfrom...

    Still I get confused...please explain how and where it messes up...

    Edit:
    Lolololol

    SCAR Code:
    function FindSomething(var x, y, Color, MinPoints : integer; Text : String) : Boolean;
    var
      TPA : TPointArray;
      ATPA : TPointArrayArray;
      I, L : integer;
    begin
      FindColorsTolerance(TPA, Color, MSX1, MSY1, MSX2, MSY2, 12);
      ATPA := SplitTPAEx(TPA, 10, 10);
      SortATPAFrom(ATPA, IntToPoint(MSCX, MSCY));
      L := High(ATPA)
      For i := 0 to L do
      if Length(ATPA[i]) >= MinPoints then
      begin
        MiddleTPAEx(ATPA[i], a, b);
        MMouse(x - 5, y - 5, 11, 11);
        Wait(50 + random(50));
        if (pos(text, rs_GetUpText) > 0) then
        begin
          Getmousepos(x, y);
          Result := True;
          status('Object found!');
          Exit;
        end;
      end;
    end;
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    You use TPointArrays, but yet you still use the old stupid3ooo FindObj algorithm.
    Just use FindColorsSpiralTolerance?



    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)

  4. #4
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    Function FindClerk(Var X, Y: Integer; Color1, Color2: Integer): Boolean;
    Var
      L, I, CTS: Integer;
      Tree: Array [1..2] Of TPointArray;
      TPA2, TPA: TPointArray;
    Begin
      Flag;
      Wait(500+Random(500));
     
      CTS := GetColorTolerancespeed;
      ColorToleranceSpeed(2);

      FindColorsSpiralTolerance(MSCX, MSCY - 50, Tree[1], Color1, MSX1, MSY1, MSX2, MSY2, 5);
      FindColorsSpiralTolerance(MSCX, MSCY - 50, Tree[2], Color2, MSX1, MSY1, MSX2, MSY2, 5);

      TPA := CombineTPA(Tree[1], Tree[2]);

      L := High(TPA);
      For I := 0 To L Do
      Begin
        FindColorsSpiralTolerance(TPA[High(TPA)/2].X, TPA[High(TPA)/2].Y, TPA2, 4400690, TPA[I].X - 10, TPA[I].Y - 10, TPA[I].X + 10, TPA[I].Y + 10, 5);
        For I := 0 To High(TPA2) Do
        Begin
          MMouse(TPA[I].X, TPA[I].Y, 0, 0);
          Wait(50+Random(50));
          If(IsUpText('cler'))Then
          Begin
            WriteTimeln('Found Clerk');
            X := TPA[I].X;
            Y := TPA[I].Y;
            Result := True;
            ColorToleranceSpeed(CTS);
            Exit;
          End;
        End;
      End;
      ColorToleranceSpeed(CTS);
    End;

    i use this for finding a GE clerk.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    TPA[High(TPA)/2].X, TPA[High(TPA)/2].Y
    That's not what you want to do, you know that now you are looking from the point in middle of mainscreen center and the most far-away point?

    Well atleast I can't see a purpose for that.


    Also, why do a new FindColorsSpiral around every point, search for my GrabTPA, do only one FindColorsSpiralTolerance and "Grab" the TPA from the TPA[i].x - 10 etc



    Also maybe do a TPAToATPAEx(TPA, 20, 20) with about 20 or so X and Y, so you'll end up with 20*20 big "Clerk Pieces", which you then can do MiddleTPAs to and move mouse to.

    Better than moving to every single point of the color until find the uptext

  6. #6
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    That's not what you want to do, you know that now you are looking from the point in middle of mainscreen center and the most far-away point?

    Well atleast I can't see a purpose for that.


    Also, why do a new FindColorsSpiral around every point, search for my GrabTPA, do only one FindColorsSpiralTolerance and "Grab" the TPA from the TPA[i].x - 10 etc



    Also maybe do a TPAToATPAEx(TPA, 20, 20) with about 20 or so X and Y, so you'll end up with 20*20 big "Clerk Pieces", which you then can do MiddleTPAs to and move mouse to.

    Better than moving to every single point of the color until find the uptext
    Yeah i kinda just threw it there to fill it up with something.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. this script is bugging me...
    By Camaro' in forum OSR Help
    Replies: 16
    Last Post: 07-22-2007, 07:55 PM

Posting Permissions

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