ashley Posted July 20, 2007 Share Posted July 20, 2007 (edited) ok well you may know that i made a 'random background color changer'... (if you didn't... check my sig) well i decided to make a 'random background picture changer' It didnt go as planned... i get an error... can anybody fix this.. or tell me how... or why its not working... here is code: #include <GUIConstants.au3> $RBGpic = Random( "C:\Documents and Settings\Windows\Desktop\Picture one.bmp", 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)), "C:\Documents and Settings\Windows\Desktop\Picture three.bmp", 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)), 0) #Region ### START Koda GUI section ### Form= $GUI = GUICreate("random background color", 604, 111, 193, 115) $test = GUICtrlCreateLabel("This is a test to show you how to make a random background picture...", 40, 32, 546, 24) $Pic1 = GUICtrlCreatePic($RBGpic) GUICtrlSetFont(-1, 12, 800, 6, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd thanks in advance... Edited July 20, 2007 by ashley Free icons for your programs Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 20, 2007 Share Posted July 20, 2007 Have you read the help file for the correct use of Random()? That is so complete wrong, it's incredible. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ashley Posted July 20, 2007 Author Share Posted July 20, 2007 Have you read the help file for the correct use of Random()? That is so complete wrong, it's incredible. i changed it... i dont get the error... but it still dont work... here the code #include <GUIConstants.au3> $RBGpic = Random( "C:\Documents and Settings\Windows\Desktop\Picture one.bmp", "C:\Documents and Settings\Windows\Desktop\Picture three.bmp") #Region ### START Koda GUI section ### Form= $GUI = GUICreate("random background color", 604, 111, 193, 115) $test = GUICtrlCreateLabel("This is a test to show you how to make a random background picture...", 40, 32, 546, 24) $Pic1 = GUICtrlCreatePic($RBGpic, 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlSetFont(-1, 12, 800, 6, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Free icons for your programs Link to comment Share on other sites More sharing options...
mrbond007 Posted July 20, 2007 Share Posted July 20, 2007 (edited) $RBGpic = Random(1, 9, 1) If $RBGpic = 1 Then ;use "C:\Documents and Settings\Windows\Desktop\Picture one.bmp" ElseIf $RBGpic = 2 Then ;use "C:\Documents and Settings\Windows\Desktop\Picture three.bmp" EndIf Edited July 20, 2007 by mrbond007 Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight Link to comment Share on other sites More sharing options...
ashley Posted July 20, 2007 Author Share Posted July 20, 2007 ok now i have tryed a few things... here they are: (they still dont work) expandcollapse popup#include <GUIConstants.au3> $RBGpic = Random( "C:\Documents and Settings\Windows\Desktop\Picture one.bmp", "C:\Documents and Settings\Windows\Desktop\Picture three.bmp") $RBGpic = Random(1, 9, 1) If $RBGpic = 1 Then ;use "C:\Documents and Settings\Windows\Desktop\Picture one.bmp" ElseIf $RBGpic = 2 Then ;use "C:\Documents and Settings\Windows\Desktop\Picture three.bmp" EndIf #Region ### START Koda GUI section ### Form= $GUI = GUICreate("random background color", 604, 111, 193, 115) $test = GUICtrlCreateLabel("This is a test to show you how to make a random background picture...", 40, 32, 546, 24) $Pic1 = GUICtrlCreatePic($RBGpic, 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlSetFont(-1, 12, 800, 6, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndoÝ÷ Ù«¢+Ø¥¹±Õ±ÐíU% ½¹ÍѹÑ̹ÔÌÐì((((ÀÌØíI Á¥ôI¹½´ Ä°ä°Ä¤)%ÀÌØíI Á¥ôÄQ¡¸(ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈí]¥¹½ÝÌÀäÈíÍѽÀÀäÈíA¥ÑÕɽ¹¹µÀÅÕ½Ðì)±Í%ÀÌØíI Á¥ôÈQ¡¸(ÅÕ½ÐíèÀäÈí½Õµ¹Ñ̹MÑÑ¥¹ÌÀäÈí]¥¹½ÝÌÀäÈíÍѽÀÀäÈíA¥ÑÕÉѡɹµÀÅÕ½Ðì)¹%((I¥½¸MQIP-½U$ÍÑ¥½¸½É´ô(ÀÌØíU$ôU% ÉÑ ÅÕ½Ðíɹ½´É½Õ¹½±½ÈÅÕ½Ðì°ØÀаÄÄÄ°ÄäÌ°ÄÄÔ¤(ÀÌØíÑÍÐôU% Ñɱ ÉÑ1° ÅÕ½ÐíQ¡¥Ì¥ÌÑÍÐѼ͡½Üå½Ô¡½ÜѼµÉ¹½´É½Õ¹Á¥ÑÕɸ¸¸ÅÕ½Ðì°ÐÀ°ÌÈ°ÔÐØ°ÈФ(ÀÌØíA¥ÄôU% Ñɱ ÉÑA¥ ÀÌØíI Á¥°À°À°ØÀаÄÔÔ° ¥Ñ=H ÀÌØíMM}9=Q%d°ÀÌØí]M}I=U@°ÀÌØí]M} 1%AM% 1%9L¤¤)U% ÑɱMѽ¹Ð ´Ä°ÄÈ°àÀÀ°Ø°ÅÕ½Ðí5LM¹ÌMÉ¥ÅÕ½Ðì¤)U%MÑMÑÑ¡M]}M!=¤(¹I¥½¸9-½U$ÍÑ¥½¸()]¡¥±Ä($ÀÌØí¹5ÍôU%Ñ5Í ¤(%MÝ¥Ñ ÀÌØí¹5Í($% ÍÀÌØíU%}Y9Q} 1=M($$%á¥Ð((%¹MÝ¥Ñ )]¹ any more ideas Free icons for your programs Link to comment Share on other sites More sharing options...
mrbond007 Posted July 20, 2007 Share Posted July 20, 2007 (edited) #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $GUI = GUICreate("random background color", 604, 111, 193, 115) $test = GUICtrlCreateLabel("This is a test to show you how to make a random background picture...", 40, 32, 546, 24) $RBGpic = Random(1, 9, 1) If $RBGpic = 1 Then GUICtrlCreatePic("C:\Documents and Settings\Windows\Desktop\Picture one.bmp" , 0, 0, 604, 155, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) EndIf GUISetState() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited July 20, 2007 by mrbond007 Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 20, 2007 Share Posted July 20, 2007 ok now i have tryed a few things...any more ideasYou are pulling a random integer from 1 to 9, but only handle cases for 1 and 2. I'll be that works about... 2 times out of 9! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ashley Posted July 20, 2007 Author Share Posted July 20, 2007 thanks for ur help... Free icons for your programs 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