supadodger 0 Posted August 24, 2010 i know its probably a simple fix but i cant figure out why the msgbox is returning a numeric value instead of a filename... $FileList=_FileListToArray("./","*.mp4",1) $end = $filelist[0] $x = random (1,$end,1) $name = $filelist[$x] MsgBox (4096,"",$name) Share this post Link to post Share on other sites
somdcomputerguy 103 Posted August 24, 2010 (edited) Capitalize the f in the two $filelist lines (2 & 4), or uncapitalize the F in the first line $Filelist. Edited August 24, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Share this post Link to post Share on other sites
JohnOne 1,603 Posted August 24, 2010 _FileListToArray could be at error and returning 0 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
supadodger 0 Posted August 24, 2010 (edited) _FileListToArray could be at error and returning 0i should have said its not returning 0...there are 21 mp4 files and it is returning randomly 1-21...i just need it to return a random filename not a random number...also tried uncapitalizing the 1 F and no change... Edited August 24, 2010 by supadodger Share this post Link to post Share on other sites
ajag 10 Posted August 24, 2010 supadodger, your posted script works fine for me. The MessageBox shows a random filename every time I start the script! (I only changed the search pattern) #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("./","*.*",1) $end = $filelist[0] $x = random (1,$end,1) $name = $filelist[$x] MsgBox (4096,"",$name) A-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Share this post Link to post Share on other sites
gull 0 Posted August 24, 2010 the script works fine for me too i think you can use you can use _ArrayDisplay($filelist, "") to check the return value of _FileListToArray and see if it fails Share this post Link to post Share on other sites
supadodger 0 Posted August 24, 2010 supadodger, your posted script works fine for me. The MessageBox shows a random filename every time I start the script! (I only changed the search pattern) #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("./","*.*",1) $end = $filelist[0] $x = random (1,$end,1) $name = $filelist[$x] MsgBox (4096,"",$name) A-Jay if i leave it at *.* its displaying filenames but if i make it *.mp4 its giving me numbers hmmm at least im making progress... Share this post Link to post Share on other sites
somdcomputerguy 103 Posted August 24, 2010 Sorry to ask an obvious question, but .mp4 files do exist in the scripts directory? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Share this post Link to post Share on other sites
ajag 10 Posted August 24, 2010 Okay, I changed search pattern back to *.mp4 and I created some .mp4 files in the script directory --- and: Works fine! Compiled and uncompiled works. WinXP x86 AutoIt 3.3.4.0 hmm.... Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Share this post Link to post Share on other sites
JohnOne 1,603 Posted August 24, 2010 I changed search pattern back to *.mp4 and I created some .mp4 files in the script directory AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
ajag 10 Posted August 24, 2010 Come on, John... for testing the script it is not necessary to have "real" .mp4-files. The right filename will do it A-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Share this post Link to post Share on other sites
supadodger 0 Posted August 24, 2010 rebooted and works fine... oh well... thanks guys.. Share this post Link to post Share on other sites
AlmarM 22 Posted August 24, 2010 I lol'd. MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites
kaotkbliss 146 Posted August 24, 2010 I lol'd.I'm still lol'ing!I see your collection of eggs has grown 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
AlmarM 22 Posted August 24, 2010 I'm still lol'ing!I see your collection of eggs has grownHell yeah, new UnCommon eggs each time.Not all are my though, im sharing with my girlfriend MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites