Jump to content

simple starter script


AlfzZz
 Share

Recommended Posts

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]
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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
    
    

            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


SmOke_N
            
            
                Posted 
                
            
        
    
    
        


SmOke_N
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 16.3k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        49
                                
                                    
                                
                            
                        
                    
                
            
            
                

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

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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.

Link to comment
Share on other sites

  • Moderators

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.

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...