xealot Posted March 20, 2008 Share Posted March 20, 2008 This is a very rough copy of my login script is there an one who can help me put all this in to one GUI box? Or just give any advice on how to make this better? !!! #include <GUIConstants.au3> #include <GuiIPAddress.au3> #include <Date.au3> #Include <Constants.au3> #NoTrayIcon GUICreate("Login",250,100, 200,300) $progressbar1 = GUICtrlCreateProgress (10,10,200,20) GUICtrlSetColor(-1,32250) $button = GUICtrlCreateButton ("Execute",75,70,70,20) GUISetState () $wait = 10 $s = 0 do $msg = GUIGetMsg() If $msg = $button Then GUICtrlSetData ($button,"Stop") For $i = $s To 100 If GUICtrlRead($progressbar1) = 100 Then Msgbox(64,"Sucess!!","The Login was successful!!!...", 1) Sleep(150) $m = GUIGetMsg () If $m = -3 Then ExitLoop If $m = $button Then GUICtrlSetData ($button,"Continue") $s = $i ExitLoop Else $s=0 GUICtrlSetData ($progressbar1,$i) Sleep($wait) EndIf NextX if $i >100 then ; GUICtrlSetData ($button,"Finish") endif EndIf until $msg = $GUI_EVENT_CLOSE Opt("TrayMenuMode",1) $settingsitem = TrayCreateMenu("Settings") $displayitem = TrayCreateItem("Display", $settingsitem) $printeritem = TrayCreateItem("Printer", $settingsitem) TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $aboutitem Msgbox(64,"About CVM LOGIN:","This tells about the program") Case $msg = $exititem ExitLoop EndSelect WEnd Exit Opt("MustDeclareVars", 1) $Debug_IP = False Global $iMemo _Main() Func _Main() Local $hgui, $aIP[4] = [24, 168, 2, 128], $hIPAddress $hgui = GUICreate("IP Address Control Get (Array) Example", 400, 300) $hIPAddress = _GUICtrlIpAddress_Create ($hgui, 2, 4, 125, 20) $iMemo = GUICtrlCreateEdit("", 2, 28, 396, 270, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) _GUICtrlIpAddress_SetArray ($hIPAddress, $aIP) $aIP = _GUICtrlIpAddress_GetArray ($hIPAddress) MemoWrite("Field 1 .....: " & $aIP[0]) MemoWrite("Field 2 .....: " & $aIP[1]) MemoWrite("Field 3 .....: " & $aIP[2]) MemoWrite("Field 4 .....: " & $aIP[3]) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Local $hGUI, $tFile, $tLocal $hGUI = GUICreate("Time", 400, 300) $iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() $tFile = _Date_Time_EncodeFileTime(@MON, @MDAY, @YEAR, @HOUR, @MIN, @SEC) $tLocal = _Date_Time_FileTimeToLocalFileTime(DllStructGetPtr($tFile)) MemoWrite("Local file time .: " & _Date_Time_FileTimeToStr($tLocal)) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc Func MemoWrite($sMessage) GUICtrddlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 20, 2008 Share Posted March 20, 2008 Have you run these through SciTe?? There seems to be 4 errors which stop this from even running at all C:\Documents and Settings\Ärkeskäggot\Skrivbord\mklkl.au3(37,6) : ERROR: syntax error NextX ~~~~~^ C:\Documents and Settings\Ärkeskäggot\Skrivbord\mklkl.au3(42,1) : ERROR: missing Next. EndIf ^ C:\Documents and Settings\Ärkeskäggot\Skrivbord\mklkl.au3(20,13) : REF: missing Next. For $i = $s To ~~~~~~~~~~~~^ C:\Documents and Settings\Ärkeskäggot\Skrivbord\mklkl.au3(121,46) : ERROR: GUICtrddlSetData(): undefined function. GUICtrddlSetData($iMemo, $sMessage & @CRLF, 1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
xealot Posted March 20, 2008 Author Share Posted March 20, 2008 Yes i fixed thease errors and it works but it keeps looping and crashing can u help? #include <GUIConstants.au3> #include <GuiIPAddress.au3> #include <Date.au3> #Include <Constants.au3> #NoTrayIcon GUICreate("Login",250,100, 200,300) $progressbar1 = GUICtrlCreateProgress (10,10,200,20) GUICtrlSetColor(-1,32250) $button = GUICtrlCreateButton ("Execute",75,70,70,20) GUISetState () $wait = 10 $s = 0 do $msg = GUIGetMsg() If $msg = $button Then EndIf GUICtrlSetData ($button,"Stop") For $i = $s To 100 Next If GUICtrlRead($progressbar1) = 100 Then Msgbox(64,"Sucess!!","The Login was successful!!!...", 1) Sleep(150) $m = GUIGetMsg () If $m = -3 Then ExitLoop If $m = $button Then GUICtrlSetData ($button,"Continue") $s = $i ExitLoop Else $s=0 GUICtrlSetData ($progressbar1,$i) Sleep($wait) EndIf If $i >100 then ; GUICtrlSetData ($button,"Finish") EndIf until $msg = $GUI_EVENT_CLOSE Opt("TrayMenuMode",1) $settingsitem = TrayCreateMenu("Settings") $displayitem = TrayCreateItem("Display", $settingsitem) $printeritem = TrayCreateItem("Printer", $settingsitem) TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $aboutitem Msgbox(64,"About CVM LOGIN:","This tells about the program") Case $msg = $exititem ExitLoop EndSelect WEnd Exit Opt("MustDeclareVars", 1) $Debug_IP = False Global $iMemo _Main() Func _Main() Local $hgui, $aIP[4] = [24, 168, 2, 128], $hIPAddress $hgui = GUICreate("IP Address Control Get (Array) Example", 400, 300) $hIPAddress = _GUICtrlIpAddress_Create ($hgui, 2, 4, 125, 20) $iMemo = GUICtrlCreateEdit("", 2, 28, 396, 270, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) _GUICtrlIpAddress_SetArray ($hIPAddress, $aIP) $aIP = _GUICtrlIpAddress_GetArray ($hIPAddress) MemoWrite("Field 1 .....: " & $aIP[0]) MemoWrite("Field 2 .....: " & $aIP[1]) MemoWrite("Field 3 .....: " & $aIP[2]) MemoWrite("Field 4 .....: " & $aIP[3]) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Local $hGUI, $tFile, $tLocal $hGUI = GUICreate("Time", 400, 300) $iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() $tFile = _Date_Time_EncodeFileTime(@MON, @MDAY, @YEAR, @HOUR, @MIN, @SEC) $tLocal = _Date_Time_FileTimeToLocalFileTime(DllStructGetPtr($tFile)) MemoWrite("Local file time .: " & _Date_Time_FileTimeToStr($tLocal)) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc 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