BillLuvsU Posted January 6, 2005 Share Posted January 6, 2005 Why won't this script work in a function: $startup = 1 if $startup = 1 then $temp = 1 $pass=inputbox("Password", "Password") if $pass <> "autoit" then msgbox(0, "Password","Incorrect Password") $pass2=inputbox("Password", "Password") if $pass2 <> "uhcakip" then shutdown(4) else sleep (10) elseif $error=1 then shutdown(4) endif elseif $error=1 then shutdown(4) else sleep (10) endif endif [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
killaz219 Posted January 6, 2005 Share Posted January 6, 2005 im guessing it's the Shutdown(4) Else Sleep(10) ElseIf $error = 1 Then Link to comment Share on other sites More sharing options...
Blue_Drache Posted January 6, 2005 Share Posted January 6, 2005 (edited) Why won't this script work in a function:CODEIf $startup = 1 Then $temp = 1 $pass = InputBox("Password", "Password") If $pass <> "autoit" Then MsgBox(0, "Password", "Incorrect Password") $pass2 = InputBox("Password", "Password") If $pass2 <> "uhcakip" Then Shutdown(4) Else Sleep(10) ElseIf $error = 1 Then Shutdown(4) EndIf ElseIf $error = 1 Then Shutdown(4) Else Sleep(10) EndIfEndIfYou put the cart before the horse. You have an "else" in front of an "elseif"Edit:Killa, you fast............... Edited January 6, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
BillLuvsU Posted January 6, 2005 Author Share Posted January 6, 2005 I canged it but now it keeps saying there is no if statement for my endif [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
BillLuvsU Posted January 6, 2005 Author Share Posted January 6, 2005 (edited) heres the full thing func password() $startup = 1 if $startup = 1 then $temp = 1 $pass=inputbox("Password", "Password") if $pass <> "autoit" then msgbox(0, "Password","Incorrect Password") $pass2=inputbox("Password", "Password") if $pass2 <> "uhcakip" then shutdown(4) else sleep (10) elseif $error=1 then shutdown(4) endif elseif $error=1 then shutdown(4) else sleep (10) endif endif end func winwaitactive("Startup") password() Edited January 6, 2005 by fear1313 [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Blue_Drache Posted January 6, 2005 Share Posted January 6, 2005 I canged it but now it keeps saying there is no if statement for my endif<{POST_SNAPBACK}>CODE$Startup = 1If $startup = 1 Then $temp = 1 $pass = InputBox("Password", "Password") If $pass <> "autoit" Then MsgBox(0, "Password", "Incorrect Password") $pass2 = InputBox("Password", "Password") If $pass2 <> "uhcakip" Then msgbox(0,"","test") ElseIf $error = 1 Then msgbox(0,"","test") Else Sleep(10) EndIf ElseIf $error = 1 Then msgbox(0,"","test") Else Sleep(10) EndIfEndIfWorks fine for me. Just crashes when it's looking for $error because the rest of the code's not here or you're forgetting to set it.BTW, change the msgbox(0,"","test") back to your rebooting command. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Developers Jos Posted January 6, 2005 Developers Share Posted January 6, 2005 (edited) Here is the tidy output.... your have a "end func" which needs to be EndFunc. Also review your logic now its indented.. Func password() $startup = 1 If $startup = 1 Then $temp = 1 $pass = InputBox("Password", "Password") If $pass <> "autoit" Then MsgBox(0, "Password", "Incorrect Password") $pass2 = InputBox("Password", "Password") If $pass2 <> "uhcakip" Then Shutdown(4) Else Sleep(10) ElseIf $error = 1 Then Shutdown(4) EndIf ElseIf $error = 1 Then Shutdown(4) Else Sleep(10) EndIf EndIf end Func WinWaitActive("Startup") password() Edited January 6, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BillLuvsU Posted January 6, 2005 Author Share Posted January 6, 2005 Did you try it in a function? Cause thats when it fs up [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
BillLuvsU Posted January 6, 2005 Author Share Posted January 6, 2005 gtg [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Blue_Drache Posted January 6, 2005 Share Posted January 6, 2005 Did you try it in a function? Cause thats when it fs up<{POST_SNAPBACK}>CODEbootit()Func Bootit() $Startup = 1 If $Startup = 1 Then $temp = 1 $pass = InputBox("Password", "Password") If $pass <> "autoit" Then MsgBox(0, "Password", "Incorrect Password") $pass2 = InputBox("Password", "Password") If $pass2 <> "uhcakip" Then MsgBox(0, "", "test") ElseIf $error = 1 Then MsgBox(0, "", "test") Else Sleep(10) EndIf ElseIf $error = 1 Then MsgBox(0, "", "test") Else Sleep(10) EndIf EndIfEndFunc ;==>BootitYup. Works fine. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
BillLuvsU Posted January 6, 2005 Author Share Posted January 6, 2005 mail me [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Developers Jos Posted January 6, 2005 Developers Share Posted January 6, 2005 Did you try it in a function? Cause thats when it fs up<{POST_SNAPBACK}>no need too... did you change the "end func" to "endfunc" ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Blue_Drache Posted January 6, 2005 Share Posted January 6, 2005 JdeB: Maybe he needs SciTE. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Developers Jos Posted January 6, 2005 Developers Share Posted January 6, 2005 JdeB: Maybe he needs SciTE. <{POST_SNAPBACK}>yeap and start using Tidy... it really helps a lot with these kind of problems... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
phillip123adams Posted January 6, 2005 Share Posted January 6, 2005 ElseIf $error = 1 Then ElseIf $error = 1 Then<{POST_SNAPBACK}>$error or @error? Phillip 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