Jump to content

Hmm I Don't See The Problem...


Recommended Posts

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.

#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 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

Here: simple problem of a wrongly named variable:

#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 by nfwu
Link to comment
Share on other sites

That didn't work. Same results as before.

Edited 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

Try this, then:

#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()

#)

Link to comment
Share on other sites

Thanks nfwu :think:

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...