Advertisement
Guest User

Untitled

a guest
Jun 16th, 2017
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 10.71 KB | None | 0 0
  1. #cs
  2. #########################
  3. ##       Includes      ##
  4. #########################
  5. #ce
  6. #include <WindowsConstants.au3>
  7. #include <GUIConstantsEx.au3>
  8. #include <GUIConstants.au3>
  9. #include <string.au3>
  10. #include <EditConstants.au3>
  11. #include <date.au3>
  12. #include <array.au3>
  13. #include <ImageSearch.au3>
  14.  
  15.  
  16. #cs
  17. #########################
  18. ##      Variablen      ##
  19. #########################
  20. #ce
  21. $Datum = @MDAY&"/" & @MON&"/" & @YEAR&" - "&@HOUR&":" & @MIN &":"& @SEC
  22.  
  23. $clickkey = IniRead("Config.ini","hotkeys","Click","up")
  24. $walkkey = IniRead("Config.ini","hotkeys","Walk","left")
  25. $helpkey = IniRead("Config.ini","hotkeys","Help","right")
  26. $pausekey = IniRead("Config.ini","hotkeys","Pause","down")
  27. $endekey = IniRead("Config.ini","hotkeys","End","F10")
  28. $loginkey = IniRead("Config.ini","hotkeys","Login","p")
  29. $beendenkey = IniRead("Config.ini","hotkeys","Beenden","F9")
  30.  
  31. $funcon = 0
  32. $running = 0
  33.  
  34. $Server = "ftp://mozo:12031993@mozo.square7.ch/"
  35.  
  36. #cs
  37. #########################
  38. ##       Build GUI     ##
  39. #########################
  40. #ce
  41. #Region ### START Koda GUI section ### Form=C:\Users\Mozo\Desktop\Form1.kxf
  42. $Form1 = GUICreate("Dekaron Tool", 248, 202, 193, 125)
  43. $Group2 = GUICtrlCreateGroup("Credits", 136, 0, 105, 97)
  44. $Label2 = GUICtrlCreateLabel("Credits:", 168, 24, 47, 17)
  45. GUICtrlSetFont(-1, 8, 800, 4, "MS Sans Serif")
  46. $Label3 = GUICtrlCreateLabel("Mozo007", 168, 64, 48, 17)
  47. GUICtrlCreateGroup("", -99, -99, 1, 1)
  48. $Group1 = GUICtrlCreateGroup("Change Login", 8, 0, 113, 97)
  49. $Loginname = GUICtrlCreateInput("Loginname", 16, 16, 97, 21)
  50. $Passwort = GUICtrlCreateInput("Passwort", 16, 40, 97, 21,$es_password)
  51. $Button1 = GUICtrlCreateButton("Ändern", 16, 64, 97, 25, 0)
  52. GUICtrlCreateGroup("", -99, -99, 1, 1)
  53. $Group3 = GUICtrlCreateGroup("Start", 8, 96, 233, 41)
  54. $Button2 = GUICtrlCreateButton("Start", 56, 104, 129, 25, 0)
  55. GUICtrlCreateGroup("", -99, -99, 1, 1)
  56. $Group4 = GUICtrlCreateGroup("Datum - Uhrzeit", 8, 136, 233, 41)
  57. $Label1 = GUICtrlCreateLabel($Datum, 68, 152, 200, 20)
  58. GUICtrlCreateGroup("", -99, -99, 1, 1)
  59. $Menu = GUICtrlCreateMenu("&Menu")
  60. $Update = GUICtrlCreateMenuItem("Update", $Menu)
  61. $Close = GUICtrlCreateMenuItem("Close", $Menu)
  62. $MenuItem2 = GUICtrlCreateMenu("?")
  63. $Info = GUICtrlCreateMenuItem("Login",$MenuItem2)
  64. $Help = GUICtrlCreateMenuItem("Help", $MenuItem2)
  65. GUISetState(@SW_SHOW)
  66. #EndRegion ### END Koda GUI section ###
  67. Dim $AccelKeys[1][2] = [["{ENTER}", $Button1]]
  68. GUISetAccelerators($AccelKeys)
  69.  
  70. #cs
  71. ##########################
  72. ##    Endlosschleife    ##
  73. ##########################
  74. #ce
  75. While 1
  76.     $nMsg = GUIGetMsg($Form1)
  77.     Switch $nMsg
  78.         Case $GUI_EVENT_CLOSE
  79.             Exit
  80.         Case $Button1
  81.             _change()
  82.         Case $Button2
  83.             _dkstart()
  84.         Case $Close
  85.             Exit
  86.         Case $Help
  87.             _help()
  88.         Case $Update
  89.             _update()
  90.         Case $Info
  91.             _info()
  92.     EndSwitch
  93.     If ProcessExists("dekaron.exe") Then
  94.         GUISetState(@SW_HIDE)
  95.         TraySetState(1)
  96.         $running = 1
  97.         HotKeySet("{"&$endekey&"}", "_ende")
  98.         HotKeySet("{"&$helpkey&"}", "_help")
  99.         HotKeySet("{"&$clickkey&"}", "_click")
  100.         HotKeySet("{"&$pausekey&"}", "_pause")
  101.         HotKeySet("{"&$walkkey&"}", "_walk")
  102.         HotKeySet("{"&$loginkey&"}", "_login")
  103.         HotKeySet("{"&$beendenkey&"}", "_been")
  104.     Else
  105.         GUISetState(@SW_SHOW)
  106.         TraySetState(0)
  107.         $running = 0
  108.         HotKeySet("{"&$endekey&"}")
  109.         HotKeySet("{"&$helpkey&"}")
  110.         HotKeySet("{"&$clickkey&"}")
  111.         HotKeySet("{"&$pausekey&"}")
  112.         HotKeySet("{"&$walkkey&"}")
  113.         HotKeySet("{"&$loginkey&"}")
  114.         HotKeySet("{"&$beendenkey&"}")
  115.     EndIf
  116.    
  117.     $Datum = @MDAY&"/" & @MON&"/" & @YEAR&" - "&@HOUR&":" & @MIN &":"& @SEC
  118.     If $Datum <> GUICtrlRead($Label1) Then GUICtrlSetData($Label1,$Datum)
  119. WEnd
  120.    
  121.  
  122. #cs
  123. #########################
  124. ##      Funktionen     ##
  125. #########################
  126. #ce
  127. Func _change()
  128.     If GUICtrlRead($Loginname) = "" Or GUICtrlRead($Passwort) = "" Or GUICtrlRead($Loginname) = "Loginname" Or GUICtrlRead($Passwort) = "Passwort" Then
  129.         MsgBox(0,"Daten eingeben", "Es wurden keine Daten eingegeben!")
  130.     Else
  131.         $idch = _StringEncrypt(1,GUICtrlRead($Loginname),"loginid",3)
  132.         $pwch = _StringEncrypt(1,GUICtrlRead($Passwort),"loginpw",3)
  133.         $idold = IniRead("Config.ini","login","Id","NoID")
  134.         $pwold = IniRead("Config.ini","login","Pw","NoPW")
  135.         If $idch = $idold And $pwch = $pwold Then
  136.             MsgBox(0,"Daten","Gleiche Daten!")
  137.         Else
  138.             SplashTextOn("Aktualisierung", ""&@CRLF&@CRLF&@CRLF&"Daten werden aktualisiert",260,202)
  139.             Sleep(600)
  140.             SplashOff()
  141.             If $idch <> $idold Then
  142.                 IniWrite("Config.ini","login","Id",$idch)
  143.                 IniWrite("Config.ini","change","Loginname","Last Change: "&@MDAY&"/"&@MON&"/"&@YEAR&", "&@HOUR&":"&@MIN& ":" &@SEC&" !")
  144.             EndIf
  145.             If $pwch <> $pwold Then
  146.                 IniWrite("Config.ini","login","Pw",$pwch)
  147.                 IniWrite("Config.ini","change","Password","Last Change: "&@MDAY&"/"&@MON&"/"&@YEAR&", "&@HOUR&":"&@MIN& ":" &@SEC&" !")
  148.             EndIf
  149.             $grund = InputBox("Grund", "Grund der Änderung:")
  150.             IniWrite("Config.ini","change","Grund",$grund)
  151.             MsgBox(0,"LoginDaten","Logindaten wurden erfolgreich aktuallisiert!")
  152.         EndIf
  153.     EndIf
  154. EndFunc
  155. Func _click()
  156.     If $running = 1 Then
  157.         If $funcon = 0 Then
  158.             $funcon = 1
  159.             While $funcon = 1
  160.                 MouseClick("left")
  161.             WEnd
  162.         Else
  163.             MsgBox(0,"Funktion", "Es wird bereits ein anderer Script ausgeführt!")
  164.         EndIf
  165.     EndIf
  166. EndFunc
  167. Func _walk()
  168.     If $running = 1 Then
  169.         If $funcon = 0 Then
  170.             $funcon = 2
  171.             While $funcon = 2
  172.                 Send("{W DOWN}")
  173.             WEnd
  174.         Else
  175.             MsgBox(0,"Funktion", "Es wird bereits ein anderer Script ausgeführt!")
  176.         EndIf
  177.     EndIf
  178. EndFunc
  179. Func _login()
  180.     If $running = 1 Then
  181.         If $funcon = 0 Then
  182.             $funcon = 3
  183.             While $funcon = 3
  184.                 $loginid = IniRead("Config.ini","login","Id","NoID")
  185.                 $loginpw = IniRead("Config.ini","login","Pw","NoPW")
  186.                 If $loginid = "NoID" Then
  187.                     $id = InputBox("Name","Loginname eingeben!")
  188.                     $id2 = _StringEncrypt(1,$id,"loginid",3)
  189.                     IniWrite("Config.ini","login","Id",$id2)
  190.                     IniWrite("Config.ini","change","Loginname","Last Change: "&@MDAY&"/"&@MON&"/"&@YEAR&", "&@HOUR&":"&@MIN&" !")
  191.                     Sleep(500)
  192.                     _login()
  193.                 ElseIf $loginpw = "NoPW" Then
  194.                     $pw = InputBox("Passwort","Passwort eingeben!","","*")
  195.                     $pw2 = _StringEncrypt(1,$pw,"loginpw",3)
  196.                     IniWrite("Config.ini","login","Pw",$pw2)
  197.                     IniWrite("Config.ini","change","Password","Last Change: "&@MDAY&"/"&@MON&"/"&@YEAR&", "&@HOUR&":"&@MIN&" !")
  198.                     Sleep(500)
  199.                     _login()
  200.                 Else
  201.                     $x1 = 0
  202.                     $y1 = 0
  203.                     $x2 = 0
  204.                     $y2 = 0
  205.                     $loginid2 = _StringEncrypt(0,$loginid,"loginid",3)
  206.                     $loginpw2 = _StringEncrypt(0,$loginpw,"loginpw",3)
  207.                     $result1 = _ImageSearch("server1.png",1,$x1,$y1,0)
  208.                     $result2 = _ImageSearch("server.png",1,$x2,$y2,0)
  209. ;~                  $result3 = _ImageSearch("login.png",1,$x3,$y3,0)
  210.                     Beep(480,400)
  211.                     If $result1=1 Then
  212.                         MouseMove($x1,$y1,1)
  213.                         MouseClick("left")
  214.                     EndIf
  215.                     Sleep(1000)
  216.                     If $result2=1 Then
  217.                         MouseMove($x2,$y2,1)
  218.                         MouseClick("left")
  219.                     EndIf
  220.                     Sleep(1000)
  221.                     Send($loginid2)
  222.                     Send("{TAB}")
  223.                     Sleep(100)
  224.                     Send($loginpw2)
  225.                     Sleep(100)
  226.                     Send("{ENTER}")
  227.                     Sleep(10000)
  228.                     MouseClick("left" , 975, 84, 1)
  229.                     MouseClick("left" , 642, 906, 1)
  230.                 EndIf
  231.                 $funcon = 0
  232.             WEnd
  233.         Else
  234.             MsgBox(0,"Funktion", "Es wird bereits ein anderer Script ausgeführt!")
  235.         EndIf
  236.     EndIf
  237. EndFunc
  238. Func _been()
  239.     If $running = 1 Then
  240.         If $funcon = 0 Then
  241.             $funcon = 4
  242.             Send("{ESC}")
  243.             Sleep(200)
  244.             MouseClick("left" , 630, 429, 1)
  245.             $funcon = 0
  246.         Else
  247.             MsgBox(0,"Funktion", "Es wird bereits ein anderer Script ausgeführt!")
  248.         EndIf
  249.     EndIf
  250. EndFunc
  251. Func _help()
  252.     If $funcon = 0 Then
  253.         $funcon = 5
  254.         MsgBox(0,"Helpbox", ""&$clickkey&" -> Autoklick" & @CRLF & ""&$walkkey&" -> Auto-W (Autolaufen)" & @CRLF & ""&$pausekey&" -> Alles Stoppen" & @CRLF & ""&$helpkey&" -> Helpbox" & @CRLF & ""&$loginkey&" -> Autologin" & @CRLF & ""&$beendenkey&" -> Dekaron beenden" & @CRLF & ""&$endekey&" -> Tool Beenden")
  255.     Else
  256.         MsgBox(0,"Funktion", "Es wird bereits ein anderer Script ausgeführt!")
  257.     EndIf
  258. EndFunc
  259. Func _pause()
  260.     If $running = 1 Then
  261.         If $funcon > 0 Then
  262.             Send("{W UP}")
  263.             $funcon = 0
  264.         Else
  265.             MsgBox(0,"Funktion", "Es wird bereits ein anderer Script ausgeführt!")
  266.         EndIf
  267.     EndIf
  268. EndFunc
  269. Func _dkstart()
  270.     $dkstart = IniRead("Config.ini","path","Path","path")
  271.     If $running = 0 Then
  272.         If $dkstart = "path" Or $dkstart = "" Then
  273.             $dkpfad = FileOpenDialog("Datei suchen..", @ScriptDir, "(*.exe)")
  274.             If $dkpfad <> "" Then
  275.                 IniWrite("Config.ini","path","Path",$dkpfad)
  276.                 _dkstart()
  277.             EndIf
  278.         Else
  279.             Run($dkstart)
  280.         EndIf
  281.     EndIf
  282. EndFunc
  283. Func _update()
  284.     $version = IniRead("Config.ini","version","Version","1.0.0.0")    ;liest die akutelle version
  285.     FileDelete("update.txt")    ;Falls die Datei schon vorhanden ist
  286.     InetGet("ftp://mozo_update:update@mozo.square7.de/Version.txt", "update.txt", 1, 0)    ;läd die datei runter
  287.     $file = FileOpen("update.txt", 0)    ;ffnet sie
  288.     $ver_server = FileReadLine($file, 1)    ;liest zeile 1 (dort steht bei mir eben die version)
  289.     If $ver_server = $version or $ver_server = "" Then    ;vergleicht die version
  290.         FileClose($file)    ;schließt die datei
  291.         FileDelete("update.txt")    ;und löscht sie
  292.         MsgBox(0,"Updater","Sie besitzen bereits die aktuellste Version!")
  293.     Else
  294.         $msgbox = MsgBox(36, "Update!", "Es ist ein neues Update verfügbar!"&@CRLF&"Aktuelle Version: "&$ver_server&@CRLF&"Wollen sie es runterladen?")    ;ja-nein.msgbox
  295.         If $msgbox = 6 Then    ;wenn ja
  296.             Tooltip("Update wird runtergeladen... bitte warten :-)")
  297.             InetGet("ftp://mozo_update:update@mozo.square7.ch/DekaronTool-"&$ver_server&".exe", @scriptDir&"\" &"DekaronTool-"&$ver_server&".exe",0 )    ;läd er diese datei hier runter
  298.             IniWrite("Config.ini","version","Version", $ver_server)    ;schreibt die neue version in die ini
  299.             FileClose($file)    ;schließt die datei
  300.             FileDelete("update.txt")    ;löscht die datei
  301.             Tooltip("")    ;das ist wegen dem tooltip...der geht sonst nimmer wech xD
  302.             msgbox(0,"Update", "Das Programm wurde aktualisiert ;)")    ;bestätigung
  303.             Run("DekaronTool-"&$ver_server&".exe")    ;öffnet die neue version
  304.             Exit    ;schließt die alte
  305.         Else
  306.             FileClose($file)
  307.             FileDelete("update.txt")
  308.         EndIf
  309.     EndIf  
  310. EndFunc
  311. Func _GetVersion()
  312.     $InetVersion = InetRead($Server & "Version.txt")
  313.     If @error Then
  314.         MsgBox(48, "Fehler", "Die Version konnte nicht überprüft werden")
  315.         GUIDelete($Form)
  316.     Else
  317.         Return BinaryToString($InetVersion)
  318.     EndIf
  319. EndFunc
  320. Func _info()
  321.     $logininfo = IniRead("Config.ini","login","Id","NoID")
  322.     $logininfo5 = IniRead("Config.ini","login","Pw","NoPW")
  323.     $logininfo2 = _StringEncrypt(0,$logininfo,"loginid",3)
  324.     MsgBox(0,"Login Info","Username: "&$logininfo2 & @CRLF &"Password: **********")
  325. EndFunc
  326. Func _ende()
  327.     Exit
  328. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement