belvedere Posted July 29, 2010 Posted July 29, 2010 Hey guys, I was trying to make a sequence using a hotkey each time it is pressed it send random letters, my code isnt working, but at least you can understand what i mean. Do If _IsPressed("2D") Then Send("a") EndIf Sleep(1000) Until Sleep(1000) Do If _IsPressed("2D") Then Send("b") EndIf Until Sleep(1000)
jaberwacky Posted July 29, 2010 Posted July 29, 2010 Will this do? HotKeySet("{INS}", "SendChar") While True Sleep(10) WEnd Func SendChar() Local $char = Random(97, 98, 1) Return Send(Chr($char), 1) EndFunc ;==>SendChar Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
belvedere Posted July 29, 2010 Author Posted July 29, 2010 Will this do? HotKeySet("{INS}", "SendChar") While True Sleep(10) WEnd Func SendChar() Local $char = Random(97, 98, 1) Return Send(Chr($char), 1) EndFunc ;==>SendChar it works, but i dont want it randomical, i want a sequence, 'a' then if press 'ins' again send 'b' if press 'ins' again go back to 'a'
smashly Posted July 29, 2010 Posted July 29, 2010 Hi,HotKeySet("{INS}", "SendChar") Global $i = 66 ;B While 1 Sleep(10) WEnd Func SendChar() If $i = 65 Then $i = 66 Else $i = 65 EndIf Send(Chr($i), 1) EndFunc ;==>SendChar Cheers
jaberwacky Posted July 30, 2010 Posted July 30, 2010 each time it is pressed it send random lettersI'm just sayin' Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now