quick_sliver007 Posted April 30, 2005 Share Posted April 30, 2005 (edited) Is it possible to have more then one loop statement active at the same time. I am not talking about loops inside of loops. Edited April 30, 2005 by quick_sliver007 . Link to comment Share on other sites More sharing options...
buzz44 Posted April 30, 2005 Share Posted April 30, 2005 (edited) I'm not sure what you mean. You can't do 2 things at once.$i = $i + 1 $z = $z + 1$i is added before $z, you can't have something like.$i = $i + 1, $z = $z + 1If I'm understanding you correctly. Only other thing I can think of is.For... For... Next Next While 1 While 1 Wend WendBut you said not loops inside loops. Edited April 30, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
megahyperion Posted April 30, 2005 Share Posted April 30, 2005 compile your loop into another executable and have autoit trigger it and then close it when its not needed. autoit can both open and close executables dont know if that will do what you want to do. Link to comment Share on other sites More sharing options...
quick_sliver007 Posted May 1, 2005 Author Share Posted May 1, 2005 I'm not sure what you mean. You can't do 2 things at once.$i = $i + 1 $z = $z + 1$i is added before $z, you can't have something like.$i = $i + 1, $z = $z + 1If I'm understanding you correctly. Only other thing I can think of is.For... For... Next Next While 1 While 1 Wend WendBut you said not loops inside loops.<{POST_SNAPBACK}>I mean something like the thing that you said can not be done. Like for exsample calling two or more functions at the same time. I was thinking about making a PACMAN game, and was just gathering info to figure out how I would having different pictures updating at the same time. Like a way to have the ghosts moving even if the player is not moving. Like having the ghosts running around at random and not just move only when the player moves and in responses to the player. I may not make this game and if I do it should be a while. . Link to comment Share on other sites More sharing options...
quick_sliver007 Posted May 1, 2005 Author Share Posted May 1, 2005 compile your loop into another executable and have autoit trigger it and then close it when its not needed.autoit can both open and close executablesdont know if that will do what you want to do.<{POST_SNAPBACK}>I Think this may work for what I am thinking about. I just would have to use control ID's for it to interact with the GUI that is runing from the other script(Program). . Link to comment Share on other sites More sharing options...
Greenseed Posted May 1, 2005 Share Posted May 1, 2005 you can make it, with spaning another copy of you .exe and start both be sure to get 2 image of you .exe in memory and past msg between then with the clipboard or the environement system. sorry im french you understand? GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You. Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 maby this will help you. if not then well ... not.in this code i am giving the command to speakAND show a message box at the same timeall in one .exe(the code is sloppy but it works :">)http://www.autoitscript.com/forum/index.php?showtopic=10985 My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 I don't see what your saying in your script... Its just like going, SoundPlay ( "filename.wav") Msgbox(0,"","") Am I playing the sound and showing a message box at the same time? Yes but the commands are not executed at the same time. qq Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 SoundPlay ( "filename.wav") Msgbox(0,"","")<{POST_SNAPBACK}>yes but now try$talk = ObjCreate("SAPI.SpVoice") $talk.Speak("A really long example sentence to proove my point.") Msgbox(0,"","")first it will talk, and when its done, then it will give the message box. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 (edited) in this code i am giving the command to speakAND show a message box at the same time<{POST_SNAPBACK}>first it will talk, and when its done, then it will give the message box.<{POST_SNAPBACK}>? Edited May 2, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 $talk = ObjCreate("SAPI.SpVoice") $talk.Speak("A really long example sentence to proove my point.") Msgbox(0,"","") is just to proove that you are wrong. and in my scipt there is a work around for this problem by calling itself w/ a parameter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 What point? Arn't you just proving me right??? If you are 'right' then it would talk and display a message box at the same time, but no, it doesn't. It talks and THEN displays the message box... thus proving my original qoute correct. You cant do 2 things at once in the same script. qq Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 What point? Arn't you just proving me right??? If you are 'right' then it would talk and display a message box at the same time, but no, it doesn't. It talks and THEN displays the message box... thus proving my original qoute correct. You cant do 2 things at once in the same script.<{POST_SNAPBACK}>thats why you need to look at my SCRIPT not just the snippet i posted in this topicheres an example of the work around:(you need to compile it before it works since run cant run .au3's)#NoTrayIcon If StringInStr(String('' & $CmdLineRaw), "-box") Then MsgBox(0, 'i win', 'and you do not') Exit EndIf $talk = ObjCreate("SAPI.SpVoice") If @error Then Exit EndIf Run(@ScriptFullPath & " -box") $talk.Speak("I win and you loose give it up.") My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 (edited) Ok then, Can you please give me an example where you do not use COM.Edit: Can you please give me an example where you do not use COM AND you don't need to compile... Edited May 2, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 how about 2 message boxes ? #NoTrayIcon If StringInStr(String('' & $CmdLineRaw), "-box") Then MsgBox(0, '', 'look the 1st message box') Exit EndIf Run(@ScriptFullPath & " -box") MsgBox(0, '', "look the 2nd message box") My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 Above edited post. qq Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 (edited) #NoTrayIcon If StringInStr(String('' & $CmdLineRaw), "-box") Then MsgBox(0, '', 'look the 1st message box') Exit EndIf Run(@ComSpec & ' /c start ' & @ScriptFullPath & " -box") MsgBox(0, '', "look the 2nd message box")works only if you have the default action for .au3 files set to RUNif that is not the case i do not think it is possible w/o compile.edit:#NoTrayIcon If StringInStr(String('' & $CmdLineRaw), "-box") Then MsgBox(0, '', 'look the 1st message box') Exit EndIf $exe = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & '\AutoIt3.exe ' Run($exe & @ScriptFullPath & " -box") MsgBox(0, '', "look the 2nd message box")is also possibleedit 2:this also prooves that you are wrong in your oddometer thread1. I am not sure how the hibernation bug is related, as you said once a message box appears it pauses the entire script, meaning that it is impossible to have more than one message box at any one time.<{POST_SNAPBACK}> Edited May 2, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 (edited) Exactly. When I made my statement about not being able to do 2 thigns at once I was taking into consideratio nthe current situation and didn't think that someone would make a fuss about how I am 'wrong', When the only way you can get it to work is not have it compiled AND blah AND blah and blah and blah and blah... I doubt when someone wants to perform the above 'action' or test/run/code/debug there script they can be bothered to compile it each time.And just to prove my point again. AutoIt, just as any other language, AutoIt isn't a language but thats besides the point, performs functions/commands in chronological order... meaning up, down, left, right. Meaning that they only real way to do this is to have 2 different scripts.The example you provided still performs up, down, left, right, just as any other example you will try and pass as 'right'. It is mierly an illusion.Edit: BTW none of your example you have provided have worked at all... with 3.1.1.19 tested.Edit2: There you go again twisting my words again, Odometre.... In relation to my program, and yes a message box DOES, repeat keyword DOES pause a script, once the message box has been created you can not bypass it until you have clicked 'ok' or whatever. In my script, which again, as before is correct. Not trying to disguise it by compiling it and such.Edit3: Incase I forget, none of your example you have provided have worked at all, again key words are... at all. Edited May 2, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
w0uter Posted May 2, 2005 Share Posted May 2, 2005 (edited) Edit: BTW none of your example you have provided have worked at all... with 3.1.1.19 tested.i also got 3.1.1.19 and they work fine on my pc. exept the one that req to have the default action at run. since i have SciTE.btw im not trying to fight you or anything. Edited May 2, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
buzz44 Posted May 2, 2005 Share Posted May 2, 2005 I have just re-installed 3.1.1.19 Zip and EXE and still it does not work. There is only 1 message box... the 2nd one. qq 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