Hi all,
Im completely newbie here. I have a problem with script that really need your help.
I want: When I press right mouse, number 2 will be pressed and it will loop per 5s. And it only stop ( I mean stop/script but not close it) when I press enter key. Here is my script:
While 1
If _ispressed("2") Then
While _ispressed("2")
Send("62")
Sleep(50)
WEnd
EndIf
WEnd
Func if _ispressed("2") Then
You mean something like this?
#include <Misc.au3>
Global $bSTOP = False
HotKeySet('{Esc}', '_FNC_EXIT')
HotKeySet('{Enter}', '_FNC_STOP')
While 1
If _IsPressed('02') Then _FNC_TIME()
Sleep(50)
WEnd
Func _FNC_STOP()
If $bSTOP = False Then
$bSTOP = True
Else
$bSTOP = False
EndIf
EndFunc
Func _FNC_TIME()
$bSTOP = False
Local $hTIME = TimerInit(), $hDIFF = 0