IrishPride 0 Posted June 24, 2011 (edited) Hey guys, For any of you that were helping me earlier, I appreciate it, and I have one more question for you. After establishing that a func can be called for using a func call, within a separate func, I was wondering if it was possible to make it only continue on with the calling for another func, if a hotkey was pressed earlier. Sorry for the poor wording, I didn't know how to state it. Check the example : HotKeySet("{F1}" , "Start" ) HotKeySet("{F2}" , "Test" ) WinActivate( "New Text Document" ) While 1 Start() WEnd Func Start() WinActivate( "New Text Document" ) Send( "1/10" ) Send( "2/10" ) Send( "3/10" ) Send( "4/10" ) Send( "5/10" ) Send( "6/10" ) Send( "7/10" ) Send( "8/10" ) Send( "9/10" ) Send( "10/10" ) Send( "{ENTER}" ) Test() Sleep ( 1500 ) EndFunc Func Test() Send( "11/10 - WINNING!" ) Send( "{ENTER}" ) Sleep ( 250 ) EndFunc However, I'm wondering how to call for the Test function, given that F2 was pressed; if not, repeat Start() loop. Thanks in advance! -IrishPride Edited June 24, 2011 by IrishPride Share this post Link to post Share on other sites
kaotkbliss 146 Posted June 24, 2011 One way you can do it is to set a "flag" expandcollapse popup#Include <Misc.au3> HotKeySet("{F1}" , "Start" ) HotKeySet("{F2}" , "Test" ) $flag=0 WinActivate( "New Text Document" ) While 1 If _isPressed("70") or _isPressed("71") Then $flag=1 EndIf Start() WEnd Func Start() WinActivate( "New Text Document" ) Send( "1/10" ) Send( "2/10" ) Send( "3/10" ) Send( "4/10" ) Send( "5/10" ) Send( "6/10" ) Send( "7/10" ) Send( "8/10" ) Send( "9/10" ) Send( "10/10" ) Send( "{ENTER}" ) If $flag=1 Then Test() EndIf Sleep ( 1500 ) EndFunc Func Test() Send( "11/10 - WINNING!" ) Send( "{ENTER}" ) Sleep ( 250 ) EndFunc 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites