Autoit Question

03/07/2008 21:46 hok30#1
Hey sorry this really doesn't have anything to do with CO but I know there are many good AutoIt programmers here and I am not one of them. I was making this application for fun and it keeps rejecting this part...
Code:
If  = "yay"
Then	
	Msgbox("Good Job, you unlocked Yay")
Else 
	MsgBox("WRONG! NO YAY")
EndIf
03/07/2008 21:59 Hiyoal#2
If ????What????? = "yay"???

You havent stated what instance should = to "yay"

A variable should be in this place, either "$variable" or an error set if @error=1

Hiyoal
03/07/2008 22:19 chatri#3
i dont get it what you just said, yay?
03/07/2008 22:37 hok30#4
Oops sorry I copied wrong -.-
Code:
   =inputbox("Type in the password to get to Yay")

If  = "yay"
Then	
	Msgbox("Good Job, you unlocked Yay")
Else 
	MsgBox("WRONG! NO YAY")
EndIf

EDIT OMG I TRIED 8 TIMES AND IT WONT WORK IN THE CODE TAGS -.-

Here it is...
$answer=inputbox("Type in the password to get to Yay")

If $answer = "yay"
Then
Msgbox("Good Job, you unlocked Yay")
Else
MsgBox("WRONG! NO YAY")
EndIf
03/07/2008 23:37 Hiyoal#5
Your messageboxes do not have the right parameters.

Try this:
Here it is...
$answer=inputbox("[TITLE GOES HERE]","Type in the password to get to Yay") ;LOOK AT THIS..WRONG PARAMETERS IN INPUTBOX

If $answer = "yay" Then ;MOVE THIS "THEN" STATEMENT IN LINE WITH ITS IF STATEMENT
Msgbox(0,"[TITLE GOES HERE]","Good Job, you unlocked Yay")
Else
MsgBox(0,"[TITLE GOES HERE]","WRONG! NO YAY")
EndIf

Also, look at the autoit help file and search: Msgbox. It will tell you all the different parameters to use.

The "0" after the first brackets specify to give an "OK" button only, you get me??

Look at my Autoit Guides. They can teach you the most basic things for autoit.

Hiyoal

P.S...Also put this in before your first if:

If @error=1 Then
Exit
EndIf

This makes it that you can close the input box when you press the X button.
03/08/2008 01:02 hok30#6
Great Stuff. Ty :-D