Guest Py7|-|[]/\/ Posted November 15, 2004 Share Posted November 15, 2004 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 More sharing options...
scriptkitty Posted November 15, 2004 Share Posted November 15, 2004 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 More sharing options...
Guest Py7|-|[]/\/ Posted November 15, 2004 Share Posted November 15, 2004 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 More sharing options...
scriptkitty Posted November 15, 2004 Share Posted November 15, 2004 (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 November 15, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted November 15, 2004 Share Posted November 15, 2004 Thanks I'll go check it out now. Link to comment Share on other sites More sharing options...
redndahead Posted November 15, 2004 Share Posted November 15, 2004 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 More sharing options...
scriptkitty Posted November 15, 2004 Share Posted November 15, 2004 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 1If fileOpen($NameOfFile) = -1 ExitLoopFileClose($NameOfFile)sleep(10)WendIf (something to test) then AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
scriptkitty Posted November 15, 2004 Share Posted November 15, 2004 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 More sharing options...
erebus Posted November 15, 2004 Share Posted November 15, 2004 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 More sharing options...
Guest Py7|-|[]/\/ Posted November 15, 2004 Share Posted November 15, 2004 Ok, I'm going to go google up some info. on .mpq files and Blizzard sounds. Link to comment Share on other sites More sharing options...
killaz219 Posted November 16, 2004 Share Posted November 16, 2004 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?) Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted November 16, 2004 Share Posted November 16, 2004 The sound of an archer that has just been built. It will say somethign when it has been built. Link to comment Share on other sites More sharing options...
killaz219 Posted November 17, 2004 Share Posted November 17, 2004 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 More sharing options...
erebus Posted November 21, 2004 Share Posted November 21, 2004 (TFT or ROC?)<{POST_SNAPBACK}>Considering of his avatar, TFT probably Link to comment Share on other sites More sharing options...
Guest Py7|-|[]/\/ Posted November 21, 2004 Share Posted November 21, 2004 I try to have the most "evi| h@x0r dude" avatar. I wanted this one really crazy ass pic, but it was like 3MB. Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 21, 2004 Share Posted November 21, 2004 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 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