Jump to content
King

Should be easy...

Recommended Posts

King

Ok. So I am new to scripting and I am just trying to make a simple script.

What I am trying to do is create a script that Sends the alphabet every second when I press Ctrl + Alt + Z and stops when I press Ctrl + Alt + X 

 

So here is what I got.

I know this will send it every one second after I open the script.

While 1
    Sleep(1000)
    Send ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
WEnd

Where can I go to learn how to make the part of the script that starts and stops in by pressing certain keys.

I know this is probably stupid to most of you lol. But I am just playing with scripting. Thanks for all the help.

Share this post


Link to post
Share on other sites
King

Ok so I kept digging and found a script. It works fine.

HotKeySet("^!z","Movment");^!z is Ctrl+Alt+'z' to run the Movment
HotKeySet("^!x","End");^!x is Ctrl+Alt+'x' to close the Movment
While 1
    Sleep(100)
WEnd
Func Movment()
    While 1
        Sleep(1000)
        Send("ABCDEFGHIJKLMONPQRSTUVWXYZ")
    WEnd
EndFunc
Func End()
    Exit
EndFunc

The problem is I just found a script, and copied a portion of it and inserted mine. Sure it works... But I don't know why.

What do you recommend I do to get started learning to script simple stuff.

 Thanks.

Share this post


Link to post
Share on other sites
Subz

The AutoIt helpfile is the best way, as it includes examples, personally I would stay away from Send or MouseClick and use ControlSend or ControlClick the reason being is, say you ran your script and it started sending "ABC..." if you click another window it will start typing into that window, Control... functions target a specific Window so is much safer.

Share this post


Link to post
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

×