Results 1 to 12 of 12

Thread: How do i "convert" this code from CTS2 to CTS3?

  1. #1
    Join Date
    Aug 2013
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default How do i "convert" this code from CTS2 to CTS3?

    Here is the code that i would want to change to CTS 3. Any help would be much obliged.

    Simba Code:
    findColorsSpiralTolerance(x, y, spotTPA, 15521733, mainScreen.getBounds(), 10, colorSetting(2, 0.22, 1.13));

  2. #2
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    You dont. CTS2 works excellent as is, and is substantially ?faster? than CTS3.
    larger number doesnt mean its better.

    But again, you dont just go from one to another. if you want cts3 modifiers, you mark all the colors again (with ACA) and get the cts3 colors and modifiers.

  3. #3
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    CTS2 [...] is substantially ?faster? than CTS3.
    Can confirm.

    Reference: http://docs.villavu.com/simba/script...lour-tolerance
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    the CTS library is under /includes/srl-6/lib/utilities.color

  5. #5
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    I am curious about why you wish to use CTS3?

    As for the change, it's actually as the others say - "You don't". You can use CTS3 but you wont get the same results, and highly likely worse result, by both the time it uses, and the result you get. Only a few (very special) cases could potentially benefit from the current algorithm behind CTS3, but for anything RS-related I strongly doubt you will get any improvement. Your best bet would be be to continue to use CTS2.

    Regarding the modifiers, "CTS3" doesn't really have modifiers, it's "modifier" simply works as a multiplicand:
    » PCTS3Info(Result)^.Tol := Ceil(Sqr(Tol*CTS3Modifier));

    ref: finder.pas
    Last edited by slacky; 01-23-2016 at 05:16 PM.
    !No priv. messages please

  6. #6
    Join Date
    Aug 2013
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    I am curious about why you wish to use CTS3?

    As for the change, it's actually as the others say - "You don't". You can use CTS3 but you wont get the same results, and highly likely worse result, by both the time it uses, and the result you get. Only a few (very special) cases could potentially benefit from the current algorithm behind CTS3, but for anything RS-related I strongly doubt you will get any improvement. Your best bet would be be to continue to use CTS2.

    Regarding the modifiers, "CTS3" doesn't really have modifiers, it's "modifier" simply works as a multiplicand:
    » PCTS3Info(Result)^.Tol := Ceil(Sqr(Tol*CTS3Modifier));

    ref: finder.pas
    The main reason why i wanted to learn how to do it is to see if it would improve the current script by simply using CTS3 is and if i would learn something and possibly possibly use the knowledge for any future scripts I make.

  7. #7
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by General_Patrick View Post
    The main reason why i wanted to learn how to do it is to see if it would improve the current script by simply using CTS3 is and if i would learn something and possibly possibly use the knowledge for any future scripts I make.
    pascal Code:
    FindColorsSpiralTolerance(x, y, spotTPA, 15521733, MainScreen.getBounds(), 10, ColorSetting(3,1));
    That's it.


    Side-note:
    I'm going to assume you are misusing `FindColorsSpiralTolerance`. I even doubt you have set `x` and `y`, so they are `0` and `0`. I am even willing to bet that you are modifying and/or using the resulting TPA in a manner that renders the order irrelevant (this is quite normal). So I want to suggest the following, that is if you have no reason for actually searching in a spiral-order (starting at 0,0):
    pascal Code:
    FindColorsTolerance(spotTPA, 15521733, MainScreen.getBounds(), 10, ColorSetting(3, 1));
    //.. or with CTS2
    FindColorsTolerance(spotTPA, 15521733, MainScreen.getBounds(), 10, ColorSetting(2, 0.2,0.2));
    Last edited by slacky; 01-23-2016 at 09:24 PM.
    !No priv. messages please

  8. #8
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    "miss-using"
    misusing is a word

    I also agree with not using the spiral search for everything. How did that happen anyway? Maybe because the tutorials use it?
    Last edited by Citrus; 01-23-2016 at 09:32 PM.

  9. #9
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Citrus View Post
    misusing is a word

    I also agree with not using the spiral search for everything. How did that happen anyway? Maybe because all the tutorials use it?
    Fixed ^^ Yeah, I have a feeling this one is behind it. That tutorial shows people to do exactly that.
    Tho I am somewhat glad that little "mistake" exists in that tutorial, it helps me filter out "copy-pasters" from "scripters" when they apply for SRL-Members
    Last edited by slacky; 01-23-2016 at 09:35 PM.
    !No priv. messages please

  10. #10
    Join Date
    Aug 2013
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    pascal Code:
    FindColorsSpiralTolerance(x, y, spotTPA, 15521733, MainScreen.getBounds(), 10, ColorSetting(3,1));
    That's it.


    Side-note:
    I'm going to assume you are misusing `FindColorsSpiralTolerance`. I even doubt you have set `x` and `y`, so they are `0` and `0`. I am even willing to bet that you are modifying and/or using the resulting TPA in a manner that renders the order irrelevant (this is quite normal). So I want to suggest the following, that is if you have no reason for actually searching in a spiral-order (starting at 0,0):
    pascal Code:
    FindColorsTolerance(spotTPA, 15521733, MainScreen.getBounds(), 10, ColorSetting(3, 1));
    //.. or with CTS2
    FindColorsTolerance(spotTPA, 15521733, MainScreen.getBounds(), 10, ColorSetting(2, 0.2,0.2));
    quick question, what does the "1" in ColorSetting(3, 1) represent? Also, I'm assuming ColorSetting(2, 0.2,0.2)) goes in the order of CTS2, Hue, and Saturation, right?

  11. #11
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by General_Patrick View Post
    quick question, what does the "1" in ColorSetting(3, 1) represent? Also, I'm assuming ColorSetting(2, 0.2,0.2)) goes in the order of CTS2, Hue, and Saturation, right?
    I think the 1 is just a placeholder because as I understand it, CTS3 should have three parameters: lightness and the two color dimensions. Not sure though.

    & yes, CTS2 color settings are always (2, hue, sat)
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  12. #12
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by General_Patrick View Post
    quick question, what does the "1" in ColorSetting(3, 1) represent? Also, I'm assuming ColorSetting(2, 0.2,0.2)) goes in the order of CTS2, Hue, and Saturation, right?
    As KeepBotting says it's pretty much a placeholder. Tho its function is described in my first post. It's a multiplicand of the tolerance. Meaning if you have 10 tolerance, and the multiplicand is 2 then you actually have 20 tolerance... 10*2. So technically there is no reason to modify it, just leave it as one and play with the tolerance instead. 1 is the default set in Simba.

    snip from my first post:
    Quote Originally Posted by slacky View Post
    Regarding the modifiers, "CTS3" doesn't really have modifiers, it's "modifier" simply works as a multiplicand:
    » PCTS3Info(Result)^.Tol := Ceil(Sqr(Tol*CTS3Modifier));

    ref: finder.pas
    Last edited by slacky; 01-24-2016 at 09:01 PM.
    !No priv. messages please

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
  •