Sign in to follow this  
Followers 0
litlmike

Two Commands At Once?

13 posts in this topic

I never thought of asking this before, but is it possible to call two commands at once, or together?

I would like to play both these at the same time.

MsgBox (4096, "Done", "Thank You! Come Again!", 10)
SoundPlay ($Apu_Wav,1)

Share this post


Link to post
Share on other sites



try this

SoundPlay ($Apu_Wav)
MsgBox (4096, "Done", "Thank You! Come Again!", 10)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Bah, you beat me to it Valuater!


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

try this

SoundPlay ($Apu_Wav)
MsgBox (4096, "Done", "Thank You! Come Again!", 10)

8)

Lol! Smart Alex...Yea I will say that it is better, but I was hoping for it to run exactly at the same time. The MsgBox happens after the sound file is done. It isn't the end of the world if there is no better way, but it would be nice.

Share this post


Link to post
Share on other sites

Only one command can be run at a time, per script.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Lol! Smart Alex...Yea I will say that it is better, but I was hoping for it to run exactly at the same time. The MsgBox happens after the sound file is done. It isn't the end of the world if there is no better way, but it would be nice.

I'm not Alex.. but thanks ( just... Valuater )

you could create you own message box and the sound will play... but what i gave you is pretty close without creating an extra GUI

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I'm not Alex.. but thanks ( just... Valuater )

you could create you own message box and the sound will play... but what i gave you is pretty close without creating an extra GUI

8)

THanks for the input. Btw, I know you are not Alex. Smart Alex was better Smart A@@

Share this post


Link to post
Share on other sites

THanks for the input. Btw, I know you are not Alex. Smart Alex was better Smart A@@

I was always told "smart Aleck" :think:

Share this post


Link to post
Share on other sites

I was always told "smart Aleck" :think:

But if you pluralize that it definitely sounds like Alex... so I can see where he got it.

Share this post


Link to post
Share on other sites

AutoIt may get a multithreaded procedure. It may not. Multithreading is what you are asking about. Only a single command may be executed on a single thread at a time. If you have more than one thread, you can run more than one command.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

...The MsgBox happens after the sound file is done...

This is the best that I could do:
; Message Box with Sound
; Author - herewasplato

_MsgBoxSound(0, "Done", "Thank You! Come Again!", "C:\WINDOWS\Media\tada.wav", 10)

Func _MsgBoxSound($MBFlag, $MBTitle, $MBText, $MBSound, $timeout)
    Local $file = FileOpen(EnvGet("temp") & "\MBSound.au3", 2)
    If $file = -1 Then MsgBox(0, "", "Error opening file.")
    
    Local $line1 = 'AutoItSetOption(' & '"WinWaitDelay", 0' & ')'
    Local $line2 = 'WinWait("' & $MBTitle & '", "' & $MBText & '")'
    Local $line3 = 'SoundPlay("' & $MBSound & '", 1)'
    
    FileWrite($file, $line1 & @CRLF & $line2 & @CRLF & $line3)
    FileClose($file)
    
    Run(@AutoItExe & " /AutoIt3ExecuteScript " & EnvGet("temp") & "\MBSound.au3")
    
    MsgBox($MBFlag, $MBTitle, $MBText, $timeout)
    
    While Not FileDelete(EnvGet("temp") & "\MBSound.au3")
        Sleep(10)
    WEnd
EndFunc ;==>_MsgBoxSound
Edit: Requires beta... Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Or just call an external program with the run command, Say like windows media player and pass it the location of an mp3. Then pop up the mesg box. I find I have to make the script pause 5 seconds before displaying the mesg box or it will pop under the media player instead of on top.

when the ok button is press then close the media player. This is what I do.

Granted, doing it like that does not have everything self contained within the script but it works fine.

If you truely needed it self contained you could compile it and use the include command. You could likely include a small mp3 and an external small player.

I've not bothered taking it that far myself.

Share this post


Link to post
Share on other sites

AutoIt may get a multithreaded procedure. It may not. Multithreading is what you are asking about. Only a single command may be executed on a single thread at a time. If you have more than one thread, you can run more than one command.

It already has one... sort of.. :think:

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0