Results 1 to 8 of 8

Thread: After each repeat...

  1. #1
    Join Date
    Jun 2007
    Location
    Minnesota
    Posts
    773
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default After each repeat...

    Ok so I am revising a really horrible script I made a week ago. Basically I want SendKeys to go from Message1 to Message2 after each repeat. (And then obviously go to Message3, MSG4, 5, ect...) Is this possible?

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

    Default

    Post the script.
    Do not propose an idea of peculation without evidence of such action.

    http://cashcrate.com/704591 click here and make money!

  3. #3
    Join Date
    Jun 2007
    Location
    Minnesota
    Posts
    773
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not until it's done :P to noobish right now... I guess it will still be nooby when I post it... But its a pretty easy concept lemme post an example. One minute.

  4. #4
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    program New;
    var
      MessageArray: Array of String;
      i: integer;

    begin
      SetArrayLength(MessageArray, 2);
      MessageArray[0] := 'Hi';
      MessageArray[1] := 'Hello';
      {...}
      repeat
        SendKeys(MessageArray[i mod Length(MessageArray)]);
        Inc(i); //i := i + 1;
        wait(500);
      until(false)
    end.

    or

    SCAR Code:
    program New;
    var
      MessageArray: Array of String;
      i: integer;

    begin
      SetArrayLength(MessageArray, 2);
      MessageArray[0] := 'Hi';
      MessageArray[1] := 'Hello';
      {...}
      repeat
        for i := 0 to Length(MessageArray) - 1 do
        begin
          SendKeys(MessageArray[i]);
          wait(500);
        end;
      until(false)
    end.
    Interested in C# and Electrical Engineering? This might interest you.

  5. #5
    Join Date
    Aug 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In all the languages I know there is a "for" loop. I'm not sure\re if that is in scar though. Try looking it up.

  6. #6
    Join Date
    Jun 2007
    Location
    Minnesota
    Posts
    773
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Smartz would that be in one procedure, or could I set the MessageArray as a const? Also what is the {...}?

  7. #7
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    procedure Talk;
    var
      MessageArray: Array of String;
      i: integer;
    begin
      SetArrayLength(MessageArray, 2);
      MessageArray[0] := 'Hi';
      MessageArray[1] := 'Hello';
      {...}
      repeat
        SendKeys(MessageArray[i mod Length(MessageArray)]);
        Inc(i); //i := i + 1;
        wait(500);
      until(i > Length(MessageArray)
    end;

    MessageArray must be a variable, but either of those will work fine as procedures.
    Interested in C# and Electrical Engineering? This might interest you.

  8. #8
    Join Date
    Jun 2007
    Location
    Minnesota
    Posts
    773
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. repeat until...???
    By Alligaattor in forum OSR Help
    Replies: 12
    Last Post: 10-23-2008, 12:59 AM
  2. How do I get this to repeat until?
    By Claymore in forum OSR Help
    Replies: 2
    Last Post: 07-07-2008, 04:02 PM
  3. repeat help
    By trojan in forum OSR Help
    Replies: 2
    Last Post: 06-15-2007, 03:54 PM
  4. repeat somewhere help thx
    By rkroxpunk in forum OSR Help
    Replies: 4
    Last Post: 03-12-2007, 08:24 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
  •