HELP with CTRL+X

11/11/2012 15:58 mlukac89#1
Hey
i want to made script when i press START button its activates window and give focus on window, then what i want and where is problem i want when i press CTLR + X to activate function and repeat it till i press CTRL + X again
11/12/2012 16:30 mlukac89#2
anyone ?
11/12/2012 18:54 schmuselord1#3
like this?:

Code:
HotKeySet("^x", "function")

Global $i = 0

Func function()
   $i += 1
   While  Mod($i, 2) <> 0 
	  whatever()
   WEnd
   ToolTip("", 0, 0)
EndFunc

Func whatever()
   ToolTip("PRESS CTRL+X TO TURN ME OFF", 0, 0)
EndFunc

While 1
   sleep(20)
WEnd
11/12/2012 19:30 Logtetsch#4
It's better if you declare your new functions under your main function.
Code:
random code
#include <.... .au3>
.........

main function()
.........

random function_1()
.........
random function_2()
.........
The main function is the most important thing in your script. So it's easier to find and your script will be clearer.

But back to your problem.
Code:
HotKeySet ("^x", "_iFunction")

Global $iStatus = True

While True
	if $iStatus == True Then
		MsgBox(64, "iFunction", "Function is enabled!" & @LF & "Press CTRL + X to disable this function.")
	EndIf
WEnd

Func _iFunction()
	if $iStatus == False Then
		$iStatus = True
	ElseIf $iStatus == True Then
		$iStatus = False
	EndIf
EndFunc
11/12/2012 22:49 mlukac89#5
Quote:
Originally Posted by Logtetsch View Post
It's better if you declare your new functions under your main function.
Code:
random code
#include <.... .au3>
.........

main function()
.........

random function_1()
.........
random function_2()
.........
The main function is the most important thing in your script. So it's easier to find and your script will be clearer.

But back to your problem.
Code:
HotKeySet ("^x", "_iFunction")

Global $iStatus = True

While True
	if $iStatus == True Then
		MsgBox(64, "iFunction", "Function is enabled!" & @LF & "Press CTRL + X to disable this function.")
	EndIf
WEnd

Func _iFunction()
	if $iStatus == False Then
		$iStatus = True
	ElseIf $iStatus == True Then
		$iStatus = False
	EndIf
EndFunc
yes thats what i want thx very much