peter960 Posted May 9, 2007 Share Posted May 9, 2007 I need to loop my macro endlessly and have a hotkey setup so that I can stop the macro at any time. I'd like to type while the macro is running so i'd prefer the stop key to be a key that isn't used in typing. If anyone can add those few simple lines of code to the following script that would be very helpful. expandcollapse popupFor $x = 1 To 14 MouseClick("Left", 880, 414) MouseClick("Left", 967, 520) Next Sleep(1000) MouseClick("Right", 508, 200) Sleep(300) MouseClick("Left", 517, 237) Sleep(1000) MouseClick("Right", 643, 289) Sleep(300) MouseClick("Left", 633, 356) Sleep(300) MouseClick("Right", 882, 337) Sleep(300) MouseClick("Left", 882, 413) Sleep(300) MouseClick("Right", 686, 284) Sleep(300) MouseClick("Left", 674, 358) Sleep(300) MouseClick("Left", 739, 122) Sleep(400) Link to comment Share on other sites More sharing options...
Valuater Posted May 9, 2007 Share Posted May 9, 2007 expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused, $Runner HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() $Runner = Not $Runner While $Runner For $x = 1 To 14 MouseClick("Left", 880, 414) MouseClick("Left", 967, 520) Next Sleep(1000) MouseClick("Right", 508, 200) Sleep(300) MouseClick("Left", 517, 237) Sleep(1000) MouseClick("Right", 643, 289) Sleep(300) MouseClick("Left", 633, 356) Sleep(300) MouseClick("Right", 882, 337) Sleep(300) MouseClick("Left", 882, 413) Sleep(300) MouseClick("Right", 686, 284) Sleep(300) MouseClick("Left", 674, 358) Sleep(300) MouseClick("Left", 739, 122) Sleep(400) WEnd EndFunc ;==>ShowMe 8) Link to comment Share on other sites More sharing options...
peter960 Posted May 9, 2007 Author Share Posted May 9, 2007 thx but it doesn't seem to work. I'm not familiar enought to figure out why. I ran script and compiled and ran it as an exe file, but it didn't work. However, after running it when i hit "pause" it said "script paused" in the upper left corner of my screen so something is running, it's just not clicking. Link to comment Share on other sites More sharing options...
Uten Posted May 9, 2007 Share Posted May 9, 2007 @Peter960 How do you expect the pause part of your script to work? Your writing a script. So when people provide some code to you you have to study it to understand how it works. When you understand that you will be able to configure it to your likings. When you hit pause the code goes into a loop until you hit pause again. Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
peter960 Posted May 10, 2007 Author Share Posted May 10, 2007 How do you expect the pause part of your script to work?Your writing a script. So when people provide some code to you you have to study it to understand how it works. When you understand that you will be able to configure it to your likings.When you hit pause the code goes into a loop until you hit pause again.Ya I get that, but the rest of the script didn't seem to work. I was on my way to bed last night and didn't look too closely at it but now I see I needed to hit "F9" to start the clicking.Thanks Val, works great. Link to comment Share on other sites More sharing options...
Valuater Posted May 10, 2007 Share Posted May 10, 2007 Welcome!!! 8) 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