Jump to content

Help With A Simple Script Please


Recommended Posts

All I want this to do is, is that if I hit F11 on my keyboard, the script will stop, and if I hit F12 on my keyboard, it'll start again. This is my script:

Do

MouseClick("left", 199,236)

Until 1 = 0

Simple huh.

Link to comment
Share on other sites

You can't assign a hotkey to F12. Windows doesn't allow it.

global $mouseclick = False
HotKeySet("{F10}","Start")
HotKeySet("{F11}","Stop")

while 1

If $mouseclick = True Then
    MouseClick("left", 199,236)
Endif

;you may want to add the following line of code to the script so that it doesn't hog your CPU
;sleep(10)

wend

Func Start()
    $mouseclick = True  
EndFunc

Func Stop()
    $mouseclick = False 
EndFunc

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Oh sorry. I wrote it for the beta version of autoit which supports boolean values. Let me fix it:

global $mouseclick = "False"
HotKeySet("{F10}","Start")
HotKeySet("{F11}","Stop")

while 1

If $mouseclick = "True" Then
    MouseClick("left", 199,236)
Endif

;you may want to add the following line of code to the script so that it doesn't hog your CPU
;sleep(10)

wend

Func Start()
    $mouseclick = "True"    
EndFunc

Func Stop()
    $mouseclick = "False"   
EndFunc

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

you can use f12 if you want (for either start or stop - i used it for stop)

just try this

global $mouseclick = "False"
HotKeySet("{F11}","Start")

while 1

If $mouseclick = "True" Then
    MouseClick("left", 199,236)
Endif

;you may want to add the following line of code to the script so that it doesn't hog your CPU
;sleep(10)
if _ispressed ("7B") then stop(); <---- only works with beta

wend

Func Start()
    $mouseclick = "True"    
EndFunc

Func Stop()
    $mouseclick = "False"   
EndFunc

only works with beta

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