Jump to content

Simple Question


JoeN
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

  • Developers

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

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