Results 1 to 5 of 5

Thread: Loop check?

  1. #1
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Loop check?

    I haven't checked this yet, but compiling is annoying.
    Code:
    Line 26: [Error] (16235:29): Type mismatch in script C:\Program Files\SCAR 3.20\Scripts\Auto.scar
    That's the error I get for compiling this:
    SCAR Code:
    program AutoTyper;
    {.include SRL/SRL.scar}

    type
      YourMessage = String;
      Repeats = Integer;

    var
      i: Integer;
     
    const
      YourMessage = 'Selling [item] for'; //Type the message you want repeated.
      Repeats     = 1; //1 repeat is default.

    procedure Idle;
    begin
      while not IsKeyDown('p') do
        Wait(10);
        IsKeyDown('p');
    end;

    procedure Talk;
    begin
      i := 0;
      repeat
        SendKeys(YourMessage+chr(13));
        i := i + 1;
        WriteLn('Your message has been repeated '+IntToStr(i)+' times.');
      until (i = Repeats);
    end;

    begin
      SetupSRL;
      ClearDebug;
      Idle;
      Talk;
      WriteLn('Your typing is finished. Terminating.');
    end.
    What's wrong now?
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

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

    Default

    Why are you declaring those "variables" as types and constants? Remove the type declaration at the top of the script and see if that fixes your issues.
    :-)

  3. #3
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Delet this:
    Code:
    type
      YourMessage = String;
      Repeats = Integer;
    and this after the wait(10)
    Code:
    IsKeyDown('p');
    Change this:
    Code:
    SendKeys(YourMessage+chr(13));
    to
    Code:
    TypeSend(YourMessage);
    And btw your script will type the text repeats times then stop. Maybe that's what you want but I think you want it to write the text always when you hit p.

    Anyway it should look something like this:
    SCAR Code:
    program AutoTyper;
    {.include SRL/SRL.scar}

    var
      i: Integer;

    const
      YourMessage = 'Selling [item] for'; //Type the message you want repeated.
      Repeats     = 1; //1 repeat is default.

    procedure Idle;
    begin
      while not IsKeyDown('p') do
        Wait(10);
    end;

    procedure Talk;
    begin
      i := 0;
      repeat
        TypeSend(YourMessage);
        i := i + 1;//same as Inc(I);
        WriteLn('Your message has been repeated '+IntToStr(i)+' times.');
      until (i = Repeats);
    end;

    begin
      SetupSRL;
      ClearDebug;
      //repeat
        Idle;
        Talk;
      //until(false);
      WriteLn('Your typing is finished. Terminating.');
    end.
    Edit: Delete // before the repeat and until if you want it to write always when you pres p
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  4. #4
    Join Date
    Mar 2009
    Location
    About six feet off the ground.
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Talking Finished!! :D

    Ok, here's the final version for now.
    Please let me know how it works, as this is my first finished script.
    Last edited by zeeky111; 04-03-2009 at 12:45 AM. Reason: Icon
    ~Zeek
    Last major script: November 2009
    Attempted to rejoin: January 2011
    Rejoining: [][][][][]
    Current task: writing basic alching script

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    use and F key so that you don't have to delete it

    just change

    IsKeyDown('p'); to IsFKeyDown(12);

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
  •