Jump to content
Sign in to follow this  
Infinitex0

Hmm I Don't See The Problem...

Recommended Posts

Infinitex0

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]

Share this post


Link to post
Share on other sites
nfwu

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

Share this post


Link to post
Share on other sites
Infinitex0

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]

Share this post


Link to post
Share on other sites
nfwu

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

#)

Share this post


Link to post
Share on other sites
Infinitex0

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]

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.