JoeN Posted January 22, 2006 Posted January 22, 2006 While 1 WEnd HotKeySet("{c}", "Thrust") Func Thrust() Send("{W 2}") MouseClick ("left") EndFunc This script is supposed to press W two times and then left click whenever the C key is pressed, until the program is shut down. For some reason this simple thing is not working. Perhaps someone can lend me a minute of help.
MHz Posted January 22, 2006 Posted January 22, 2006 Registering the HorKey 1st may help and a sleep in the loop is a good thing for your CPU. Try this: HotKeySet("c", "Thrust") While 1 Sleep(500) WEnd Func Thrust() Send("{W 2}") MouseClick ("left") EndFunc
Developers Jos Posted January 22, 2006 Developers Posted January 22, 2006 While 1 WEnd HotKeySet("{c}", "Thrust") Func Thrust() Send("{W 2}") MouseClick ("left") EndFunc This script is supposed to press W two times and then left click whenever the C key is pressed, until the program is shut down. For some reason this simple thing is not working. Perhaps someone can lend me a minute of help. Do you think that AutoIt3 ever runs the statement that activates you HotKet ? You need to put that before you While..Wend loop.... 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.
JoeN Posted January 22, 2006 Author Posted January 22, 2006 HotKeySet("{C}", "Thrust") While 1 Sleep(100) WEnd Func Thrust() Send("{W 2}") MouseClick ("left") EndFunc Still no dice
Developers Jos Posted January 22, 2006 Developers Posted January 22, 2006 HotKeySet("C", "Thrust") 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.
JoeN Posted January 22, 2006 Author Posted January 22, 2006 (edited) I always have the most stupid errors Many thanks. Edited January 22, 2006 by JoeN
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