computergroove Posted May 19, 2014 Share Posted May 19, 2014 (edited) OK final problem. Global $AviList = _FileListToArray(@ScriptDir & "\Videos","*.mpg") Func _PlayRandom() Local $ArrayNumber Local $RandomArrayNo $ArrayNumber=$AviList[0] $RandomArrayNo = Random(2,$ArrayNumber) RunWait (@ScriptDir & '\MPC-HC\mpc-hc64.exe /play /fullscreen /close "'&$AviList[$RandomArrayNo]&'"') _PlayRandom() EndFunc When I add msgbox(0,123,$AviList) after the Runwait line above (3rd line from the bottom) I get a media player classic screen theat says file not found and then a blank box that just says 'OK' behind it. Somehow I am not getting my array data to send to my program or I need to use something like _ArrayDisplay instead of msgbox. Edited May 19, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
computergroove Posted May 19, 2014 Author Share Posted May 19, 2014 (edited) I have decided that I can try this with the beta release of Autoit. Local $aVids = StringRegExp(FileRead("Video.ini"), "(?<==).*", 3);read all the files in the videos.ini and copy everything the the right of = and place array in $aVids - look at stringregexp for better explination _ArrayShuffle($aVids);Autoit Beta function shuffle array content _FileWriteFromArray(@ScriptDir & "Random.ini", $aVids, Default, Default, @CRLF) If Im reading this correctly I am making $Random.ini which will read like a randomized list of all the mpg files in the Videos.ini. Now I need to know how to pull them out line by line to feed into a video player. Edited May 19, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
computergroove Posted May 20, 2014 Author Share Posted May 20, 2014 (edited) OK I just wrote this and I once again cannot get the video file name to output with "" around the file name. When I use array display I see the name of the file without ". Help with the syntax please. Func _PlayRandom() Local $aFileList = _FileListToArray(@ScriptDir & "\Videos", "*.mpg");reads all files from videos directory and places them into a numbered 1d array $arrNum = Ubound($aFileList,1);counts the total number of entrys in the array Local Const $iRandom = Random(1,$aFileList[0]);creates a random number between 1 and the counted number of array list items Run(@ScriptDir & '\MPC-HC\mpc-hc64.exe /play /fullscreen /close "' & $aFileList[$iRandom] & '"');plays random file from videos EndFunc Also I want the randomization to have to play each file then reshuffle the video files and play each one again etc. I dont think the above code will do that. Edited May 20, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
JohnOne Posted May 20, 2014 Share Posted May 20, 2014 Random(2,$ArrayNumber, 1) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted May 20, 2014 Share Posted May 20, 2014 The 1 makes a whole number rather than a float. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
computergroove Posted May 20, 2014 Author Share Posted May 20, 2014 The 1 makes a whole number rather than a float. That's fine but the results are the same. I need to add " to the video file name in order for them to play in the video player. Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html 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