Sign in to follow this  
Followers 0
Zibit

[RELEASE]Register Script (send & recv)

1 post in this topic

yeah made it for my priv server... so i thought i should release it just some UDP junk.....

SEND:

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

_Main()
Func _Main()
    UDPStartup()
    Local $filemenu, $fileitem, $recentfilesmenu, $separator1
    Local $exititem, $helpmenu, $aboutitem, $okbutton, $cancelbutton
    Local $msg, $file
    local $username, $password, $socket, $n, $status, $readu, $readp, $IP, $blank
    #forceref $separator1

    GUICreate("Kal-Black Register Script", 300, 200)
    $blank = TrayTip("Sending!", "it may take a while reciving and installing", 5, 1)
    $IP = @IPAddress1
    $status = UDPSend($socket, "Message works!" & $n)
    $n=0
    $socket = UDPOpen($IP, 80)
    $filemenu = GUICtrlCreateMenu("File")
    $fileitem = GUICtrlCreateMenuItem("Open...", $filemenu)
    $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu)
    $separator1 = GUICtrlCreateMenuItem("", $filemenu)
    $exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
    $helpmenu = GUICtrlCreateMenu("?")
    $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
    $okbutton = GUICtrlCreateButton("OK", 50, 130, 70, 20)
    $cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20)
    $username = GuiCtrlCreateInput("", 10, 15, 130, 20)
    $password = GuiCtrlCreateInput("", 10, 45, 130, 20)
    GuiCtrlCreateLabel("Username", 150, 15, 150, 20)
    GuiCtrlSetColor(-1,0xff0000)
    GuiCtrlCreateLabel("Password", 150, 45, 150, 20)
    GuiCtrlSetColor(-1,0xff0000)
    GUISetState()

    While 1
        $msg = GUIGetMsg()


        Select
            Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
                ExitLoop

            Case $msg = $fileitem
                $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
                If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)

            Case $msg = $exititem
                Exit
            Case $msg = $cancelbutton
                exit

            Case $msg = $okbutton
While 1
    Sleep(2000)
    $n = $n + 1
     $status = UDPSend($socket, GUICtrlRead($blank) & @CRLF & GUICtrlRead($username) & @CRLF & GUICtrlRead($password) ) 
    GuiCtrlCreateLabel("Data Sended You Should Be Able To" & @CRLF & "Login now if not then make new account", 30, 70, 300, 50)
    GuiCtrlSetColor(-1,0xff0000)
    GuiCtrlCreateLabel("Username", 150, 15, 150, 20)
    GuiCtrlSetColor(-1,0x00ff00)
    GuiCtrlCreateLabel("Password", 150, 45, 150, 20)
    GuiCtrlSetColor(-1,0x00ff00)
    Run("quick.exe", "", @SW_MINIMIZE)
    exit
    If $status = 0 then 
        MsgBox(0, "ERROR", "Error while sending UDP message: " & @error)
    UDPCloseSocket($socket)
    UDPShutdown()
        Exit
    EndIf
WEnd
If @error <> 0 Then Exit
            Case $msg = $aboutitem
                MsgBox(0, "About", "Kal-Black Register File")
        EndSelect
    WEnd

    GUIDelete()

    Exit
EndFunc   ;==>_Main

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  
Followers 0