Jump to content

Pictures Dont Show


 Share

Recommended Posts

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:

Func 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

Link to comment
Share on other sites

Well you needed a @ScriptDir before your image path. This one worked fine with me ( you need pics for it to show up!:ph34r:)

Level1Q ()
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

:lmao:

Link to comment
Share on other sites

You know, you could make it Random answers pretty easy. Ill make a simple edit to it to try it out.

Link to comment
Share on other sites

Level1Q ()
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.

Link to comment
Share on other sites

Level1Q ()
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.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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