Page 2 of 2 FirstFirst 12
Results 26 to 39 of 39

Thread: Custom TPA Finding & ColorToleranceSpeed(2) Modifiers!

  1. #26
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    this tut is awesome, + rep

  2. #27
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not sure if anyone looks at this but how many significant figures do you keep on the Satmod's and huemod's? My numbers have like 20 digits :S I just can't seem to get this to work *sigh* I'll keep at it.

  3. #28
    Join Date
    Dec 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm trying so hard to understand these I think I overcomplicate things though ); but I'll keep trying I guess I can't visualize what TPA's are used for like on runescape... Are TPA's like those blue boxes you see around npc's when u use narcles fast fighter?
    My Soul Wars Scipt Proggress:[100%....]
    Probably won't release though I like it for myself

  4. #29
    Join Date
    Dec 2011
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by poopy2177 View Post
    I'm trying so hard to understand these I think I overcomplicate things though ); but I'll keep trying I guess I can't visualize what TPA's are used for like on runescape... Are TPA's like those blue boxes you see around npc's when u use narcles fast fighter?
    No that's on screen Debugging.

    TPAs from my understanding find a colour set with tolerances created from the TPA Tool.

    For example this is my findyew function using tpa.

    See where is says SetColorSpeed2Modifiers(0.14, 0.043);. The numbers are calculated using the tool. They can only be used for the yews as thats where i picked the colour from.

    FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3819340, MSX1, MSY1, MSX2, MSY2,6); Is the colour finding part. As the name says it will search for that colour spiraling out from the middle with a tolerance of 6. This number is found using the tool also.

    MMouse(x, y, 0, 0);
    If WaitUpTextMulti(['ew', 'yew'], 250) then

    This part is pretty straight forward.

    GetMousePos(x, y); // Records the x, y position of where it found the colour and uptext.

    Break; // Ends the colour searching part.

    I use this functions like this.

    I
    Simba Code:
    If FindYew(x ,y) then
        begin
          Mouse(x, y, 0, 0, True);

    Simba Code:
    function FindYew(var x, y: Integer) :Boolean;
    var
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    begin
      If Not LoggedIn then exit;
      Antirandoms;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.14, 0.043);  
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3819340, MSX1, MSY1, MSX2, MSY2,6);
      aTPA := TPAToATPAEx(TPA, 20, 20);

      For I := 0 to High(ATPA) do
      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);
       If WaitUpTextMulti(['ew', 'yew'], 250) then
        begin
          Result := True;
          GetMousePos(x, y);
          Break;
        end;
      end;
    end;

  5. #30
    Join Date
    Dec 2008
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ohhhhhhhhhh gotcha it really is that simple! thanks man +rep
    My Soul Wars Scipt Proggress:[100%....]
    Probably won't release though I like it for myself

  6. #31
    Join Date
    Dec 2011
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by poopy2177 View Post
    Ohhhhhhhhhh gotcha it really is that simple! thanks man +rep
    No worries Bro XD

  7. #32
    Join Date
    Jan 2012
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Brilliant guide, it was the easiest for me to read out of the rest of the TPA threads in this section. I will try to use this in my scripts

    Rep++

  8. #33
    Join Date
    Dec 2007
    Location
    Middle of Here and There
    Posts
    417
    Mentioned
    6 Post(s)
    Quoted
    25 Post(s)

    Default

    I'm glad I could help, and if you ever have any questions just post here / PM me

  9. #34
    Join Date
    Nov 2011
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a ton, this has just made a nice place in my new script and I couldn't have done it with out this
    I like making stuff.

  10. #35
    Join Date
    Oct 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow man, really helped me understand this stuff! Thanks!!!

  11. #36
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Default

    Quote Originally Posted by ProphesyOfWolf View Post

    program TPALearningTut;
    {.include SRL/SRL.scar}

    function TPAFinder(x, y: Integer): Boolean;
    var
    CTS, I: Integer; //CTS will store the ColorToleranceSpeed before we change it, for later.
    TPA: TPointArray; //The TPointArray in which all Coordinates which are found later will be stored
    ATPA: Array of TPointArray;
    begin
    CTS := GetColorToleranceSpeed;
    ColorToleranceSpeed(2); //Sets the color tolerance speed to 2 so we can do HSL tolerance stuff
    SetColorSpeed2Modifiers(.76, .55);
    FindColorsSpiralTolerance(MSCX, MSCY, TPA, YourColorHere, MSX1, MSY1, MSX2, MSY2, Tolerance); //For tolerance, put in your own tolerance. MSCX and MSCY are the starting points in the center of the mainscreen. MSX1, MSY1, etc. are the outside of the Main Screen.
    ColorToleranceSpeed(CTS); //Make sure you do this after you're done color finding, so text finding will work again.
    ATPA := TPAToATPAEx(TPA, 15, 15);

    For I := 0 to High(ATPA) do
    begin
    MiddleTPAEx(ATPA[i], x, y); //Returns the middle coords of the current TPA in the ATPA
    MMouse(x, y, 2, 2); //Moves mouse over the object
    If(IsUpTextMultiCustom(['your uptext(s) here'])) then
    begin
    Result := True;
    GetMousePox(x, y); //Sets the x and y values for future use (Like clicking)
    Break; //Exits the For To Do statement so it doesn't keep moving around looking for the object
    end;
    end;
    end;

    begin
    end.
    Shouldnt it be GetMousePox(x, y);

    Just a small typo. Amazing tutorial btw

  12. #37
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fantastic tutorial up to this day.
    Previously known as "Phyaskou"

  13. #38
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Siel View Post
    Shouldnt it be GetMousePox(x, y);

    Just a small typo. Amazing tutorial btw
    Yeh it's there on purpose for people to spot and fix - looks like it worked!


    Quote Originally Posted by ProphesyOfWolf View Post
    I know. I did that on purpose so someone who doesn't know how to script would not be able to make it work right <3. Learning purposes only.

  14. #39
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    I am trying to add a array to my TPA func, but there are literally about 10-15 colors; It isn't working too good for me... Can someone help me out a bit please?

    PM me .
    Cheers!

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ColorToleranceSpeed and XYZ
    By Cazax in forum OSR Advanced Scripting Tutorials
    Replies: 14
    Last Post: 04-26-2009, 10:51 PM
  2. Replies: 2
    Last Post: 11-07-2008, 09:17 PM
  3. Small Tut. (ColorToleranceSpeed)
    By Wizzup? in forum OSR Advanced Scripting Tutorials
    Replies: 4
    Last Post: 04-19-2007, 08:54 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
  •