Jump to content

Recommended Posts

Posted

Hi,

Just wondering if could I use the RANDOM function to to "store" the pic files and then use SplashImageOn function to display the pics randomly?

Thanks.

mouse not found....scroll any mouse to continue.

Posted

If I understand you correctly you want to choose a random picture to show on your splash image?

Well I suppose if your picture files were named with numbers only it could work.

;Randomly choose between 1.bmp, 2.bmp and 3.bmp
SplashImageOn("", Random(1, 3, 1) & ".bmp")
Posted

Hi,

Just wondering if could I use the RANDOM function to to "store" the pic files and then use SplashImageOn function to display the pics randomly?

Thanks.

Try this (BETA)

#Include <File.au3>
#Include <Array.au3>

$path = 'c:\images'
$FileList =_FileListToArray ( $path )

For $i = 1 To $FileList[0]
    $image = $FileList[Random(1, $FileList[0])]
    SplashImageOn ( 'Title', $path & '\' & $image )
    Sleep(3000)
Next
Posted

thanks for the replies.

Emperor > after renaming my picture files to numbers, how i do write it in codes so that the script understands and works with SplashImage?

Briegel > how to i use your code if I am planning to use FileInstall to copy the pictures?

thanks again.

mouse not found....scroll any mouse to continue.

Posted (edited)

Briegel > how to i use your code if I am planning to use FileInstall to copy the pictures?

Sample:

#Include <File.au3>
#Include <Array.au3>

$path = 'c:\images\' ; set to folder where images should install to
DirCreate ( $path )

FileInstall ( 'c:\yourimages\pic1.xxx', $path, 1 )
FileInstall ( 'c:\yourimages\pic2.xxx', $path, 1 )
FileInstall ( 'c:\yourimages\pic3.xxx', $path, 1 )
FileInstall ( 'c:\yourimages\pic4.xxx', $path, 1 )
FileInstall ( 'c:\yourimages\pic5.xxx', $path, 1 ) ; so on

$FileList =_FileListToArray ( $path )

For $i = 1 To $FileList[0]
    SplashImageOn ( 'Title', $path & '\' & $FileList[Random(1, $FileList[0])] )
    Sleep(3000) ; set timer to change images
Next

DirRemove ( $path )

I wonder that I have to use 'DirCreate()' and 'DirRemove()'. Until now I thought I can use 'FileInstall()' without this.

But I works. :D

Briegel

EDIT: language, grrrr

Edited by Briegel
Posted

thanks alot for the excellent scripting Emperor & Briegel.

both works great. :D

mouse not found....scroll any mouse to continue.

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
  • Recently Browsing   0 members

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