Jump to content

If Statement From Sound


Guest Py7|-|[]/\/
 Share

Recommended Posts

Guest Py7|-|[]/\/

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.

Link to comment
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.

Link to comment
Share on other sites

Guest Py7|-|[]/\/

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?

Link to comment
Share on other sites

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.

Link to comment
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

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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?)

Link to comment
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)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...