Results 1 to 24 of 24

Thread: Find A color And Click

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

    Default Find A color And Click

    This Is My Very First TUT So Please Rate It

    Hi i started scripted not that long ago and im not that good but i thought i would give a helping hand to the people who don't know how to do certain things with SCAR.


    If you are confused by any of this dont worry im putting a simple quide at the end.

    Step1. (Make the commands)

    SCAR Code:
    Program New;
    Var

    Const
    Color1=000000;

    Procedure Color_click;
    Begin
    If(Findcolor(x, y, Color1, 1, 1, 600, 600))then
    mmouse(x, y, 2, 2);
    mouse(x, y, 1, 1, true);
    End.

    Now If you dont know what these commands are i will tell you
    SCAR Code:
    if(findcolor(x, y, Color1, 1, 1, 600, 600))

    This basicly means if SCAR finds Color1 it will remember where it is (x, y,) and it will move to it with a tolerance of 1 pixel.

    SCAR Code:
    mmouse(x, y, 2, 2)
    Basicly means move the mouse to the (x, y,) it remembered at the start but to a tolerance of 2 pixels.

    SCAR Code:
    mouse(x, y, 1, 1, true)
    Means left click the (x, y,) at the same spot its remembered it at.

    Now We need to find the color we want to click and select it with the SCAR color picker (the little ink thing at the top of scar).

    Once you have picked the color copy and the paste the color here
    SCAR Code:
    Const
    Color1=Paste it here

    Now that will simply find the color you picked as Color1 move the mouse to it and click on it. Thats all that this script will do.

    ####QUICK GUIDE####
    mmouse(x, y, 1, 1,)
    This Command Moves The Mouse To The X, Y, Coordinites
    mouse(x, y, 1, 1, true)
    This Command Clicks The Mouse At The X, Y, Coordinites
    If(FindColor(x, y, Color1, 1, 1, 600, 600))
    This Command Finds The Color You Picked And "Remembers" Its Coordinites.

  2. #2
    Join Date
    Mar 2007
    Posts
    3,681
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by atmmaster2 View Post
    This Is My Very First TUT So Please Rate It

    Hi i started scripted not that long ago and im not that good but i thought i would give a helping hand to the people who don't know how to do certain things with SCAR.


    If you are confused by any of this dont worry im putting a simple quide at the end.

    Step1. (Make the commands)

    SCAR Code:
    Program New;
    Var

    Const
    Color1=000000;

    Procedure Color_click;
    Begin
    If(Findcolor(x, y, Color1, 1, 1, 600, 600))then
    mmouse(x, y, 2, 2);
    mouse(x, y, 1, 1, true);
    End.

    Now If you dont know what these commands are i will tell you
    SCAR Code:
    if(findcolor(x, y, Color1, 1, 1, 600, 600))

    This basicly means if SCAR finds Color1 it will remember where it is (x, y,) and it will move to it with a tolerance of 1 pixel.

    SCAR Code:
    mmouse(x, y, 2, 2)
    Basicly means move the mouse to the (x, y,) it remembered at the start but to a tolerance of 2 pixels.

    SCAR Code:
    mouse(x, y, 1, 1, true)
    Means left click the (x, y,) at the same spot its remembered it at.

    Now We need to find the color we want to click and select it with the SCAR color picker (the little ink thing at the top of scar).

    Once you have picked the color copy and the paste the color here
    SCAR Code:
    Const
    Color1=Paste it here

    Now that will simply find the color you picked as Color1 move the mouse to it and click on it. Thats all that this script will do.

    ####QUICK GUIDE####
    mmouse(x, y, 1, 1,)
    This Command Moves The Mouse To The X, Y, Coordinites
    mouse(x, y, 1, 1, true)
    This Command Clicks The Mouse At The X, Y, Coordinites
    If(FindColor(x, y, Color1, 1, 1, 600, 600))
    This Command Finds The Color You Picked And "Remembers" Its Coordinites.
    just a lil something :

    mouse(x, y, 1, 1, true)

    The 'true' means it will left click with the mouse

    if you put 'false' it will right click with the mouse

    gd guide overall tho

  3. #3
    Join Date
    May 2007
    Posts
    102
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not bad for a first guide, keep it up

  4. #4
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not a bad tutorial I guess...just improve your spelling, and also edit this:
    SCAR Code:
    Program New;
    Var
     
    Const
    Color1=000000;
     
    Procedure Color_click;
    Begin
    If(Findcolor(x, y, Color1, 1, 1, 600, 600))then
    mmouse(x, y, 2, 2);
    mouse(x, y, 1, 1, true);
    End.
    You don't need to put
    mmouse(x, y, 2, 2); and mouse(x, y, 1, 1, true);
    All you need is mouse(x, y, 1, 1, true); Mouse moves the crusor, and clicks.
    procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
    By: Mutant Squirrle
    Description:
    Moves then clicks mouse.

  5. #5
    Join Date
    Apr 2007
    Location
    new zealand
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    looks good trying learn find color funtion thks

  6. #6
    Join Date
    Jul 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    pretty nice guide 7/10, could use maybe 2 more color const to give more flexibilty to scar.

    Like this.

    SCAR Code:
    Color1=000000;
    Color2=000000;
    Color3=000000;
     Procedure Color_click;
    Begin
    If(Findcolor(x, y, Color1,Color2,Color3, 1, 1, 600, 600))then
    mmouse(x, y, 2, 2);
    mouse(x, y, 1, 1, true);
    End.
    Nice though, good job on first TUT!!

  7. #7
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Nice job it wil help the new very new SCAR learners and people who forget.

    Good Job Rep+

  8. #8
    Join Date
    Jul 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And you also forgot the
    SCAR Code:
    program WhatEver;
    {.include SRL/SRL.scar}
    //some procedures etc...

    begin
    SetupSRL;
    //Even more script...(im to lazy to click the quote button :P)
    end.

    Else...Good job.

  9. #9
    Join Date
    Jul 2007
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey tyvm although you need to get rid of the vars.. thank you again!





  10. #10
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Good tutorial but , It dose not nessarily "remember" x, y in the findcolor function, it returns but i guest its good enoth

  11. #11
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by sukomabawls View Post
    pretty nice guide 7/10, could use maybe 2 more color const to give more flexibilty to scar.

    Like this.

    SCAR Code:
    Color1=000000;
    Color2=000000;
    Color3=000000;
     Procedure Color_click;
    Begin
    If(Findcolor(x, y, Color1,Color2,Color3, 1, 1, 600, 600))then
    mmouse(x, y, 2, 2);
    mouse(x, y, 1, 1, true);
    End.
    Nice though, good job on first TUT!!
    I don't think that will work.... FindColor only works with one colour at a time. You will need to do something like this:

    SCAR Code:
    If (Findcolor(x, y, Color1, 1, 1, 600, 600)) or
    (Findcolor(x, y, Color2, 1, 1, 600, 600)) or
    (Findcolor(x, y, Color3, 1, 1, 600, 600))then
      mouse(x, y, 1, 1, true);

  12. #12
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    lol this may be nuby but why does mine say unknow identifier x

  13. #13
    Join Date
    Aug 2007
    Posts
    172
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    many thanks for this, I am attempting to create a script that will select the clippers in pack then select a sheep and shear it walk to bank and bank it.

    can i use this example to choose a differnt sheep every time so that it dosnt seem to be autoed?..

    LOL 1st script but i need it, Might as well start at deep end..

  14. #14
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    Make sure you declare x and y as integers at the top otherwise the script won't compile. Looks like someone's already noticed that (2 posts up).

  15. #15
    Join Date
    Jun 2007
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Cool good tut, could really help out the new scriptees!

  16. #16
    Join Date
    Oct 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've been using this tutorial on on a lot of test scripts.
    Thanx.

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

    Default

    Quote Originally Posted by hugolord View Post
    just a lil something :

    mouse(x, y, 1, 1, true)

    The 'true' means it will left click with the mouse

    if you put 'false' it will right click with the mouse

    gd guide overall tho
    What was the point of quoting the whole thing?

    Like what I'm doing now. Annoying, isn't it?




  18. #18
    Join Date
    Oct 2007
    Location
    Worthing, England
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Metho D View Post
    Make sure you declare x and y as integers at the top otherwise the script won't compile. Looks like someone's already noticed that (2 posts up).
    Can you do a working example with the integers as i dont understand

  19. #19
    Join Date
    Jul 2007
    Posts
    0
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ive needed somethin like this
    thanks!

  20. #20
    Join Date
    Oct 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, nice work but what's the point of findcolor? Isn't it a little too weak? findcolortolerance(x,y,color[1],msx1,msy1,msx2,msy2,2):Finds a color(color[1]) in the main screen with a colortolerance of two and stores the coordinates in x and y

  21. #21
    Join Date
    Sep 2007
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That seems like it will auto find the color right?

  22. #22
    Join Date
    Jun 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, this really helped!

  23. #23
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Good job! But I think you should do something that describes the function like:

    SCAR Code:
    if(FindColor(x,y:integer,color,)//ect...

    Thanks though!

  24. #24
    Join Date
    Oct 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice for first TUT! good job!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. not click color. bit of help needed here
    By Prince in forum OSR Help
    Replies: 2
    Last Post: 02-22-2008, 09:15 PM
  2. Find a Chest & Left Click,Right Click
    By yanix in forum OSR Help
    Replies: 3
    Last Post: 10-03-2007, 06:40 PM
  3. Replies: 5
    Last Post: 07-31-2007, 07:23 PM
  4. How to make it click a color
    By RudeBoiAlex in forum OSR Help
    Replies: 5
    Last Post: 03-05-2007, 03:57 AM
  5. Click here if color is not equal to...
    By twobac in forum OSR Help
    Replies: 3
    Last Post: 02-15-2007, 07:50 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
  •