Results 1 to 7 of 7

Thread: How do I make my Script Repeat itself

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

    Default How do I make my Script Repeat itself

    Just decided I'd try learning something new before college


    and here is my very first super simple script

    [spoiler]
    program new;
    begin
    MoveMouse(211, 174)
    ClickMouse(211, 174, 1)
    Wait(2500)
    MoveMouse(211, 174)
    ClickMouse(211, 174, 1)
    Wait(2500)
    MoveMouse(211, 174)
    ClickMouse(211, 174, 1)
    Wait(2500)
    MoveMouse(211, 174)
    ClickMouse(211, 174, 1)
    Wait(2500)
    MoveMouse(211, 174)
    ClickMouse(211, 174, 1)
    Wait(2500)
    MoveMouse(211, 174)
    ClickMouse(211, 174, 1)
    Wait(2500)

    end.

    [/spoiler]

    How do i make is repeat itself without having to re-run the script?

  2. #2
    Join Date
    Dec 2011
    Posts
    414
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Just put it inside a loop?

  3. #3
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    procedure MainLoop;

    begin
      MoveMouse(211, 174)
      ClickMouse(211, 174, 1)
      Wait(2500)
      MoveMouse(211, 174)
      ClickMouse(211, 174, 1)
      Wait(2500)
      MoveMouse(211, 174)
      ClickMouse(211, 174, 1)
      Wait(2500)
      MoveMouse(211, 174)
      ClickMouse(211, 174, 1)
      Wait(2500)
      MoveMouse(211, 174)
      ClickMouse(211, 174, 1)
      Wait(2500)
      MoveMouse(211, 174)
      ClickMouse(211, 174, 1)
      Wait(2500)
    end;

    begin
      repeat
        MainLoop;
      until (not (LoggedIn));
    end.

    Untested but, I think that works.

  4. #4
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    not LoggedIn is specific to runescape so that won't work.
    Simba Code:
    program SimpleScript;
    const
      REPEATS = 1000; // How many times to repeat the script

    procedure MainLoop;
    var
      i: Integer;
    begin
      MoveMouse(211, 174);
      ClickMouse(211, 174, 1);
      Wait(2500);
      MoveMouse(211, 174);
      ClickMouse(211, 174, 1);
      Wait(2500);
      MoveMouse(211, 174);
      ClickMouse(211, 174, 1);
      Wait(2500);
      MoveMouse(211, 174);
      ClickMouse(211, 174, 1);
      Wait(2500);
      MoveMouse(211, 174);
      ClickMouse(211, 174, 1);
      Wait(2500);
      MoveMouse(211, 174);
      ClickMouse(211, 174, 1);
      Wait(2500);
      Inc(i);
    end;

    begin
      repeat
        MainLoop;
      until (i >= REPEATS);
    end.

  5. #5
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is this for runescape or another game? If runescape, use mouse(x, y, ranx, rany, button); It moves and clicks at once, and it moves at human speed.ranx and rany are randomness to the x and y coordinates, if you put 3 for each ran,it will click a random pixel between your x and y, and 3 pixels away, if that makes sence.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  6. #6
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    not LoggedIn is specific to runescape so that won't work.
    He never said it wasn't for Runescape, lol.

  7. #7
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    I just assume these things when I see no SRL include and the use of MoveMouse and ClickMouse.

    But you are very correct, he did not state that it wasn't for RuneScape. In which case yours would work if you include SRL at the top.

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
  •