Page 1 of 2 12 LastLast
Results 1 to 25 of 39

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

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

    Default Custom TPA Finding & ColorToleranceSpeed(2) Modifiers!

    I haven't written a tutorial in a while, so here we go.

    This stuff is mid level, semi advanced stuff (It's hard to learn the first time, but then it's easy as pie after that.) I will teach you how to make a basic, yet effective TPA function that will do wonders for you~ (No more FindObjCustom =P)

    Okay so.. We must start somewhere, no?

    Part 1 - Setting Up The TPA and such

    Okey, copy this little snippet of script here. It's a very basic setup right now, but WILL be expanded on.


    SCAR Code:
    program TPALearningTut;
    {.include SRL/SRL.scar}
     
    function TPAFinder(x, y: Integer): Boolean;
    begin
    end;
     
    begin
    end.
    We'll use the x and y to return the Mouse's (you got it) x and y coordinates for actual clicking. So far, so good!

    Now, we will add our variables.


    SCAR Code:
    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
    end;
     
    begin
    end.

    Not lost yet? Good. If you don't know what TPointArrays are, look it up, they're a simple concept, and I don't feel like explaining. Just know that they are VERY important to we the cheaters (and therefore, it must be effective, no?)

    Now, here's where we get into the bad parts..


    SCAR Code:
    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
    end;
     
    begin
    end.

    ColorToleranceSpeed? What is that?

    Well, good question. I'm not 100% on it, I just know that 0 is the fastest, but the least accurate, and 2 is the best, and the most accurate. 1 is the middle ground, but most everyone uses 2 anywho.

    Why can't we keep it at 2 all the time, then? Text finding is not compatible with ColorToleranceSpeed(2), because 2 deals with Hue and Saturation modifiers.

    Confused? Keep reading, I'll explain in a sec.

    First, paste this into a new script in scar, and SAVE IT. You will need it if you continue to use TPA's.


    SCAR Code:
    program New;
    //By Mastaraymond
    //0 = Min
    //1 = Max
    var
      I,II : integer;
      RGBColor : Array[1..3] of Integer;
      RGB : Array[0..1] of Array[1..3] of Integer;
      XYZColor, HSLColor : Array[1..3] of Extended;
      HSL,XYZ : Array[0..1] of Array[1..3] of Extended;
      Colors : TIntegerArray;
      Strings : Array[0..9] of String;
    Procedure Init;
    begin;
      Colors := [];
    end;
    begin
      Init;
      For I:= 1 to 3 do
      begin;
        Writeln('');
        RGB[0][i] := 255;
        HSL[0][i] := 255; //Max is 240?
        XYZ[0][i] := 255; //Max is ...?
      end;
      Strings[1] := 'R: ';
      Strings[0] := '   ';
      Strings[2] := 'G: ';
      Strings[3] := 'B: ';
      Strings[4] := 'H: ';
      Strings[5] := 'S: ';
      Strings[6] := 'L: ';
      Strings[7] := 'X: ';
      Strings[8] := 'Y: ';
      Strings[9] := 'Z: ';
      For I:= 0 to High(Colors) do
      begin;
        Strings[0] := Strings[0] + Padr('Color: '+inttostr(Colors[i]),16) +' | ';
        ColortoRGB(Colors[i],RGBColor[1],RGBColor[2],RGBColor[3]);
        ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
        ColortoXYZ(Colors[i],XYZColor[1],XYZColor[2],XYZColor[3]);
        For II:= 1 to 3 do
        begin;
          RGB[0][II] := Min(RGBColor[II],RGB[0][II]);
          RGB[1][II] := Max(RGBColor[II],RGB[1][II]);
          HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
          HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
          XYZ[0][II] := MinE(XYZColor[II],XYZ[0][II]);
          XYZ[1][II] := MaxE(XYZColor[II],XYZ[1][II]);
        end;
        For II := 1 to 3 do
          Strings[II] := Strings[II] +Padr(IntToStr  (RGBColor[II]),16) +' | ';
        For II := 4 to 6 do
          Strings[II] := Strings[II] +Padr(FloatToStr(HSLColor[II-3]),16) +' | ';
        For II := 7 to 9 do
          Strings[II] := Strings[II] +Padr(FloatToStr(XYZColor[II-6]),16) +' | ';
      end;
      For I:= 0 to 9 do
        Delete(Strings[i],Length(Strings[i])-2,3);
      For I:= 0 to 9 do
      begin;
        if (I = 1) or (I = 4)or (I = 7)  then Writeln('');
        Writeln(Strings[i]);
      end;
      Writeln('');
      Writeln('Highest RGB values = R: '+ Padr(FloatToStr(RGB[1][1]),3) +  ' | ' +'G: '+ Padr(FloatToStr(RGB[1][2]),3)  +  ' | ' +'B: '+ Padr(FloatToStr(RGB[1][3]),3) );
      Writeln('Lowest  RGB values = R: '+ Padr(FloatToStr(RGB[0][1]),3) +  ' | ' +'G: '+ Padr(FloatToStr(RGB[0][2]),3)  +  ' | ' +'B: '+ Padr(FloatToStr(RGB[0][3]),3) );
      Writeln('Differ  RGB values = R: '+ Padr(IntToStr(RGB[1][1] - RGB[0][1]),3) + ' | G: '+ Padr(inttostr(RGB[1][2] - RGB[0][2]) ,3) + ' | B: '+Padr(inttostr(RGB[1][3] - RGB[0][3]),3));
      Writeln('Middle  RGB values = R: '+ Padr(IntToStr((RGB[1][1] + RGB[0][1]) div 2),3) + ' | G: '+ Padr(inttostr((RGB[1][2] + RGB[0][2]) div 2),3) + ' | B: '+Padr(inttostr((RGB[1][3] + RGB[0][3]) div 2),3));
      Writeln('Middle  RGB color  = '   + IntToStr(RGBToColor((RGB[1][1] + RGB[0][1]) div 2,(RGB[1][2] + RGB[0][2]) div 2,(RGB[1][3] + RGB[0][3]) div 2)));
      Writeln('');
      Writeln('Highest HSL values = H: '+ Padr(FloatToStr(HSL[1][1]),16) +  ' | ' +'S: '+ Padr(FloatToStr(HSL[1][2]),16)  +  ' | ' +'L: '+ Padr(FloatToStr(HSL[1][3]),16) );
      Writeln('Lowest  HSL values = H: '+ Padr(FloatToStr(HSL[0][1]),16) +  ' | ' +'S: '+ Padr(FloatToStr(HSL[0][2]),16)  +  ' | ' +'L: '+ Padr(FloatToStr(HSL[0][3]),16) );
      Writeln('Differ  HSL values = H: '+ Padr(FloatToStr(HSL[1][1] - HSL[0][1]),16) + ' | S: '+ Padr(FloatToStr(HSL[1][2] - HSL[0][2]) ,16) + ' | L: '+Padr(FloatToStr(HSL[1][3] - HSL[0][3]),16));
      Writeln('Middle  HSL values = H: '+ FloatToStr((HSL[1][1] + HSL[0][1]) div 2) + ' | S: '+ FloatToStr((HSL[1][2] + HSL[0][2]) div 2) + ' | L: '+FloatToStr((HSL[1][3] + HSL[0][3]) div 2));
      Writeln('Middle  HSL color  = '   + IntToStr(HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2)));
      Writeln('');
      Writeln('Highest XYZ values = X: '+ Padr(FloatToStr(XYZ[1][1]),16) +  ' | ' +'Y: '+ Padr(FloatToStr(XYZ[1][2]),16)  +  ' | ' +'Z: '+ Padr(FloatToStr(XYZ[1][3]),16) );
      Writeln('Lowest  XYZ values = X: '+ Padr(FloatToStr(XYZ[0][1]),16) +  ' | ' +'Y: '+ Padr(FloatToStr(XYZ[0][2]),16)  +  ' | ' +'Z: '+ Padr(FloatToStr(XYZ[0][3]),16) );
      Writeln('Differ  XYZ values = X: '+ Padr(FloatToStr(XYZ[1][1] - XYZ[0][1]),16) + ' | Y: '+ Padr(FloatToStr(XYZ[1][2] - XYZ[0][2]) ,16) + ' | Z: '+Padr(FloatToStr(XYZ[1][3] - XYZ[0][3]),16));
      Writeln('Middle  XYZ values = X: '+ FloatToStr((XYZ[1][1] + XYZ[0][1]) div 2) + ' | Y: '+ FloatToStr((XYZ[1][2] + XYZ[0][2]) div 2) + ' | Z: '+FloatToStr((XYZ[1][3] + XYZ[0][3]) div 2));
      Writeln('Middle  XYZ color  = '   + IntToStr(XYZToColor((XYZ[1][1] + XYZ[0][1]) div 2,(XYZ[1][2] + XYZ[0][2]) div 2,(XYZ[1][3] + XYZ[0][3]) div 2)));
      WritelN('');
    end.
    I'll tell you what you need it for in a minute, so just hang on to your britches, kiddo.

    So, we want to find something, right? Well, for that, we need colors. Go ahead, choose some colors from something or another. Be it from a tree, or a Lesser Demon. It doesn't really matter. Just get 3-5 different colors to make this work as well as it can.

    Now, in that script I just had to paste in, find where it says Colors := [];

    Paste in your 3-5 colors, separated by a comma (,);

    Now click run. Like magic, things popped up in our Debug Box! Oh yay~

    Find where it says Differ HSL Value. Everything surrounding this is important.

    Okay. First, we need to change something in the TPA finding script we're developing. We're going to add a nice little thing we call... *drumroll* SetColorSpeed2Modifers.

    YAY!

    This sets the Hue and Saturation modifiers used for finding colors with tolerance. You'll see...


    SCAR Code:
    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(HueMod, SatMod);
    end;
     
    begin
    end.

    It only has those two modifiers, so it's not that bad.

    Now comes the math time.

    Remember that info in the debug text box? Well, we'll need to do some stuff.

    Here's what you need to do.

    Divide H by L to get = HueMod
    Divide S by L to get = SatMod
    L is your Tolerance (rounded up)
    Middle HSL color is the color (You'll need this and Tolerance in a sec.)

    Remember, all these values are in Differ HSL values, after putting in the colors of whatever you did. At this point, you should almost understand what I'm talking about.

    Put in your values for HueMod and SatMod. I will make up some for mine.


    SCAR Code:
    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);
    end;
     
    begin
    end.
    So far, so good! Now..

    We find the color.


    SCAR Code:
    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.
    end;
     
    begin
    end.
    Make sure it's FindColorsSpiralTolerance, and not FindColorSpiralTolerance. If you don't understand this, then .

    This will find every coordinate within range of your colors in the Main Screen and then store it in TPoints in an array, hence TPointArray. But, right now, it's pretty dis organized, just a jumble of TPoints all over the place. That's why we group them into separate TPA's in a Array of TPA's. We do this thus:


    SCAR Code:
    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);
    end;
     
    begin
    end.
    Now, we have an ATPA with all the TPA's in it. Here comes the, hopefully, final part. Ish.

    The Final Part ISH!

    Okay, so. Now we need to make it see if it's what we're looking for (If it's a lesser or if it' s a torch; it has to know the difference somehow!) Hopefully you picked unique colors from whatever you're finding, but whatever floats your boat!

    Okay we'll use a For To Do statement to deal with this.

    I tried to explain it as well as I could in the script, please bear with me, it's 11 at night and I'm bushed


    SCAR Code:
    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.
    Now, it will look around for the object, starting from the middle out (Simply because of FindColorsSpiralTolerance) When it finds it, it will stop looking and hover the mouse right there (or not, depending on what you do next)

    Usage

    So, you found the object. What now?

    Simple!

    You can just put in another procedure that will Click on the object then wait, or do antirandoms/antiban. It's all downhill from here. ^.^

    Afterword

    I learned this from a few different tutorials, one of which I got the color script thing. It's mastaraymond's, not mine. Just for copyright stuff, y'know.

    Thanks for reading my tutorial. I probably didn't explain well enough in some places, so please post here with questions if you have them. I just thought I'd share this with you, since it's so useful.

    Cheers,

    ProphesyOfWolf

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

    Default

    Umm. Bump? This has been here for like a month.

  3. #3
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Wow!!! Thanks for bumping! I didn't even know you posted this. I need help with these, so expect posts back!!!

    Holy s#it! That was the best guide I have read on TPA's repped!!!!!!!!!!!!!!!!!!!!!!!! This cleared up ALOT for me.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  4. #4
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    *bump*

    It's a good tutorial, you deserve some more creds for making it.

    Rep+ from me.

  5. #5
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks. Never really knew howt his worked

  6. #6
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    omg!!! i was looking for something just like this!!! thanks freakymonkey for bumping it!... just one question... how can i use this for mapwalking, if its even possible?

  7. #7
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    omg!!! i was looking for something just like this!!! thanks freakymonkey for bumping it!... just one question... how can i use this for mapwalking, if its even possible?
    You could use a TPA for finding a color, then use getcolor(), and radialwalk on it?

    Thats how the devs get like FindRoadColor, and FindFallyRoadColor.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  8. #8
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    i can't really use radial walk because i won't ever know how far away i am from where i am trying to walk to, because i walk to a symbol that is dynamic(it moves).... just to let you know what i am trying... i am working on my jun mem script and i want to walk to a specific kind of rock after walking to the mining symbol, i tried a ddtm but i failed...

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

    Default

    If you don't have the radial walk aid, you'll have some problems with RRW. If you need it, it's here.

    Thanks for the reps, guys <3

    I put it here for organization, but no one organized it. I was hoping for a Intermediate placement or something, but it's been here for like 3 months. Ahh! =X

    But, thanks for the attention guys. I really appreciate it.

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

    Default

    Holy Mother Of God Bump! What do I have to do to get this organized?

  11. #11
    Join Date
    Aug 2007
    Location
    Where do you live?
    Posts
    934
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Very nice... Question though...

    SCAR Code:
    ATPA := TPAToATPAEx(TPA, 15, 15);

    Why 15 and 15?

    and when to use SplitTPA and when to use TPAtoATPA?

  12. #12
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Quote Originally Posted by nose_smasher View Post
    Very nice... Question though...

    SCAR Code:
    ATPA := TPAToATPAEx(TPA, 15, 15);

    Why 15 and 15?

    and when to use SplitTPA and when to use TPAtoATPA?
    http://www.villavu.com/forum/showthread.php?t=36016
    http://www.villavu.com/forum/showthread.php?t=42428
    Hup Holland Hup!

  13. #13
    Join Date
    Aug 2007
    Location
    Where do you live?
    Posts
    934
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I know about those tuts, but I mean do I need wizzy's TPADebuggers to figure out which grouping method works better for what ever it is that I'm doin? I guess I'm jus having a lil trouble really understanding how all this works... like, I know how to use it all when I'm scripting, but I jus like really understanding how all this works

    I guess I'll jus play around with wizzy's debuggers and see what happens...

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

    Default

    Quote Originally Posted by nose_smasher View Post
    I know about those tuts, but I mean do I need wizzy's TPADebuggers to figure out which grouping method works better for what ever it is that I'm doin? I guess I'm jus having a lil trouble really understanding how all this works... like, I know how to use it all when I'm scripting, but I jus like really understanding how all this works

    I guess I'll jus play around with wizzy's debuggers and see what happens...
    You could look at my tutorial ...(sig)


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

    Default

    Honey return your HSL modifiers back to 0.2, otherwise the scripts that use that thing copy pasted will fuck up.

  16. #16
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    It only has those two modifiers, so it's not that bad.

    Now comes the math time.

    Remember that info in the debug text box? Well, we'll need to do some stuff.

    Here's what you need to do.

    Divide H by L to get = HueMod
    Divide S by L to get = SatMod
    L is your Tolerance (rounded up)
    Middle HSL color is the color (You'll need this and Tolerance in a sec.)
    Expand this a bit more. Tell people they need to use the Differ HSL bit, because it wasnt very clear and it took me a while to figure out I needed to use the H S and L in the Differ HSL.
    Jus' Lurkin'

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

    Default

    Do these tutorials ever get sorted? O.o

    Original post date:09-17-2008, 06:16 AM

  18. #18
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I LOVE this TUT. I mean, I knew how do this this stuff before, but this really helped me understand it better. Thanks.

    Rep+

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

    Default

    Oh, sweet! Advanced placement! Thanks for sorting and for reorganizing Tutorial Island!

    @Coh3n: Thanks for the feedback! I worked hard on this =X

  20. #20
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    function TPAFinder(x, y: Integer): Boolean;
    should be
    SCAR Code:
    function TPAFinder(var x, y: Integer): Boolean;

  21. #21
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Was just about to post that lol ^^
    Ce ne sont que des gueux


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

    Default

    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.

  23. #23
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    More good reading here. Thanks for the post.
    I like my coffee black just like my metal.

  24. #24
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Man this was hiding at the bottom. Can't even remember how I found it. I needs a good bump. Rep++ Great Read

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

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

    Default

    Haha thanks - I was just looking at this today myself. I need to learn up more on Simba and write more tutorials.

Page 1 of 2 12 LastLast

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
  •