Results 1 to 13 of 13

Thread: Need something :)

  1. #1
    Join Date
    Apr 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need something :)

    Hey all,
    I am a noob scripter with scar, but I am familiar with scripts like gml, php, html and a lil bit of C++ and VB. Scar CDE is a great program(I think), I've tested a few of its script and they are great. Anyway I was searching for a color finder+clicker, I didn't found one yet, but I am happy that I found SCAR . So can someone explain me how to make a color finder+clicker, I think its not hard the only thing that I got for it is
    FindColor(x,y,color,?,?,?,?) < finding color
    Mouse(x,y,?,?); < for clicking

    Thanks in future

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

    Default

    Finding ONE single color without tolerance

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    X, Y: Integer; // Global variables.


    begin // This will search from the centre of the main client window and outwards.
      if FindColorSpiral(MSCX, MSCY, {REPLACE THIS WITH THE COLOR}, MSX1, MSY1, MSX2, MSY2) then
        Mouse(X, Y, 0, 0, True); //I'm using NO randomness.
      // OR: "MMouse(X, Y, 0, 0);" if you only want to move the mouse to the coord.
    end.

  3. #3
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    EvilChicken change it fast or he wil think that begin
    // This will search from the centre of the main client window and outwards.
    lol
    ~Hermen

  4. #4
    Join Date
    Apr 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by EvilChicken! View Post
    Finding ONE single color without tolerance

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    X, Y: Integer; // Global variables.


    begin // This will search from the centre of the main client window and outwards.
      if FindColorSpiral(MSCX, MSCY, {REPLACE THIS WITH THE COLOR}, MSX1, MSY1, MSX2, MSY2) then
        Mouse(X, Y, 0, 0, True); //I'm using NO randomness.
      // OR: "MMouse(X, Y, 0, 0);" if you only want to move the mouse to the coord.
    end.
    Ty for responsing,
    I get this error:
    Line 432: [Hint] (10376:1): Variable 'OLDMS' never used in script C:\Documents and Settings\HP_Administrator\Bureaublad\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 87: [Error] (12254:1): Unknown identifier 'SetMouseMode' in script C:\Documents and Settings\HP_Administrator\Bureaublad\SCAR 3.15\includes\SRL/SRL.scar

  5. #5
    Join Date
    Jan 2008
    Location
    UK
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    FindColor(x, y, color, X1,Y1, X2, Y2)

    x & y are variables and return the coordinates of the colour.
    color = color
    X1, Y1, X2, Y2 is the area you wish the function to look in.

    You also have FindColorSpiral which starts looking for the color in a spiral from x & y if they are defined.

    MCX & MCY are constants. The represent the Center of the main gaming screen. These cannot be used in the x & y area as EvilChicken demonstrates.

    MSX1 MSY1 MSX2 MSY2 are constants of the coordinates defining the main gaming screen area. These can be used in the place of X1 Y1 X2 Y2.

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

    x & y are where the mouse moves to.
    The 0's are a random factor so if you replaced the first 0 with 5 it would move the mouse to x plus a random number up to 5.
    true means left click, false means right click.
    For the Ultimate Monk Fisher: Ultra Monkfish n Bank Click Here


  6. #6
    Join Date
    Apr 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by PriSoner View Post
    FindColor(x, y, color, X1,Y1, X2, Y2)

    x & y are variables and return the coordinates of the colour.
    color = color
    X1, Y1, X2, Y2 is the area you wish the function to look in.

    You also have FindColorSpiral which starts looking for the color in a spiral from x & y if they are defined.

    MCX & MCY are constants. The represent the Center of the main gaming screen. These cannot be used in the x & y area as EvilChicken demonstrates.

    MSX1 MSY1 MSX2 MSY2 are constants of the coordinates defining the main gaming screen area. These can be used in the place of X1 Y1 X2 Y2.

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

    x & y are where the mouse moves to.
    The 0's are a random factor so if you replaced the first 0 with 5 it would move the mouse to x plus a random number up to 5.
    true means left click, false means right click.
    Ty for explaining I think I understand it a bit, I made this script:
    Code:
    program New;
    {.include SRL/SRL.scar}
    begin
    FindColor(x, y, color, MSX1,MSY1, MSX2, MSY2)
    color = color
    Mouse(x, y, 0, 0, true);
    end.
    I get this error:
    Code:
    Line 4: [Error] (12583:11): Unknown identifier 'x' in script

  7. #7
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    X and Y are the variables (integer (numeric)wher ethe found color(the coords of it) will be stored if the color is found on
    0,0(the leftuppercorner)
    the x will contain 0
    and the Y 0 to
    SCAR Code:
    FindColor(X,y//this is it will be stored in
    mouse(X,y//here are you using it

    sorry for not good grammar but i am in a hurry

    the Important!
    X and y have to be declared as variables!

    put this under

    SCAR Code:
    program bla;
    include srl bla


    Var
      X,Y: Integer;
    Edit:

    SCAR Code:
    program New;
    {.Include SRL/SRL.Scar}
    Var
      X, Y:integer;
    <The Rest OF the Script!>
    Hermpie


    If You post your script(the stuff you got until now)
    i will fix it and debug it for you with Writeln's so you know what you done wrong!loser! just kidding
    ~Hermen

  8. #8
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here
    SCAR Code:
    program Example;//program name
    {.Include SRL/SRL.Scar}//Includes SRL this is one of the most important things

    Var//Global Vars, this is i think a bit to hard for you so i wont it fully but you can use those var's everywhere in the script
      X, Y:integer;//X and Y are declared as Integers integers can contain numerical chars like Coords
    const

    Treecolor =0;//this contains the tree color you have to pick the color first with the color picker from the screen.


    begin// the main loop here starts scar reading
      SetupSRL; // you need this to call all the procedure's and functions used in SRL
      Repeat
        if FindColorSpiralTolerance(X,Y,TreeColor,MSX1,MSY1,MSX2,MSY2,10) then Mouse(X,Y,3,3,true);
        wait(5000 +random(500));
      Until(false)
         { If The Color is found in certain
        Coords the coords will be loaded into x and y
        TreeColor Contains the color filed in at The Const at the top
        MSX1,MSY1,MSX2,MSY2 this will search at the mainscreen, :p you wont search on the minimap while treecutting do you :p
        10 is the tolerance if the tree haves the color 327236(some randomcolor) and the color changes a bit you can't find it
        so if you use tolerance it will search from like 300000 to 350000 (just some random numbers) how higher number in the tol how
        bigger range it will be
        The If and Then Statement is if thecolor is found? then do?
        we have
        if FindColorSpiralTolerance(X,Y,TreeColor,MSX1,MSY1,MSX2,MSY2,10) then
        Mouse(X,Y,3,3,true);
       
        Mouse Click on The Coords X,Y (where the color is found)
        the 3,3 will add some random rang from 0 to 3 at the coords so it won't click the same exactly the same corods everytime
        True = Left Click
        False = rightClick
        we use true so it will cutdown the tree immediatley
       
        Then we have a ; to terminate that line
        then we have wait(5000 +random(500)); Because else it will do every 5000 miliseconds(5 secs) the same click
        and we dont want that random (500) gives us a wait from 5000 to 55000 miliseconds
       
        The code is between a
        Repeat
       
        until (false)
        this will repeat forever so if you will be advanced more you will do it when all players get false(like if they gained an unsolved random)
       

                                                     }




    end.
    ~Hermen

  9. #9
    Join Date
    Apr 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hermpie View Post
    Here
    SCAR Code:
    program Example;//program name
    {.Include SRL/SRL.Scar}//Includes SRL this is one of the most important things

    Var//Global Vars, this is i think a bit to hard for you so i wont it fully but you can use those var's everywhere in the script
      X, Y:integer;//X and Y are declared as Integers integers can contain numerical chars like Coords
    const

    Treecolor =0;//this contains the tree color you have to pick the color first with the color picker from the screen.


    begin// the main loop here starts scar reading
      SetupSRL; // you need this to call all the procedure's and functions used in SRL
      Repeat
        if FindColorSpiralTolerance(X,Y,TreeColor,MSX1,MSY1,MSX2,MSY2,10) then Mouse(X,Y,3,3,true);
        wait(5000 +random(500));
      Until(false)
         { If The Color is found in certain
        Coords the coords will be loaded into x and y
        TreeColor Contains the color filed in at The Const at the top
        MSX1,MSY1,MSX2,MSY2 this will search at the mainscreen, :p you wont search on the minimap while treecutting do you :p
        10 is the tolerance if the tree haves the color 327236(some randomcolor) and the color changes a bit you can't find it
        so if you use tolerance it will search from like 300000 to 350000 (just some random numbers) how higher number in the tol how
        bigger range it will be
        The If and Then Statement is if thecolor is found? then do?
        we have
        if FindColorSpiralTolerance(X,Y,TreeColor,MSX1,MSY1,MSX2,MSY2,10) then
        Mouse(X,Y,3,3,true);
       
        Mouse Click on The Coords X,Y (where the color is found)
        the 3,3 will add some random rang from 0 to 3 at the coords so it won't click the same exactly the same corods everytime
        True = Left Click
        False = rightClick
        we use true so it will cutdown the tree immediatley
       
        Then we have a ; to terminate that line
        then we have wait(5000 +random(500)); Because else it will do every 5000 miliseconds(5 secs) the same click
        and we dont want that random (500) gives us a wait from 5000 to 55000 miliseconds
       
        The code is between a
        Repeat
       
        until (false)
        this will repeat forever so if you will be advanced more you will do it when all players get false(like if they gained an unsolved random)
       

                                                     }




    end.
    I get this error
    Code:
    Line 12: [Error] (12:1): Unknown identifier 'SetupSRL' in script
    btw I don't need this for treecutting , I need this for autoshooting monsters.

  10. #10
    Join Date
    Nov 2007
    Location
    Poland
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program Example;
    {.Include SRL/SRL.Scar}
    const
    Treecolor =0;

    Var
      X, Y:integer;
    begin
      SetupSRL;
      Repeat
        if FindColorSpiralTolerance(X,Y,TreeColor,MSX1,MSY1,MSX2,MSY2,10) then Mouse(X,Y,3,3,true);
        wait(5000 +random(500));
      Until(false);
    end.
    try now.

  11. #11
    Join Date
    Apr 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by iroki View Post
    SCAR Code:
    program Example;
    {.Include SRL/SRL.Scar}
    const
    Treecolor =0;

    Var
      X, Y:integer;
    begin
      SetupSRL;
      Repeat
        if FindColorSpiralTolerance(X,Y,TreeColor,MSX1,MSY1,MSX2,MSY2,10) then Mouse(X,Y,3,3,true);
        wait(5000 +random(500));
      Until(false);
    end.
    try now.
    How does it find it color, cause when i start it it just clicks somewhere.


    K I got it it works! ty guys

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

    Default

    Change the 0 in "TreeColor := 0" to the color you want to find.

  13. #13
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    0 is the black color
    ~Hermen

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
  •