Results 1 to 7 of 7

Thread: IsKeyDown

  1. #1
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default IsKeyDown

    I have made a simple auto-typer, and want to add start/stop shortcuts. I know you need IsKeyDown but I don't know how to put that into use. I would like F1 to start, and F2 to stop. I can also post the script I have at the moment if that would help? Thankyou.

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Simba Code:
    If IsKeyDown(08) then
      writeln('you pressed backspace')
    else
      if IsFKeyDown(124) then
        writeln('You pressed F12?');
       
    //http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html#keyboard-virtual-keys
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    Simba Code:
    If IsKeyDown(08) then
      writeln('you pressed backspace')
    else
      if IsFKeyDown(124) then
        writeln('You pressed F12?');

    //http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html#keyboard-virtual-keys
    Thanks for the reply. I've got this script at the moment. I am completely stumped:

    Simba Code:
    program AutoTpyer;

    procedure Typing;
    begin

      SendKeys('Your Text Here', 1);
      KeyDown(13);
      KeyUp(13);
      Wait(2500);
    end;

    begin
    repeat
      Typing;
      for i:= 0 to 19 do
    begin
      Wait(100);
      if IsKeyDown(F1KeyCode) then terminateScript;
    end;
    until(false);

    I get this error:

    Code:
    [Error] (16:7): Unknown identifier 'i' at line 15
    Compiling failed.

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    U didn't declare I :S

    Simba Code:
    program AutoTpyer;

    procedure Typing;
    begin

      SendKeys('Your Text Here', 1);
      KeyDown(13);
      KeyUp(13);
      Wait(2500);
    end;

    var
        I: Integer;
        F1KeyCode: word;//or whatever type u named it.
    begin
        repeat
            Typing;
            for i:= 0 to 19 do
            begin
                Wait(100);
                if IsKeyDown(F1KeyCode) then
                    terminateScript;
            end;
        until(false);
    end.
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by sm321 View Post
    I have made a simple auto-typer, and want to add start/stop shortcuts. I know you need IsKeyDown but I don't know how to put that into use. I would like F1 to start, and F2 to stop. I can also post the script I have at the moment if that would help? Thankyou.
    Autotyper for what? You just doing this to learn Simba coding, or do you really want this? I know an application that can do typing/mouse/window switching/etc for you. It works extremely well. If you want it PM me for it and I can link you to it. You can setup hotkeys for anything with it.

  6. #6
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by LordJashin View Post
    Autotyper for what? You just doing this to learn Simba coding, or do you really want this?
    I'm just learning some things before I move onto RuneScape bots.

    Quote Originally Posted by LordJashin View Post
    I know an application that can do typing/mouse/window switching/etc for you. It works extremely well. If you want it PM me for it and I can link you to it. You can setup hotkeys for anything with it.
    I'm ok, thankyou anyway.

  7. #7
    Join Date
    Dec 2011
    Posts
    257
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by LordJashin View Post
    Autotyper for what? You just doing this to learn Simba coding, or do you really want this?
    I'm just learning some things before I move onto RuneScape bots.

    Quote Originally Posted by LordJashin View Post
    I know an application that can do typing/mouse/window switching/etc for you. It works extremely well. If you want it PM me for it and I can link you to it. You can setup hotkeys for anything with it.
    I'm ok, thankyou anyway.

    Quote Originally Posted by ggzz View Post
    U didn't declare I :S

    Simba Code:
    program AutoTpyer;

    procedure Typing;
    begin

      SendKeys('Your Text Here', 1);
      KeyDown(13);
      KeyUp(13);
      Wait(2500);
    end;

    var
        I: Integer;
        F1KeyCode: word;//or whatever type u named it.
    begin
        repeat
            Typing;
            for i:= 0 to 19 do
            begin
                Wait(100);
                if IsKeyDown(F1KeyCode) then
                    terminateScript;
            end;
        until(false);
    end.
    What do I put here:

    Simba Code:
    F1KeyCode: word;//or whatever type u named it.

    Do I put the name of the procedure?

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
  •