Results 1 to 8 of 8

Thread: TPA help

  1. #1
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default TPA help

    Could anyone hlep show me how to make a TPA to find , lets say, an iron rock?

    I've read a couple tutorials on them but still do not quite understand how to use them, thanks.
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What dont you understand? post it here.

    btw, negaal tuts explain everything*most of them*.


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

    Default

    Finding ore itself is not hard. Hard is to make youre mouse to click center of ore.

    See my TPA tutorial in my signature. There is example script at the end. just change the uptext and color.

    I'm not really sure what can't you understand. Maybe explain & ask more?
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    Hard is to make youre mouse to click center of ore.
    Wrong.


    MiddleTPAEx(veinTPA, X, Y);

    There, you have the middle of the ore.

  5. #5
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't understand how Tpa's actually work. =\
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

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

    Default

    Quote Originally Posted by n3ss3s View Post
    Wrong.


    MiddleTPAEx(veinTPA, X, Y);

    There, you have the middle of the ore.
    Middle of vein, but vein isn't spreaded exactly all over the rock. there might be no vein on one side etc. You know what I mean. and you knew that I know middletpa

    ...

    Quote Originally Posted by lancelot074 View Post
    I don't understand how Tpa's actually work. =\
    See, it find all coordinates of color given in params x1, y1, x2, y2.

    And saves list of x's and y's to TPointArray.

    You did read my tutorial ?
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  7. #7
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah I read your tut and tried to make one, but I failed and got tons of errors.
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

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

    Default

    Quote Originally Posted by lancelot074 View Post
    Yeah I read your tut and tried to make one, but I failed and got tons of errors.
    I think the one whats built in scar or SRL plugins looks like this:
    SCAR Code:
    program Lolol;

    function FindTPA(var TPA : TPointArray; Color, x1, y1, x2, y2, tolerance : integer) : boolean;
    var
      x, y, c : integer;
    begin
      SetArraylength(tpa,(x2-x1)*(y2 - y1))
      for y:=y1 to y2 do
        for x:=x1 to x2 do
        if similarcolors(getcolor(x,y), color, tolerance) then
        begin
          tpa[c].x := x;
          tpa[c].y := y;
          inc(c)
        end;
        SetArrayLength(TPA, C)
        Result := Length(tpa) > 0;
    end;

    var
      tpa : tpointarray;
      i, t : integer;
     
    begin
     t := getsystemtime;
     findtpa(tpa, 255, 0, 0, 100, 100, 0)
     writeln(inttostr(getsystemtime - t));
     if length(tpa) > 0 then
     for i:=0 to high(tpa) do
     begin
       movemousesmooth(tpa[i].x,tpa[i].y);
       wait(100);
     end;
    end.

    Because it's in script it's very slow. it took me almost 300 ms to scar 100 * 100 area.

    I hope you can understand what function does.

    Edit, to test, do draw something with red, you'll see it moves trough all the red pixels. note that you have to set you're x2 and y2.
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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
  •