Sign in to follow this  
Followers 0
Guest Py7|-|[]/\/

If Statement From Sound

16 posts in this topic

I am trying to create a .au3 script that will perform an if statement based on a sound playing. Here's what I am working with:

C:\Program Files\Warcraft III\War3Patch.mpq

What I want to do is check to see if a sound has been used from that. Is this possible? I don't know much about .mpq files and I'm not sure exactly how to handle this. Thanks.

Share this post


Link to post
Share on other sites



does it open a proccess to do it?

I am guessing that it is running inside the game, and you are not just opening the sound clip and want to know when it is done.

Might be able to check the fileopen in NT based kernals. I do something like this on the server. I log when certain files are accessed and by whom.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Yes, it runs in a game, and I don't think that it will use its own process just to play a sound, I mean, it plays a lot of sounds. Maybe to rephrase my question I should ask if the sound plays in the game does that mean that the game "opened" the .mpq file listed above? Or does it mean that it is already (integrated?) into the game when I first load it?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It actually depends on the program, many programs load files into memory and access them there. Others will open the file on demand to save memory space. Memory is a lot faster to access, and so loading frequently used things there gives very fast responce.

If you want to see some information, go to www.sysinternals.com and look at filemon.

You may find that quite helpful.

Hint, try looking with a filter with *War3Patch*

ok... http://www.sysinternals.com/ntw2k/source/filemon.shtml

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Thanks I'll go check it out now.

Share this post


Link to post
Share on other sites

If you know that the file you need is that one could you check to see if the file is opened and when it is opened then run your script. Something using

While 1

If fileOpen($NameOfFile) = -1 ExitLoop

FileClose($NameOfFile)

sleep(10)

Wend

Heres the rest of ur script.

Just a thought

red

Share this post


Link to post
Share on other sites

That isn't going to work too well. Oh, and make sure to have a then in the If statement.

FileOpen would try to open the file and return the error code, it is not a monitor to see if some other application opened it.

While 1

If fileOpen($NameOfFile) = -1 ExitLoop

FileClose($NameOfFile)

sleep(10)

Wend

If (something to test) then

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Actually it might be easier to use thier Handle program, something like this:

run(@comspec & ' /c handle "C:\Program Files\Warcraft III\War3Patch.mpq" >temp.txt')

Then read the text file, if it has "No matching handles found" then it is not open.

If the program uses standard practices this might do nicely. Handle is a freeware commandline program.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

I don't know much about .mpq files and I'm not sure exactly how to handle this.

MPQ is a Blizzard's compression file type (similar to the ZIP and RAR archives). It contains folders and files of different types (fonts, images, models, sounds etc). I can't imagine of a way to achieve your goal but if you ask it is possible (a) to read/extract the included files with an MPQ viewer and (:) to use a specific external DLL to include compress/extract commands in your code (known to work with VB, no idea about AutoIt). Try googling a bit and you 'll find more.

Hope these help.

Share this post


Link to post
Share on other sites

Ok, I'm going to go google up some info. on .mpq files and Blizzard sounds.

Share this post


Link to post
Share on other sites

I've worked with WAR3.mpq when i was doing some modding for it to make the grunts look cooler. I may be able to find you some tools that i use to use...... (btw what sound is it?)

Share this post


Link to post
Share on other sites

The sound of an archer that has just been built. It will say somethign when it has been built.

Share this post


Link to post
Share on other sites

The sound of an archer that has just been built. It will say somethign when it has been built.

<{POST_SNAPBACK}>

Ah the Night Elf archer.. I'm trying to recall in my head what some of her phrases are when she is made, but my mind has gone blank. I will need to reinstall Warcraft III

(TFT or ROC?)

Share this post


Link to post
Share on other sites

(TFT or ROC?)

<{POST_SNAPBACK}>

Considering of his avatar, TFT probably :)

Share this post


Link to post
Share on other sites

I try to have the most "evi| h@x0r dude" avatar. I wanted this one really crazy ass pic, but it was like 3MB.

Share this post


Link to post
Share on other sites

I try to have the most "evi| h@x0r dude" avatar. I wanted this one really crazy ass pic, but it was like 3MB.

<{POST_SNAPBACK}>

That being the case you should have used IrfanView :)

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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