PlayHD Posted August 23, 2011 Posted August 23, 2011 Hi all.. i have a problem, i am a beginer in AutoITI want to do a program that you turn off your computer after a time that you put.But i recive this error>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\ANDREI\Desktop\test.au3" C:\Users\{USER}\Desktop\test.au3 (88) : ==> "Case" statement with no matching "Select"or "Switch" statement.: Case $Button2 >Exit code: 1 Time: 0.446Program is here:expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $Form1 = GUICreate("Inchizator v2.0", 315, 164, 197, 126) Global $Label1 = GUICtrlCreateLabel("INCHIZATOR", 24, 0, 271, 68) GUICtrlSetFont(-1, 48, 800, 0, "Sagoe Script") GUICtrlSetColor(-1, 0xC8C8C8) Global $Label2 = GUICtrlCreateLabel("Time:", 8, 80, 30, 17) Global $Input1 = GUICtrlCreateInput("0", 38, 78, 49, 21) Global $Input2 = GUICtrlCreateInput("1", 114, 78, 49, 21) Global $Label3 = GUICtrlCreateLabel("h", 92, 80, 19, 17) Global $Label4 = GUICtrlCreateLabel("min", 168, 80, 35, 17) Global $Button1 = GUICtrlCreateButton("OK", 8, 104, 129, 57) Global $Radio1 = GUICtrlCreateRadio("Shutdown", 240, 104, 65, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $Radio2 = GUICtrlCreateRadio("Restart", 240, 120, 65, 17) Global $Radio3 = GUICtrlCreateRadio("LogOff", 240, 136, 57, 17) Global $Button2 = GUICtrlCreateButton("Info", 144, 104, 81, 57) Global $Checkbox1 = GUICtrlCreateCheckbox("Alert on 2 min remain", 208, 80, 105, 17) Global $timp_h Global $timp_m Global $timp_s Global $tipm_ms Global $status = 1 Global $anunt = 0 Global $a = 1 Global $test GUISetState(@SW_SHOW) While $a = 1 $timp_h = GUICtrlRead($input1) $timp_m = GUICtrlRead($input1) $timp_s = ($timp_m*60)+($timp*60*60) $timp_ms = $timp_s * 1000 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Ratio1 $status = 1 Case $Ratio2 2 $status = 2 Case $Ratio3 $status = 3 Case $Checkbox1 $anunt = 1 Case $Button1 If $timp_s=0 Then $yorn = MsgBox(36,"WTF!?! 0 Min:-?","You want to shutdown your computer now?") If $yorn = 6 Then MsgBox(64,"END OF THE WORLD","Computer will shutdown now",5) $a = 2 Else $a = 1 EndIf ElseIf $timp_s > 43200 Then MsgBox(16,"Too much man.... Too much","Max time is 12 h") Else If $timp_m = 0 Then If $timp_h = 1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour.",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" h.",15) EndIf ElseIf $timp_h = 0 Then If $timp_m = 1 Then MsgBox(64,"END OF THE WORLDComputer will be close in one minute.",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_m &" minutes.",15) EndIf Else If $timp_h=1 And $timp_m=1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour and one minute",15) ElseIf $timp_h=1 And $timp_m>1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour and "&$timp_m&" minutes.",15) ElseIf $timp_m=1 And $timp_h>1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" hours and one minute",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" hours and "&$timp_m&" minutes.",15) EndIf $a = 2 EndIf $test=1 Case $Button2 MsgBox(64,"Inchizator by PLAYHD","1. Seteaza numarul de ore si minute"&@lf&"2. Selecteaza Optiunea dorita de OPRIRE, RESTART sau LOGOFF"&@lf&"3. Apasa pe OK"&@lf&"(t)Max 12 ore") EndSwitch WEnd If $a = 2 Then If $anunt = 1 Then GUIDelete() $timp_ms - = 12000 Sleep($timp_ms) MsgBox(48,"Atention Please!","In two minutes computer will be close, please exit all aplication",10) Sleep(12000) MsgBox(0,"We are all die >:)","Booooooooooom",5) If $status=1 Shutdown(5) ElseIf $status=2 Shutdown(6) ElseIf $status=3 Shutdown(4) Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Exit ElseIf $anunt = 0 Then GUIDelete() Sleep($timp_ms) MsgBox(0,"We are all die >:)","Booooooooooom",5) If $status=1 Shutdown(5) ElseIf $status=2 Shutdown(6) ElseIf $status=3 Shutdown(4) Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Exit Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIfYou can help me?I made ​​one, which I did, but I said I do "v2.0"v1.0 > http://pastebin.com/H70AFZMEP.S. Sorry for my english My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit
rcmaehl Posted August 23, 2011 Posted August 23, 2011 (edited) expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $Form1 = GUICreate("Inchizator v2.0", 315, 164, 197, 126) Global $Label1 = GUICtrlCreateLabel("INCHIZATOR", 24, 0, 271, 68) GUICtrlSetFont(-1, 48, 800, 0, "Sagoe Script") GUICtrlSetColor(-1, 0xC8C8C8) Global $Label2 = GUICtrlCreateLabel("Time:", 8, 80, 30, 17) Global $Input1 = GUICtrlCreateInput("0", 38, 78, 49, 21) Global $Input2 = GUICtrlCreateInput("1", 114, 78, 49, 21) Global $Label3 = GUICtrlCreateLabel("h", 92, 80, 19, 17) Global $Label4 = GUICtrlCreateLabel("min", 168, 80, 35, 17) Global $Button1 = GUICtrlCreateButton("OK", 8, 104, 129, 57) Global $Radio1 = GUICtrlCreateRadio("Shutdown", 240, 104, 65, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $Radio2 = GUICtrlCreateRadio("Restart", 240, 120, 65, 17) Global $Radio3 = GUICtrlCreateRadio("LogOff", 240, 136, 57, 17) Global $Button2 = GUICtrlCreateButton("Info", 144, 104, 81, 57) Global $Checkbox1 = GUICtrlCreateCheckbox("Alert on 2 min remain", 208, 80, 105, 17) Global $timp_h Global $timp_m Global $timp_s Global $tipm_ms Global $status = 1 Global $anunt = 0 Global $a = 1 Global $test Global $timp, $Ratio1, $Ratio2, $Ratio3 GUISetState(@SW_SHOW) While $a = 1 $timp_h = GUICtrlRead($input1) $timp_m = GUICtrlRead($input1) $timp_s = ($timp_m*60)+($timp*60*60) $timp_ms = $timp_s * 1000 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Ratio1 $status = 1 Case $Ratio2 $status = 2 Case $Ratio3 $status = 3 Case $Checkbox1 $anunt = 1 Case $Button1 If $timp_s=0 Then $yorn = MsgBox(36,"WTF!?! 0 Min:-?","You want to shutdown your computer now?") If $yorn = 6 Then MsgBox(64,"END OF THE WORLD","Computer will shutdown now",5) $a = 2 Else $a = 1 EndIf ElseIf $timp_s > 43200 Then MsgBox(16,"Too much man.... Too much","Max time is 12 h") Else If $timp_m = 0 Then If $timp_h = 1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour.",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" h.",15) EndIf ElseIf $timp_h = 0 Then If $timp_m = 1 Then MsgBox(64,"END OF THE WORLDComputer will be close in one minute.",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_m &" minutes.",15) EndIf Else If $timp_h=1 And $timp_m=1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour and one minute",15) ElseIf $timp_h=1 And $timp_m>1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour and "&$timp_m&" minutes.",15) ElseIf $timp_m=1 And $timp_h>1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" hours and one minute",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" hours and "&$timp_m&" minutes.",15) EndIf $a = 2 EndIf EndIf $test=1 Case $Button2 MsgBox(64,"Inchizator by PLAYHD","1. Seteaza numarul de ore si minute"&@lf&"2. Selecteaza Optiunea dorita de OPRIRE, RESTART sau LOGOFF"&@lf&"3. Apasa pe OK"&@lf&"(t)Max 12 ore") EndSwitch WEnd If $a = 2 Then If $anunt = 1 Then GUIDelete() $timp_ms -= 12000 Sleep($timp_ms) MsgBox(48,"Atention Please!","In two minutes computer will be close, please exit all aplication",10) Sleep(12000) MsgBox(0,"We are all die >:)","Booooooooooom",5) If $status=1 Then Shutdown(5) ElseIf $status=2 Then Shutdown(6) ElseIf $status=3 Then Shutdown(4) Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Exit ElseIf $anunt = 0 Then GUIDelete() Sleep($timp_ms) MsgBox(0,"We are all die >:)","Booooooooooom",5) If $status=1 Then Shutdown(5) ElseIf $status=2 Then Shutdown(6) ElseIf $status=3 Then Shutdown(4) Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Exit Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Fixed Missing EndIf Edit: Fixed Missing Thens Edit Edit: Missed Undeclared Vars Comment: Script Needs A Lot of work; Will Post Improvement Suggestions later today. Edited August 23, 2011 by rcmaehl My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Â
PlayHD Posted August 23, 2011 Author Posted August 23, 2011 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $Form1 = GUICreate("Inchizator v2.0", 315, 164, 197, 126) Global $Label1 = GUICtrlCreateLabel("INCHIZATOR", 24, 0, 271, 68) GUICtrlSetFont(-1, 48, 800, 0, "Sagoe Script") GUICtrlSetColor(-1, 0xC8C8C8) Global $Label2 = GUICtrlCreateLabel("Time:", 8, 80, 30, 17) Global $Input1 = GUICtrlCreateInput("0", 38, 78, 49, 21) Global $Input2 = GUICtrlCreateInput("1", 114, 78, 49, 21) Global $Label3 = GUICtrlCreateLabel("h", 92, 80, 19, 17) Global $Label4 = GUICtrlCreateLabel("min", 168, 80, 35, 17) Global $Button1 = GUICtrlCreateButton("OK", 8, 104, 129, 57) Global $Radio1 = GUICtrlCreateRadio("Shutdown", 240, 104, 65, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $Radio2 = GUICtrlCreateRadio("Restart", 240, 120, 65, 17) Global $Radio3 = GUICtrlCreateRadio("LogOff", 240, 136, 57, 17) Global $Button2 = GUICtrlCreateButton("Info", 144, 104, 81, 57) Global $Checkbox1 = GUICtrlCreateCheckbox("Alert on 2 min remain", 208, 80, 105, 17) Global $timp_h Global $timp_m Global $timp_s Global $tipm_ms Global $status = 1 Global $anunt = 0 Global $a = 1 Global $test Global $timp, $Ratio1, $Ratio2, $Ratio3 GUISetState(@SW_SHOW) While $a = 1 $timp_h = GUICtrlRead($input1) $timp_m = GUICtrlRead($input1) $timp_s = ($timp_m*60)+($timp*60*60) $timp_ms = $timp_s * 1000 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Ratio1 $status = 1 Case $Ratio2 $status = 2 Case $Ratio3 $status = 3 Case $Checkbox1 $anunt = 1 Case $Button1 If $timp_s=0 Then $yorn = MsgBox(36,"WTF!?! 0 Min:-?","You want to shutdown your computer now?") If $yorn = 6 Then MsgBox(64,"END OF THE WORLD","Computer will shutdown now",5) $a = 2 Else $a = 1 EndIf ElseIf $timp_s > 43200 Then MsgBox(16,"Too much man.... Too much","Max time is 12 h") Else If $timp_m = 0 Then If $timp_h = 1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour.",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" h.",15) EndIf ElseIf $timp_h = 0 Then If $timp_m = 1 Then MsgBox(64,"END OF THE WORLDComputer will be close in one minute.",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_m &" minutes.",15) EndIf Else If $timp_h=1 And $timp_m=1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour and one minute",15) ElseIf $timp_h=1 And $timp_m>1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in one hour and "&$timp_m&" minutes.",15) ElseIf $timp_m=1 And $timp_h>1 Then MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" hours and one minute",15) Else MsgBox(64,"END OF THE WORLD","Computer will be close in "& $timp_h &" hours and "&$timp_m&" minutes.",15) EndIf $a = 2 EndIf EndIf $test=1 Case $Button2 MsgBox(64,"Inchizator by PLAYHD","1. Seteaza numarul de ore si minute"&@lf&"2. Selecteaza Optiunea dorita de OPRIRE, RESTART sau LOGOFF"&@lf&"3. Apasa pe OK"&@lf&"(t)Max 12 ore") EndSwitch WEnd If $a = 2 Then If $anunt = 1 Then GUIDelete() $timp_ms -= 12000 Sleep($timp_ms) MsgBox(48,"Atention Please!","In two minutes computer will be close, please exit all aplication",10) Sleep(12000) MsgBox(0,"We are all die >:)","Booooooooooom",5) If $status=1 Then Shutdown(5) ElseIf $status=2 Then Shutdown(6) ElseIf $status=3 Then Shutdown(4) Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Exit ElseIf $anunt = 0 Then GUIDelete() Sleep($timp_ms) MsgBox(0,"We are all die >:)","Booooooooooom",5) If $status=1 Then Shutdown(5) ElseIf $status=2 Then Shutdown(6) ElseIf $status=3 Then Shutdown(4) Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Exit Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Else MsgBox(0,"Must be something wrong","Programul a intampinat o eroare,"&@lf&"Va rog sa reporniti programul!") Exit EndIf Fixed Missing EndIf Edit: Fixed Missing Thens Edit Edit: Missed Undeclared Vars Comment: Script Needs A Lot of work; Will Post Improvement Suggestions later today. ok Thank you verry much My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit
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