Programm auslesen & Editbox schreiben

  • Hallo leute =) , in diesem Forum hier bin ich neu :D
    Und ich freue mich hier zusein 8)

    Vor ungefähr 2 Jahre habe ich das lezte mal mit AutoIt gearbeitet und bin wieder raus -.-"
    Ich habe nun 2 fragen ;)
    Ich will das man bestimme Programme ausliest , nehmen wir mal "TeamSpeak 2".
    Das Teamspeak 2 in "Edit1" steht und wenn ich auf "Verstecken (Button1)" drücke es auf der Rechten seite ist und "gehidet"

    Da ich im moment nur ein bisschen von AutoIt wieder weiß kann ich sowas noch nicht und muss erstmal wieder reinkommen ^^
    Deswegen frage ich euch ob ihr mir helfen könnt ;)

    Mit freundlichen Grüßen <--


    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit][autoit][/autoit][autoit]

    AutoIt Version: 3.2.13.13 (beta)
    Author: Blub F.

    [/autoit][autoit][/autoit][autoit]

    Script Function:
    Template AutoIt script.

    [/autoit][autoit][/autoit][autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit][autoit][/autoit][autoit]

    ; Script Start - Add your code below here

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    HotkeySet("{ESC}","_endsplash")

    [/autoit][autoit][/autoit][autoit]

    #Region --- CodeWizard generated code Start ---
    ;SpashText features: Title=No, Text=Yes, Centered vertically text, Center justified text, Fontname=Comic Sans MS, Font size=9, Font weight=400
    $alex = SplashTextOn("",@CRLF & "------------------------------------" & @CRLF & "Dieses Tool ist geschrieben von Blub F." & @CRLF & @CRLF & "Es ist ledlich für den Privat gebrauch verfügbar und nicht für was anderes." & @CRLF & "Das tool könnt ihr gerne irgendwo Posten oder verschiken aber unter meinem Copyright (c)" & @CRLF & @CRLF & @CRLF & "Das Programm kann eure Übersicht mit den Sbots verbessern, ihr könnt Sie verstecken und / oder zeigen lassen." & @CRLF & "So ist die Übersicht wieder da" & @CRLF & @CRLF & "------------------------------------" & @CRLF & "Um nun weiter zum Programm zu gehen drücken Sie die *ESC* Taste" & @CRLF & "------------------------------------","-1","-1","-1","-1",1,"Comic Sans MS","9","400")
    #EndRegion --- CodeWizard generated code End ---

    [/autoit][autoit][/autoit][autoit]

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Sbot - Verstecker (R) by Blub F.", 523, 491, -1, -1)
    $Edit1 = GUICtrlCreateEdit("", 24, 56, 177, 273, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
    GUICtrlSetData(-1, "")
    $Edit2 = GUICtrlCreateEdit("", 320, 56, 177, 273, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
    GUICtrlSetData(-1, "")
    $Group1 = GUICtrlCreateGroup("Gruppe 1", 72, 352, 385, 81)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("Verstecken ->", 216, 72, 89, 33, 0)
    $Button2 = GUICtrlCreateButton("<- Normal", 216, 128, 89, 33, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit


    Case $Button2


    Case $Button1

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Func _endsplash()
    SplashOff()
    EndFunc

    [/autoit][autoit][/autoit][autoit][/autoit]
    • Offizieller Beitrag

    Schau dir in der Hilfe mal den Befehl WinSetState an.

  • Hi,
    also zu deinem "Problem"...
    du kannst fenster mit dem controlgettext befehl auslesen (sollte bei den meisten anwendungen funktionieren)
    und mit dem winmove befehl kannste das fenster (wie es der name ja schon sagt^^) bewegen, und zu guter letzt kannste
    per winsetstate("Fenstername","Text",@sw_hide) das gewünschte fenster verstecken
    du kannst ja ab und an mal in die autoit hilfe schauen :P
    ich hoffe mit den informationen kannste was anfangen
    (da man durchs "selberbasteln" am besten lernt habe ich hier keinen vollwertigen lösungsteil angefügt :rolleyes: )
    ich hoffe ich konnte dir helfen.. sonst frag einfach nochmal ;)

    Wer immer nur das tut, was er bereits kann - wird auch immer nur das bleiben, was er bereits ist!

  • Ich guck mal was sich machen lässt ^^ wenn nicht dan Nimm ich die Befehle und gib die hier in der suche ein ;) Dann müsste ich ja Scripte finden wo sowas drin ist =)

    Ich melde mich später nomma ob ich es geschaft habe =)

  • Achja ^^ Ehm ich brauch ja nur den Programm namen in den Edit fesntern nicht den Text und bei "Controlgettext" finde ich nix , das mit Verstecken (SW_HIDE & SW_SHOW) habe ich jetzt ;)

    Nur beim auslesen von dem bestimmten Programm , dass es dort angezeigt wid finde ich net raus -.-" Sorry ^^

  • Es würde auch mit WinList gehen das sind alllerdings nur die offenen Programme

  • Habt ihr vll beispiel scripts =)

    Edit:

    Ich hab nun ein Fertigis Programm aber nicht von mir.Ich wollte mir ein paar Sachen so abgucken wie der jenige das gemacht hat.
    Aber ich checke da garnicht druch ! Ich bitte um hilfe =)

    Ich will ja nur wissen wie der die Chars ausliest.

    Ich habe ja schon alles mögliche probiert , habe aber nix gescheites bekommen , ich weiß nur das es mit dem Char auslesen bei

    [autoit]

    Func Refresh_SBot_List()

    [/autoit]

    Sein müsste =) MfG

    Quellen: "cp-g.forum"


    Hauptprogramm

    [autoit]

    $version = "2.18"

    [/autoit][autoit][/autoit][autoit]

    ;OFFSETS
    $offset_curhp = 0x1098EE0
    $offset_maxhp = 0x1098ED4
    $offset_curmp = 0x1098EE4
    $offset_maxmp = 0x1098ED8
    $offset_curexp = 0x1098E30

    [/autoit][autoit][/autoit][autoit]

    ;INSTANCES
    $instance_charname = 135 ;#######################
    $instance_sroserverstatus = 9
    $instance_botstatus = 11

    [/autoit][autoit][/autoit][autoit]

    $instance_level = $instance_charname + 2
    $instance_gold = $instance_charname + 4
    $instance_sp = $instance_charname + 6
    $instance_location = $instance_charname + 8
    $instance_x = $instance_charname - 5
    $instance_y = $instance_charname - 3

    [/autoit][autoit][/autoit][autoit]

    $instance_totaltime = $instance_charname + 11
    $instance_kills = $instance_charname + 13
    $instance_xpgained = $instance_charname + 15
    $instance_xpmin = $instance_charname + 17
    $instance_xphour = $instance_charname + 19
    $instance_spgained = $instance_charname + 21
    $instance_spmin = $instance_charname + 23
    $instance_sphour = $instance_charname + 25
    $instance_died = $instance_charname + 27
    $instance_itemdrops = $instance_charname + 29
    $instance_goldloop = $instance_charname + 31

    [/autoit][autoit][/autoit][autoit]

    ;Buttoninstances
    $instance_goclientless = 4
    $instance_starttraining = 163

    [/autoit][autoit][/autoit][autoit]

    $instance_stoptraining = $instance_starttraining + 1
    $instance_resetstats = $instance_starttraining - 3
    $instance_hideshowclient = $instance_starttraining - 1

    [/autoit][autoit][/autoit][autoit]

    Opt("GUIResizeMode", 802)
    Opt("TrayMenuMode", 1)
    Opt("TrayOnEventMode", 1)
    Opt("GUIOnEventMode", 1)

    [/autoit][autoit][/autoit][autoit]

    #include <GuiListView.au3>
    #include <GDIPlus.au3>
    #include <mem.au3>
    #include <extra.au3>
    #include <GDIpProgress.au3>
    #include <inet.au3>

    [/autoit][autoit][/autoit][autoit]

    ;Updatecheck
    Dim $uploadingcomplete, $waitupload, $startup = 1, $GLanguage = 1
    If IniRead(@ScriptDir & "\images\configuration.ini", "Updatecheck", "CheckOnStartup", "no") = "yes" Then
    $update = 1
    _Check4NewVersion()
    Else
    $update = 0
    EndIf
    $startup = 0

    [/autoit][autoit][/autoit][autoit]

    ;FTP activated? FTP = 1 -> Yes; 0 -> No
    If IniRead(@ScriptDir & "\images\configuration.ini", "FTP", "UseFTP", "no") = "yes" Then
    $ftp = 1
    Else
    $ftp = 0
    EndIf

    [/autoit][autoit][/autoit][autoit]

    ;General options
    $botftpserver = IniRead(@ScriptDir & "\images\configuration.ini", "FTP", "server", "")
    $botftpuser = IniRead(@ScriptDir & "\images\configuration.ini", "FTP", "username", "")
    $botftppw = IniRead(@ScriptDir & "\images\configuration.ini", "FTP", "passwort", "")
    $botftpport = IniRead(@ScriptDir & "\images\configuration.ini", "FTP", "port", 21)
    $botftpdir = IniRead(@ScriptDir & "\images\configuration.ini", "FTP", "directory", "/SBot Manager Chardata")
    If $botftpdir = "0" Then $botftpdir = "/SBot Manager Chardata"

    [/autoit][autoit][/autoit][autoit]

    If IniRead(@ScriptDir & "\images\configuration.ini", "General", "Language", "") = "english" Then
    $GLanguage = 1
    ElseIf IniRead(@ScriptDir & "\images\configuration.ini", "General", "Language", "") = "deutsch" Then
    $GLanguage = 2
    Else
    $GLanguage = 1
    EndIf

    [/autoit][autoit][/autoit][autoit]

    If Not IsInt($botftpport) Then
    $botftpport = 21
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "port", 21)
    EndIf
    $labeldelay = IniRead(@ScriptDir & "\images\configuration.ini", "Delaytimes", "Labels", 200)
    $mapdelay = IniRead(@ScriptDir & "\images\configuration.ini", "Delaytimes", "Minimap", 2000)
    $sound = IniRead(@ScriptDir & "\images\configuration.ini", "DC", "Sound", "")
    $flashwhendc = IniRead(@ScriptDir & "\images\configuration.ini", "DC", "WinFlash", "no")

    [/autoit][autoit][/autoit][autoit]

    If $labeldelay < 200 Then $labeldelay = 200
    If $mapdelay < 2000 Then $mapdelay = 2000

    [/autoit][autoit][/autoit][autoit]

    ;Mapfiles downloadsection
    If Not FileExists(@ScriptDir & "\images\sro worldmap.jpg") Or Not FileExists(@ScriptDir & "\images\point.png") Or Not FileExists(@ScriptDir & "\images\ChinTombB1.jpg") Or Not FileExists(@ScriptDir & "\images\ChinTombB2.jpg") Or Not FileExists(@ScriptDir & "\images\ChinTombB3.jpg") Or Not FileExists(@ScriptDir & "\images\ChinTombB4.jpg") Then
    If MsgBox(4, "Attention", "To use the minimap, you need some missing pictures." & @CRLF & "Download them now?") = 6 Then
    DirCreate(@ScriptDir & "\images")
    If Not FileExists(@ScriptDir & "\images\sro worldmap.jpg") Then
    $size = InetGetSize("http://secrets.kilu.de/SBot Manager/map/sro worldmap.jpg")
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/sro worldmap.jpg", @ScriptDir & "\images\sro worldmap.jpg", 0, 1)
    While @InetGetActive = 1
    TrayTip('Downloading "sro worldmap.jpg"', Round(@InetGetBytesRead / 1024, 0) & "/" & Round($size / 1024, 0) & " KB downloaded.", 3)
    Sleep(500)
    WEnd
    EndIf
    If Not FileExists(@ScriptDir & "\images\point.png") Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/point.png", @ScriptDir & "\images\point.png", 0, 1)
    TrayTip("", 'Downloading "point.png"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    If Not FileExists(@ScriptDir & "\images\ChinTombB1.jpg") Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/ChinTombB1.jpg", @ScriptDir & "\images\ChinTombB1.jpg", 0, 1)
    TrayTip("", 'Downloading "ChinTombB1.jpg"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    If Not FileExists(@ScriptDir & "\images\ChinTombB2.jpg") Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/ChinTombB2.jpg", @ScriptDir & "\images\ChinTombB2.jpg", 0, 1)
    TrayTip("", 'Downloading "ChinTombB2.jpg"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    If Not FileExists(@ScriptDir & "\images\ChinTombB3.jpg") Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/ChinTombB3.jpg", @ScriptDir & "\images\ChinTombB3.jpg", 0, 1)
    TrayTip("", 'Downloading "ChinTombB3.jpg"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    If Not FileExists(@ScriptDir & "\images\ChinTombB4.jpg") Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/ChinTombB4.jpg", @ScriptDir & "\images\ChinTombB4.jpg", 0, 1)
    TrayTip("", 'Downloading "ChinTombB4.jpg"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    TrayTip("", "Downloading finished", 3)
    EndIf
    EndIf
    If FileExists(@ScriptDir & "\images\ChinTombB1.jpg") And FileGetSize(@ScriptDir & "\images\ChinTombB1.jpg") <> 25811 Then
    If MsgBox(4, "Attention", 'You do not have the current fileversion of "ChinTombB1.jpg".' & @CRLF & "Download it now?") = 6 Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/ChinTombB1.jpg", @ScriptDir & "\images\ChinTombB1.jpg", 0, 1)
    TrayTip("", 'Downloading "ChinTombB1.jpg"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    EndIf
    If FileExists(@ScriptDir & "\images\ChinTombB2.jpg") And FileGetSize(@ScriptDir & "\images\ChinTombB2.jpg") <> 32488 Then
    If MsgBox(4, "Attention", 'You do not have the current fileversion of "ChinTombB2.jpg".' & @CRLF & "Download it now?") = 6 Then
    InetGet("http://s3cret.s3.ohost.de/SBot Manager/map/ChinTombB2.jpg", @ScriptDir & "\images\ChinTombB2.jpg", 0, 1)
    TrayTip("", 'Downloading "ChinTombB2.jpg"', 10)
    While @InetGetActive = 1
    Sleep(100)
    WEnd
    EndIf
    EndIf

    [/autoit][autoit][/autoit][autoit]

    _GDIPlus_Startup()
    $worldmap = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\sro worldmap.jpg")
    $mappoint = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\point.png")
    $maptomb1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\ChinTombB1.jpg")
    $maptomb2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\ChinTombB2.jpg")
    $maptomb3 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\ChinTombB3.jpg")
    $maptomb4 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\ChinTombB4.jpg")
    ;$mapdhcave1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\images\DH-Cave F1.jpg")
    ;###############################################################################
    $width = 560
    $extrawidth = 245
    $gui = GUICreate("SBot Manager v" & $version, $width + $extrawidth, 265)
    GUISetBkColor(0x000000, $gui)
    GUISetIcon("Street.ico")

    [/autoit][autoit][/autoit][autoit]

    $settings = GUICtrlCreateMenu("Settings")
    $ontop = GUICtrlCreateMenu("Set Manager always on top", $settings)
    $ontopenable = GUICtrlCreateMenuItem("Enable", $ontop)
    $ontopdisable = GUICtrlCreateMenuItem("Disable", $ontop)
    $uploaddata = GUICtrlCreateMenu("Upload data to FTP", $settings)
    $uploaddataenable = GUICtrlCreateMenuItem("Enable", $uploaddata)
    $uploaddatadisable = GUICtrlCreateMenuItem("Disable", $uploaddata)
    $generalsettings = GUICtrlCreateMenuItem("General Settings", $settings)
    $check4newversion = GUICtrlCreateMenuItem("Check for a new version now", $settings)
    $checksbotversion = GUICtrlCreateMenuItem("Check for the latest SBot-Version", $settings)
    ;##########

    [/autoit][autoit][/autoit][autoit]

    $ftpupload = GUICtrlCreateMenu("FTP-Upload")
    $info = GUICtrlCreateMenuItem("General information", $ftpupload)
    $uploadstyle = GUICtrlCreateMenuItem("Upload standart style", $ftpupload)
    If $ftp = 1 Then
    GUICtrlSetState($uploaddataenable, 1)
    Else
    GUICtrlSetState($uploaddatadisable, 1)
    EndIf
    GUICtrlSetState($ontopdisable, 1)
    ;-------------------------------------------------------------------------------
    ;Groups
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $groupcharlist = GUICtrlCreateGroup("SBot Charlist", 5, 5, 170, 220)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $groupgeneral = GUICtrlCreateGroup("General", 180, 5, 194, 220)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $groupbottingstats = GUICtrlCreateGroup("Botting stats", 379, 5, 150, 220)
    GUICtrlSetColor(-1, 0xFFFFFF)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)
    ;-------------------------------------------------------------------------------
    $sbotlist = GUICtrlCreateListView("Charname|Handle", 8, 25, 160, 165, BitOR(0x0004, 0x4000, 0x0010, 0x0008), 0x00000020)
    GUICtrlSetBkColor(-1, 0x000000)
    _GUICtrlListView_SetColumnWidth($sbotlist, 0, 160)
    $refresh = GUICtrlCreateButton("Refresh List", 12, 195, 73, 20)
    $hideall = GUICtrlCreateButton("Hide all", 87, 195, 82, 20)
    ;-------------------------------------------------------------------------------
    $progresshp = _ProgressCreate(190, 40, 84, 17, 0xFF0000, 0xFF0000, 0x000000, 0x000000)
    $progressmp = _ProgressCreate(280, 40, 84, 17, 0x2E4FC1, 0x2E4FC1, 0x000000, 0x000000)
    $progressexp = _ProgressCreate(190, 61, 174, 17, 0x32CD32, 0x32CD32, 0x000000, 0x000000)
    _ProgressSetFont($progresshp, "", 9, "", 0xFFFFFF)
    _ProgressSetFont($progressmp, "", 9, "", 0xFFFFFF)
    _ProgressSetFont($progressexp, "", 9, "", 0xFFFFFF)

    [/autoit][autoit][/autoit][autoit]

    GUICtrlCreateLabel("Charname:", 190, 25, "", 15)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Level:", 190, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("SP:", 275, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("X:", 190, 95)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Y:", 275, 95)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Gold:", 190, 110)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labellocation = GUICtrlCreateLabel("Location:", 190, 125)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelsroserver = GUICtrlCreateLabel("Silkroad server status:", 190, 140)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelbotstatus = GUICtrlCreateLabel("Bot status:", 190, 155)
    GUICtrlSetColor(-1, 0xFFFFFF)

    [/autoit][autoit][/autoit][autoit]

    $charname = GUICtrlCreateLabel("", 245, 25, 100, 15)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $level = GUICtrlCreateLabel("", 230, 80, 30, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $sp = GUICtrlCreateLabel("", 300, 80, 70, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $x = GUICtrlCreateLabel("", 215, 95, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $y = GUICtrlCreateLabel("", 300, 95, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $gold = GUICtrlCreateLabel("", 235, 110, 100, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $location = GUICtrlCreateLabel("", 245, 125, 100, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $sroserverstatus = GUICtrlCreateLabel("", 300, 140, 66, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $botstatus = GUICtrlCreateLabel("", 245, 155, 120, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)

    [/autoit][autoit][/autoit][autoit]

    $hideshowclient = GUICtrlCreateButton("...", 188, 171, 88, 20)
    $goclientless = GUICtrlCreateButton("Go clientless", 188, 195, 88, 20)
    $stoptrain = GUICtrlCreateButton("Stop training", 278, 195, 88, 20)
    $starttrain = GUICtrlCreateButton("Start training", 278, 171, 88, 20)
    ;-------------------------------------------------------------------------------
    $labeltotaltime = GUICtrlCreateLabel("Total time:", 389, 30, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelkills = GUICtrlCreateLabel("Kills:", 389, 46, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelxpgained = GUICtrlCreateLabel("XP gained:", 389, 62, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelxpmin = GUICtrlCreateLabel("XP/min:", 389, 78, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelxph = GUICtrlCreateLabel("XP/h:", 389, 94, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelspgained = GUICtrlCreateLabel("SP gained:", 389, 110, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelspmin = GUICtrlCreateLabel("SP/min:", 389, 126, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labelsph = GUICtrlCreateLabel("SP/h:", 389, 142, 70, 80)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labeldied = GUICtrlCreateLabel("Died:", 389, 158)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Itemdrops:", 450, 159)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Gold/loop:", 389, 175)
    GUICtrlSetColor(-1, 0xFFFFFF)

    [/autoit][autoit][/autoit][autoit]

    $totaltime = GUICtrlCreateLabel("", 470, 31, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $kills = GUICtrlCreateLabel("", 470, 47, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $xpgained = GUICtrlCreateLabel("", 470, 63, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $xpmin = GUICtrlCreateLabel("", 470, 79, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $xphour = GUICtrlCreateLabel("", 470, 95, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $spgained = GUICtrlCreateLabel("", 470, 111, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $spmin = GUICtrlCreateLabel("", 470, 127, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $sphour = GUICtrlCreateLabel("", 470, 143, 50, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $died = GUICtrlCreateLabel("", 418, 159, 30, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $itemdrops = GUICtrlCreateLabel("", 500, 159, 23, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $goldloop = GUICtrlCreateLabel("", 450, 175, 76, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)

    [/autoit][autoit][/autoit][autoit]

    $resetstats = GUICtrlCreateButton("Reset stats", 389, 195, 130, 20)
    ;-------------------------------------------------------------------------------
    $openclosemap = GUICtrlCreateButton("=>" & @CRLF & @CRLF & "M" & @CRLF & "I" & @CRLF & "N" & @CRLF & "I" & @CRLF & "M" & @CRLF & "A" & @CRLF & "P" & @CRLF & @CRLF & "=>", 535, 10, 20, 215, 0x2000);BitOR(0x0300, 0x2000))
    GUICtrlCreateLabel("", 560, 10, 214, 214)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("+", 784, 10)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("_", 784, 200)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $Graphic = _GDIPlus_GraphicsCreateFromHWND($gui)
    $zoom = GUICtrlCreateSlider(775, 25, 30, 185, 0x0002)
    GUICtrlSetBkColor(-1, 0x000000)
    _GUICtrlSlider_SetTicFreq($zoom, 1)
    GUICtrlSetLimit($zoom, 15, 0)
    GUICtrlSetData($zoom, 15)

    [/autoit][autoit][/autoit][autoit]

    $mapinfo = GUICtrlCreateLabel("", 557, 228, 220, 17, 0x01)
    GUICtrlSetColor(-1, 0xFFFFFF)
    ;-------------------------------------------------------------------------------
    $ftpuploadlabel = GUICtrlCreateLabel("FTP-Server upload: ", 10, 228)
    GUICtrlSetColor(-1, 0xFFFFFF)
    If $ftp = 1 Then
    $showftp = GUICtrlCreateLabel("Enabled", 110, 228, 445)
    GUICtrlSetColor(-1, 0x32CD32)
    Else
    $showftp = GUICtrlCreateLabel("Disabled", 110, 228, 445)
    GUICtrlSetColor(-1, 0xFF0000)
    EndIf
    $ftpuploadstatus = GUICtrlCreateLabel("", 105, 228, 695, 17)
    GUICtrlSetColor(-1, 0x32CD32)
    GUICtrlSetState(-1, 32);Hide
    $sbotversionstatus = GUICtrlCreateLabel("", 10, 228, 695, 17)
    GUICtrlSetColor(-1, 0x32CD32)
    GUICtrlSetState(-1, 32);Hide

    [/autoit][autoit][/autoit][autoit]

    $pos = WinGetPos($gui)
    WinMove($gui, "", $pos[0], $pos[1], $width + 5)
    ;###############################################################################
    TraySetToolTip("SBot-Manager v" & $version)
    TraySetClick(16)
    $trayshowhide = TrayCreateMenu("Show/Hide")
    $trayshow = TrayCreateItem("Show", $trayshowhide)
    $trayhide = TrayCreateItem("Hide", $trayshowhide)
    TrayCreateItem("")
    $trayexit = TrayCreateItem("Exit")
    TrayItemSetOnEvent($trayshow, "GUIShow")
    TrayItemSetOnEvent($trayhide, "GUIHide")
    TrayItemSetOnEvent($trayexit, "_Exit")
    TraySetOnEvent(-13, "GUISetByTray")
    ;###############################################################################
    GUISetOnEvent(-3, "_Exit", $gui)

    [/autoit][autoit][/autoit][autoit]

    GUICtrlSetOnEvent($ontopenable, "General")
    GUICtrlSetOnEvent($ontopdisable, "General")
    GUICtrlSetOnEvent($generalsettings, "SettingGUI")
    GUICtrlSetOnEvent($check4newversion, "_Check4NewVersion")
    GUICtrlSetOnEvent($info, "General")
    GUICtrlSetOnEvent($uploaddataenable, "General")
    GUICtrlSetOnEvent($uploaddatadisable, "General")
    GUICtrlSetOnEvent($uploadstyle, "StyleGen")
    GUICtrlSetOnEvent($checksbotversion, "General")

    [/autoit][autoit][/autoit][autoit]

    GUICtrlSetOnEvent($refresh, "Refresh_SBot_List")
    GUICtrlSetOnEvent($starttrain, "General")
    GUICtrlSetOnEvent($stoptrain, "General")
    GUICtrlSetOnEvent($resetstats, "General")
    GUICtrlSetOnEvent($hideshowclient, "General")
    GUICtrlSetOnEvent($goclientless, "General")
    GUICtrlSetOnEvent($openclosemap, "General")
    GUICtrlSetOnEvent($sbotlist, "General")
    GUICtrlSetOnEvent($zoom, "Refresh_Image")
    GUICtrlSetOnEvent($hideall, "General")
    ;###############################################################################

    [/autoit][autoit][/autoit][autoit]

    Refresh_SBot_List()
    If $GLanguage = 2 Then SetLanguage(2, 1)

    [/autoit][autoit][/autoit][autoit]

    GUISetState(@SW_SHOW, $gui)
    Dim $mapopen = False, $oldx, $oldy, $oldchar, $waittimelabel, $waittimemap, $waittimedccheck, $waittimeupload = 0, $labelsloaded = 1, $exitmapbutton
    While 1
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $string[0] >= 2 Then

    [/autoit][autoit][/autoit][autoit]

    If $labelsloaded <> 1 Then
    If GUICtrlGetState($hideshowclient) = 144 Then GUICtrlSetState($hideshowclient, 64)
    If GUICtrlGetState($goclientless) = 144 Then GUICtrlSetState($goclientless, 64)
    If GUICtrlGetState($starttrain) = 144 Then GUICtrlSetState($starttrain, 64)
    If GUICtrlGetState($stoptrain) = 144 Then GUICtrlSetState($stoptrain, 64)
    If GUICtrlGetState($resetstats) = 144 Then GUICtrlSetState($resetstats, 64)
    If GUICtrlGetState($openclosemap) = 144 Then GUICtrlSetState($openclosemap, 64)
    EndIf
    If $GLanguage = 1 Then
    If GUICtrlRead($hideshowclient) <> ControlGetText(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_hideshowclient & "]") Then GUICtrlSetData($hideshowclient, ControlGetText(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_hideshowclient & "]"))
    ElseIf $GLanguage = 2 Then
    If ControlGetText(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_hideshowclient & "]") = "Hide client" And GUICtrlRead($hideshowclient) <> "Client verstecken" Then
    GUICtrlSetData($hideshowclient, "Client verstecken")
    ElseIf ControlGetText(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_hideshowclient & "]") = "Show client" And GUICtrlRead($hideshowclient) <> "Client zeigen" Then
    GUICtrlSetData($hideshowclient, "Client zeigen")
    EndIf
    EndIf

    [/autoit][autoit][/autoit][autoit]

    If $string[1] <> $oldchar Then
    Refresh_Labels(_Str2HWnd($string[2]), 1)
    If $mapopen = True Then Refresh_Image()
    $oldchar = $string[1]
    $waittimelabel = 0
    $waittimemap = 0
    $done = 1
    ElseIf $done <> 1 And $waittimelabel >= $labeldelay Then
    Refresh_Labels(_Str2HWnd($string[2]), 1)
    $waittimelabel = 0
    ElseIf $done <> 1 And $mapopen = True And $waittimemap >= $mapdelay Then
    Refresh_Image()
    $waittimemap = 0
    EndIf

    [/autoit][autoit][/autoit][autoit]

    $done = 0
    $labelsloaded = 1
    Else
    If $labelsloaded <> 0 Then
    If GUICtrlGetState($hideshowclient) = 80 Then GUICtrlSetState($hideshowclient, 128)
    If GUICtrlGetState($goclientless) = 80 Then GUICtrlSetState($goclientless, 128)
    If GUICtrlGetState($starttrain) = 80 Then GUICtrlSetState($starttrain, 128)
    If GUICtrlGetState($stoptrain) = 80 Then GUICtrlSetState($stoptrain, 128)
    If GUICtrlGetState($resetstats) = 80 Then GUICtrlSetState($resetstats, 128)
    If GUICtrlGetState($openclosemap) = 80 And $mapopen = False Then
    GUICtrlSetState($openclosemap, 128)
    Else
    $exitmapbutton = True
    EndIf
    Refresh_Labels("", 0)
    $oldhp[0] = -1
    $oldmp[0] = -1
    $oldexp = -1
    $labelsloaded = 0
    EndIf
    EndIf

    [/autoit][autoit][/autoit][autoit]

    If $waittimedccheck >= 5000 Then
    Check4DC()
    $waittimedccheck = 0
    EndIf

    [/autoit][autoit][/autoit][autoit]

    If $ftp = 1 Then
    If $waittimeupload >= 120000 Or $waittimeupload = 0 Then
    GUISetState(@SW_DISABLE, $gui)
    If _GUICtrlListView_GetItemCount($sbotlist) > 0 Then FTP_Upload()
    $waittimeupload = 0
    GUISetState(@SW_ENABLE, $gui)
    EndIf
    $waittimeupload += 50 ;###############
    EndIf

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Sleep(50)
    $waittimelabel += 50
    $waittimemap += 50
    $waittimedccheck += 50

    [/autoit][autoit][/autoit][autoit]

    If $uploadingcomplete = 1 Then
    $waitupload += 50
    If $waitupload >= 3000 And $ftp = 1 Then
    GUICtrlSetData($showftp, "Enabled")
    $uploadingcomplete = 0
    $waitupload = 0
    EndIf
    EndIf
    WEnd

    [/autoit][autoit][/autoit][autoit]

    Func Refresh_Labels($handle, $hhn)
    If $hhn <> 0 Then

    [/autoit][autoit][/autoit][autoit]

    If GUICtrlRead($charname) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_charname & "]") Then GUICtrlSetData($charname, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_charname & "]"))
    If GUICtrlRead($level) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_level & "]") Then GUICtrlSetData($level, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_level & "]"))
    If GUICtrlRead($gold) <> _StringAddThousandsSep(ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_gold & "]"), ".") Then GUICtrlSetData($gold, _StringAddThousandsSep(ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_gold & "]"), "."))
    If GUICtrlRead($sp) <> _StringAddThousandsSep(ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_sp & "]"), ".") Then GUICtrlSetData($sp, _StringAddThousandsSep(ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_sp & "]"), "."))
    If GUICtrlRead($location) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_location & "]") Then GUICtrlSetData($location, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_location & "]"))
    $x_ = ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_x & "]")
    If $x_ < 0 Then $xsep = "-"
    If $x_ >= 0 Then $xsep = ""
    If GUICtrlRead($x) <> ($xsep & _StringAddThousandsSep($x_, ".")) Then GUICtrlSetData($x, $xsep & _StringAddThousandsSep($x_, "."))
    $y_ = ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_y & "]")
    If $y_ < 0 Then $ysep = "-"
    If $y_ >= 0 Then $ysep = ""
    If GUICtrlRead($y) <> ($ysep & _StringAddThousandsSep($y_, ".")) Then GUICtrlSetData($y, $ysep & _StringAddThousandsSep($y_, "."))
    $serverstatus = ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_sroserverstatus & "]")
    If GUICtrlRead($sroserverstatus) <> $serverstatus Then
    If $serverstatus = "Disconnected" Then
    GUICtrlSetColor($sroserverstatus, 0xFF0000)
    Else
    GUICtrlSetColor($sroserverstatus, 0xFFFFFF)
    EndIf
    GUICtrlSetData($sroserverstatus, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_sroserverstatus & "]"))
    EndIf
    If GUICtrlRead($botstatus) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_botstatus & "]") Then GUICtrlSetData($botstatus, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_botstatus & "]"))
    If GUICtrlRead($totaltime) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_totaltime & "]") Then GUICtrlSetData($totaltime, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_totaltime & "]"))
    If GUICtrlRead($kills) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_kills & "]") Then GUICtrlSetData($kills, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_kills & "]"))
    If GUICtrlRead($xpgained) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_xpgained & "]") Then GUICtrlSetData($xpgained, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_xpgained & "]"))
    If GUICtrlRead($xpmin) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_xpmin & "]") Then GUICtrlSetData($xpmin, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_xpmin & "]"))
    If GUICtrlRead($xphour) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_xphour & "]") Then GUICtrlSetData($xphour, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_xphour & "]"))
    If GUICtrlRead($sp) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_spgained & "]") Then GUICtrlSetData($spgained, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_spgained & "]"))
    If GUICtrlRead($spmin) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_spmin & "]") Then GUICtrlSetData($spmin, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_spmin & "]"))
    If GUICtrlRead($sphour) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_sphour & "]") Then GUICtrlSetData($sphour, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_sphour & "]"))
    If GUICtrlRead($died) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_died & "]") Then GUICtrlSetData($died, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_died & "]"))
    If GUICtrlRead($itemdrops) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_itemdrops & "]") Then GUICtrlSetData($itemdrops, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_itemdrops & "]"))
    If GUICtrlRead($goldloop) <> ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_goldloop & "]") Then GUICtrlSetData($goldloop, ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_goldloop & "]"))

    [/autoit][autoit][/autoit][autoit]

    $mem = _MemoryOpen(WinGetProcess($handle))
    If _MemoryRead($offset_maxhp, $mem) > 0 Then

    [/autoit][autoit][/autoit][autoit]

    $curhp = _MemoryRead($offset_curhp, $mem)
    $maxhp = _MemoryRead($offset_maxhp, $mem)
    If $curhp <> $oldhp[0] Or $maxhp <> $oldhp[1] Then
    _ProgressSet($progresshp, Round($curhp / $maxhp, 2) * 100)
    _ProgressSetText($progresshp, $curhp & "/" & $maxhp)
    $oldhp[0] = $curhp
    $oldhp[1] = $maxhp
    EndIf

    [/autoit][autoit][/autoit][autoit]

    $curmp = _MemoryRead($offset_curmp, $mem)
    $maxmp = _MemoryRead($offset_maxmp, $mem)
    If $curmp <> $oldmp[0] Or $maxmp <> $oldmp[1] Then
    _ProgressSet($progressmp, Round($curmp / $maxmp, 2) * 100)
    _ProgressSetText($progressmp, $curmp & "/" & $maxmp)
    $oldmp[0] = $curmp
    $oldmp[1] = $maxmp
    EndIf

    [/autoit][autoit][/autoit][autoit]

    $curexp = _MemoryRead($offset_curexp, $mem)
    If $curexp <> $oldexp Then
    $exp = Round($curexp / _NextExp(ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_level & "]")) * 100, 2)
    If $exp >= 1 And $exp < 2 Then
    _ProgressSet($progressexp, 2)
    Else
    _ProgressSet($progressexp, $exp)
    EndIf
    $exp = StringFormat("%.2f", $exp)
    _ProgressSetText($progressexp, $exp & "%")
    $oldexp = $curexp
    EndIf
    Else
    _ProgressSet($progresshp, 0)
    _ProgressSetText($progresshp, "")
    _ProgressSet($progressmp, 0)
    _ProgressSetText($progressmp, "")
    _ProgressSet($progressexp, 0)
    _ProgressSetText($progressexp, "")
    $oldhp[0] = -1
    $oldhp[1] = -1
    $oldmp[0] = -1
    $oldmp[1] = -1
    $oldexp = -1
    EndIf
    _MemoryClose($mem)
    ElseIf $hhn = 0 Then
    GUICtrlSetData($charname, "")
    GUICtrlSetData($level, "")
    GUICtrlSetData($gold, "")
    GUICtrlSetData($sp, "")
    GUICtrlSetData($location, "")
    GUICtrlSetData($x, "")
    GUICtrlSetData($y, "")
    GUICtrlSetData($sroserverstatus, "")
    GUICtrlSetData($botstatus, "")
    GUICtrlSetData($totaltime, "")
    GUICtrlSetData($kills, "")
    GUICtrlSetData($xpgained, "")
    GUICtrlSetData($xpmin, "")
    GUICtrlSetData($xphour, "")
    GUICtrlSetData($spgained, "")
    GUICtrlSetData($spmin, "")
    GUICtrlSetData($sphour, "")
    GUICtrlSetData($died, "")
    GUICtrlSetData($itemdrops, "")
    GUICtrlSetData($goldloop, "")
    _ProgressSet($progresshp, 0)
    _ProgressSet($progressmp, 0)
    _ProgressSet($progressexp, 0)
    _ProgressSetText($progresshp, "")
    _ProgressSetText($progressmp, "")
    _ProgressSetText($progressexp, "")
    EndIf
    EndFunc ;==>Refresh_Labels

    [/autoit][autoit][/autoit][autoit]

    Func Refresh_SBot_List()
    Global $oldhp[2], $oldmp[2], $oldexp = -1
    $oldhp[0] = -1
    $oldhp[1] = -1
    $oldmp[0] = -1
    $oldmp[1] = -1

    [/autoit][autoit][/autoit][autoit]

    GUICtrlSetState($sbotlist, 128)
    _GUICtrlListView_DeleteAllItems($sbotlist)
    $winlist = WinList("[CLASS:wxWindowClassNR]")
    Global $sbotnum[$winlist[0][0] + 1]
    $sbotnum[0] = $winlist[0][0]
    $processlist = ProcessList()
    For $i = 1 To $winlist[0][0]
    If $winlist[$i][0] <> "Chat settings" And $winlist[$i][0] <> "" Then
    For $p = 1 To $processlist[0][0]
    If StringInStr($processlist[$p][0], "SBot_") <> 0 And WinGetProcess($winlist[$i][1]) = $processlist[$p][1] Then

    [/autoit][autoit][/autoit][autoit]

    $handle = $winlist[$i][1]
    Do
    $handle = StringTrimLeft($handle, 1)
    Until StringLen($handle) = 8
    $sbotnum[$i] = GUICtrlCreateListViewItem(ControlGetText($winlist[$i][1], "", "[CLASS:Static; INSTANCE:" & $instance_charname & "]") & "|0x" & $handle, $sbotlist)
    GUICtrlSetColor($sbotnum[$i], 0x32CD32)

    [/autoit][autoit][/autoit][autoit]

    GUICtrlCreateContextMenu($sbotnum[$i])
    $min = GUICtrlCreateMenuItem("Min", $sbotnum[$i])
    $max = GUICtrlCreateMenuItem("Max", $sbotnum[$i])
    $hide = GUICtrlCreateMenuItem("Hide", $sbotnum[$i])
    $show = GUICtrlCreateMenuItem("Show", $sbotnum[$i])
    $close = GUICtrlCreateMenuItem("Close", $sbotnum[$i])
    GUICtrlSetOnEvent($min, "Min_")
    GUICtrlSetOnEvent($max, "Max_")
    GUICtrlSetOnEvent($hide, "Hide_")
    GUICtrlSetOnEvent($show, "Show_")
    GUICtrlSetOnEvent($close, "Close_")
    EndIf
    Next
    EndIf
    Next
    _GUICtrlListView_SetColumnWidth($sbotlist, 1, 0)
    Global $DC[$sbotnum[0] + 1]
    Check4DC(1)
    GUICtrlSetState($sbotlist, 64)
    EndFunc ;==>Refresh_SBot_List

    [/autoit][autoit][/autoit][autoit]

    Func General()
    Switch @GUI_CtrlId
    Case $openclosemap
    $pos = WinGetPos($gui)
    If $mapopen = True Then
    GUICtrlSetData($openclosemap, "=>" & @CRLF & @CRLF & "M" & @CRLF & "I" & @CRLF & "N" & @CRLF & "I" & @CRLF & "M" & @CRLF & "A" & @CRLF & "P" & @CRLF & @CRLF & "=>")
    GUICtrlSetData($mapinfo, "")
    WinMove($gui, "", $pos[0], $pos[1], $width + 5)
    $mapopen = False
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $exitmapbutton = True And $string[1] <> "" Then
    GUICtrlSetState($openclosemap, 128)
    $exitmapbutton = False
    EndIf
    ElseIf $mapopen = False Then
    WinMove($gui, "", $pos[0], $pos[1], $width + $extrawidth)
    GUICtrlSetData($openclosemap, "<=" & @CRLF & @CRLF & "M" & @CRLF & "I" & @CRLF & "N" & @CRLF & "I" & @CRLF & "M" & @CRLF & "A" & @CRLF & "P" & @CRLF & @CRLF & "<=")
    $mapopen = True
    Refresh_Image()
    EndIf
    Case $starttrain
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $string[0] >= 2 Then ControlClick(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_starttraining & "]")
    Case $stoptrain
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $string[0] >= 2 Then ControlClick(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_stoptraining & "]")
    Case $resetstats
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $string[0] >= 2 Then ControlClick(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_resetstats & "]")
    Case $goclientless
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $string[0] >= 2 Then
    If MsgBox(4, "Warning", "If you go to clientless mode, it won't be able to restore the client." & @CRLF & "Go clientless?") = 6 Then _
    ControlClick(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_goclientless & "]")
    EndIf
    Case $hideshowclient
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $string[0] >= 2 Then
    $state = WinGetState(_Str2HWnd($string[2]))
    ControlClick(_Str2HWnd($string[2]), "", "[CLASS:Button; INSTANCE:" & $instance_hideshowclient & "]")
    Sleep(100)
    If BitAND($state, 2) <> 2 Then WinSetState(_Str2HWnd($string[2]), "", @SW_HIDE)
    EndIf
    Case $hideall
    For $z = 1 To _GUICtrlListView_GetItemCount($sbotlist)
    WinSetState(_Str2HWnd(_GUICtrlListView_GetItemText($sbotlist, $z - 1, 1)), "", @SW_HIDE)
    Next
    Case $info
    If $GLanguage = 1 Then MsgBox(64, "Upload chardata to a FTP-Server", 'Activate this function to get your personal chardata uploaded to an FTP-Server. This will help you to have a look over what your char does, where your char currently is, how good his leveling is going and more! The data on the server will be updated every 2-3 minutes. You have to use your own FTP-Server for this function.' & @CRLF & @CRLF & "1. Set your FTP-Data (Settings -> General Settings)" & @CRLF & "2. Activate FTP-Upload (Settings -> Upload data to FTP -> Enable)" & @CRLF & '3. Enjoy viewing your characters stats online =)')
    If $GLanguage = 2 Then MsgBox(64, "Chardaten auf einen FTP-Server laden", 'Beim aktivieren dieser Funktion werden alle Daten aus dem SBot von jedem Char in der Liste auf einen FTP-Server geladen, damit man überall online sehen kann, was welcher Char gerade tut, wie gut er levelt und mehr. Die Daten werden alle 2-3 Minuten neu hochgeladen. Es muss ein eigener FTP-Server eingerichtet werden um diese Funktion nutzen zu können.' & @CRLF & @CRLF & "1. FTP-Daten eingeben (Einstellungen -> Allgemeine Einstellungen)" & @CRLF & "2. Hochladen aktivieren (Einstellungen -> Chardaten auf FTP laden -> Aktivieren)" & @CRLF & '3. Chardaten online auf dem FTP-Server angucken =)')
    Case $ontopenable
    GUICtrlSetState($ontopdisable, 4)
    GUICtrlSetState($ontopenable, 1)
    WinSetOnTop($gui, "", 1)
    Case $ontopdisable
    GUICtrlSetState($ontopdisable, 1)
    GUICtrlSetState($ontopenable, 4)
    WinSetOnTop($gui, "", 0)
    Case $uploaddataenable
    GUICtrlSetColor($showftp, 0x32CD32)
    If $GLanguage = 1 Then
    GUICtrlSetData($showftp, "Enabled")
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($showftp, "Aktiviert")
    EndIf
    GUICtrlSetState($uploaddataenable, 1)
    GUICtrlSetState($uploaddatadisable, 4)
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "UseFTP", "yes")
    $ftp = 1
    If _GUICtrlListView_GetItemCount($sbotlist) > 0 Then FTP_Upload()
    Case $uploaddatadisable
    If $GLanguage = 1 Then
    GUICtrlSetData($showftp, "Disabled")
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($showftp, "Deaktiviert")
    EndIf
    GUICtrlSetColor($showftp, 0xFF0000)
    GUICtrlSetState($uploaddataenable, 4)
    GUICtrlSetState($uploaddatadisable, 1)
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "UseFTP", "no")
    $ftp = 0
    Case $checksbotversion
    GUICtrlSetState($showftp, 32);Hide
    GUICtrlSetState($ftpuploadlabel, 32);Hide
    GUICtrlSetState($sbotversionstatus, 16);Show
    If $GLanguage = 1 Then GUICtrlSetData($sbotversionstatus, 'Manager stopped! Receiving SBot-Version from bot-cave.net...')
    If $GLanguage = 2 Then GUICtrlSetData($sbotversionstatus, 'Manager gestoppt! Empfange SBot-Version von bot-cave.net...')
    $source = _INetGetSource("http://www2.bot-cave.net/main")
    If Not @error Then
    $sbotversion = StringRegExp($source, 'Latest SBot-Version: <strong>(.*?)</strong>', 1)
    $sbotreleasedate = StringRegExp($source, 'Release Date: <strong>(.*?)</strong>', 1)
    If $GLanguage = 1 Then
    GUICtrlSetData($sbotversionstatus, 'Manager stopped! Latest Version received...')
    MsgBox(64, "SBot-Version", "Latest SBot-Version: " & $sbotversion[0] & @CRLF & "Release Date: " & $sbotreleasedate[0] & @CRLF & @CRLF & @CRLF & "Please visit http://www.bot-cave.net for more information.")
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($sbotversionstatus, 'Manager gestoppt. Neueste SBot-Version empfangen...')
    MsgBox(64, "SBot-Version", "Neueste SBot-Version: " & $sbotversion[0] & @CRLF & "Erscheinungsdatum: " & $sbotreleasedate[0] & @CRLF & @CRLF & @CRLF & "Auf http://www.bot-cave.net gibt es mehr Informationen.")
    EndIf
    Else
    GUICtrlSetColor($sbotversionstatus, 0xFF0000)
    If $GLanguage = 1 Then GUICtrlSetData($sbotversionstatus, 'Manager stopped! Connection Error!')
    If $GLanguage = 2 Then GUICtrlSetData($sbotversionstatus, 'Manager gestoppt! Verbindungsfehler!')
    If $GLanguage = 1 Then MsgBox(48, "Connection Error", "You either don't have a connection to the world wide web or the server is currently down!")
    If $GLanguage = 2 Then MsgBox(48, "Verbindungsfehler", "Es besteht entweder keine Verbindung zum Internet oder der Server istmomentan nicht erreichbar!")
    EndIf
    GUICtrlSetState($sbotversionstatus, 32);Hide
    GUICtrlSetState($ftpuploadlabel, 16);Show
    GUICtrlSetState($showftp, 16);Show
    EndSwitch
    EndFunc ;==>General

    [/autoit][autoit][/autoit][autoit]

    Func GUISetByTray()
    If BitAND(WinGetState($gui), 2) Then
    GUISetState(@SW_HIDE, $gui)
    Else
    GUISetState(@SW_SHOW, $gui)
    EndIf
    EndFunc ;==>GUISetByTray

    [/autoit][autoit][/autoit][autoit]

    Func GUIShow()
    GUISetState(@SW_SHOW, $gui)
    EndFunc ;==>GUIShow

    [/autoit][autoit][/autoit][autoit]

    Func GUIHide()
    GUISetState(@SW_HIDE, $gui)
    EndFunc ;==>GUIHide

    [/autoit][autoit][/autoit][autoit]

    Func _Exit()
    _GDIPlus_ImageDispose($worldmap)
    _GDIPlus_ImageDispose($mappoint)
    _GDIPlus_ImageDispose($maptomb1)
    _GDIPlus_ImageDispose($maptomb2)
    _GDIPlus_ImageDispose($maptomb3)
    _GDIPlus_ImageDispose($maptomb4)
    _GDIPlus_GraphicsDispose($Graphic)
    _ProgressDelete($progresshp)
    _ProgressDelete($progressmp)
    _ProgressDelete($progressexp)
    _Progress_CallBack_Free(1) ; Force Killing Timer
    _GDIPlus_Shutdown()
    TraySetState(2)
    ProcessClose(WinGetProcess($gui))
    EndFunc ;==>_Exit

    [/autoit][autoit][/autoit][autoit]

    Func Min_()
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    WinSetState(_Str2HWnd($string[2]), "", @SW_MINIMIZE)
    EndFunc ;==>Min_

    [/autoit][autoit][/autoit][autoit]

    Func Max_()
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    WinSetState(_Str2HWnd($string[2]), "", @SW_MAXIMIZE)
    EndFunc ;==>Max_

    [/autoit][autoit][/autoit][autoit]

    Func Hide_()
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    WinSetState(_Str2HWnd($string[2]), "", @SW_HIDE)
    EndFunc ;==>Hide_

    [/autoit][autoit][/autoit][autoit]

    Func Show_()
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    WinSetState(_Str2HWnd($string[2]), "", @SW_SHOW)
    EndFunc ;==>Show_

    [/autoit][autoit][/autoit][autoit]

    Func Close_()
    $string = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    GUISetState(@SW_DISABLE, $gui)
    If $GLanguage = 1 Then
    $msgboxheader = "Warning"
    $msgboxtext = "If you close the SBot then the client will be closed as well (" & $string[1] & ")."
    ElseIf $GLanguage = 2 Then
    $msgboxheader = "Achtung"
    $msgboxtext = "Wird der SBot geschlossen schließt sich auch der Client zu " & $string[1] & "." & @CRLF & "Fortfahren?"
    EndIf
    If MsgBox(4, $msgboxheader, $msgboxtext) = 6 Then
    WinClose(_Str2HWnd($string[2]))
    _GUICtrlListView_DeleteItemsSelected($sbotlist)
    GUICtrlSetData($mapinfo, "")
    If $mapopen = True Then _GDIPlus_GraphicsFillRect($Graphic, 561, 11, 212, 212)
    EndIf
    GUISetState(@SW_ENABLE, $gui)
    WinActivate($gui)
    EndFunc ;==>Close_

    [/autoit][autoit][/autoit][autoit]

    Func Check4DC($soundsleeptime = 0)
    $RegisterSort = False

    [/autoit][autoit][/autoit][autoit]

    For $count = 1 To $sbotnum[0]
    $parts = StringSplit(GUICtrlRead($sbotnum[$count]), "|")
    If $parts[0] >= 2 Then
    $2handle = _Str2HWnd($parts[2])
    If ControlGetText($2handle, "", "[CLASS:Static; INSTANCE:" & $instance_sroserverstatus & "]") = "Disconnected" Then
    GUICtrlSetColor($sbotnum[$count], 0xFF0000)
    If $DC[$count] <> "DC" Then
    $DC[$count] = "DC"
    If FileExists($sound) And $soundsleeptime <= 0 Then SoundPlay($sound)
    If $flashwhendc = "yes" Then WinFlash($gui)
    EndIf
    ElseIf ControlGetText($2handle, "", "[CLASS:Static; INSTANCE:" & $instance_sroserverstatus & "]") = "Connected" Or ControlGetText($2handle, "", "[CLASS:Static; INSTANCE:" & $instance_sroserverstatus & "]") = "Connecting" Then
    GUICtrlSetColor($sbotnum[$count], 0x32CD32)
    Else
    GUICtrlSetColor($sbotnum[$count], 0xFFA500)
    EndIf
    EndIf
    Next
    $soundsleeptime -= 1
    For $count2 = 0 To (_GUICtrlListView_GetItemCount($sbotlist) - 1)
    $newcharname = ControlGetText(_Str2HWnd(_GUICtrlListView_GetItemText($sbotlist, $count2, 1)), "", "[CLASS:Static; INSTANCE:" & $instance_charname & "]")
    If _GUICtrlListView_GetItemText($sbotlist, $count2, 0) <> $newcharname And $newcharname <> "" Then
    _GUICtrlListView_SetItemText($sbotlist, $count2, $newcharname)
    $RegisterSort = True
    EndIf
    Next
    If $RegisterSort = True Then
    _GUICtrlListView_RegisterSortCallBack($sbotlist, True, False)
    _GUICtrlListView_SortItems($sbotlist, 0)
    _GUICtrlListView_UnRegisterSortCallBack($sbotlist)
    EndIf
    EndFunc ;==>Check4DC

    [/autoit]

    Extra

    [autoit]

    #include <GuiListBox.au3>
    #include <FTP.au3>

    [/autoit][autoit][/autoit][autoit]

    Func SetLanguage($lan, $firstuse = 0)
    If $lan = 1 Then ;English
    If $GLanguage <> 1 Then
    GUICtrlSetData($settings, "Settings")
    GUICtrlSetData($ontop, "Set Manager always ontop")
    GUICtrlSetData($ontopenable, "Enable")
    GUICtrlSetData($ontopdisable, "Disable")
    GUICtrlSetData($uploaddata, "Upload data to FTP")
    GUICtrlSetData($uploaddataenable, "Enable")
    GUICtrlSetData($uploaddatadisable, "Disable")
    GUICtrlSetData($generalsettings, "General Settings")
    GUICtrlSetData($check4newversion, "Check for a new version now")
    GUICtrlSetData($checksbotversion, "Check for the latest SBot-Version")
    GUICtrlSetData($info, "General Information")
    GUICtrlSetData($uploadstyle, "Upload standart style")
    ;###########################################################
    GUICtrlSetData($groupcharlist, "SBot Charlist")
    GUICtrlSetData($refresh, "Refresh List")
    GUICtrlSetData($hideall, "Hide all")
    ;###########################################################
    GUICtrlSetData($groupgeneral, "General")
    GUICtrlSetData($labellocation, "Location:")
    GUICtrlSetData($labelsroserver, "Silkroad server status:")
    GUICtrlSetData($labelbotstatus, "Bot status:")
    GUICtrlSetData($starttrain, "Start training")
    GUICtrlSetData($stoptrain, "Stop training")
    GUICtrlSetData($goclientless, "Go clientless")
    If GUICtrlRead($hideshowclient) = "Client zeigen" Then
    GUICtrlSetData($hideshowclient, "Show client")
    ElseIf GUICtrlRead($hideshowclient) = "Client verstecken" Then
    GUICtrlSetData($hideshowclient, "Hide client")
    Else
    GUICtrlSetData($hideshowclient, "...")
    EndIf
    ;###########################################################
    GUICtrlSetData($groupbottingstats, "Botting stats")
    GUICtrlSetData($labeltotaltime, "Total time:")
    GUICtrlSetData($labelxpgained, "XP gained:")
    GUICtrlSetData($labelxpmin, "XP/min:")
    GUICtrlSetData($labelxph, "XP/h:")
    GUICtrlSetData($labelspgained, "SP gained:")
    GUICtrlSetData($labelspmin, "SP/min:")
    GUICtrlSetData($labelsph, "SP/h:")
    GUICtrlSetData($labeldied, "Kills:")
    GUICtrlSetData($resetstats, "Reset stats")
    ;###########################################################
    GUICtrlSetData($ftpuploadlabel, "FTP-Server upload:")
    If GUICtrlRead($showftp) = "Deaktiviert" Then
    GUICtrlSetData($showftp, "Disabled")
    ElseIf GUICtrlRead($showftp) = "Aktiviert" Then
    GUICtrlSetData($showftp, "Enabled")
    Else
    GUICtrlSetData($showftp, "Uploading chardata complete.")
    EndIf
    ;###########################################################
    IniWrite(@ScriptDir & "\images\configuration.ini", "General", "Language", "english")
    $GLanguage = 1
    EndIf
    ElseIf $lan = 2 Then ;German
    If $GLanguage <> 2 Or $firstuse <> 0 Then
    GUICtrlSetData($settings, "Einstellungen")
    GUICtrlSetData($ontop, "Manager immer im Vordergrund")
    GUICtrlSetData($ontopenable, "Aktivieren")
    GUICtrlSetData($ontopdisable, "Deaktivieren")
    GUICtrlSetData($uploaddata, "Chardaten auf FTP laden")
    GUICtrlSetData($uploaddataenable, "Aktivieren")
    GUICtrlSetData($uploaddatadisable, "Deaktivieren")
    GUICtrlSetData($generalsettings, "Allgemeine Einstellungen")
    GUICtrlSetData($check4newversion, "Nach neuer Version suchen")
    GUICtrlSetData($checksbotversion, "Nach der letzten SBot-Version suchen")
    GUICtrlSetData($info, "Allgemeine Informationen")
    GUICtrlSetData($uploadstyle, "Standartstyle uploaden")
    ;###########################################################
    GUICtrlSetData($groupcharlist, "SBot Charliste")
    GUICtrlSetData($refresh, "Liste erneuern")
    GUICtrlSetData($hideall, "Alle verstecken")
    ;###########################################################
    GUICtrlSetData($groupgeneral, "Allgemeines")
    GUICtrlSetData($labellocation, "Standort:")
    GUICtrlSetData($labelsroserver, "Silkroad Serverstatus:")
    GUICtrlSetData($labelbotstatus, "Botstatus:")
    GUICtrlSetData($starttrain, "Bot starten")
    GUICtrlSetData($stoptrain, "Bot stoppen")
    GUICtrlSetData($goclientless, "Clientless gehen")
    If GUICtrlRead($hideshowclient) = "Show client" Then
    GUICtrlSetData($hideshowclient, "Client zeigen")
    ElseIf GUICtrlRead($hideshowclient) = "Hide client" Then
    GUICtrlSetData($hideshowclient, "Client verstecken")
    Else
    GUICtrlSetData($hideshowclient, "...")
    EndIf
    ;###########################################################
    GUICtrlSetData($groupbottingstats, "Botstatus")
    GUICtrlSetData($labeltotaltime, "Botzeit:")
    GUICtrlSetData($labelxpgained, "XP gesammelt:")
    GUICtrlSetData($labelxpmin, "XP/Min:")
    GUICtrlSetData($labelxph, "XP/Std:")
    GUICtrlSetData($labelspgained, "SP gesammelt:")
    GUICtrlSetData($labelspmin, "SP/Min:")
    GUICtrlSetData($labelsph, "SP/Std:")
    GUICtrlSetData($labeldied, "Tode:")
    GUICtrlSetData($resetstats, "Stats zurücksetzen")
    ;###########################################################
    GUICtrlSetData($ftpuploadlabel, "FTP-Server Upload:")
    If GUICtrlRead($showftp) = "Disabled" Then
    GUICtrlSetData($showftp, "Deaktiviert")
    ElseIf GUICtrlRead($showftp) = "Enabled" Then
    GUICtrlSetData($showftp, "Aktiviert")
    Else
    GUICtrlSetData($showftp, "Chardaten erfolgreich hochgeladen.")
    EndIf
    ;###########################################################
    IniWrite(@ScriptDir & "\images\configuration.ini", "General", "Language", "deutsch")
    $GLanguage = 2
    EndIf
    EndIf
    EndFunc ;==>SetLanguage

    [/autoit][autoit][/autoit][autoit]

    Func Refresh_Image()
    $Indices = StringSplit(GUICtrlRead(GUICtrlRead($sbotlist)), "|")
    If $Indices[0] >= 2 Then
    $handle = _Str2HWnd($Indices[2])
    If ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_charname & "]") <> "none" Then
    $zoomrange = (GUICtrlRead($zoom) + 10) * 8.56

    [/autoit][autoit][/autoit][autoit]

    $xcoord = ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_x & "]")
    $ycoord = ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_y & "]")
    _GDIPlus_GraphicsFillRect($Graphic, 561, 11, 212, 212)
    $loc = GUICtrlRead($location)
    If $loc = "JG Cave (lvl 1)" Then
    $PixelX = Round(($xcoord + 24914) / 4.5) ;24914 ist xmin der B1-map, 4.5 ist die anzahl koordinaten pro pixel
    $PixelY = Round((-$ycoord + 7716) / 4.5) ;7716'', 4.5 ''
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $maptomb1, $PixelX - $zoomrange / 2, $PixelY - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "Ch` in Tomb B1 X: " & $xcoord & " Y: " & $ycoord)
    ElseIf $loc = "JG Cave (lvl 2)" Then
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $maptomb2, Round(($xcoord + 26888) / 12) - $zoomrange / 2, Round((-$ycoord + 7874) / 12) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "Ch` in Tomb B2 Camp" & GetTombCamp($xcoord, $ycoord) & " X: " & $xcoord & " Y: " & $ycoord)
    ElseIf $loc = "JG Cave (lvl 3)" Then
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $maptomb3, Round(($xcoord + 27300) / 12) - $zoomrange / 2, Round((-$ycoord + 9220) / 12) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "Ch` in Tomb B3 X: " & $xcoord & " Y: " & $ycoord)
    ElseIf $loc = "JG Cave (lvl 4)" Then
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $maptomb4, Round(($xcoord + 27080) / 12) - $zoomrange / 2, Round((-$ycoord + 9050) / 12) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "Ch` in Tomb B4 X: " & $xcoord & " Y: " & $ycoord)
    ElseIf $loc = "JG Cave (lvl 5)" Then
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $worldmap, Round((7225 + 13248) / 6) - $zoomrange / 2, Round((-2015 + 4218) / 6) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "Ch` in Tomb B5 X: " & $xcoord & " Y: " & $ycoord)
    ElseIf $loc = "JG Cave (lvl 6)" Then
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $worldmap, Round((7225 + 13248) / 6) - $zoomrange / 2, Round((-2015 + 4218) / 6) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "Ch` in Tomb B6 X: " & $xcoord & " Y: " & $ycoord)
    ElseIf $loc = "DW Cave" Then
    ;_GDIPlus_GraphicsDrawImageRectRect($Graphic, $mapdhcave1, Round(($xcoord + 25921.5) / 0.75) - $zoomrange / 2, Round((-$ycoord + 7105) / 0.75) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $wmap, Round((2505 + 13248) / 6) - $zoomrange / 2, Round((-2670 + 4218) / 6) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    GUICtrlSetData($mapinfo, "DW Cave X: " & $xcoord & " Y: " & $ycoord)

    [/autoit][autoit][/autoit][autoit]

    Else
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $worldmap, Round(($xcoord + 13248) / 6) - $zoomrange / 2, Round((-$ycoord + 4218) / 6) - $zoomrange / 2, $zoomrange - 2, $zoomrange - 2, 561, 11, 212, 212)
    If $GLanguage = 1 Then GUICtrlSetData($mapinfo, "Worldmap " & ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_location & "]") & " X: " & $xcoord & " Y: " & $ycoord)
    If $GLanguage = 2 Then GUICtrlSetData($mapinfo, "Weltkarte " & ControlGetText($handle, "", "[CLASS:Static; INSTANCE:" & $instance_location & "]") & " X: " & $xcoord & " Y: " & $ycoord)
    EndIf
    _GDIPlus_GraphicsDrawImageRectRect($Graphic, $mappoint, 0, 0, 12, 12, 660, 112, 12, 12)
    Else
    _GDIPlus_GraphicsFillRect($Graphic, 561, 11, 212, 212)
    If $GLanguage = 1 Then GUICtrlSetData($mapinfo, "No Char connected")
    If $GLanguage = 2 Then GUICtrlSetData($mapinfo, "Kein Char eingeloggt")
    EndIf
    EndIf
    EndFunc ;==>Refresh_Image

    [/autoit][autoit][/autoit][autoit]

    Func StyleGen()
    GUISetState(@SW_DISABLE, $gui)
    GUICtrlSetState($mapinfo, 32);Hide
    GUICtrlSetState($showftp, 32);Hide
    GUICtrlSetState($ftpuploadstatus, 16);Show
    If $GLanguage = 1 Then GUICtrlSetData($ftpuploadstatus, 'Manager stopped! Uploading stylefile...')
    If $GLanguage = 2 Then GUICtrlSetData($ftpuploadstatus, 'Manager gestoppt! Styledatei wird hochgeladen...')
    $session = _FTPOpen('FTP')
    $connect = _FTPConnect($session, $botftpserver, $botftpuser, $botftppw, $botftpport)
    _FTPMakeDir($connect, $botftpdir)
    ;##################
    FileWrite(@TempDir & "\styles.css", 'h2 {' & @CRLF & @TAB & 'text-align: center;' & @CRLF & '}' & @CRLF & 'h1 {' & @CRLF & @TAB & 'text-align: center;' & @CRLF & '}' & @CRLF & 'table {' & @CRLF & @TAB & 'margin-top: 25px;' & @CRLF & @TAB & 'background-color: #313131;' & @CRLF & @TAB & 'empty-cells: show;' & @CRLF & '}' & @CRLF & 'body {' & @CRLF & @TAB & 'background-color: #242424;' & @CRLF & @TAB & 'color: #FFFFFF;' & @CRLF & '}' & @CRLF & '.titel {' & @CRLF & @TAB & 'font-weight: bold;' & @CRLF & '}')
    ;##################
    _FtpPutFile($connect, @TempDir & "\styles.css", $botftpdir & "/styles.css")
    FileDelete(@TempDir & "\styles.css")
    _FTPClose($session)
    GUICtrlSetState($ftpuploadstatus, 32);Hide
    GUICtrlSetState($mapinfo, 16);Show
    GUICtrlSetState($showftp, 16);Show
    GUISetState(@SW_ENABLE, $gui)
    EndFunc ;==>StyleGen

    [/autoit][autoit][/autoit][autoit]

    Func FTP_Upload()
    If $botftpserver = "" Or $botftpuser = "" Or $botftppw = "" Then
    If $GLanguage = 1 Then
    MsgBox(48, "FTP Error", 'Please go to "Settings -> General Settings" to check your settings.' & @CRLF & "Uploading will stop.")
    ElseIf $GLanguage = 2 Then
    MsgBox(48, "FTP Fehler", 'Bitte ändere deine Einstellungen für den FTP unter "Einstellungen -> Allgemeine Einstellungen".' & @CRLF & "Hochladen gestoppt.")
    EndIf
    $ftp = 0
    If $GLanguage = 1 Then
    GUICtrlSetData($showftp, "Disabled")
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($showftp, "Deaktiviert")
    EndIf
    GUICtrlSetColor($showftp, 0xFF0000)
    GUICtrlSetState($uploaddata, 4)
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "UseFTP", "no")
    Else
    GUICtrlSetState($mapinfo, 32);Hide
    GUICtrlSetState($showftp, 32);Hide
    GUICtrlSetState($ftpuploadstatus, 16);Show
    If $GLanguage = 1 Then
    GUICtrlSetData($ftpuploadstatus, 'Manager stopped! Uploading chardata to "' & $botftpserver & $botftpdir & '"')
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($ftpuploadstatus, 'Manager gestoppt! Chardaten werden hochgeladen zu "' & $botftpserver & $botftpdir & '"')
    EndIf
    $session = _FTPOpen('FTP')
    $connect = _FTPConnect($session, $botftpserver, $botftpuser, $botftppw, $botftpport)
    _FTPMakeDir($connect, $botftpdir)
    For $chars = 1 To _GUICtrlListView_GetItemCount($sbotlist)
    $sbotcharname = _GUICtrlListView_GetItemText($sbotlist, $chars - 1, 0)
    If $sbotcharname <> "none" And $sbotcharname <> "" Then
    $sbotwinhandle = _Str2HWnd(_GUICtrlListView_GetItemText($sbotlist, $chars - 1, 1))
    $mem = _MemoryOpen(WinGetProcess($sbotwinhandle))
    $curhp = _MemoryRead($offset_curhp, $mem)
    $maxhp = _MemoryRead($offset_maxhp, $mem)
    $curmp = _MemoryRead($offset_curmp, $mem)
    $maxmp = _MemoryRead($offset_maxmp, $mem)
    $curexp = _MemoryRead($offset_curexp, $mem)
    $charlevel = ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_level & "]")
    _MemoryClose($mem)
    ;html erstellen
    FileWrite(@TempDir & "\" & $sbotcharname & ".htm", '<html><head><title>' & $sbotcharname & '</title><link rel="Stylesheet" type="text/css" href="styles.css" /><style type="text/css">.titel{width: 150px;}.wert {width: 75px;}</style></head><body><br><h1 align="center">' & $sbotcharname & '</h1><table class="stats" cellspacing="0" align="center" border="1"><tr><td colspan="2"><h2>General</h2></td><td >&nbsp&nbsp&nbsp;</td><td colspan="2"><h2>Botting stats</h2></td></tr><tr><td class="titel">Level:</td><td class="style1">' & $charlevel & '</td ><td >&nbsp&nbsp&nbsp;</td><td class="titel">Total Time:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_totaltime & "]") & '</td></tr><tr><td class="titel">SP:</td><td class="style1">' & _StringAddThousandsSep(ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_sp & "]"), ".") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">Kills:</td><td> ' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_kills & "]") & '</td></tr><tr><td class="titel">HP:</td><td class="style1">' & $curhp & '/' & $maxhp & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">XP gained:</td><td >' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_xpgained & "]") & '</td></tr><tr><td class="titel">MP:</td><td class="style1">' & $curmp & '/' & $maxmp & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">XP/min:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_xpmin & "]") & '</td></tr><tr><td class="titel">EXP:</td><td class="style1">' & Round($curexp / _NextExp($charlevel) * 100, 2) & '%</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">XP/h:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_xphour & "]") & '</td></tr><tr><td class="titel">X:</td><td class="style1">' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_x & "]") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">SP gained:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_spgained & "]") & '</td></tr><tr><td class="titel">Y:</td><td class="style1">' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_y & "]") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">SP/min:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_spmin & "]") & '</td></tr><tr><td class="titel">Gold:</td><td class="style1">' & _StringAddThousandsSep(ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_gold & "]"), ".") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">SP/h:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_sphour & "]") & '</td></tr><tr><td class="titel">Location:</td><td class="style1">' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_location & "]") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">Died:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_died & "]") & '</td></tr><tr><td class="titel">SRO Server Status:</td><td class="style1">' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_sroserverstatus & "]") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">Itemdrops:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_itemdrops & "]") & '</td></tr><tr><td class="titel">Bot Status:</td><td class="style1">' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_botstatus & "]") & '</td><td >&nbsp&nbsp&nbsp;</td><td class="titel">Gold/loop:</td><td>' & ControlGetText($sbotwinhandle, "", "[CLASS:Static; INSTANCE:" & $instance_goldloop & "]") & '</td></tr><tr><td colspan="5" class="titel">Last time updated:</td></tr><tr><td colspan="2">' & @MDAY & '.' & @MON & '.' & @YEAR & ' (DD.MM.YYYY)</td><td >&nbsp&nbsp&nbsp;</td><td colspan="2">' & @HOUR & ':' & @MIN & ':' & @SEC & ' (HH:MM:SS)</td></tr></table></body></html>')
    _FtpPutFile($connect, @TempDir & "\" & $sbotcharname & ".htm", $botftpdir & "/" & $sbotcharname & ".htm")
    FileDelete(@TempDir & "\" & $sbotcharname & ".htm")
    EndIf
    Next
    _FTPClose($session)
    $uploadingcomplete = 1
    If $GLanguage = 1 Then
    GUICtrlSetData($showftp, "Uploading chardata complete.")
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($showftp, "Chardaten erfolgreich hochgeladen.")
    EndIf
    GUICtrlSetState($ftpuploadstatus, 32);Hide
    GUICtrlSetState($mapinfo, 16);Show
    GUICtrlSetState($showftp, 16);Show
    EndIf
    EndFunc ;==>FTP_Upload

    [/autoit][autoit][/autoit][autoit]

    Func SettingGUI()
    Opt("GUIOnEventMode", 0)
    GUISetState(@SW_DISABLE, $gui)
    GUISetState(@SW_HIDE, $gui)
    TrayItemSetState($trayshowhide, 128)
    DirCreate(@ScriptDir & "\images")

    [/autoit][autoit][/autoit][autoit]

    $settinggui = GUICreate("Settings", 520, 260)
    GUISetBkColor(0x000000)

    [/autoit][autoit][/autoit][autoit]

    $cancel = GUICtrlCreateButton("Cancel", 263, 232, 247, 20)
    $save = GUICtrlCreateButton("Save", 10, 232, 247, 20)

    [/autoit][autoit][/autoit][autoit]

    ;Groups
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $groupdelays = GUICtrlCreateGroup("Delays", 10, 10, 260, 70)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $groupdisconnect = GUICtrlCreateGroup("Disconnect", 10, 90, 260, 75)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateGroup("FTP", 280, 10, 230, 155)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $groupgeneral2 = GUICtrlCreateGroup("General", 10, 175, 500, 50)
    GUICtrlSetColor(-1, 0xFFFFFF)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)
    ;Delays
    $delaylabels = GUICtrlCreateLabel("Refreshing time for Labels:", 20, 30)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $delayminimap = GUICtrlCreateLabel("Refreshing time for Minimap:", 20, 50)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $labeltime = GUICtrlCreateInput($labeldelay, 160, 30, 40, 17, BitOR(0x0001, 0x2000))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $maptime = GUICtrlCreateInput($mapdelay, 160, 50, 40, 17, BitOR(0x0001, 0x2000))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("ms", 205, 30)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("ms", 205, 50)
    GUICtrlSetColor(-1, 0xFFFFFF)
    ;DC
    GUICtrlCreateLabel("Sound:", 20, 115)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $newsound = GUICtrlCreateInput($sound, 58, 113, 146, 17, 0x0080)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $search = GUICtrlCreateButton("...", 206, 112, 20, 19)
    $play = GUICtrlCreateButton("Play", 226, 112, 40, 19)
    $winflash = GUICtrlCreateCheckbox("", 20, 137, 20, 20)
    $winflashlabel = GUICtrlCreateLabel("Flash Window when a Char disconnected", 40, 140, 225)
    If $flashwhendc = "yes" Then GUICtrlSetState($winflash, 1)
    GUICtrlSetColor(-1, 0xFFFFFF)
    ;FTP
    GUICtrlCreateLabel("Server:", 290, 33)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Username:", 290, 55)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Passwort:", 290, 77)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlCreateLabel("Port (Standard 21):", 290, 98)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $botftpdirlabel = GUICtrlCreateLabel('Directory on FTP-Server (Example: "/chars")', 290, 120)
    GUICtrlSetColor(-1, 0xFFFFFF)

    [/autoit][autoit][/autoit][autoit]

    $ftpserwer = GUICtrlCreateInput($botftpserver, 350, 30, 150, 19, BitOR(0x0001, 0x0080))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $ftpuser = GUICtrlCreateInput($botftpuser, 350, 52, 150, 19, 0x0001)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $ftppass = GUICtrlCreateInput($botftppw, 350, 74, 150, 19, BitOR(0x0020, 0x0001))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $ftpport = GUICtrlCreateInput($botftpport, 390, 95, 110, 19, BitOR(0x2000, 0x0001))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $ftpdir = GUICtrlCreateInput($botftpdir, 290, 136, 210, 19, BitOR(0x0001, 0x0080))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    ;Update
    $check4newver = GUICtrlCreateCheckbox("", 20, 195, 20, 20)
    $check4newverlabel = GUICtrlCreateLabel("Always check for a new version on startup", 40, 198)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $setlanguagelabel = GUICtrlCreateLabel("Language:" , 310, 198)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $setlanguage = GUICtrlCreateCombo("Deutsch",370,194, 70, "", 0x0003)
    GUICtrlSetData(-1, "English")
    If $update = 1 Then GUICtrlSetState($check4newver, 1)

    [/autoit][autoit][/autoit][autoit]

    If $GLanguage = 1 Then
    GUICtrlSetData($setlanguage, "English")
    ElseIf $GLanguage = 2 Then
    GUICtrlSetData($setlanguage, "Deutsch")
    GUICtrlSetData($botftpdirlabel, 'Verzeichnis auf dem FTP-Server (Bsp: /chars)')
    GUICtrlSetData($groupgeneral2, "Allgemeines")
    GUICtrlSetData($groupdelays, "Wartezeiten")
    GUICtrlSetData($groupdisconnect, "Disconnect Einstellungen")
    GUICtrlSetData($check4newverlabel, "Beim Starten immer auf neue Version prüfen")
    GUICtrlSetData($setlanguagelabel, "Sprache:")
    GUICtrlSetData($play, "Spielen")
    GUICtrlSetData($winflashlabel, "Bei DC eines Chars Manager aufblinken lassen")
    GUICtrlSetData($delaylabels, "Wartezeiten für Labels:")
    GUICtrlSetData($delayminimap, "Wartezeit für die Minimap:")
    GUICtrlSetData($save, "Speichern")
    GUICtrlSetData($cancel, "Abbrechen")
    WinSetTitle($settinggui, "", "Allgemeine Einstellungen")
    EndIf
    GUISetState(@SW_SHOW, $settinggui)

    [/autoit][autoit][/autoit][autoit]

    While 1
    If Not FileExists(GUICtrlRead($newsound)) Then
    If GUICtrlGetState($play) = 80 Then GUICtrlSetState($play, 128)
    Else
    If GUICtrlGetState($play) = 144 Then
    If StringRight(GUICtrlRead($newsound), 4) = ".wav" Or StringRight(GUICtrlRead($newsound), 4) = ".mp3" Then GUICtrlSetState($play, 64)
    EndIf
    EndIf

    [/autoit][autoit][/autoit][autoit]

    Switch GUIGetMsg($settinggui)
    Case - 3
    ExitLoop
    Case $search
    $sound = FileOpenDialog("Choose a soundfile", "", "Soundfiles (*.mp3;*.wav)", 1)
    If Not @error Then GUICtrlSetData($newsound, $sound)
    Case $play
    SoundPlay(GUICtrlRead($newsound))
    Case $winflashlabel
    If GUICtrlRead($winflash) = 1 Then
    GUICtrlSetState($winflash, 4)
    Else
    GUICtrlSetState($winflash, 1)
    EndIf
    Case $check4newverlabel
    If GUICtrlRead($check4newver) = 1 Then
    GUICtrlSetState($check4newver, 4)
    Else
    GUICtrlSetState($check4newver, 1)
    EndIf
    Case $cancel
    ExitLoop
    Case $save
    ;Delays
    IniWrite(@ScriptDir & "\images\configuration.ini", "Delaytimes", "Labels", GUICtrlRead($labeltime))
    IniWrite(@ScriptDir & "\images\configuration.ini", "Delaytimes", "Minimap", GUICtrlRead($maptime))
    ;DC
    IniWrite(@ScriptDir & "\images\configuration.ini", "DC", "Sound", GUICtrlRead($newsound))
    $sound = GUICtrlRead($newsound)
    If GUICtrlRead($winflash) = 1 Then
    IniWrite(@ScriptDir & "\images\configuration.ini", "DC", "WinFlash", "yes")
    $flashwhendc = "yes"
    Else
    IniWrite(@ScriptDir & "\images\configuration.ini", "DC", "WinFlash", "no")
    $flashwhendc = "no"
    EndIf
    ;FTP
    $serwer = GUICtrlRead($ftpserwer)
    $dir = GUICtrlRead($ftpdir)
    If StringRight($serwer, 1) = "/" Then $serwer = StringTrimRight($serwer, 1)
    If StringLeft($dir, 1) <> "/" Then $dir = "/" & $dir
    If StringRight($dir, 1) = "/" Then $dir = StringTrimRight($dir, 1)
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "server", $serwer)
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "username", GUICtrlRead($ftpuser))
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "passwort", GUICtrlRead($ftppass))
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "port", GUICtrlRead($ftpport))
    IniWrite(@ScriptDir & "\images\configuration.ini", "FTP", "directory", $dir)
    $botftpserver = $serwer
    $botftpuser = GUICtrlRead($ftpuser)
    $botftppw = GUICtrlRead($ftppass)
    $botftpport = GUICtrlRead($ftpport)
    $botftpdir = $dir
    ;Update
    If GUICtrlRead($check4newver) = 1 Then
    IniWrite(@ScriptDir & "\images\configuration.ini", "Updatecheck", "CheckOnStartup", "yes")
    $update = 1
    Else
    IniWrite(@ScriptDir & "\images\configuration.ini", "Updatecheck", "CheckOnStartup", "no")
    $update = 0
    EndIf
    ;Exit
    ExitLoop
    EndSwitch
    Sleep(10)
    WEnd
    If GUICtrlRead($setlanguage) = "English" Then
    SetLanguage(1)
    ElseIf GUICtrlRead($setlanguage) = "Deutsch" Then
    SetLanguage(2)
    Else
    SetLanguage(1)
    EndIf
    $curmapdelay = GUICtrlRead($maptime)
    If $curmapdelay < 2000 Then
    Global $mapdelay = 2000
    Else
    Global $mapdelay = $curmapdelay
    EndIf
    $curlabeldelay = GUICtrlRead($labeltime)
    If $curlabeldelay < 200 Then
    Global $labeldelay = 200
    Else
    Global $labeldelay = $curlabeldelay
    EndIf

    [/autoit][autoit][/autoit][autoit]

    GUIDelete($settinggui)
    Sleep(500)
    Opt("GUIOnEventMode", 1)
    GUISetState(@SW_ENABLE, $gui)
    GUISetState(@SW_SHOW, $gui)
    If $mapopen = True Then Refresh_Image()
    TrayItemSetState($trayshowhide, 64)
    EndFunc ;==>SettingGUI

    [/autoit][autoit][/autoit][autoit]

    Func _Check4NewVersion()
    Dim $changelogfile

    [/autoit][autoit][/autoit][autoit]

    $oldversion = $version
    $ftpserver = "s3cret.s3.ohost.de"
    $scriptfile = "http://s3cret.s3.ohost.de/SBot Manager/SBot Manager.au3"
    If $GLanguage = 1 Then $changelogfile = "http://s3cret.s3.ohost.de/SBot Manager/changelog/changelog_en.htm"
    If $GLanguage = 2 Then $changelogfile = "http://s3cret.s3.ohost.de/SBot Manager/changelog/changelog_de.htm"
    $sbotmanager = "http://s3cret.s3.ohost.de/SBot Manager/SBot Manager.exe"
    If Ping($ftpserver) = 0 Then
    If $GLanguage = 1 Then MsgBox(48, "Connection timeout", "You either do not have a connection to the world wide web or the server is currently down.")
    If $GLanguage = 2 Then MsgBox(48, "Verbindungsfehler", "Es besteht entweder keine Verbindung zum Internet oder der Server ist momentan nicht erreichbar.")
    Else
    $newversion = StringLeft(StringTrimLeft(_INetGetSource($scriptfile), 12), 4)

    [/autoit][autoit][/autoit][autoit]

    If $oldversion <> $newversion Then

    [/autoit][autoit][/autoit][autoit]

    Opt("GUIOnEventMode", 0)
    If $startup <> 1 Then
    GUISetState(@SW_DISABLE, $gui)
    GUISetState(@SW_HIDE, $gui)
    TrayItemSetState($trayshowhide, 128)
    EndIf

    [/autoit][autoit][/autoit][autoit]

    $updategui = GUICreate("SBot Manager - Update", 500, 305)

    [/autoit][autoit][/autoit][autoit]

    GUISetBkColor(0x000000, $updategui)
    $labelnewversion = GUICtrlCreateLabel("There is a new version available (old: " & $oldversion & " | new: " & $newversion & ").", 10, 10, 480)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $listchangelog = GUICtrlCreateList("", 10, 30, 480, 240, BitOR(0x4000, 0x0100, 0x00200000))
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetColor(-1, 0xFFFFFF)
    $download = GUICtrlCreateButton("Download now", 10, 275, 235, 20)
    $cancel = GUICtrlCreateButton("Cancel", 255, 275, 235, 20)

    [/autoit][autoit][/autoit][autoit]

    InetGet($changelogfile, @TempDir & "\changelogsbotmanager.txt")
    $max = _FileCountLines(@TempDir & "\changelogsbotmanager.txt") - 1
    For $a = 1 To $max
    $FileLine = StringReplace(FileReadLine(@TempDir & "\changelogsbotmanager.txt", $a + 1), "<br>", "")
    If $a = $max Then
    If $GLanguage = 1 Then $FileLine = "- Code optimized"
    If $GLanguage = 2 Then $FileLine = "- Verbesserungen am Code"
    EndIf
    _GUICtrlListBox_AddString($listchangelog, $FileLine)
    Next
    FileDelete(@TempDir & "\changelogsbotmanager.txt")

    [/autoit][autoit][/autoit][autoit]

    If $GLanguage = 2 Then
    WinSetTitle($updategui, "", "SBot Manager - Neue Version")
    GUICtrlSetData($labelnewversion, "Es ist eine neue Version verfügbar (alte: " & $oldversion & " | neue: " & $newversion & ").")
    GUICtrlSetData($download, "Jetzt herunterladen")
    GUICtrlSetData($cancel, "Abbrechen")
    EndIf

    [/autoit][autoit][/autoit][autoit]

    GUISetState(@SW_SHOW, $updategui)
    While 1
    Switch GUIGetMsg($updategui)
    Case $cancel
    ExitLoop
    Case $download
    ShellExecute($sbotmanager)
    GUIDelete($updategui)
    If $startup = 1 Then
    Exit
    Else
    _Exit()
    EndIf
    Case - 3
    ExitLoop
    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit]

    GUIDelete($updategui)
    Sleep(500)

    [/autoit][autoit][/autoit][autoit]

    Opt("GUIOnEventMode", 1)
    If $startup <> 1 Then
    GUISetState(@SW_ENABLE, $gui)
    GUISetState(@SW_SHOW, $gui)
    If $mapopen = True Then Refresh_Image()
    TrayItemSetState($trayshowhide, 64)
    EndIf
    Else
    If $startup <> 1 Then
    If $GLanguage = 1 Then MsgBox(64, "No update", "You are using the latest version (v" & $oldversion & ").")
    If $GLanguage = 2 Then MsgBox(64, "Keine neue Version", "Es ist keine neue Version verfügbar." & @CRLF & "Neueste Version: v" & $oldversion)
    EndIf
    EndIf
    EndIf
    EndFunc ;==>_Check4NewVersion

    [/autoit][autoit][/autoit][autoit]

    Func _Str2HWnd($string) ;author Prog@ndy
    Local $HWND = DllStructCreate("HWND")
    DllStructSetData($HWND, 1, $string)
    Return DllStructGetData($HWND, 1)
    EndFunc ;==>_Str2HWnd

    [/autoit][autoit][/autoit][autoit]

    Func _NextExp($level)
    Switch $level
    Case 1
    Return 118
    Case 2
    Return 470
    Case 3
    Return 1058
    Case 4
    Return 1880
    Case 5
    Return 2938
    Case 6
    Return 5640
    Case 7
    Return 9048
    Case 8
    Return 13160
    Case 9
    Return 17978
    Case 10
    Return 23500
    Case 11
    Return 34898
    Case 12
    Return 47940
    Case 13
    Return 62628
    Case 14
    Return 78960
    Case 15
    Return 96938
    Case 16
    Return 127849
    Case 17
    Return 161798
    Case 18
    Return 198810
    Case 19
    Return 238878
    Case 20
    Return 282000
    Case 21
    Return 351231
    Case 22
    Return 427755
    Case 23
    Return 512196
    Case 24
    Return 605232
    Case 25
    Return 707587
    Case 26
    Return 820046
    Case 27
    Return 943453
    Case 28
    Return 1078717
    Case 29
    Return 1226815
    Case 30
    Return 1388803
    Case 31
    Return 1595229
    Case 32
    Return 1818827
    Case 33
    Return 2060796
    Case 34
    Return 2322414
    Case 35
    Return 2605043
    Case 36
    Return 2910129
    Case 37
    Return 3239210
    Case 38
    Return 3593924
    Case 39
    Return 3976012
    Case 40
    Return 4387323
    Case 41
    Return 4869381
    Case 42
    Return 5382982
    Case 43
    Return 5929882
    Case 44
    Return 6511920
    Case 45
    Return 7131034
    Case 46
    Return 7789258
    Case 47
    Return 8488730
    Case 48
    Return 9231697
    Case 49
    Return 10020519
    Case 50
    Return 10857676
    Case 51
    Return 11857343
    Case 52
    Return 12913686
    Case 53
    Return 14029449
    Case 54
    Return 15207495
    Case 55
    Return 16450818
    Case 56
    Return 17762545
    Case 57
    Return 19145941
    Case 58
    Return 20604414
    Case 59
    Return 22141527
    Case 60
    Return 23760997
    Case 61
    Return 25933410
    Case 62
    Return 28214785
    Case 63
    Return 30609702
    Case 64
    Return 39747505
    Case 65
    Return 51493509
    Case 66
    Return 55474876
    Case 67
    Return 59648780
    Case 68
    Return 64023195
    Case 69
    Return 68606389
    Case 70
    Return 73406955
    Case 71
    Return 79345238
    Case 72
    Return 85573753
    Case 73
    Return 92104572
    Case 74
    Return 98950215
    Case 75
    Return 106123703
    Case 76
    Return 113638552
    Case 77
    Return 121508783
    Case 78
    Return 129748946
    Case 79
    Return 138374168
    Case 80
    Return 147400127
    Case 81
    Return 158227752
    Case 82
    Return 169572387
    Case 83
    Return 181455292
    Case 84
    Return 193898546
    Case 85
    Return 206558723
    Case 86
    Return 220558723
    Case 87
    Return 234824141
    Case 88
    Return 249746989
    Case 89
    Return 265353867
    Case 90
    Return 281672373
    Case 91
    Return 369337595
    Case 92
    Return 473538898
    Case 93
    Return 430636533
    Case 94
    Return 688586209
    Case 95
    Return 686078166
    Case 96
    Return 630281734
    Case 97
    Return 843249355
    Case 98
    Return 963955058
    Case 99
    Return 1322659532
    Case 100
    Return 1406035568
    Case 101
    Return 1507651756
    Case 102
    Return 1614099432
    Case 103
    Return 1725577160
    Case 104
    Return 1842290785
    Case 105
    Return 1964454143
    Case 106
    Return 2092289330
    Case 107
    Return 2226026602
    Case 108
    Return 2365904969
    Case 109
    Return 2512172674
    Case 110
    Return 2665087076
    Case 111
    Return 2850768781
    Case 112
    Return 3045192767
    Case 113
    Return 3248716461
    Case 114
    Return 3461711006
    Case 115
    Return 3684561209
    Case 116
    Return 3962623419
    Case 117
    Return 4254053422
    Case 118
    Return 4559402688
    Case 119
    Return 4879244274
    Case 120
    Return 5214172680
    Case 121
    Return 5651667517
    Case 122
    Return 6110719303
    Case 123
    Return 6592227598
    Case 124
    Return 7097126521
    Case 125
    Return 7626386625
    Case 126
    Return 8181014569
    Case 127
    Return 8762056543
    Case 128
    Return 9370597975
    Case 129
    Return 10007766416
    Case 130
    Return 10674731122
    Case 131
    Return 11839645448
    Case 132
    Return 13064847484
    Case 133
    Return 14352905686
    Case 134
    Return 15706489007
    Case 135
    Return 17128369152
    Case 136
    Return 21327974495
    Case 137
    Return 25764141377
    Case 138
    Return 30447283657
    Case 139
    Return 35388227098
    Case 140
    Return 40598223991
    EndSwitch
    EndFunc ;==>_NextExp

    [/autoit][autoit][/autoit][autoit]

    Func GetTombCamp($KoordX, $KoordY)
    If $KoordX > -26230 And $KoordX < -25720 Then
    If $KoordY < 6580 Then
    Return 11
    ElseIf $KoordY > 6580 And $KoordY < 7170 Then
    Return 10
    ElseIf $KoordY > 7170 Then
    Return 1
    EndIf
    ElseIf $KoordX > -25720 And $KoordX < -25030 Then
    If $KoordY < 6580 Then
    Return 12
    ElseIf $KoordY > 6580 And $KoordY < 7170 Then
    Return 9
    ElseIf $KoordY > 7170 Then
    Return 2
    EndIf
    ElseIf $KoordX > -25030 And $KoordX < -24350 Then
    If $KoordY < 6580 Then
    Return 13
    ElseIf $KoordY > 6580 And $KoordY < 7170 Then
    Return 8
    ElseIf $KoordY > 7170 Then
    Return 3
    EndIf
    ElseIf $KoordX > -24350 And $KoordX < -23810 Then
    If $KoordY < 6580 Then
    Return 14
    ElseIf $KoordY > 6580 And $KoordY < 7170 Then
    Return 7
    ElseIf $KoordY > 7170 Then
    Return 4
    EndIf
    ElseIf $KoordX > -23810 And $KoordX < -23300 Then
    If $KoordY < 6580 Then
    Return 15
    ElseIf $KoordY > 6580 And $KoordY < 7170 Then
    Return 6
    ElseIf $KoordY > 7170 Then
    Return 5
    EndIf
    ElseIf $KoordX > -23300 Then
    If $KoordY < 6580 Then Return 16
    EndIf
    EndFunc ;==>GetTombCamp

    [/autoit][autoit][/autoit][autoit]

    ; Author ........: Tylo <tylo at start dot no>
    ; Modified.......: Xenobiologist, Gary
    Func _FileCountLines($sFilePath)
    ;~ Local $N = FileGetSize($sFilePath) - 1
    ;~ If @error Or $N = -1 Then Return 0
    ;~ Return StringLen(StringAddCR(FileRead($sFilePath, $N))) - $N + 1
    Local $hFile, $sFileContent, $aTmp
    $hFile = FileOpen($sFilePath, 0)
    If $hFile = -1 Then Return SetError(1, 0, 0)
    $sFileContent = StringStripWS(FileRead($hFile), 2)
    FileClose($hFile)
    If StringInStr($sFileContent, @LF) Then
    $aTmp = StringSplit(StringStripCR($sFileContent), @LF)
    ElseIf StringInStr($sFileContent, @CR) Then
    $aTmp = StringSplit($sFileContent, @CR)
    Else
    If StringLen($sFileContent) Then
    Return 1
    Else
    Return SetError(2, 0, 0)
    EndIf
    EndIf
    Return $aTmp[0]
    EndFunc ;==>_FileCountLines

    [/autoit][autoit][/autoit][autoit]

    ; Author ........: SmOke_N (orignal _StringAddComma)
    ; Modified.......: Valik (complete re-write, new function name)
    Func _StringAddThousandsSep($sString, $sThousands = ",", $sDecimal = ".")
    Local $sResult = "" ; Force string
    Local $aNumber = StringRegExp($sString, "(\d+)\D?(\d*)", 1)
    If UBound($aNumber) = 2 Then
    Local $sLeft = $aNumber[0]
    While StringLen($sLeft)
    $sResult = $sThousands & StringRight($sLeft, 3) & $sResult
    $sLeft = StringTrimRight($sLeft, 3)
    WEnd
    $sResult = StringTrimLeft($sResult, 1) ; Strip leading thousands separator
    If $aNumber[1] <> "" Then $sResult &= $sDecimal & $aNumber[1]
    EndIf
    Return $sResult
    EndFunc ;==>_StringAddThousandsSep

    [/autoit][autoit][/autoit][autoit]

    Global $Debug_S = False
    Global Const $TWM_USER = 0x400 ; WM_USER
    Global Const $TBM_SETTICFREQ = ($TWM_USER + 20)
    ; Author ........: Gary Frost (gafrost)
    Func _GUICtrlSlider_SetTicFreq($HWND, $iFreg)
    If $Debug_S Then _GUICtrlSlider_ValidateClassName($HWND)
    If Not IsHWnd($HWND) Then $HWND = GUICtrlGetHandle($HWND)

    [/autoit][autoit][/autoit][autoit]

    _SendMessage($HWND, $TBM_SETTICFREQ, $iFreg)
    EndFunc ;==>_GUICtrlSlider_SetTicFreq

    [/autoit]

    Mem (was auch immer ^^)

    [autoit]

    #include<Constants.au3>
    #include<SecurityConstants.au3>
    #include-once
    #region _Memory
    ;==================================================================================
    ; AutoIt Version: 3.1.127 (beta)
    ; Language: English
    ; Platform: All Windows
    ; Author: Nomad
    ; Requirements: These functions will only work with beta.
    ;==================================================================================
    ; Credits: wOuter - These functions are based on his original _Mem() functions.
    ; But they are easier to comprehend and more reliable. These
    ; functions are in no way a direct copy of his functions. His
    ; functions only provided a foundation from which these evolved.
    ;==================================================================================
    ;
    ; Functions:
    ;
    ;==================================================================================
    ; Function: _MemoryOpen($iv_Pid[, $iv_DesiredAccess[, $iv_InheritHandle]])
    ; Description: Opens a process and enables all possible access rights to the
    ; process. The Process ID of the process is used to specify which
    ; process to open. You must call this function before calling
    ; _MemoryClose(), _MemoryRead(), or _MemoryWrite().
    ; Parameter(s): $iv_Pid - The Process ID of the program you want to open.
    ; $iv_DesiredAccess - (optional) Set to 0x1F0FFF by default, which
    ; enables all possible access rights to the
    ; process specified by the Process ID.
    ; $iv_InheritHandle - (optional) If this value is TRUE, all processes
    ; created by this process will inherit the access
    ; handle. Set to 1 (TRUE) by default. Set to 0
    ; if you want it FALSE.
    ; Requirement(s): None.
    ; Return Value(s): On Success - Returns an array containing the Dll handle and an
    ; open handle to the specified process.
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $iv_Pid.
    ; 2 = Failed to open Kernel32.dll.
    ; 3 = Failed to open the specified process.
    ; Author(s): Nomad
    ; Note(s):
    ;==================================================================================
    Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)

    If Not ProcessExists($iv_Pid) Then
    SetError(1)
    Return 0
    EndIf

    Local $ah_Handle[2] = [DllOpen('kernel32.dll')]

    If @Error Then
    SetError(2)
    Return 0
    EndIf

    Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid)

    If @Error Then
    DllClose($ah_Handle[0])
    SetError(3)
    Return 0
    EndIf

    $ah_Handle[1] = $av_OpenProcess[0]

    Return $ah_Handle

    EndFunc

    [/autoit][autoit][/autoit][autoit]

    ;==================================================================================
    ; Function: _MemoryRead($iv_Address, $ah_Handle[, $sv_Type])
    ; Description: Reads the value located in the memory address specified.
    ; Parameter(s): $iv_Address - The memory address you want to read from. It must
    ; be in hex format (0x00000000).
    ; $ah_Handle - An array containing the Dll handle and the handle
    ; of the open process as returned by _MemoryOpen().
    ; $sv_Type - (optional) The "Type" of value you intend to read.
    ; This is set to 'dword'(32bit(4byte) signed integer)
    ; by default. See the help file for DllStructCreate
    ; for all types. An example: If you want to read a
    ; word that is 15 characters in length, you would use
    ; 'char[16]' since a 'char' is 8 bits (1 byte) in size.
    ; Return Value(s): On Success - Returns the value located at the specified address.
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $ah_Handle.
    ; 2 = $sv_Type was not a string.
    ; 3 = $sv_Type is an unknown data type.
    ; 4 = Failed to allocate the memory needed for the DllStructure.
    ; 5 = Error allocating memory for $sv_Type.
    ; 6 = Failed to read from the specified process.
    ; Author(s): Nomad
    ; Note(s): Values returned are in Decimal format, unless specified as a
    ; 'char' type, then they are returned in ASCII format. Also note
    ; that size ('char[size]') for all 'char' types should be 1
    ; greater than the actual size.
    ;==================================================================================
    Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')

    If Not IsArray($ah_Handle) Then
    SetError(1)
    Return 0
    EndIf

    Local $v_Buffer = DllStructCreate($sv_Type)

    If @Error Then
    SetError(@Error + 1)
    Return 0
    EndIf

    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')

    If Not @Error Then
    Local $v_Value = DllStructGetData($v_Buffer, 1)
    Return $v_Value
    Else
    SetError(6)
    Return 0
    EndIf

    EndFunc

    [/autoit][autoit][/autoit][autoit]

    ;==================================================================================
    ; Function: _MemoryWrite($iv_Address, $ah_Handle, $v_Data[, $sv_Type])
    ; Description: Writes data to the specified memory address.
    ; Parameter(s): $iv_Address - The memory address which you want to write to.
    ; It must be in hex format (0x00000000).
    ; $ah_Handle - An array containing the Dll handle and the handle
    ; of the open process as returned by _MemoryOpen().
    ; $v_Data - The data to be written.
    ; $sv_Type - (optional) The "Type" of value you intend to write.
    ; This is set to 'dword'(32bit(4byte) signed integer)
    ; by default. See the help file for DllStructCreate
    ; for all types. An example: If you want to write a
    ; word that is 15 characters in length, you would use
    ; 'char[16]' since a 'char' is 8 bits (1 byte) in size.
    ; Return Value(s): On Success - Returns 1
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $ah_Handle.
    ; 2 = $sv_Type was not a string.
    ; 3 = $sv_Type is an unknown data type.
    ; 4 = Failed to allocate the memory needed for the DllStructure.
    ; 5 = Error allocating memory for $sv_Type.
    ; 6 = $v_Data is not in the proper format to be used with the
    ; "Type" selected for $sv_Type, or it is out of range.
    ; 7 = Failed to write to the specified process.
    ; Author(s): Nomad
    ; Note(s): Values sent must be in Decimal format, unless specified as a
    ; 'char' type, then they must be in ASCII format. Also note
    ; that size ('char[size]') for all 'char' types should be 1
    ; greater than the actual size.
    ;==================================================================================
    Func _MemoryWrite($iv_Address, $ah_Handle, $v_Data, $sv_Type = 'dword')

    If Not IsArray($ah_Handle) Then
    SetError(1)
    Return 0
    EndIf

    Local $v_Buffer = DllStructCreate($sv_Type)

    If @Error Then
    SetError(@Error + 1)
    Return 0
    Else
    DllStructSetData($v_Buffer, 1, $v_Data)
    If @Error Then
    SetError(6)
    Return 0
    EndIf
    EndIf

    DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')

    If Not @Error Then
    Return 1
    Else
    SetError(7)
    Return 0
    EndIf

    EndFunc

    [/autoit][autoit][/autoit][autoit]

    ;==================================================================================
    ; Function: _MemoryClose($ah_Handle)
    ; Description: Closes the process handle opened by using _MemoryOpen().
    ; Parameter(s): $ah_Handle - An array containing the Dll handle and the handle
    ; of the open process as returned by _MemoryOpen().
    ; Return Value(s): On Success - Returns 1
    ; On Failure - Returns 0
    ; @Error - 0 = No error.
    ; 1 = Invalid $ah_Handle.
    ; 2 = Unable to close the process handle.
    ; Author(s): Nomad
    ; Note(s):
    ;==================================================================================
    Func _MemoryClose($ah_Handle)

    If Not IsArray($ah_Handle) Then
    SetError(1)
    Return 0
    EndIf

    DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1])
    If Not @Error Then
    DllClose($ah_Handle[0])
    Return 1
    Else
    DllClose($ah_Handle[0])
    SetError(2)
    Return 0
    EndIf

    EndFunc

    [/autoit][autoit][/autoit][autoit]

    ;==================================================================================
    ; Function: SetPrivilege( $privilege, $bEnable )
    ; Description: Enables (or disables) the $privilege on the current process
    ; (Probably) requires administrator privileges to run
    ;
    ; Author(s): Larry (from autoitscript.com's Forum)
    ; Notes(s):
    ; http://www.autoitscript.com/forum/index.ph…ndpost&p=223999
    ;==================================================================================

    [/autoit][autoit][/autoit][autoit]

    Func SetPrivilege( $privilege, $bEnable )
    ;~ Const $TOKEN_ADJUST_PRIVILEGES = 0x0020
    ;~ Const $TOKEN_QUERY = 0x0008
    ;~ Const $SE_PRIVILEGE_ENABLED = 0x0002
    Local $hToken, $SP_auxret, $SP_ret, $hCurrProcess, $nTokens, $nTokenIndex, $priv
    $nTokens = 1
    $LUID = DLLStructCreate("dword;int")
    If IsArray($privilege) Then $nTokens = UBound($privilege)
    $TOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
    $NEWTOKEN_PRIVILEGES = DLLStructCreate("dword;dword[" & (3 * $nTokens) & "]")
    $hCurrProcess = DLLCall("kernel32.dll","hwnd","GetCurrentProcess")
    $SP_auxret = DLLCall("advapi32.dll","int","OpenProcessToken","hwnd",$hCurrProcess[0], _
    "int",BitOR($TOKEN_ADJUST_PRIVILEGES,$TOKEN_QUERY),"int_ptr",0)
    If $SP_auxret[0] Then
    $hToken = $SP_auxret[3]
    DLLStructSetData($TOKEN_PRIVILEGES,1,1)
    $nTokenIndex = 1
    While $nTokenIndex <= $nTokens
    If IsArray($privilege) Then
    $priv = $privilege[$nTokenIndex-1]
    Else
    $priv = $privilege
    EndIf
    $ret = DLLCall("advapi32.dll","int","LookupPrivilegeValue","str","","str",$priv, _
    "ptr",DLLStructGetPtr($LUID))
    If $ret[0] Then
    If $bEnable Then
    DLLStructSetData($TOKEN_PRIVILEGES,2,$SE_PRIVILEGE_ENABLED,(3 * $nTokenIndex))
    Else
    DLLStructSetData($TOKEN_PRIVILEGES,2,0,(3 * $nTokenIndex))
    EndIf
    DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,1),(3 * ($nTokenIndex-1)) + 1)
    DLLStructSetData($TOKEN_PRIVILEGES,2,DllStructGetData($LUID,2),(3 * ($nTokenIndex-1)) + 2)
    DLLStructSetData($LUID,1,0)
    DLLStructSetData($LUID,2,0)
    EndIf
    $nTokenIndex += 1
    WEnd
    $ret = DLLCall("advapi32.dll","int","AdjustTokenPrivileges","hwnd",$hToken,"int",0, _
    "ptr",DllStructGetPtr($TOKEN_PRIVILEGES),"int",DllStructGetSize($NEWTOKEN_PRIVILEGES), _
    "ptr",DllStructGetPtr($NEWTOKEN_PRIVILEGES),"int_ptr",0)
    $f = DLLCall("kernel32.dll","int","GetLastError")
    EndIf
    $NEWTOKEN_PRIVILEGES=0
    $TOKEN_PRIVILEGES=0
    $LUID=0
    If $SP_auxret[0] = 0 Then Return 0
    $SP_auxret = DLLCall("kernel32.dll","int","CloseHandle","hwnd",$hToken)
    If Not $ret[0] And Not $SP_auxret[0] Then Return 0
    return $ret[0]
    EndFunc ;==>SetPrivilege

    [/autoit][autoit][/autoit][autoit]

    #endregion

    [/autoit]

    Einmal editiert, zuletzt von tuttifrutti (6. Mai 2009 um 22:05)

  • Hey ich bins wieder ^^

    Ich habe jetzt ein Programm (Scripts) wie es geht , aber ich checke das ganze nicht.
    Quellen "cp-g.forum"

    Der Author sagte selber das man das Programm benutzen und ändern darf

    Also ich will ja nur wissen wie man Die Chars ausliest. Bei

    [autoit]

    Func Refresh_SBot_List()

    [/autoit]

    Müsste des sein ;)

    Hier mal die ganzen scripts ^^

    Ich konnte Sie hier nicht Posten , weil sie zu Lang sind ^^

    Ich schreib die Links =)

    [BugFix: Links entfernt]

    Hoffe ihr könnt mir helfen =)

    3 Mal editiert, zuletzt von BugFix (6. Mai 2009 um 22:57)