What's wrong with this simple script?

10/24/2017 11:23 h4ss4n#1
I want ''e down'' to hold down ''s'' & ''f'' and ''e up'' to release ''s'' & ''f''. But this doesn't seem to be working. Any help?


#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
Sleep(10)
; If E key is pressed hold key S & F down until E is released
If _IsPressed("45", $dll) Then
Send("{s down}") ;Holds the s key down
Send("{f down}") ;Holds the f key down
While _IsPressed("45", $dll)
Sleep(10)
WEnd
EndIf
WEnd
10/24/2017 11:39 FlyffServices#2
Quote:
Originally Posted by h4ss4n View Post
I want ''e down'' to hold down ''s'' & ''f'' and ''e up'' to release ''s'' & ''f''. But this doesn't seem to be working. Any help?


#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
Sleep(10)
; If E key is pressed hold key S & F down until E is released
If _IsPressed("45", $dll) Then
Send("{s down}") ;Holds the s key down
Send("{f down}") ;Holds the f key down
While _IsPressed("45", $dll)
Sleep(10)
WEnd

EndIf
WEnd
Code:
#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
	; If E key is pressed hold key S & F down until E is released
	If _IsPressed("45", $dll) Then
		Send("{s down}") ;Holds the s key down
		Send("{f down}") ;Holds the f key down
		While _IsPressed("45", $dll)
			Sleep(10)
		WEnd
		Send("{s up}");
		Send("{f up}");
	EndIf
WEnd
perhaps release the key? what is the problem? do the script nothing?
10/24/2017 14:54 h4ss4n#3
Quote:
Originally Posted by FlyffServices View Post
Code:
#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
	; If E key is pressed hold key S & F down until E is released
	If _IsPressed("45", $dll) Then
		Send("{s down}") ;Holds the s key down
		Send("{f down}") ;Holds the f key down
		While _IsPressed("45", $dll)
			Sleep(10)
		WEnd
		Send("{s up}");
		Send("{f up}");
	EndIf
WEnd
perhaps release the key? what is the problem? do the script nothing?
It works now =)! Thank you very much. The problem was the s & f keys were not getting released when e was released.