Jump to content

Sending an error to the screen and moving on in the script


Recommended Posts

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 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

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 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

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 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

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...