Jump to content

Write... Slower!


 Share

Recommended Posts

Hi.

I wanted to know if there was a way to make my script to write slower?

I made a script that writes something first, but I need it a little slower.

If you're using Send you can check out the Send* options (SendKeyDelay, SendKeyDownDelay), or you can just use Sleep(...).

Opt("SendKeyDelay", 100) ;waits 100 ms after each keystroke.
Edited by cppman
Link to comment
Share on other sites

Another question...

The

Opt("SendKeyDelay", 100) ;waits 100 ms after each keystroke.

where should I put it?

Look:

Opt("SendKeyDelay", 100) ;waits 100 ms after each keystroke.

Send("Hello")

When I use this, it should write:

H

Wait 100ms.

e

Wait 100ms.

l

wait 100ms.

l

wait 100ms.

o

Right? I don't know why but it is not working... I use autoit 3.

Link to comment
Share on other sites

Try a larger value for SendKeyDelay.

I think 100 ms is too fast.

It seems painfully slow to me :-)

AutoItSetOption("WinWaitDelay", 1)
AutoItSetOption("WinTitleMatchMode", 2)

Run("notepad")
WinWait("Notepad")

For $i = 10 To 100 Step 10
    AutoItSetOption("SendKeyDelay", $i)
    WinActivate("Notepad")
    Send("I am typing here  " & $i & "ms" & @CR)
Next

For $i = 200 To 400 Step 100
    AutoItSetOption("SendKeyDelay", $i)
    WinActivate("Notepad")
    Send("I am typing here  " & $i & "ms" & @CR)
Next

@Omegas,

The AutoItSetOption or Opt functions do normally go near the top of your script unless you are doing something like I coded above. You mentioned that it was not working for you??? What operating system are you using? XP? Vista?

Please copy/paste/post your exact code that "does not work" for you.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

It seems painfully slow to me :-)

AutoItSetOption("WinWaitDelay", 1)
AutoItSetOption("WinTitleMatchMode", 2)

Run("notepad")
WinWait("Notepad")

For $i = 10 To 100 Step 10
    AutoItSetOption("SendKeyDelay", $i)
    WinActivate("Notepad")
    Send("I am typing here  " & $i & "ms" & @CR)
Next

For $i = 200 To 400 Step 100
    AutoItSetOption("SendKeyDelay", $i)
    WinActivate("Notepad")
    Send("I am typing here  " & $i & "ms" & @CR)
Next

@Omegas,

The AutoItSetOption or Opt functions do normally go near the top of your script unless you are doing something like I coded above. You mentioned that it was not working for you??? What operating system are you using? XP? Vista?

Please copy/paste/post your exact code that "does not work" for you.

This is pretty sweet. How do I use this in reverse?

For instance... I want to do a Send("{Down}"); command once then for it to get progressively faster.

Furthermore, I'd like the command to have a delay before executing and a condition based on a key hit twice.

I'm the creator of the rm-1800 program. One major limitation you are probably going to find with my program is that each button press is simply calling autoit.exe with a parameter to load a different script depending on the button pressed. This means that each time a button is pressed, a brand new script will be loaded. In order to counter this, you'll need to have your scripts reading and writing data from a file if you want memory to be retained. This method would allow you to save a state and then increment to let it know how many times the button has been pressed.

Would it be possible (may need to be answered by someone more proficient with autoit) to write a more complex script for the button pressed so that it's stored in memory for a given time? So, if I press one of the navigation keys, it puts sort of a wait here for 1 second to see if I make another command type thing? If this is possible, I'd say that creating some form of a script which would "hit the arrow key" for a certain number of times, if held hit's it for more times...

Something like.. Press button Down is hit once>Script goes to memory but something is still keeping the script active then if the button is pressed and held starts running a further written script which would hit the down key for lets say 3 times for a period of 500 ms, then if that command (button is still being pressed) 6 times for 500 ms and so on.

Edited by Omala
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...