Page 1 of 3 123 LastLast
Results 1 to 25 of 60

Thread: All about colors

  1. #1
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default All about colors


    All About Colors
    By Tickyy




    What is Color Finding?

    Color finding in simba is used mainly for finding the object/item/thing on the selected client, in this case for example RuneScape. There are many different functions that use color finding, but this tutorial will only go over the basics.

    Color Picking

    The first things is, color picking, without a color we won't need a function or anything else, so first we need to pick the color for the item we are looking for.





    That's the color picking tool that i am talking about, after clicking on it , you'll notice some numbers will change just after you move your mouse, Exactly like this:





    Those changing numbers are the position of the selected client and the color, so basically this isn't just a color picker, this is also a great tool to find out the coordinates of the position! But let's get to the point, so if that position is the color you are looking for... click on it, and you'll see something on the debug box!





    So basically, just as you can see it says "Picked colour: 16711680" so... that's the color and "at (814, 447)" is the position! That's it! You just found the color you wanted, but if you're going to use it for scripting i am going further for basic color finding


    Variable Index


    x - the x coordinate of the color

    y - the y coordinate of the color
    color - the color you are searching for

    xs, ys - the x and y coordinates of the point on the RS screen to start searching for the color (the top left corner)

    xe, ye - the x and y coordinates of the point on the RS screen to stop searching for the color (the bottom right corner)

    tol - the tolerance of the color to search for. The higher the tolerance, the wider the range of colors it will search for. This is only used in the FindColor functions that use the tol variable.


    Color finding.



    Well lets start with...

    FindColor(x, y, color, xs, ys, xe, ye)

    One of the simplest color finding functions out there. It searches for one color with no tolerance and records the color position at x and y. Not recommended using for RuneScape. Since they are trying to stop color boting so they change colors from time to time, even while logged in!

    FindColorSpiral(x, y, color, xs, ys, xe, ye)

    This works much like FindColor, except instead of searching from left to right it searches in a spiral. Differences: a little bit faster, but you barely can see it, so no big deal.

    FindColorTolerance(x, y, color, xs, ys, xe, ye, tol)

    This is one of the best color finding functions, simply because it has tolerance. This way, you will most often find a color you are searching for. For those who have never used tolerance, should try to increase slowly the number of the tolerance if it can't find the object, starting with 4-5 is good, if it still fails at finding try to increase it! That will change the range of the color

    FindColorSpiralTolerance(x, y, color, xs, ys, xe, ye, tol)

    The same in Spiral search.

    Now an example using them! But first there are few srl coordinates that i'm gonna show you

    Code:
    Minimap = MMX1, MMY1, MMX2, MMY2.
    
    MainScreen = MSX1, MSY1, MSX2, MSY2.
    
    Inventory = MIX1, MIY1, MIX2, MIY2.
    Simba Code:
    if(FindColorSpiralTolerance(x, y, 2324621, MMX1, MMY1, MMX2, MMY2, 5))then
    begin
      Mouse(x, y, 5, 5, true); //If found will Left-Click on the x, y coordinates with a randomness between 5 pixel
    end

    End Note - If sometimes the script just starts to lag for some reason just add a wait in the repeating loop.
    Last edited by Tickyy; 02-03-2012 at 11:34 PM.
    Hi

  2. #2
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not bad, just took a quick glance. Why not add stuff like clGreen? I'd like to learn about them.

    ~Sandstorm

  3. #3
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by Sandstorm View Post
    Not bad, just took a quick glance. Why not add stuff like clGreen? I'd like to learn about them.

    ~Sandstorm
    this is a beginner category... everything has to be simple, so i tried to make it simple.
    Hi

  4. #4
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    everything haves to be simple,
    has*

    Nice little TUT

  5. #5
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by N C D S View Post
    has*

    Nice little TUT
    lol my grammar sux.. oh glad to see that somebody likes it
    Hi

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

    Default

    clGreen etc have got nothing to do with color finding to be honest.

    Also, there is nothing to be taught about them, they are just consts, premade colors for you...

  7. #7
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey how come this doesnt work?

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      x, y, rx, ry: Integer;
     
    procedure start;
    begin
    if (FindColorTolerance(x, y,6002571,MMX1, MMY1, MMX2, MMY2,5)) then
    begin


    Mouse(x,y,5,5,true);

    end;

    end;

    begin
    setupSRL;
    start;
    end.

    I mean it never find the colour, and there isnt anything wrong with the colour anyone know?

  8. #8
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by blood1000 View Post
    hey how come this doesnt work?
    try it again just with a bigger tolerance then that one... try 10-15

    BTW I've fixed your standards

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      x, y, rx, ry: Integer;

    procedure start;
    begin
      if (FindColorTolerance(x, y, 6002571, MMX1, MMY1, MMX2, MMY2, 5)) then
      begin
        Mouse(x,y,5,5,true);
      end;
    end;

    begin
      setupSRL;
      start;
    end.
    Hi

  9. #9
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah thank you, one more question, i make it mmouse to the colour but i want it to make sure it says "attack" in the top left hand corner whats the function for that?

  10. #10
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IsUpText('tack');
    when you use IsUpText(UpText:string); make sure you have it not check for capitals if you don't have to, and it has to have ' ' around the word (unless you use like.. IntToStr(i:Int64);

  11. #11
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah thankyou, i used to script like 2 years ago but i forgot a lot of it lol also a lot has changed

  12. #12
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah no problem

  13. #13
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  14. #14
    Join Date
    Sep 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the tutorial, but how come sometimes the script still mixes stuff up? I tried to kill brown chickens but it kept clicking the bag...

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

    Default

    Jeffrey, you need to understand.

    Different scripts have different qualities. Good scripts have failsafes, isuptext checks. Bad scripts click the bag.
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  16. #16
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    LOL >>owned<<
    thanx i learned sumthing from it, it smal and simple.
    Formerly known as FrancisHelie

  17. #17
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    wow, i did not expect so many posts on my first tutorial ...

    Glad to see that you guys like it
    Hi

  18. #18
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    does it exist a fonction that automatic click color ?
    and not only find color then .. click color ??
    Formerly known as FrancisHelie

  19. #19
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  20. #20
    Join Date
    Feb 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice Tutorial, Keep it up..

  21. #21
    Join Date
    Feb 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice color tut solved one of my problems ^^ ty

  22. #22
    Join Date
    Mar 2009
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow Ticky awesome tut man made alot of sence on the colors for me hopefully now i can get my script up and running

  23. #23
    Join Date
    May 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dumbass question! but how do you get the cords if you want to narrow the search area? do you use the "picked at cords" from colour picker?

  24. #24
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    u need to put activateclient in there to lik so
    SCAR Code:
    setupsrl;
    Activateclient;

  25. #25
    Join Date
    Mar 2008
    Posts
    84
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey im a newbie in srl and I cannot understand what xs ys xe ye stands for..
    can someone explain it to me? Any help would be grateful

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. colors
    By Iroki in forum OSR Help
    Replies: 1
    Last Post: 10-06-2008, 08:09 PM
  2. New Colors !!!
    By XxtOmxX in forum RS has been updated.
    Replies: 13
    Last Post: 06-05-2007, 02:02 PM
  3. Getting axe colors.
    By kooldude in forum OSR Help
    Replies: 3
    Last Post: 04-17-2007, 09:07 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
  •