Jump to content

Recommended Posts

Posted

Hi All,

I have tried and errored a lot by reading both the forums and the help file but one part of my script is refusing to work the way I want...
It want to start and stop with F-keys but only the starting part works.

So something must be wrong but I can't figure it out.
Starting works, exit works but a plain stop just won't.

I'm using the function keys:

HotKeySet("{F9}", "_start")
HotKeySet("^{F9}", "_start")

HotKeySet("{F10}", "_stop")
HotKeySet("^{F10}", "_stop")

HotKeySet("{F11}", "_exit")
HotKeySet("^{F11}", "_exit")

And added:

$run = True

while 1
    Sleep(500)
WEnd

Func _stop()
    $run = False
EndFunc


So something must be wrong here but I just can't find it...

The whole script (with the extensive commands removed) is like this:

 

; HOTKEYS ----------------------

HotKeySet("{F9}", "_start")
HotKeySet("^{F9}", "_start")

HotKeySet("{F10}", "_stop")
HotKeySet("^{F10}", "_stop")

HotKeySet("{F11}", "_exit")
HotKeySet("^{F11}", "_exit")

; EINDE HOTKEYS ----------------------

$run = True

while 1
    Sleep(500)
WEnd

; STOP SCRIPT ----------------------
Func _stop()
    $run = False
EndFunc

; START SCRIPT ----------------------
Func _start()
    $run = True
    while $run
       MouseClick("left",3620,1870,2)
    WEnd
 EndFunc

; EINDE SCRIPT ----------------------
Func _exit()
    Exit 1
EndFunc

If anyone can point me in the direction of the error I would be very happy :) or if there is a better way to start/stop please let me know.

Posted

Here you go:

; HOTKEYS ----------------------

HotKeySet("{F9}", "_start")
HotKeySet("^{F9}", "_start")

HotKeySet("{F10}", "_stop")
HotKeySet("^{F10}", "_stop")

HotKeySet("{F11}", "_exit")
HotKeySet("^{F11}", "_exit")

; EINDE HOTKEYS ----------------------

$run = True

while 1
    Sleep(500)
WEnd

; STOP SCRIPT ----------------------
Func _stop()
    $run = False
    while $run
       MouseClick("left",27, 1060,2)
    WEnd
EndFunc

; START SCRIPT ----------------------
Func _start()
    $run = True
    while $run
       MouseClick("left",3620,1870,2)
    WEnd
 EndFunc

; EINDE SCRIPT ----------------------
Func _exit()
    Exit 1
EndFunc

 

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

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
×
×
  • Create New...