King Posted March 3, 2018 Share Posted March 3, 2018 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. Link to comment Share on other sites More sharing options...
King Posted March 3, 2018 Author Share Posted March 3, 2018 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. Link to comment Share on other sites More sharing options...
Subz Posted March 3, 2018 Share Posted March 3, 2018 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 3, 2018 Developers Share Posted March 3, 2018 Still working on your Notepad challenge? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now