Arez Posted March 19, 2006 Share Posted March 19, 2006 While 1 MouseClick("left", 0, 186, 2, 2.5) WEnd Makes the mouse stay at the left side of the screen indefinitely Send("Test Message Here") Types in text Is there any way to make the first happen while the second does instead of one at a time? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 19, 2006 Moderators Share Posted March 19, 2006 While 1MouseClick("left", 0, 186, 2, 2.5)WEndMakes the mouse stay at the left side of the screen indefinitelySend("Test Message Here")Types in textIs there any way to make the first happen while the second does instead of one at a time?2 different scripts it can be done at the same time. AutoIt doesn't support MultiThreading... you might want to take a peak at AdlibEnable() in the helpfile... that may help you a bit. 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...
billmez Posted March 19, 2006 Share Posted March 19, 2006 While 1 MouseClick("left", 0, 186, 2, 2.5) WEnd Makes the mouse stay at the left side of the screen indefinitely Send("Test Message Here") Types in text Is there any way to make the first happen while the second does instead of one at a time? See if this will do it for you $Count = 0 While 1 $Count += 1 MouseClick("left", 0, 186, 2, 2.5) If $Count = 1 Then Send("Test Message Here") Else $Count = 2 EndIf WEnd Thsi should only send the Send("Test Message Here") the first time the loop runs, but will do it all from the same code block even if not at exactly the same time. Link to comment Share on other sites More sharing options...
greenmachine Posted March 19, 2006 Share Posted March 19, 2006 See if this will do it for you $Count = 0 While 1 $Count += 1 MouseClick("left", 0, 186, 2, 2.5) If $Count = 1 Then Send("Test Message Here") Else $Count = 2 EndIf WEnd Thsi should only send the Send("Test Message Here") the first time the loop runs, but will do it all from the same code block even if not at exactly the same time. Since that's only doing it the first time the loop runs, why even have it in the loop? Why not just have it outside the loop and save the extra time dealing with variables. Send ("test message") While 1 MouseClick ("left", 0, 186, 2, 2.5) Sleep (100) WEnd Added a tiny bit of sleep because that's a lot of clicking.... Link to comment Share on other sites More sharing options...
billmez Posted March 19, 2006 Share Posted March 19, 2006 Since that's only doing it the first time the loop runs, why even have it in the loop? Why not just have it outside the loop and save the extra time dealing with variables.Good question. I'm guessing Arez seems to want to do it all in one call, although I have no idea why that would be necessary???? I'm also gyessing for some reason he doesn't want to send the test message until after the mouse pointer is frozen, which is why I put it in the loop and not first. Link to comment Share on other sites More sharing options...
BigDod Posted March 19, 2006 Share Posted March 19, 2006 If the idea is to keep the mouse at the left of the screen would using _MouseTrap not be better than continual clicking. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
billmez Posted March 19, 2006 Share Posted March 19, 2006 If the idea is to keep the mouse at the left of the screen would using _MouseTrap not be better than continual clicking. I agree, but hey, he didn't ask ablut that only running th etwo at the same time and I figured he must have something going on at the left of his screen that makes him want to do that. Link to comment Share on other sites More sharing options...
cal Posted March 22, 2006 Share Posted March 22, 2006 Is there any way to make the first happen while the second does instead of one at a time? Not directly but its pretty easy to have one script call itself passing command line arguments. Your end up with 2 or more copies running and doing different things but everything is still contained in just one script. Here is the first few lines from one of mine. Select Case $CmdLine[0] = 0; no args then call with args $gamepid = Run(@AutoItExe & ' "' & @ScriptFullPath & '" games') $apppid = Run(@AutoItExe & ' "' & @ScriptFullPath & '" apps') Case $CmdLine[1] = 'games'; games arg so run games part findgames() Exit Case $CmdLine[1] = 'apps'; app arg so run apps part findapps() Exit EndSelect basically it calls itself with arguments. If when called, it has arguments, it then calls the proper function for that argument. Link to comment Share on other sites More sharing options...
ChrisL Posted March 22, 2006 Share Posted March 22, 2006 A couple of my faking multi threading ideashttp://www.autoitscript.com/forum/index.php?showtopic=22069 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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