slightly_abnormal Posted May 12, 2006 Share Posted May 12, 2006 okay.. so i want to randomly display one image everytime the script starts.. but the filename should not matter.. just that the images should exist and display one randomly.. I tryed multiple ways, of doing this i dont know arrays all that great either soo #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 546, 405, 192, 125, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP)) $Pic1 = Random(1,GUICtrlCreatePic("*.bmp", 29, 20, 486, 358),1) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Valuater Posted May 12, 2006 Share Posted May 12, 2006 not tested #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 546, 405, 192, 125, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP)) $Pic1 = GUICtrlCreatePic((Random(1,5,1) & ".bmp"), 29, 20, 486, 358) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit 8) Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 12, 2006 Author Share Posted May 12, 2006 (edited) it worked.. thanks val [EDIT] it can only do numbers... ?? Edited May 12, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Valuater Posted May 12, 2006 Share Posted May 12, 2006 it worked.. thanks val Welcome8) Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 12, 2006 Author Share Posted May 12, 2006 (edited) eh.. how do i get it to display images with letters, and numbers in there name?? #include <GUIConstants.au3> ; == GUI generated with Koda == for $i= Asc(0) to Asc(255) Next $Form1 = GUICreate("AForm1", 546, 405, 192, 125, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP)) $Pic1 = GUICtrlCreatePic((Random(Chr($i),Chr($i),1) & ".bmp"), 29, 20, 486, 358) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit ???? #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 546, 405, 192, 125, BitOR($WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_TABSTOP)) $Pic1 = GUICtrlCreatePic((Random(chr(0),chr(255),1) & ".bmp"), 29, 20, 486, 358) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Edited May 12, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 12, 2006 Share Posted May 12, 2006 Hi, what about reading the filenames into an array and then random from 0 to Ubound(array) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 12, 2006 Author Share Posted May 12, 2006 Hi,what about reading the filenames into an array and then random from 0 to Ubound(array)So long,Megalol.. as you can see i'm not very good arrays.. can you show me how? 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