Jump to content

Recommended Posts

Posted

Hi can anyone show me a script that sends the keystroke of "a" every 2 seconds? I tried doing this but it would just type the "a" key really fast. I think i set the delay wrong.

Posted

Hi can anyone show me a script that sends the keystroke of "a" every 2 seconds? I tried doing this but it would just type the "a" key really fast. I think i set the delay wrong.

post what you have and we can help you from there...

keep in mind that the sleep function accepts milliseconds, not seconds

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Posted

Im asuming you have "Sleep(2)" in your script, try "Sleep(2000)" instead

[quote name='DaleHohm']You have a strange habit of posting error messages that don't match your code.[/quote][quote name='SmOke_N']Forget the learning... straight to the scripting :lol: (laugh.gif)[/quote]

Posted (edited)

i have no clue what im doing, it took me a while to get this set up, i dont know if this is the right way

Global $Paused

HotKeySet("{INSERT}", "TogglePause")

HotKeySet("{END}", "Terminate")

While 1

Sleep(110)

WEnd

Func TogglePause()

$Paused = NOT $Paused

While $Paused

Opt("SendKeyDelay", 10000000) ;5 milliseconds

Opt("SendKeyDownDelay", 10000) ;1 millisecond

Send("{a down}")

WEnd

EndFunc

Func Terminate()

Exit 0

EndFunc


you can probably code somthing like this in a more simple way...

ok so i fixed it by adding sleep(800) on a new line after send("{a down}")
will there be an easier way to write this script? like a shorter way


            
                


    Edited  by AlfzZz
    
    

            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


SmOke_N
            
            
                Posted 
                
            
        
    
    
        


SmOke_N
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 16.3k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        49
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
It's not what you know ... It's what you can prove!
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            Looks like you need a basic understanding of the options for time.$millisecond = 1
$second = 1000
$minute = 60000
$hour = 3600000

See a pattern there?

Also, I'd suggest trying this:

http://www.autoitscript.com/forum/index.php?showtopic=21048

Once you understand it, you'll be able to answer most questions yourself without the need for being told to RTFM.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Opt("SendKeyDownDelay", 10000) ;1 millisecond

Your delays are way off...

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted

what does RTFM mean?

i understand the time, :\

the only problem was that i set the delays wrong and when i added sleep (number) it turned out to be way easier

  • Moderators
Posted

what does RTFM mean?

i understand the time, :\

the only problem was that i set the delays wrong and when i added sleep (number) it turned out to be way easier

Usually I try to search for something if I don't know what it does or what it means. :)

http://www.google.com/search?q=RTFM&st...:en-US:official

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
  • Recently Browsing   0 members

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