Infinitex0 Posted April 19, 2006 Share Posted April 19, 2006 (edited) I'm working on a script that will let you do a lot of stuff(don't feel like going into details), any way heres my script. expandcollapse popup#include <GUIconstants.au3> GUICreate("You must first log on", -1, 100) GUICtrlCreateLabel("You must log on before you can use this program", 0, 0) $user1 = GUICtrlCreateInput("Username", 0, 15) $ok1 = GUICtrlCreateButton("OK", 0, 37, 50) $username = "beta" GUISetState(@SW_SHOW) While 1 $getmsg = GUIGetMsg() Select Case $getmsg = $GUI_EVENT_CLOSE Exit Case $getmsg = $ok1 Log_On() EndSelect WEnd Func Log_On() If GUICtrlRead($user1) <> $username Then MsgBox(4096, "Access Denied", "Access Denied") Exit ElseIf GUICtrlRead($username) = $username Then MsgBox(4096, "Access Granted", "Access Granted", 2) Good_to_go() EndIf EndFunc Func Good_to_go() Sleep(500) WinKill("You must first log on") Sleep(500) GUICreate("Master Control Program") GUISetState(@SW_SHOW) while 1 WEnd EndFunc The problem is that once you login the login window is still up and you can't exit it. Also no function (once their put in) will work until I can fix this problem. Edited April 19, 2006 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
nfwu Posted April 19, 2006 Share Posted April 19, 2006 (edited) Here: simple problem of a wrongly named variable: expandcollapse popup#include <GUIconstants.au3> GUICreate("You must first log on", -1, 100) GUICtrlCreateLabel("You must log on before you can use this program", 0, 0) $user1 = GUICtrlCreateInput("Username", 0, 15) $ok1 = GUICtrlCreateButton("OK", 0, 37, 50) $MCPloc = "C:\Documents and Settings\Owner\My Documents\Data\MCP.ini" $username = "beta" GUISetState(@SW_SHOW) While 1 $getmsg = GUIGetMsg() Select Case $getmsg = $GUI_EVENT_CLOSE Exit Case $getmsg = $ok1 Log_On() EndSelect WEnd Func Log_On() If GUICtrlRead($user1) <> $username Then MsgBox(4096, "Access Denied", "Access Denied") Exit ElseIf GUICtrlRead($user1) = $username Then MsgBox(4096, "Access Granted", "Access Granted", 2) Good_to_go() EndIf EndFunc Func Good_to_go() Sleep(500) WinKill("You must first log on") Sleep(500) GUICreate("Master Control Program") GUISetState(@SW_SHOW) while 1 Sleep(10) WEnd EndFunc #) Edited April 19, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Infinitex0 Posted April 19, 2006 Author Share Posted April 19, 2006 (edited) That didn't work. Same results as before. Edited April 19, 2006 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] Link to comment Share on other sites More sharing options...
nfwu Posted April 19, 2006 Share Posted April 19, 2006 Try this, then: expandcollapse popup#include <GUIconstants.au3> GUICreate("You must first log on", -1, 100) GUICtrlCreateLabel("You must log on before you can use this program", 0, 0) $user1 = GUICtrlCreateInput("Username", 0, 15) $ok1 = GUICtrlCreateButton("OK", 0, 37, 50) $MCPloc = "C:\Documents and Settings\Owner\My Documents\Data\MCP.ini" $username = "beta" GUISetState(@SW_SHOW) While 1 $getmsg = GUIGetMsg() Select Case $getmsg = $GUI_EVENT_CLOSE Exit Case $getmsg = $ok1 Log_On() EndSelect WEnd Func Log_On() If GUICtrlRead($user1) <> $username Then MsgBox(4096, "Access Denied", "Access Denied") Exit ElseIf GUICtrlRead($user1) = $username Then MsgBox(4096, "Access Granted", "Access Granted", 2) Good_to_go() EndIf EndFunc Func Good_to_go() GUIDelete() GUICreate("Master Control Program") GUISetState(@SW_SHOW) while 1 Sleep(10) WEnd EndFunc Look up GUIDelete() #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Infinitex0 Posted April 19, 2006 Author Share Posted April 19, 2006 Thanks nfwu The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center] 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