Results 1 to 9 of 9

Thread: Phantom1's First auto Typer First Script

  1. #1
    Join Date
    Jun 2008
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Phantom1's First auto Typer First Script

    this is my first script and its a auto typer
    <3 RISK, <3 P1nky

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's pretty simple but good for a first script.

    However, you should remove the functions you took from SRL (TypeByte, TypeSend) or credit them (because there is no credits). You don't need to do that because just after Program you can put {.include SRL/SRL.scar}

    Also, you should never have a endless loop. The until(False) should be something else such as until(IsFkeyDown(12)) or until(TimesTyped = TimesToType) etc.

    And it is pretty good that you have correct standards. I didn't have correct standards until a long way after because I was to lazy to learn them. I see that they are not hard though now.

    Try this one.

    SCAR Code:
    program AutoTyper;
    {.include SRL/SRL.scar}

    var
      Msgs : TStringArray;
      TimesToType, TimesTyped, WaitTime : integer;
      FKey : integer;
     
    procedure Setup;
    begin
      Msgs := ['msg1', 'msg2', 'msg3', 'etc']; //The messages you want to type.
      TimesToType := 5; {How many times you want to say the text. This will
                        increment when ALL the messages are said not just one.}

      FKey := 12;       //The FKey you want to use to stop the script when pressed.
      WaitTime := 100;  //Time to wait in between text.
      if ((GetArrayLength(Msgs) = 0) or (TimesToType = 0)) then
        exit;
    end;

    procedure TypeText(index : integer);
    begin
      if Msgs[index] = '' then exit;
      if IsFKeyDown(FKey) then TerminateScript;
      TypeSend(Msgs[Index]);
      Wait(WaitTime + random(80));
    end;

    procedure TypeArray;
    var
      i : integer;
    begin
      for i := 0 to GetArrayLength(Msgs) - 1 do
        TypeText(i);
      TimesTyped := TimesTyped + 1; // Not inc because it's slower ;)
    end;

    begin
      Setup;
      repeat
        TypeArray;
      until((IsFKeyDown(FKey)) or (TimesTyped = TimesToType));
    end.

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

    Default

    Inc is faster..

    and you don't need to credit SRL for SRL functions..

    nice job

    (just to let you know, you don't need to put the functions in the script.. take them out and do TypeSend('something'); and it will do the same thing

    that's the whole point of {.include srl/srl.scar} and SetupSRL; )

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, inc is not faster dude. And I already told him he dosen't need to put the functions in. And I only told him to credit them at least because he put them in there like he was saying he did them.

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

    Default

    orly?

    run this..

    SCAR Code:
    program FastTime;
    var x,y: integer;
    const Count = 1000000;
    begin
      ClearDebug;
      WriteLn('Please wait a few seconds...');
      X := GetSystemTime;
      for Y:= 0 to Count do
        Y := Y + 1;
      ClearDebug;
      WriteLn('Took '+IntToStr(GetSystemTime - X)+' ms to do '+Inttostr(Count)+' incs using Y := Y + 1;');
      X := GetSystemTime;
      for Y:= 0 to Count do
        Inc(Y);
      WriteLn('Took '+IntToStr(GetSystemTime - X)+' ms to do '+Inttostr(Count)+' incs using Inc(Y);');
      WriteLn('');
      WriteLn('Use Inc();!');
    end.

    Took 1295 ms to do 1000000 incs using Y := Y + 1;
    Took 1108 ms to do 1000000 incs using Inc(Y);

    Use Inc();!
    Successfully executed

    >.>

  6. #6
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a lot better than my first script, good job

  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well I didn't want to prove it, but I read somewhere on the forums that Inc is faster, and it also was posted by a Developer (ray I think?).

    And you proved him wrong not me .

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

    Default

    I got that from Hy and he got it from Timer or something..

    this has been discussed a lot.. Inc is faster for SCAR but a := a + 1; is faster for most things..

  9. #9
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah. Well I would have tested myself but I was to lazy.

    Edit: I found it!

    Unknown\unusual things in SCAR!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Auto Typer
    By kevin0095 in forum First Scripts
    Replies: 4
    Last Post: 12-31-2007, 06:38 PM
  2. My First Auto Typer
    By otoole123 in forum First Scripts
    Replies: 12
    Last Post: 12-07-2007, 11:12 PM
  3. VERY VERY VERY x4 auto typer
    By rs cheata in forum First Scripts
    Replies: 14
    Last Post: 11-25-2007, 04:43 AM
  4. i need help again (not an auto typer)
    By corl455 in forum First Scripts
    Replies: 5
    Last Post: 09-18-2007, 09:08 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
  •