Results 1 to 9 of 9

Thread: Write a quick script

  1. #1
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default Write a quick script

    If it takes more than 5 min then don't bother.
    I was wondering if someone could make a script that clicks on a color every 10 seconds.

    Color:10145331
    Last edited by Cynic; 06-28-2012 at 07:04 PM.

  2. #2
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Not a Hex color, find the normal color and I can do it.

  3. #3
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    why use hex? are you just saying hex to sound smart... if i am not mistaken any color is considered a hex in computer science... do you want to enter the hexadecimal value and have simba convert it to color or do you just simply want to find colors on the screen?



    Simba Code:
    program color;

    var
    x,y:integer;

    begin
    findcolor(x,y,111111);

    repeat

    movemouse(x,y,5,5);
    wait(100+random(100));
    clickmouse2(x,y,5,5);

    wait(20000);
    until(false);
    end.

    //something like this?, i do think clickmouse2 is not properly set up but you /can catch my riff

  4. #4
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by wantonman View Post
    why use hex? are you just saying hex to sound smart... if i am not mistaken any color is considered a hex in computer science... do you want to enter the hexadecimal value and have simba convert it to color or do you just simply want to find colors on the screen?



    Simba Code:
    program color;

    var
    x,y:integer;

    begin
    findcolor(x,y,111111);

    repeat

    movemouse(x,y,5,5);
    wait(100+random(100));
    clickmouse2(x,y,5,5);

    wait(20000);
    until(false);
    end.

    //something like this?, i do think clickmouse2 is not properly set up but you /can catch my riff
    No. I work in hex. I just stumbled onto Simba today. What I want it to do is click on a certain color on the screen every 10 seconds.

  5. #5
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    If it takes more than 5 min then don't bother.
    I was wondering if someone could make a script that clicks on a color every 10 seconds.

    Color:10145331

  6. #6
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Simba Code:
    program ColorClick;
    var
      x, y : Integer;
    begin
      repeat
        if FindColor(x, y, 10145331, 0, 0, 2000, 2000) then
          ClickMouse(x, y, mouse_left);
        Wait(10000);
      until(false)
    end;
    This should do the job, you can change the 2000s with x and y dimensions of the screen, respectively.
    BTW, you can use a hexadecimal color by putting a @ sign in front of it.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  7. #7
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    well its it very simple... though im not sure simba uses hex by default, what you would have to to is use the built in color chooser with simba and there are very simple functions...

    they are

    findcolor()
    Movemouse()
    ClickMouse()


    Simba Code:
    program color;

    var
    x,y:integer;

    begin
    findcolor(x,y,10145331,0,0,800,600);  // if this color isnt working use the color chooser above

    repeat

    movemouse(x,y);
    clickmouse(x,y,1);

    wait(20000);  // this is the wait 10 seconds part adjust to your needs
    until(false);
    end.

    in the findcolor function i set the search area to 800 by 600 but u can change that accordingly to suit your preferences...

  8. #8
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I think this is what you want, will search for the number by hex (it uses some of wantonman's code)

    Simba Code:
    program color;
    Const
      Color = '';   //Put the hex of the colour here between the ''
    var
      x, y, W, H :integer;

    Function HexToColor(Hex : String) : integer;
    Var
      R, G, B : integer;
    begin

      Result := -1;

      if(Length(Hex) <> 6)then
        exit;

      R := HexToInt(Copy(Hex, 1, 2));
      G := HexToInt(Copy(Hex, 3, 2));
      B := HexToInt(Copy(Hex, 5, 2));

      Result := RGBtoColor(R, G, B);

    end;

    begin
      GetClientDimensions(W, H);
      findcolor(x, y, HexToColor(Color), 0, 0, W - 1, H - 1);

      repeat
        movemouse(x, y);
        WriteLn('Clicking mouse at point: '+ToStr(Point(x, y)));
        clickmouse(x, y, mouse_Left);
        wait(20000);  // this is the wait 20 seconds part adjust to your needs (time is in msec)
      until(false);

    end.
    Last edited by putonajonny; 06-29-2012 at 12:39 AM.

  9. #9
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    lol @ you guise.

    Simba Code:
    program ColourClicker;

    const
      TheColour = $FFFFFF;  // Preceed with dollar sign ($) if in hex format.

    var
      P, Dimensions: TPoint;

    begin
      GetClientDimensions(Dimensions.X, Dimensions.Y);
      ActivateClient;

      repeat
        if(FindColor(P.X, P.Y, TheColour, 0, 0, Dimensions.X - 1, Dimensions.Y - 1)) then
        begin
          MoveMouse(P.X, P.Y);
          ClickMouse(P.X, P.Y, mouse_Left);
          Sleep(10000);
        end;
      Until(IsKeyDown(VK_F2));
    end.

    Wrote in web browser, but should work.
    Last edited by Daniel; 07-02-2012 at 06:08 AM.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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
  •