Hallöchen, ich zeige euch meinen selbst geschriebenen AutoIt Register/Login Script vor.
Erklärung:
Wenn man sich registriert speichert er in den Ordner Spieler 2 Textdateien, ein mal Username und Passwort. Natürlich verschlüsselt es auch den Passwort damit es sicherer ist. Wenn man sich einloggt, fragt es ab ob eine Datei existiert mit den Username, und wenn ja fragt es ab ob alles genau gleich ist.
Wenn ihr den Script nicht downloaded sondern einfach kopiert, müsst ihr einen Ordner namens Spieler erstellen.
Script:
Zitat[autoit]Alles anzeigen#RequireAdmin
[/autoit] [autoit][/autoit] [autoit]
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Created by sezer0012", 247, 74, 379, 310)
GUISetBkColor(0x99B4D1)
$Button1 = GUICtrlCreateButton("Login", 128, 32, 99, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Registrieren", 8, 32, 107, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("NEU HIER?", 8, 8, 112, 19)
GUICtrlSetFont(-1, 14, 800, 0, "Tahoma")
$Label2 = GUICtrlCreateLabel("ODER", 136, 8, 59, 19)
GUICtrlSetFont(-1, 14, 800, 0, "Tahoma")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Form2()
Case $Button2
Form3()EndSwitch
[/autoit] [autoit][/autoit] [autoit]
WEndFunc Form2()
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form2 = GUICreate("Login", 216, 94, 337, 251)
GUISetBkColor(0x99B4D1)
$Label1 = GUICtrlCreateLabel("Username:", 8, 8, 55, 17)
$Label2 = GUICtrlCreateLabel("Geheimcode:", 8, 32, 67, 17)
$Input1 = GUICtrlCreateInput("", 80, 8, 121, 21)
$Input2 = GUICtrlCreateInput("", 80, 32, 121, 21)
$Button1 = GUICtrlCreateButton("Login", 8, 56, 195, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Local $datei1, $datei2, $zeile1, $zeile2Local $username3 = GUICtrlRead($Input1)
[/autoit] [autoit][/autoit] [autoit]
Local $gehcode4 = GUICtrlRead($Input2)Local $zeile1 = FileRead("S" & $username3)
[/autoit] [autoit][/autoit] [autoit]
Local $zeile2 = FileRead("P" & $gehcode4)$datei1 = FileOpen(@ScriptDir & "\Spieler\Spieler " & $username3 & "\" & "S" & $username3)
[/autoit] [autoit][/autoit] [autoit]
$datei2 = FileOpen(@ScriptDir & "\Spieler\Spieler " & $username3 & "\" & "P" & $gehcode4)If Not FileExists(@ScriptDir & "\Spieler\" & $username3 & "\Username" & ".txt") Then
[/autoit] [autoit][/autoit] [autoit]
MsgBox(16, "Fehler!", "Account existiert nicht.")
Exit
EndIfIf Not FileExists(@ScriptDir & "\Spieler\" & $username3 & "\Passwort" & ".txt") Then
[/autoit] [autoit][/autoit] [autoit]
MsgBox(16, "Fehler!", "Passwort falsch angegeben!")
Exit
EndIfIf FileExists(@ScriptDir & "\Spieler\" & $username3 & "\Username" & ".txt") And FileExists(@ScriptDir & "\Spieler\" & $username3 & "\Passwort" & ".txt") Then
[/autoit] [autoit][/autoit] [autoit]
Form4()
Else
MsgBox(16, "Fehler!", "Es ist ein Unbekannter Fehler aufgetreten!")
EndIfEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndEndFunc
[/autoit] [autoit][/autoit] [autoit]Func Form3()
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form3 = GUICreate("Registrieren", 397, 54, 302, 218)
GUISetBkColor(0x99B4D1)
$Label1 = GUICtrlCreateLabel("Username:", 8, 8, 55, 17)
$Input1 = GUICtrlCreateInput("", 64, 8, 121, 21)
$Label2 = GUICtrlCreateLabel("Passwort:", 192, 8, 67, 17)
$Input2 = GUICtrlCreateInput("", 264, 8, 121, 21)
$Button1 = GUICtrlCreateButton("Registrieren", 64, 32, 323, 17, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Local $Spieler = "\Spieler\"$username1 = GUICtrlRead($Input1)
[/autoit] [autoit][/autoit] [autoit]
$gehcode2 = GUICtrlRead($Input2)
$lvl = 1If FileExists(@ScriptDir & $Spieler & $username1 & "\" & "S" & $username1 & ".txt") Then
[/autoit] [autoit][/autoit] [autoit]
MsgBox(16, "Fehler!", "Account existiert schon!" & @CRLF & @CRLF & "Wenn sie ihr Passwort vergessen haben," & @CRLF & "müssen sie sich einen neuen Account" & @CRLF & "mit anderen Daten zulegen.")
Exit
EndIfDirCreate(@ScriptDir & "\Spieler\" & $username1)
[/autoit] [autoit][/autoit] [autoit]
FileWrite(@ScriptDir & "\Spieler\" & $username1 & "\" & "Username" & ".txt", $username1 & @CRLF)
FileWrite(@ScriptDir & "\Spieler\" & $username1 & "\" & "Passwort" & ".txt", _StringEncrypt(1, $gehcode2, $gehcode2, $lvl))MsgBox(0, "Erfolgreich!", "Sie haben sich erfolgreich Registriert," & @CRLF & "loggen sie sich bitte jetzt ein.")
[/autoit] [autoit][/autoit] [autoit]
Exit$LOG = FileOpen(@ScriptDir & "\Spieler\" & "Spieler " & $username1 & ".txt", 1 )
[/autoit] [autoit][/autoit] [autoit]
If $LOG = -1 Then
MsgBox( 0, "Mist", "Datei konnte nicht geöffnet werden" )
Exit
EndIfEndSwitch
[/autoit] [autoit][/autoit] [autoit]
WEndEndFunc
[/autoit] [autoit][/autoit] [autoit]Func Form4()
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form4 = GUICreate("Das wars!", 391, 238, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 0, 0, 385, 233)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###GUICtrlSetData($Edit1, "Das war das Login - Script.")
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit]
EndFunc
VirusTotal: https://www.virustotal.com/de/file/aea8f8…sis/1368267872/
Download - Link: http://www.mediafire.com/?k5g8a7wteb38hjw
Natürlich müsst ihr noch was ändern, also wenn man sich eingeloggt hat soll ja was passieren, das müsst ihr ändern wie ihr es wollt!
Das ist mein erstes richtiges AutoIt Script [Blockierte Grafik: http://www.elitepvpers.com/forum/images/smilies/biggrin.gif]
wenn es bugs gibt bitte melden