Gif Posted April 27, 2007 Posted April 27, 2007 (edited) Case $msg = $btn_shutdownIf StringIsAlpha($in_serekalointa) ThenMsgBox(16, "Numbers Only!", "Please enter numbers only.") ElseIf $in_serekalointa<0 Then MsgBox(0, "Error", "Error in the time, try again") ElseIf $in_serekalointa>0 And $in_serekalointa<100000000 And Not StringIsAlpha($in_serekalointa) ThenSleep($in_serekalointa * 1000)Shutdown(1)EndIfCant Find THe Mistake Please Help Me Edited April 27, 2007 by c4nm7
Developers Jos Posted April 27, 2007 Developers Posted April 27, 2007 would help if you say what the problem is ..... 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.
Gif Posted April 27, 2007 Author Posted April 27, 2007 would help if you say what the problem is ..... ... Does not works, i insert letters in the input box and it still accepts them , while it does not functions properly, it is suppost to shutdown the pc in the time specified but it does not...
Valuater Posted April 27, 2007 Posted April 27, 2007 maybe.. you should/need to read the info Case $msg = $btn_shutdown $in_serekalointa = "2" ;GUICtrlRead($THE_INPUT_INFO) If StringIsAlpha($in_serekalointa) Then MsgBox(16, "Numbers Only!", "Please enter numbers only.") ElseIf $in_serekalointa < 0 Then MsgBox(0, "Error", "Error in the time, try again") ElseIf $in_serekalointa > 0 And $in_serekalointa < 100000000 And Not StringIsAlpha($in_serekalointa) Then Sleep($in_serekalointa * 1000) MsgBox(0,0,"shutdown", 1) ;Shutdown(1) EndIf 8)
PsaltyDS Posted April 27, 2007 Posted April 27, 2007 (edited) I notice you are mixing string and numeric comparisons. Be sure you understand the difference between 0 and "0". Maybe: Case $msg = $btn_shutdown If Not StringIsInt($in_serekalointa) Then MsgBox(16, "Whole numbers Only!", "Please enter whole numbers only.") Else $in_serekalointa = Number($in_serekalointa) If $in_serekalointa < 0 Then MsgBox(0, "Error", "Error in the time, try again") ElseIf $in_serekalointa > 0 And $in_serekalointa < 100000000 And Not StringIsAlpha($in_serekalointa) Then Sleep($in_serekalointa * 1000) Shutdown(1) EndIf EndIf Edited April 27, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Xand3r Posted April 27, 2007 Posted April 27, 2007 $input="lol" $text = "Time in seconds to shutdown your pc" while 1 $input=InputBox("Shutdown time" , $text) $input=Dec(Hex($input)) If @error=1 Then Exit EndIf Sleep(10) If IsNumber($input)=1 And $input<>0 Then Sleep($input) Shutdown(9) Exit EndIf $text="Time in seconds to shutdown your pc"&@CRLF&@CRLF&@CRLF&" The input was incorrect!" WEnd this works Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
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