BrettF Posted October 4, 2006 Posted October 4, 2006 I was trying to make the pictures' path a var by making the picture a tick or a cross depending on whether the answers was correct or not. Hense the picture type. Heres part of the code for where the program has the pics: expandcollapse popupFunc Level1Q () MsgBox (0, "Get Ready!", "You have 10 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 9 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 8 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 7 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 6 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 5 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 4 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 3 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 2 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "GO!", 1) $correct = 0 $incorrect = 0 $time1 = TimerStart ( ) $1q1 = InputBox ( "Question 1", "What is 1 + 5?") If $1q1 = 6 Then $correct +=1 DIM $Answer1 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer1 = "\Images\Incorrect.bmp" EndIf $1q2 = InputBox ( "Question 2", "What is 6 - 4?") If $1q2 = 2 Then $correct +=1 DIM $Answer2 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer2 = "\Images\Incorrect.bmp" EndIf $1q3 = InputBox ( "Question 3", "What is 3 + 2?") If $1q3 = 5 Then $correct +=1 DIM $Answer3 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer3 = "\Images\Incorrect.bmp" EndIf $1q4 = InputBox ( "Question 4", "What is 7 - 4?") If $1q4 = 3 Then $correct +=1 DIM $Answer4 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer4 = "\Images\Incorrect.bmp" EndIf $1q5 = InputBox ( "Question 5", "What is 3 + 5?") If $1q5 = 8 Then $correct +=1 DIM $Answer5 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer5 = "\Images\Incorrect.bmp" EndIf $1q6 = InputBox ( "Question 6", "What is 10 - 9?") If $1q6 = 1 Then $correct +=1 DIM $Answer6 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer6 = "\Images\Incorrect.bmp" EndIf $1q7 = InputBox ( "Question 7", "What is 2 + 2?") If $1q7 = 4 Then $correct +=1 DIM $Answer7 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer7 = "\Images\Incorrect.bmp" EndIf $1q8 = InputBox ( "Question 8", "What is 9 - 2?") If $1q8 = 7 Then $correct +=1 DIM $Answer8 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer8 = "\Images\Incorrect.bmp" EndIf $1q9 = InputBox ( "Question 9", "What is 4 + 5?") If $1q9 = 9 Then $correct +=1 DIM $Answer9 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer9 = "\Images\Incorrect.bmp" EndIf $1q10 = InputBox ( "Question 10", "What is 10 - 0?") If $1q10 = 10 Then $correct +=1 DIM $Answer10 = "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer10 = "\Images\Incorrect.bmp" EndIf Local $timing = TimerDiff ($time1) Local $time1 = Abs ($timing / 1000) Local $time = Round ( $time1, -1) $l1rec = FileOpen ( "Scores\Level1Scores.au3", 1 ) FileWriteLine ("Scores\Level1Scores.au3", $correct) FileClose ($l1rec) #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate($name & "'s, Level 1 Report Card", 620, 441, 192, 119) $Group1 = GUICtrlCreateGroup("Time", 16, 8, 145, 57) GUICtrlCreateLabel($time & " Seconds", 24, 32, 100, 17) $Group2 = GUICtrlCreateGroup("Name", 168, 8, 145, 57) GUICtrlCreateLabel($Name, 176, 32, 100, 17) $Group3 = GUICtrlCreateGroup("Correct Answers", 320, 8, 137, 57) GUICtrlCreateLabel($Correct, 328, 32, 100, 17) $Group4 = GUICtrlCreateGroup("Incorrect Answers", 464, 8, 137, 57) GUICtrlCreateLabel($incorrect, 472, 32, 100, 17) $Group5 = GUICtrlCreateGroup("Report Card", 16, 72, 585, 329) GUICtrlCreateLabel("Question 1-", 24, 96, 58, 17) GUICtrlCreateLabel("Question 2-", 24, 144, 58, 17) GUICtrlCreateLabel("Question 3-", 24, 192, 58, 17) GUICtrlCreateLabel("Question 4-", 24, 240, 58, 17) GUICtrlCreateLabel("Question 5-", 24, 288, 58, 17) GUICtrlCreateLabel("Question 6-", 320, 96, 58, 17) GUICtrlCreateLabel("Question 7-", 320, 144, 58, 17) GUICtrlCreateLabel("Question 8-", 320, 192, 58, 17) GUICtrlCreateLabel("Question 9-", 320, 240, 58, 17) GUICtrlCreateLabel("Question 10-", 320, 288, 64, 17) GUICtrlCreateLabel("Your Anser was: " & $1q1, 24, 112, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q2, 24, 160, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q3, 24, 208, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q4, 24, 256, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q5, 24, 304, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q6, 320, 112, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q7, 320, 160, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q8, 320, 208, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q9, 320, 256, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q10, 320, 304, 100, 17) $Pic1 = GUICtrlCreatePic("\Images\Bar.bmp", 297, 88, 7, 305) GUICtrlSetImage ( $pic1, "\Images\Bar.bmp") $Pic2 = GUICtrlCreatePic("", 160, 96, 33, 33) GUICtrlSetData ( -1, $answer1) $Pic3 = GUICtrlCreatePic($Answer2, 160, 144, 33, 33) $Pic4 = GUICtrlCreatePic($Answer3, 160, 192, 33, 33) $Pic5 = GUICtrlCreatePic($Answer4, 160, 240, 33, 33) $Pic6 = GUICtrlCreatePic($Answer5, 160, 288, 33, 33) $Pic7 = GUICtrlCreatePic($Answer6, 448, 96, 33, 33) $Pic8 = GUICtrlCreatePic($Answer7, 448, 144, 33, 33) $Pic9 = GUICtrlCreatePic($Answer8, 448, 192, 33, 33) $Pic10 = GUICtrlCreatePic($Answer9, 448, 288, 33, 33) $Pic11 = GUICtrlCreatePic($Answer10, 448, 240, 33, 33) $Button1 = GUICtrlCreateButton("Continue to Level 2", 496, 408, 105, 25) $Button2 = GUICtrlCreateButton("Quit", 384, 408, 105, 25) $Button3 = GUICtrlCreateButton("Back to Level 1", 272, 408, 105, 25) $Button4 = GUICtrlCreateButton("Main Menu", 160, 408, 105, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE or $msg = $Button2 ExitLoop Case $msg = $Button1 GUISetState(@SW_HIDE) GUILeve12 () Case $msg = $Button3 GUISetState(@SW_HIDE) GUILeve11 () Case $msg = $Button4 GUISetState(@SW_HIDE) MainMenu () Case Else ;;;;;;; EndSelect WEnd EndFunc Thanks Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
McGod Posted October 4, 2006 Posted October 4, 2006 Well you needed a @ScriptDir before your image path. This one worked fine with me ( you need pics for it to show up!) expandcollapse popupLevel1Q () Func Level1Q () $name = InputBox ( "Name", "Please enter your name" ) MsgBox (0, "Get Ready!", "You have 10 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 9 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 8 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 7 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 6 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 5 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 4 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 3 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 2 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "GO!", 1) $correct = 0 $incorrect = 0 $time1 = TimerStart ( ) $1q1 = InputBox ( "Question 1", "What is 1 + 5?") If $1q1 = 6 Then $correct +=1 DIM $Answer1 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer1 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q2 = InputBox ( "Question 2", "What is 6 - 4?") If $1q2 = 2 Then $correct +=1 DIM $Answer2 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer2 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q3 = InputBox ( "Question 3", "What is 3 + 2?") If $1q3 = 5 Then $correct +=1 DIM $Answer3 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer3 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q4 = InputBox ( "Question 4", "What is 7 - 4?") If $1q4 = 3 Then $correct +=1 DIM $Answer4 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer4 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q5 = InputBox ( "Question 5", "What is 3 + 5?") If $1q5 = 8 Then $correct +=1 DIM $Answer5 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer5 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q6 = InputBox ( "Question 6", "What is 10 - 9?") If $1q6 = 1 Then $correct +=1 DIM $Answer6 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer6 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q7 = InputBox ( "Question 7", "What is 2 + 2?") If $1q7 = 4 Then $correct +=1 DIM $Answer7 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer7 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q8 = InputBox ( "Question 8", "What is 9 - 2?") If $1q8 = 7 Then $correct +=1 DIM $Answer8 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer8 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q9 = InputBox ( "Question 9", "What is 4 + 5?") If $1q9 = 9 Then $correct +=1 DIM $Answer9 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer9 = @ScriptDir & "\Images\Incorrect.bmp" EndIf $1q10 = InputBox ( "Question 10", "What is 10 - 0?") If $1q10 = 10 Then $correct +=1 DIM $Answer10 = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 DIM $Answer10 = @ScriptDir & "\Images\Incorrect.bmp" EndIf Local $timing = TimerDiff ($time1) Local $time1 = Abs ($timing / 1000) Local $time = Round ( $time1, -1) $l1rec = FileOpen ( "Scores\Level1Scores.au3", 1 ) FileWriteLine ("Scores\Level1Scores.au3", $correct) FileClose ($l1rec) #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate($name & "'s, Level 1 Report Card", 620, 441, 192, 119) $Group1 = GUICtrlCreateGroup("Time", 16, 8, 145, 57) GUICtrlCreateLabel($time & " Seconds", 24, 32, 100, 17) $Group2 = GUICtrlCreateGroup("Name", 168, 8, 145, 57) GUICtrlCreateLabel($Name, 176, 32, 100, 17) $Group3 = GUICtrlCreateGroup("Correct Answers", 320, 8, 137, 57) GUICtrlCreateLabel($Correct, 328, 32, 100, 17) $Group4 = GUICtrlCreateGroup("Incorrect Answers", 464, 8, 137, 57) GUICtrlCreateLabel($incorrect, 472, 32, 100, 17) $Group5 = GUICtrlCreateGroup("Report Card", 16, 72, 585, 329) GUICtrlCreateLabel("Question 1-", 24, 96, 58, 17) GUICtrlCreateLabel("Question 2-", 24, 144, 58, 17) GUICtrlCreateLabel("Question 3-", 24, 192, 58, 17) GUICtrlCreateLabel("Question 4-", 24, 240, 58, 17) GUICtrlCreateLabel("Question 5-", 24, 288, 58, 17) GUICtrlCreateLabel("Question 6-", 320, 96, 58, 17) GUICtrlCreateLabel("Question 7-", 320, 144, 58, 17) GUICtrlCreateLabel("Question 8-", 320, 192, 58, 17) GUICtrlCreateLabel("Question 9-", 320, 240, 58, 17) GUICtrlCreateLabel("Question 10-", 320, 288, 64, 17) GUICtrlCreateLabel("Your Anser was: " & $1q1, 24, 112, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q2, 24, 160, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q3, 24, 208, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q4, 24, 256, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q5, 24, 304, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q6, 320, 112, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q7, 320, 160, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q8, 320, 208, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q9, 320, 256, 100, 17) GUICtrlCreateLabel("Your Anser was: " & $1q10, 320, 304, 100, 17) $Pic1 = GUICtrlCreatePic("\Images\Bar.bmp", 297, 88, 7, 305) GUICtrlSetImage ( $pic1, "\Images\Bar.bmp") $Pic2 = GUICtrlCreatePic("", 160, 96, 33, 33) GUICtrlSetData ( -1, $answer1) $Pic3 = GUICtrlCreatePic($Answer2, 160, 144, 33, 33) $Pic4 = GUICtrlCreatePic($Answer3, 160, 192, 33, 33) $Pic5 = GUICtrlCreatePic($Answer4, 160, 240, 33, 33) $Pic6 = GUICtrlCreatePic($Answer5, 160, 288, 33, 33) $Pic7 = GUICtrlCreatePic($Answer6, 448, 96, 33, 33) $Pic8 = GUICtrlCreatePic($Answer7, 448, 144, 33, 33) $Pic9 = GUICtrlCreatePic($Answer8, 448, 192, 33, 33) $Pic10 = GUICtrlCreatePic($Answer9, 448, 288, 33, 33) $Pic11 = GUICtrlCreatePic($Answer10, 448, 240, 33, 33) $Button1 = GUICtrlCreateButton("Continue to Level 2", 496, 408, 105, 25) $Button2 = GUICtrlCreateButton("Quit", 384, 408, 105, 25) $Button3 = GUICtrlCreateButton("Back to Level 1", 272, 408, 105, 25) $Button4 = GUICtrlCreateButton("Main Menu", 160, 408, 105, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE or $msg = $Button2 ExitLoop Case $msg = $Button1 GUISetState(@SW_HIDE) GUILeve12 () Case $msg = $Button3 GUISetState(@SW_HIDE) GUILeve11 () Case $msg = $Button4 GUISetState(@SW_HIDE) MainMenu () Case Else ;;;;;;; EndSelect WEnd EndFunc [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
McGod Posted October 4, 2006 Posted October 4, 2006 You know, you could make it Random answers pretty easy. Ill make a simple edit to it to try it out. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
BrettF Posted October 4, 2006 Author Posted October 4, 2006 Thanks. It'll be intresting to see the result Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
McGod Posted October 4, 2006 Posted October 4, 2006 expandcollapse popupLevel1Q () Func Level1Q () $name = InputBox ( "Name", "Please enter your name" ) MsgBox (0, "Get Ready!", "You have 10 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 9 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 8 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 7 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 6 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 5 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 4 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 3 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 2 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "GO!", 1) $correct = 0 $incorrect = 0 Local $q1, $q2, $q3, $1q1[11], $Answer[11], $qq $time1 = TimerStart ( ) For $i = 1 To 10 Step 1 $q1 = Random ( 1, 10, 1 ) $q2 = Random ( 1, 10, 1 ) $q3 = Random ( 1, 2, 1) If $q3 = 1 Then $qq = "+" Else $qq = "-" EndIf If $q1 < $q2 Then $qt = $q2 $q2 = $q1 $q1 = $qt EndIf $1q1[$i] = InputBox ( "Question " & $i,"What is " & $q1 & $qq & $q2 & "?" ) If $q3 = 1 Then $Ans = $q1 + $q2 Else $Ans = $q1 - $q2 EndIf If $1q1[$i] = $Ans Then $correct +=1 $Answer[$i] = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 $Answer[$i] = @ScriptDir & "\Images\Incorrect.bmp" EndIf Next Local $timing = TimerDiff ($time1) Local $time1 = Abs ($timing / 1000) Local $time = Round ( $time1, -1) $l1rec = FileOpen ( "Scores\Level1Scores.au3", 1 ) FileWriteLine ("Scores\Level1Scores.au3", $correct) FileClose ($l1rec) #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate($name & "'s, Level 1 Report Card", 620, 441, 192, 119) $Group1 = GUICtrlCreateGroup("Time", 16, 8, 145, 57) GUICtrlCreateLabel($time & " Seconds", 24, 32, 100, 17) $Group2 = GUICtrlCreateGroup("Name", 168, 8, 145, 57) GUICtrlCreateLabel($Name, 176, 32, 100, 17) $Group3 = GUICtrlCreateGroup("Correct Answers", 320, 8, 137, 57) GUICtrlCreateLabel($Correct, 328, 32, 100, 17) $Group4 = GUICtrlCreateGroup("Incorrect Answers", 464, 8, 137, 57) GUICtrlCreateLabel($incorrect, 472, 32, 100, 17) $Group5 = GUICtrlCreateGroup("Report Card", 16, 72, 585, 329) GUICtrlCreateLabel("Question 1-", 24, 96, 58, 17) GUICtrlCreateLabel("Question 2-", 24, 144, 58, 17) GUICtrlCreateLabel("Question 3-", 24, 192, 58, 17) GUICtrlCreateLabel("Question 4-", 24, 240, 58, 17) GUICtrlCreateLabel("Question 5-", 24, 288, 58, 17) GUICtrlCreateLabel("Question 6-", 320, 96, 58, 17) GUICtrlCreateLabel("Question 7-", 320, 144, 58, 17) GUICtrlCreateLabel("Question 8-", 320, 192, 58, 17) GUICtrlCreateLabel("Question 9-", 320, 240, 58, 17) GUICtrlCreateLabel("Question 10-", 320, 288, 64, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[1], 24, 112, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[2], 24, 160, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[3], 24, 208, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[4], 24, 256, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[5], 24, 304, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[6], 320, 112, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[7], 320, 160, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[8], 320, 208, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[9], 320, 256, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[10], 320, 304, 100, 17) $Pic1 = GUICtrlCreatePic("\Images\Bar.bmp", 297, 88, 7, 305) GUICtrlSetImage ( $pic1, "\Images\Bar.bmp") $Pic2 = GUICtrlCreatePic($answer[1], 160, 96, 33, 33) $Pic3 = GUICtrlCreatePic($Answer[2], 160, 144, 33, 33) $Pic4 = GUICtrlCreatePic($Answer[3], 160, 192, 33, 33) $Pic5 = GUICtrlCreatePic($Answer[4], 160, 240, 33, 33) $Pic6 = GUICtrlCreatePic($Answer[5], 160, 288, 33, 33) $Pic7 = GUICtrlCreatePic($Answer[6], 448, 96, 33, 33) $Pic8 = GUICtrlCreatePic($Answer[7], 448, 144, 33, 33) $Pic9 = GUICtrlCreatePic($Answer[8], 448, 192, 33, 33) $Pic10 = GUICtrlCreatePic($Answer[9], 448, 288, 33, 33) $Pic11 = GUICtrlCreatePic($Answer[10], 448, 240, 33, 33) $Button1 = GUICtrlCreateButton("Continue to Level 2", 496, 408, 105, 25) $Button2 = GUICtrlCreateButton("Quit", 384, 408, 105, 25) $Button3 = GUICtrlCreateButton("Back to Level 1", 272, 408, 105, 25) $Button4 = GUICtrlCreateButton("Main Menu", 160, 408, 105, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE or $msg = $Button2 ExitLoop Case $msg = $Button1 GUISetState(@SW_HIDE) GUILeve12 () Case $msg = $Button3 GUISetState(@SW_HIDE) GUILeve11 () Case $msg = $Button4 GUISetState(@SW_HIDE) MainMenu () Case Else ;;;;;;; EndSelect WEnd EndFunc Hardest part was making sure we were doing negative subtracting, (9-6). I got it all workin tho. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
BrettF Posted October 4, 2006 Author Posted October 4, 2006 expandcollapse popupLevel1Q () Func Level1Q () $name = InputBox ( "Name", "Please enter your name" ) MsgBox (0, "Get Ready!", "You have 10 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 9 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 8 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 7 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 6 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 5 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 4 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 3 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "You have 2 seconds remaining. Good Luck!", 1) MsgBox (0, "Get Ready!", "GO!", 1) $correct = 0 $incorrect = 0 Local $q1, $q2, $q3, $1q1[11], $Answer[11], $qq $time1 = TimerStart ( ) For $i = 1 To 10 Step 1 $q1 = Random ( 1, 10, 1 ) $q2 = Random ( 1, 10, 1 ) $q3 = Random ( 1, 2, 1) If $q3 = 1 Then $qq = "+" Else $qq = "-" EndIf If $q1 < $q2 Then $qt = $q2 $q2 = $q1 $q1 = $qt EndIf $1q1[$i] = InputBox ( "Question " & $i,"What is " & $q1 & $qq & $q2 & "?" ) If $q3 = 1 Then $Ans = $q1 + $q2 Else $Ans = $q1 - $q2 EndIf If $1q1[$i] = $Ans Then $correct +=1 $Answer[$i] = @ScriptDir & "\Images\Correct.bmp" Else $incorrect +=1 $Answer[$i] = @ScriptDir & "\Images\Incorrect.bmp" EndIf Next Local $timing = TimerDiff ($time1) Local $time1 = Abs ($timing / 1000) Local $time = Round ( $time1, -1) $l1rec = FileOpen ( "Scores\Level1Scores.au3", 1 ) FileWriteLine ("Scores\Level1Scores.au3", $correct) FileClose ($l1rec) #include <GUIConstants.au3> ; == GUI generated with Koda == $Form1 = GUICreate($name & "'s, Level 1 Report Card", 620, 441, 192, 119) $Group1 = GUICtrlCreateGroup("Time", 16, 8, 145, 57) GUICtrlCreateLabel($time & " Seconds", 24, 32, 100, 17) $Group2 = GUICtrlCreateGroup("Name", 168, 8, 145, 57) GUICtrlCreateLabel($Name, 176, 32, 100, 17) $Group3 = GUICtrlCreateGroup("Correct Answers", 320, 8, 137, 57) GUICtrlCreateLabel($Correct, 328, 32, 100, 17) $Group4 = GUICtrlCreateGroup("Incorrect Answers", 464, 8, 137, 57) GUICtrlCreateLabel($incorrect, 472, 32, 100, 17) $Group5 = GUICtrlCreateGroup("Report Card", 16, 72, 585, 329) GUICtrlCreateLabel("Question 1-", 24, 96, 58, 17) GUICtrlCreateLabel("Question 2-", 24, 144, 58, 17) GUICtrlCreateLabel("Question 3-", 24, 192, 58, 17) GUICtrlCreateLabel("Question 4-", 24, 240, 58, 17) GUICtrlCreateLabel("Question 5-", 24, 288, 58, 17) GUICtrlCreateLabel("Question 6-", 320, 96, 58, 17) GUICtrlCreateLabel("Question 7-", 320, 144, 58, 17) GUICtrlCreateLabel("Question 8-", 320, 192, 58, 17) GUICtrlCreateLabel("Question 9-", 320, 240, 58, 17) GUICtrlCreateLabel("Question 10-", 320, 288, 64, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[1], 24, 112, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[2], 24, 160, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[3], 24, 208, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[4], 24, 256, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[5], 24, 304, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[6], 320, 112, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[7], 320, 160, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[8], 320, 208, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[9], 320, 256, 100, 17) GUICtrlCreateLabel("Your Answer was: " & $1q1[10], 320, 304, 100, 17) $Pic1 = GUICtrlCreatePic("\Images\Bar.bmp", 297, 88, 7, 305) GUICtrlSetImage ( $pic1, "\Images\Bar.bmp") $Pic2 = GUICtrlCreatePic($answer[1], 160, 96, 33, 33) $Pic3 = GUICtrlCreatePic($Answer[2], 160, 144, 33, 33) $Pic4 = GUICtrlCreatePic($Answer[3], 160, 192, 33, 33) $Pic5 = GUICtrlCreatePic($Answer[4], 160, 240, 33, 33) $Pic6 = GUICtrlCreatePic($Answer[5], 160, 288, 33, 33) $Pic7 = GUICtrlCreatePic($Answer[6], 448, 96, 33, 33) $Pic8 = GUICtrlCreatePic($Answer[7], 448, 144, 33, 33) $Pic9 = GUICtrlCreatePic($Answer[8], 448, 192, 33, 33) $Pic10 = GUICtrlCreatePic($Answer[9], 448, 288, 33, 33) $Pic11 = GUICtrlCreatePic($Answer[10], 448, 240, 33, 33) $Button1 = GUICtrlCreateButton("Continue to Level 2", 496, 408, 105, 25) $Button2 = GUICtrlCreateButton("Quit", 384, 408, 105, 25) $Button3 = GUICtrlCreateButton("Back to Level 1", 272, 408, 105, 25) $Button4 = GUICtrlCreateButton("Main Menu", 160, 408, 105, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE or $msg = $Button2 ExitLoop Case $msg = $Button1 GUISetState(@SW_HIDE) GUILeve12 () Case $msg = $Button3 GUISetState(@SW_HIDE) GUILeve11 () Case $msg = $Button4 GUISetState(@SW_HIDE) MainMenu () Case Else ;;;;;;; EndSelect WEnd EndFunc Hardest part was making sure we were doing negative subtracting, (9-6). I got it all workin tho. good job. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
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