belvedere 0 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) Share this post Link to post Share on other sites
jaberwacky 327 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? Share this post Link to post Share on other sites
belvedere 0 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' Share this post Link to post Share on other sites
smashly 12 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 Share this post Link to post Share on other sites
jaberwacky 327 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? Share this post Link to post Share on other sites