t11wright Posted July 6, 2015 Share Posted July 6, 2015 Global $Paused, $counter = 0 HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "_Terminate") HotKeySet("{ENTER}", "Begin") Func Begin() While 1 $counter +=1 MouseClick("right",1835,701) ToolTip('Script is "Running"',0,0, $counter, 1) WEnd EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc Func _Terminate() Exit 0 EndFuncHere is my code. I tried open with F5 or double-click .au3 file or Tools>Go but doesn't works. Here is the output console:>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Will\Desktop\TIK.au3" >Exit code: 0 Time: 0.04682 AutoIt Version v3.3.12.0SciTE-Lite Version 3.4.1OS: Windows Ultimate 7 64-Bit SP1 Link to comment Share on other sites More sharing options...
Bowmore Posted July 6, 2015 Share Posted July 6, 2015 This will you forgot to call your Begin() function so the script never enters the while loop. Global $Paused, $counter = 0 HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "_Terminate") HotKeySet("{ENTER}", "Begin") Begin() Func Begin() While 1 $counter +=1 MouseClick("right",1835,701) ToolTip('Script is "Running"',0,0, $counter, 1) WEnd EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc Func _Terminate() Exit 0 EndFunc "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
t11wright Posted July 6, 2015 Author Share Posted July 6, 2015 Lol you are right I did this and works but it starts automatically. I want to press ENTER and then starts. Link to comment Share on other sites More sharing options...
noobieautolearn Posted July 7, 2015 Share Posted July 7, 2015 I'm still not that experienced but what does While 1 do? What I see in the example for "While" is Local $i = 0While $i <= 10 MsgBox(0, "Value of $i is:", $i) $i = $i + 1WEnd So it seems like While is a conditional statement like if you were to put While $counter <=10 it would do it until your counter equals 10 but I guess I don't understand the statement While 1. Link to comment Share on other sites More sharing options...
jchd Posted July 7, 2015 Share Posted July 7, 2015 Is this version clearer?While 1 = 1 ; do ; this ; and ; that Wend This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
232showtime Posted July 7, 2015 Share Posted July 7, 2015 try thisGlobal $Paused, $counter = 0 HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "_Terminate") HotKeySet("{ENTER}", "Begin") While 1 Sleep(10) WEnd Func Begin() While 1 $counter += 1 MouseClick("right", 1835, 701) ToolTip('Script is "Running"', 0, 0, $counter, 1) WEnd EndFunc ;==>Begin Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0, $counter, 1) WEnd ToolTip("") EndFunc ;==>TogglePause Func _Terminate() Exit 0 EndFunc ;==>_Terminate ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
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