Jump to content

If answer 1 use picture 1


nf67
 Share

Recommended Posts

Hey there,

I am new to AutoIt and I wondered how I could solve this problem:

I want to create a kind of quiz, and according to the answers the program will put 4 pictures together ( Head, Chest, Legs and Feet , I already made them) wich will display a character that can be totally mixed. So if you fill in answer 3 at question one, that will use head 3.

I have this code so far:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\documents and settings\wtfpwnroflpancopter\mijn documenten\mijn afbeeldingen\autoit\charactercreategui.kxf
$Form2 = GUICreate("Form2", 633, 449, 193, 115)
$List1 = GUICtrlCreateList("", 88, 32, 73, 58)
GUICtrlSetData(-1, "a pie|money|nothing|spotshoes")
$Label1 = GUICtrlCreateLabel("It's your friend's birthday! You give him", 32, 16, 183, 17)
$List2 = GUICtrlCreateList("", 88, 128, 177, 71)
GUICtrlSetData(-1, "ask for help|distract the guards|kill to get it|talk the guards into giving it to you")
$Label2 = GUICtrlCreateLabel("If someone asked you to get a certain thing out of a guarded room, then you would", 32, 104, 393, 17)
$Label3 = GUICtrlCreateLabel("Your ideal vacation would be", 32, 216, 141, 17)
$List3 = GUICtrlCreateList("", 88, 240, 193, 58)
GUICtrlSetData(-1, "at the beach|in a peaceful forest|in Las Vegas|in the jungle")
$Label4 = GUICtrlCreateLabel("If you run out of money, you would make money by", 32, 320, 243, 17)
$List4 = GUICtrlCreateList("", 88, 336, 177, 71)
GUICtrlSetData(-1, "being an artist|I wouldn"&Chr(39)&"t run out of money|sailing|training soldiers")
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\Shoof.bmp", 336, 136, 217, 241, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label5 = GUICtrlCreateLabel("Model Me  by Nf67", 264, 40, 278, 38)
GUICtrlSetFont(-1, 24, 800, 0, "Pepita MT")
$MyButton1 = GUICtrlCreateButton("Show me who I am!", 328, 384, 228, 30, $BS_FLAT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

To make the questions use images, I use this idea:

Program writes answers in a .txt

Later, it searches these answers and uses them to define what picture should be used.

So can someone code thsi for me ( it is currently written in understandable language :) )?

In case "Show me who I am" is pressed:

    if question ( list ) 1 has answer 1 Then
    write 1 in somefile.txt
    
    if question ( list ) 1 has answer 2 Then
    write 2 in somefile.txt

    if question ( list ) 1 has answer 3 Then
    write 3 in somefile.txt

    if question ( list ) 1 has answer 4 Then
    write 4 in somefile.txt

Else
Msgbox ( 0, "Problem", "You didn't fill in anything!" )

If someone could do this for me then I can do the rest myself, thanks a bunch

it would be great. Thanks for reading!

-Nf67

Link to comment
Share on other sites

Maybe

#include <GUIConstants.au3>
#Include <GuiList.au3>
Local $aImages[4]=["image1.bmp","image2.bmp","image3.bmp","image4.bmp"]
#Region ### START Koda GUI section ### Form=c:\documents and settings\wtfpwnroflpancopter\mijn documenten\mijn afbeeldingen\autoit\charactercreategui.kxf
$Form2 = GUICreate("Form2", 633, 449, 193, 115)
$List1 = GUICtrlCreateList("", 88, 32, 73, 58)
GUICtrlSetData(-1, "a pie|money|nothing|spotshoes")
$Label1 = GUICtrlCreateLabel("It's your friend's birthday! You give him", 32, 16, 183, 17)
$List2 = GUICtrlCreateList("", 88, 128, 177, 71)
GUICtrlSetData(-1, "ask for help|distract the guards|kill to get it|talk the guards into giving it to you")
$Label2 = GUICtrlCreateLabel("If someone asked you to get a certain thing out of a guarded room, then you would", 32, 104, 393, 17)
$Label3 = GUICtrlCreateLabel("Your ideal vacation would be", 32, 216, 141, 17)
$List3 = GUICtrlCreateList("", 88, 240, 193, 58)
GUICtrlSetData(-1, "at the beach|in a peaceful forest|in Las Vegas|in the jungle")
$Label4 = GUICtrlCreateLabel("If you run out of money, you would make money by", 32, 320, 243, 17)
$List4 = GUICtrlCreateList("", 88, 336, 177, 71)
GUICtrlSetData(-1, "being an artist|I wouldn"&Chr(39)&"t run out of money|sailing|training soldiers")
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\Shoof.bmp", 336, 136, 217, 241, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label5 = GUICtrlCreateLabel("Model Me  by Nf67", 264, 40, 278, 38)
GUICtrlSetFont(-1, 24, 800, 0, "Pepita MT")
$MyButton1 = GUICtrlCreateButton("Show me who I am!", 328, 384, 228, 30, $BS_FLAT)
$pict1 = GUICtrlCreatePic("",336,125,200,60)
$pict2 = GUICtrlCreatePic("",336,187,200,60)
$pict3 = GUICtrlCreatePic("",336,249,200,60)
$pict4 = GUICtrlCreatePic("",336,311,200,60)

;~ $pict1 = GUICtrlCreateLabel("",336,125,200,60)
;~ $pict2 = GUICtrlCreateLabel("",336,187,200,60)
;~ $pict3 = GUICtrlCreateLabel("",336,249,200,60)
;~ $pict4 = GUICtrlCreateLabel("",336,311,200,60)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MyButton1
            GUICtrlSetImage($pict1,$aImages[_GUICtrlListGetCaretIndex($List1)])
            GUICtrlSetImage($pict2,$aImages[_GUICtrlListGetCaretIndex($List2)])
            GUICtrlSetImage($pict3,$aImages[_GUICtrlListGetCaretIndex($List3)])
            GUICtrlSetImage($pict4,$aImages[_GUICtrlListGetCaretIndex($List4)])
            
;~             GUICtrlSetData($pict1,$aImages[_GUICtrlListGetCaretIndex($List1)])
;~             GUICtrlSetData($pict2,$aImages[_GUICtrlListGetCaretIndex($List2)])
;~             GUICtrlSetData($pict3,$aImages[_GUICtrlListGetCaretIndex($List3)])
;~             GUICtrlSetData($pict4,$aImages[_GUICtrlListGetCaretIndex($List4)])
    EndSwitch
WEnd
Link to comment
Share on other sites

Thanks, I changed my plan.

I didn't understand some things in your script but I got an idea. So I changed mine:

#include <GUIConstants.au3>
#Include <GuiList.au3>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#Region ### START Koda GUI section ### Form=c:\documents and settings\wtfpwnroflpancopter\mijn documenten\mijn afbeeldingen\autoit\charactercreategui.kxf
$Form2 = GUICreate("Form2", 633, 449, 193, 115)
$List1 = GUICtrlCreateList("", 88, 32, 73, 58)
GUICtrlSetData(-1, "a pie|money|nothing|spotshoes")
$Label1 = GUICtrlCreateLabel("It's your friend's birthday! You give him", 32, 16, 183, 17)
$List2 = GUICtrlCreateList("", 88, 128, 177, 71)
GUICtrlSetData(-1, "ask for help|distract the guards|kill to get it|talk the guards into giving it to you")
$Label2 = GUICtrlCreateLabel("If someone asked you to get a certain thing out of a guarded room, then you would", 32, 104, 393, 17)
$Label3 = GUICtrlCreateLabel("Your ideal vacation would be", 32, 216, 141, 17)
$List3 = GUICtrlCreateList("", 88, 240, 193, 58)
GUICtrlSetData(-1, "at the beach|in a peaceful forest|in Las Vegas|in the jungle")
$Label4 = GUICtrlCreateLabel("If you run out of money, you would make money by", 32, 320, 243, 17)
$List4 = GUICtrlCreateList("", 88, 336, 177, 71)
GUICtrlSetData(-1, "being an artist|I wouldn"&Chr(39)&"t run out of money|sailing|training soldiers")
$Label5 = GUICtrlCreateLabel("Model Me  by Nf67", 264, 40, 278, 38)
GUICtrlSetFont(-1, 24, 800, 0, "Pepita MT")
$MyButton1 = GUICtrlCreateButton("Show me who I am!", 328, 384, 228, 30, $BS_FLAT)
$pict1 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,125,200,60)
$pict2 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,187,200,60)
$pict3 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,249,200,60)
$pict4 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,311,200,60)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select $nMsg                ; Error: Endselect statement without matching Select statement??
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MyButton1
            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            if $List2 = ( "talk the guards into giving it to you" ) Then  ;  <--- These are the commands that need to be changed, I don't know how
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadDetective.jpg")
            
            if $List2 = ( "kill to get it" ) Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadNinja.jpg")
            
            if $List2 = ( "distract the guards" ) Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadPig.jpg")
            
            if $List2 = ( "ask for help" ) Then 
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadSoldier.jpg")
            
            Endif
            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            if $List3 = ( "at the beach" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegSwim.jpg") 
            
            if $List3 = ( "in the jungle" )Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegShredded.jpg") 
            
            if $List3 = ( "in Las Vegas" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegSkater.jpg") 
            
            if $List3 = ( "in a peaceful forest" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegNaked.jpg")
            
            EndIf
           
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
            if $List4 = ( "being an artist" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeClown.jpg")
            
            if $List4 = ( "sailing" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoePirate.jpg")
            
            if $List4 = ( "training soldiers" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeArmy.jpg")
            
            if $List4 = ( "I wouldn"&Chr(39)&"t run out of money" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeBrown.jpg")
            
            EndIf
            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
            if $List1 = ( "a pie" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestFat.jpg")
            
            if $List1 = ( "nothing" ) Then    ; Nothing is an answer, wasn't supposed to be like 'no data'
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestHero.jpg")
            
            if $List1 = ( "money" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestWork.jpg")
            
            if $List1 = ( "sportshoes" ) Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestStrong.jpg")
            
            EndIf
           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         
            
        
        
     
        
    Endselect   ; Error: Endselect statement without matching Select statement??
    
WEnd

Still some problems as described in the script with ; comments and arrows

Link to comment
Share on other sites

You'll want to check for the answer like this:

If GuiCtrlRead($List2) = "talk the guards into giving it to you"  Then ;

Does this help?

Edited by eltorro
Link to comment
Share on other sites

#include <GUIConstants.au3>
#Include <GuiList.au3>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#Region ### START Koda GUI section ### Form=c:\documents and settings\wtfpwnroflpancopter\mijn documenten\mijn afbeeldingen\autoit\charactercreategui.kxf
$Form2 = GUICreate("Form2", 633, 449, 193, 115)
$List1 = GUICtrlCreateList("", 88, 32, 73, 58)
GUICtrlSetData(-1, "a pie|money|nothing|spotshoes")
$Label1 = GUICtrlCreateLabel("It's your friend's birthday! You give him", 32, 16, 183, 17)
$List2 = GUICtrlCreateList("", 88, 128, 177, 71)
GUICtrlSetData(-1, "ask for help|distract the guards|kill to get it|talk the guards into giving it to you")
$Label2 = GUICtrlCreateLabel("If someone asked you to get a certain thing out of a guarded room, then you would", 32, 104, 393, 17)
$Label3 = GUICtrlCreateLabel("Your ideal vacation would be", 32, 216, 141, 17)
$List3 = GUICtrlCreateList("", 88, 240, 193, 58)
GUICtrlSetData(-1, "at the beach|in a peaceful forest|in Las Vegas|in the jungle")
$Label4 = GUICtrlCreateLabel("If you run out of money, you would make money by", 32, 320, 243, 17)
$List4 = GUICtrlCreateList("", 88, 336, 177, 71)
GUICtrlSetData(-1, "being an artist|I wouldn"&Chr(39)&"t run out of money|sailing|training soldiers")
$Label5 = GUICtrlCreateLabel("Model Me  by Nf67", 264, 40, 278, 38)
GUICtrlSetFont(-1, 24, 800, 0, "Pepita MT")
$MyButton1 = GUICtrlCreateButton("Show me who I am!", 328, 384, 228, 30, $BS_FLAT)
$pict1 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,125,200,60)
$pict2 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,187,200,60)
$pict3 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,249,200,60)
$pict4 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,311,200,60)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select $nMsg        ; Error: Endselect statement without matching Select statement??
    select 
        Case $GUI_EVENT_CLOSE
            Exit
        Case $MyButton1
            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            If GuiCtrlRead($List2) = "talk the guards into giving it to you" Then  ;  <--- Thank you Eltorro
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadDetective.jpg")
            
            If GuiCtrlRead($List2) = "kill to get it" Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadNinja.jpg")
            
            If GuiCtrlRead($List2) = "distract the guards" Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadPig.jpg")
            
            If GuiCtrlRead($List2) = "ask for help" Then 
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadSoldier.jpg")
            
            Endif
            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            If GuiCtrlRead($List3) = "at the beach" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegSwim.jpg") 
            
            If GuiCtrlRead($List3) = "in the jungle" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegShredded.jpg") 
            
            If GuiCtrlRead($List3) = "in Las Vegas" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegSkater.jpg") 
            
            If GuiCtrlRead($List3) = "in a peaceful forest" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegNaked.jpg")
            
            EndIf
           
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
            If GuiCtrlRead($List4) = "being an artist" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeClown.jpg")
            
            If GuiCtrlRead($List4) = "sailing" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoePirate.jpg")
            
            If GuiCtrlRead($List4) = "training soldiers" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeArmy.jpg")
            
            If GuiCtrlRead($List4) = "I wouldn"&Chr(39)&"t run out of money" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeBrown.jpg")
            
            EndIf
            
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            
            If GuiCtrlRead($List2) = "a pie" Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestFat.jpg")
            
            If GuiCtrlRead($List2) = "nothing" Then    
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestHero.jpg")
            
            If GuiCtrlRead($List2) = "money" Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestWork.jpg")
            
            If GuiCtrlRead($List2) = "sportshoes" Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestStrong.jpg")
            
            EndIf
           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         
            
        
        
     
        
    Endselect   ; Error: Endselect statement without matching Select statement??
    
WEnd

Error: No matching select statement for the endselect command or something lik ethat? How can I fix this?

Thanks for your help El torro

Link to comment
Share on other sites

#include <GUIConstants.au3>
#Include <GuiList.au3>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#Region ### START Koda GUI section ### Form=c:\documents and settings\wtfpwnroflpancopter\mijn documenten\mijn afbeeldingen\autoit\charactercreategui.kxf
$Form2 = GUICreate("Form2", 633, 449, 193, 115)
$List1 = GUICtrlCreateList("", 88, 32, 73, 58)
GUICtrlSetData(-1, "a pie|money|nothing|spotshoes")
$Label1 = GUICtrlCreateLabel("It's your friend's birthday! You give him", 32, 16, 183, 17)
$List2 = GUICtrlCreateList("", 88, 128, 177, 71)
GUICtrlSetData(-1, "ask for help|distract the guards|kill to get it|talk the guards into giving it to you")
$Label2 = GUICtrlCreateLabel("If someone asked you to get a certain thing out of a guarded room, then you would", 32, 104, 393, 17)
$Label3 = GUICtrlCreateLabel("Your ideal vacation would be", 32, 216, 141, 17)
$List3 = GUICtrlCreateList("", 88, 240, 193, 58)
GUICtrlSetData(-1, "at the beach|in a peaceful forest|in Las Vegas|in the jungle")
$Label4 = GUICtrlCreateLabel("If you run out of money, you would make money by", 32, 320, 243, 17)
$List4 = GUICtrlCreateList("", 88, 336, 177, 71)
GUICtrlSetData(-1, "being an artist|I wouldn"&Chr(39)&"t run out of money|sailing|training soldiers")
$Label5 = GUICtrlCreateLabel("Model Me  by Nf67", 264, 40, 278, 38)
GUICtrlSetFont(-1, 24, 800, 0, "Pepita MT")
$MyButton1 = GUICtrlCreateButton("Show me who I am!", 328, 384, 228, 30, $BS_FLAT)
$pict1 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,125,200,60)
$pict2 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,187,200,60)
$pict3 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,249,200,60)
$pict4 = GUICtrlCreatePic("C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\Clean.jpg",336,311,200,60)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select       
         Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $MyButton1
            SetPicts()
        Case Else
            ;;           
    EndSelect 
   
WEnd

Func SetPicts()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            If GuiCtrlRead($List2) = "talk the guards into giving it to you" Then  ;  <--- Thank you Eltorro
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadDetective.jpg")
            Endif
            If GuiCtrlRead($List2) = "kill to get it" Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadNinja.jpg")
             Endif
          
            If GuiCtrlRead($List2) = "distract the guards" Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadPig.jpg")
             Endif
          
            If GuiCtrlRead($List2) = "ask for help" Then
            GUICtrlSetImage($pict1, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\1HeadSoldier.jpg")
           
            Endif
           
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            If GuiCtrlRead($List3) = "at the beach" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegSwim.jpg")
            Endif
           
            If GuiCtrlRead($List3) = "in the jungle" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegShredded.jpg")
             Endif
          
            If GuiCtrlRead($List3) = "in Las Vegas" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegSkater.jpg")
             Endif
          
            If GuiCtrlRead($List3) = "in a peaceful forest" Then
            GUICtrlSetImage($pict3, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\3LegNaked.jpg")
           
            EndIf
           
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
           
            If GuiCtrlRead($List4) = "being an artist" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeClown.jpg")
              Endif
         
            If GuiCtrlRead($List4) = "sailing" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoePirate.jpg")
             Endif
          
            If GuiCtrlRead($List4) = "training soldiers" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeArmy.jpg")
             Endif
          
            If GuiCtrlRead($List4) = "I wouldn"&Chr(39)&"t run out of money" Then
            GUICtrlSetImage($pict4, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\4ShoeBrown.jpg")
           
            EndIf
           
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
           
            If GuiCtrlRead($List2) = "a pie" Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestFat.jpg")
              Endif
         
            If GuiCtrlRead($List2) = "nothing" Then   
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestHero.jpg")
              Endif
         
            If GuiCtrlRead($List2) = "money" Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestWork.jpg")
              Endif
         
            If GuiCtrlRead($List2) = "sportshoes" Then
            GUICtrlSetImage($pict2, "C:\Documents and Settings\wtfpwnroflpancopter\Mijn documenten\Mijn afbeeldingen\AutoIt\2ChestStrong.jpg")
           
            EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

EndFunc
Edit: fixed some missing "End If " 's Edited by eltorro
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...