Sparrowlord Posted July 11, 2006 Share Posted July 11, 2006 I have this following script: expandcollapse popup#include <Misc.au3> Global $Paused HotKeySet("{END}", "TogglePause") HotKeySet("{HOME}", "Terminate") $dll = DllOpen("user32.dll") WinActivate("d2", "") sleep(200) WinMove("d2", "", 0, 0) sleep(1000) $i = 0 While $i <= 2 $timer = TimerInit() $tizz = 5000 While TimerDiff($timer) < $tizz Sleep(100) MouseClick("left", 243, 126, 1) WEnd sleep(1000) MouseClick("left", 243, 126, 1) sleep(1000) MouseClick("left", 350, 187, 1) sleep(1000) MouseClick("left", 243, 126, 1) sleep(1000) $time = TimerInit() While TimerDiff($time) < $tizz Sleep(100) MouseClick("left", 350, 187, 1) WEnd sleep(1000) MouseClick("left", 350, 187, 1) sleep(1000) MouseClick("left", 243, 126, 1) sleep(1000) MouseClick("left", 350, 187, 1) sleep(1000) $i = $i + 1 Wend Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc While 1 Sleep(100) If _IsPressed("01", $dll) Then WEnd Func Terminate() Exit 0 EndFunc But the While is setup to do 2 of it, but is there a way to add something else below that, that happens after the 2 times the While goes threw then back to the While? And with the " If _IsPressed("01", $dll) Then" is there a way to make everytime the mouse is clicked and log that to a ini and show in a GUI that constantly refreshes? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 11, 2006 Moderators Share Posted July 11, 2006 Wow, I can honestly say that:But the While is setup to do 2 of it, but is there a way to add something else below that, that happens after the 2 times the While goes threw then back to the While?Is totally confusing. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Sparrowlord Posted July 11, 2006 Author Share Posted July 11, 2006 Wow, I can honestly say that:Is totally confusing.Heres a example of what I mean:While $i <= 2MouseClick("left", 350, 187, 1)WendBut is there a way to make it do something after it does that twice and then it goes back clicking Link to comment Share on other sites More sharing options...
NELyon Posted July 11, 2006 Share Posted July 11, 2006 (edited) I think he is saying that he wants the whiles in a loop you beat me to it Edited July 11, 2006 by codemyster Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 11, 2006 Moderators Share Posted July 11, 2006 $Count = 0 While 1 $Count = $Count + 1 MouseClick('whateverhere') If $Count = 2 Then ;Do something here EndIf Sleep(10) WEndLike that? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Sparrowlord Posted July 11, 2006 Author Share Posted July 11, 2006 $Count = 0 While 1 $Count = $Count + 1 MouseClick('whateverhere') If $Count = 2 Then ;Do something here EndIf Sleep(10) WEndLike that? Thanks, that looks like it will work perfect. Does anyone know my problem about the GUI and the mouseclicks, I just need to log all the mouse clicks to a traytip or a GUI or something like that. Thanks Link to comment Share on other sites More sharing options...
NELyon Posted July 11, 2006 Share Posted July 11, 2006 Look at _ispressed in the beta helpfile Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 11, 2006 Moderators Share Posted July 11, 2006 Well what do you mean log? You mean it's position it clicked, or just how many times it did? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Sparrowlord Posted July 11, 2006 Author Share Posted July 11, 2006 Just how many times its clicked Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 11, 2006 Moderators Share Posted July 11, 2006 Just how many times its clickedHmm, have you tried anything, I mean I gave you the code above to do something after 2 clicks... wouldn't that make since that it clicked x times?$Count = 0 While 1 $Count = $Count + 1 MouseClick('Primary', 300, 300, 1, 1) If $Count = 2 Then ;Do something here EndIf TrayTip('Click Count', 'Click1 has been clicked: ' & $Count & ' Times.', 0) Sleep(10) WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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