mofomikeman Posted October 22, 2006 Share Posted October 22, 2006 #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 131,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $i = GuiCtrlCreateInput("", 160, 60, 40, 20) $Submit = GuiCtrlCreateButton("Lets Go!", 150, 100, 70, 20) $Info = GuiCtrlCreateLabel("How many times do you want your cd drive to work out?", 70, 10, 270, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Do CDTray("E:", "open"); CDTray("E:", "close"); $i = $i - 1 Until $i = 0 I have just began coding in this language, and am trying to create a small, funny, cd work-out program. I have gotten this far, but I do not understand how I would get the GUI to work like it should, or at all for that matter, and I would also like to make the GUI not let the numeber be set below 1 (so people do not make someones computer cd drive go in and out indeffinetly without having to do some kind of work). Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 22, 2006 Share Posted October 22, 2006 due to this being your first script i do not like the maliciousness of it :-/ but here take a look at this but promise you will not make viruses or malicious code in autoit #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 131,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $times = GuiCtrlCreateInput("", 160, 60, 40, 20) $Submit = GuiCtrlCreateButton("Lets Go!", 150, 100, 70, 20) $Info = GUICtrlCreateLabel("How many times do you want your cd drive to work out?", 70, 10, 270, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Submit If Not StringIsDigit(GUICtrlRead($times)) Then MsgBox(0,"Error","Not A Number") Else $drive = DriveGetDrive("CDROM") If IsArray($drive) Then For $i = 1 to GUICtrlRead($times) $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE THen Exit CDTray($drive[1],"open") CDTray($drive[1],"close") Next MsgBox(0,"Done","CDROM Workout Complete") Else MsgBox(0,"Error","Error No CDROM Drives") EndIf EndIf Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Link to comment Share on other sites More sharing options...
mofomikeman Posted October 28, 2006 Author Share Posted October 28, 2006 (edited) Thanks man! And I wasn't even considering the use of Autoit for malicious purposes. How would I set a limit so it cant be done over a certain amount of times? Edited October 28, 2006 by mofomikeman Link to comment Share on other sites More sharing options...
PaulIA Posted October 28, 2006 Share Posted October 28, 2006 Replace: For $i = 1 to GUICtrlRead($times)oÝ÷ Û«¢+ØÀÌØíàôU% ÑɱI ÀÌØíÑ¥µÌ¤)¥ÀÌØíàÐìÄÀÑ¡¸ÀÌØíàôÄÀ)½ÈÀÌØí¤ôÄѼÀÌØíà Auto3Lib: A library of over 1200 functions for AutoIt 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