Script Request /program

11/02/2010 02:42 12hero#1
Hey guys,

I was wondering if anyone of you programmers could write me
a simple script. Basically, I want a program that presses the
a function key for me when I press like Ctrl + x.
For example, pressing ctrl + x would result to pressing F2.
It's hard for me to explain. I don't know if I'm making sense.

What I'm trying to accomplish is that when I play conquer,
I want to be able to press F2 by just pressing Ctrl + x so
that I could easily switch skills or use pots.

I would really appreciate any help. Thanks.
11/02/2010 02:51 theoneofgod#2
In AutoIT code.

Code:
While 1
	If _IsPressed(11) Then ; if CTRL is pressed
		If _IsPressed(58) Then ; if X is pressed
			Send("{F2}")
		EndIf
	EndIf
	Sleep(10)
WEnd

Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
	; $hexKey must be the value of one of the keys.
	; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
	Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
	If @error Then Return SetError(@error, @extended, False)
	Return BitAND($a_R[0], 0x8000) <> 0
EndFunc   ;==>_IsPressed
11/02/2010 02:52 denominator#3
My suggestion is for something like that learn ahk/autoit very basic but effective :)

[Only registered and activated users can see links. Click Here To Register...]
11/02/2010 03:15 12hero#4
Ty so much :)
11/02/2010 19:30 12hero#5
theoneofgod, if i wanted to make Ctrl + c to press F3, would this be the script?

While 1
If _IsPressed(11) Then ; if CTRL is pressed
If _IsPressed(43) Then ; if X is pressed
Send("{F3}")
EndIf
EndIf
Sleep(10)
WEnd

Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
; $hexKey must be the value of one of the keys.
; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
If @error Then Return SetError(@error, @extended, False)
Return BitAND($a_R[0], 0x8000) <> 0
EndFunc ;==>_IsPressed

If not, what am i doing wrong?