Sign in to follow this  
Followers 0
marselo

need help with some script

4 posts in this topic

i made a script for a game "silkroad online" its supposed to open 15 clients from different directories with different usernames and passwords

theres save/load settings option but something seems to be wrong with my script

can u please help me? it does save/load for some users and doesnt for others and is there anyway to optimize my script ???

Code

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#Region ### START Koda GUI section ### Form=c:\documents and settings\biohazard\my documents\form1.kxf
$input1 = ""
$input2 = ""
$input3 = ""
$input4 = ""
$input5 = ""
$input6 = ""
$input7 = ""
$input8 = ""
$input9 = ""
$input10 = ""
$input11 = ""
$input12 = ""
$input13 = ""
$input14 = ""
$input15 = ""
$Form1_1 = GUICreate("Silkroad Connect Helper", 551, 927, 291, 8)
GUISetBkColor(0xffffff)
$Checkbox1 = GUICtrlCreateCheckbox("Enable", 16, 24, 57, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$input1 = GUICtrlCreateInput("C:\Sbot\", 80, 24, 265, 21)
$Button1 = GUICtrlCreateButton("Start", 96, 864, 105, 41, 0)
$Label1 = GUICtrlCreateLabel("Idle", 370, 24, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group1 = GUICtrlCreateGroup("Account 1", 8, 8, 457, 49)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Account 2", 8, 64, 457, 49)
$Checkbox2 = GUICtrlCreateCheckbox("Enable", 16, 80, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input2 = GUICtrlCreateInput("C:\Sbot\", 80, 77, 265, 21)
$Label2 = GUICtrlCreateLabel("Idle", 370, 80, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group3 = GUICtrlCreateGroup("Account 3", 8, 120, 457, 49)
$Checkbox3 = GUICtrlCreateCheckbox("Enable", 16, 136, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input3 = GUICtrlCreateInput("C:\Sbot\", 80, 133, 265, 21)
$Label3 = GUICtrlCreateLabel("Idle", 370, 136, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group4 = GUICtrlCreateGroup("Account 4", 8, 176, 457, 49)
$Checkbox4 = GUICtrlCreateCheckbox("Enable", 16, 192, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input4 = GUICtrlCreateInput("C:\Sbot\", 80, 189, 265, 21)
$Label4 = GUICtrlCreateLabel("Idle", 370, 192, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group5 = GUICtrlCreateGroup("Account 5", 8, 232, 457, 49)
$Checkbox5 = GUICtrlCreateCheckbox("Enable", 16, 248, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input5 = GUICtrlCreateInput("C:\Sbot\", 80, 245, 265, 21)
$Label5 = GUICtrlCreateLabel("Idle", 370, 248, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group6 = GUICtrlCreateGroup("Account 6", 8, 288, 457, 49)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox6 = GUICtrlCreateCheckbox("Enable", 16, 304, 57, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$input6 = GUICtrlCreateInput("C:\Sbot\", 80, 304, 265, 21)
$Label6 = GUICtrlCreateLabel("Idle", 370, 304, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group7 = GUICtrlCreateGroup("Account 7", 8, 344, 457, 49)
$Checkbox7 = GUICtrlCreateCheckbox("Enable", 16, 360, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input7 = GUICtrlCreateInput("C:\Sbot\", 80, 357, 265, 21)
$Label7 = GUICtrlCreateLabel("Idle", 370, 360, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group8 = GUICtrlCreateGroup("Account 8", 8, 400, 457, 49)
$Checkbox8 = GUICtrlCreateCheckbox("Enable", 16, 416, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input8 = GUICtrlCreateInput("C:\Sbot\", 80, 413, 265, 21)
$Label8 = GUICtrlCreateLabel("Idle", 370, 416, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group9 = GUICtrlCreateGroup("Account 9", 8, 456, 457, 49)
$Checkbox9 = GUICtrlCreateCheckbox("Enable", 16, 472, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input9 = GUICtrlCreateInput("C:\Sbot\", 80, 469, 265, 21)
$Label9 = GUICtrlCreateLabel("Idle", 370, 472, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group10 = GUICtrlCreateGroup("Account 10", 8, 512, 457, 49)
$Checkbox10 = GUICtrlCreateCheckbox("Enable", 16, 528, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input10 = GUICtrlCreateInput("C:\Sbot\", 80, 525, 265, 21)
$Label10 = GUICtrlCreateLabel("Idle", 370, 528, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group11 = GUICtrlCreateGroup("Account 11", 8, 568, 457, 49)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Checkbox11 = GUICtrlCreateCheckbox("Enable", 16, 600, 57, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$input11 = GUICtrlCreateInput("C:\Sbot\", 80, 584, 265, 21)
$Label11 = GUICtrlCreateLabel("Idle", 370, 584, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group12 = GUICtrlCreateGroup("Account 12", 8, 624, 457, 49)
$Checkbox12 = GUICtrlCreateCheckbox("Enable", 16, 640, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input12 = GUICtrlCreateInput("C:\Sbot\", 80, 637, 265, 21)
$Label12 = GUICtrlCreateLabel("Idle", 370, 640, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group13 = GUICtrlCreateGroup("Account 13", 8, 680, 457, 49)
$Checkbox13 = GUICtrlCreateCheckbox("Enable", 16, 696, 57, 25)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
$input13 = GUICtrlCreateInput("C:\Sbot\", 80, 693, 265, 21)
$Label13 = GUICtrlCreateLabel("Idle", 370, 696, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFF0000)
$Group14 = GUICtrlCreateGroup("Account 14", 8, 736, 457, 49)
$Checkbox14 = GUICtrlCreateCheckbox("Enable", 16, 752, 57, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
$input14 = GUICtrlCreateInput("C:\Sbot\", 80, 749, 265, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$Label14 = GUICtrlCreateLabel("Disabled", 370, 752, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$Group15 = GUICtrlCreateGroup("Account 15", 8, 792, 457, 49)
$Checkbox15 = GUICtrlCreateCheckbox("Enable", 16, 808, 57, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$input15 = GUICtrlCreateInput("C:\Sbot\", 80, 805, 265, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$Label15 = GUICtrlCreateLabel("Disabled", 370, 808, 86, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$Button2 = GUICtrlCreateButton("Exit", 272, 864, 113, 41, 0)
$Button3 = GUICtrlCreateButton("Set user/pass", 472, 24, 75, 25, 0)
$Button4 = GUICtrlCreateButton("Set user/pass", 472, 80, 75, 25, 0)
$Button5 = GUICtrlCreateButton("Set user/pass", 472, 136, 75, 25, 0)
$Button6 = GUICtrlCreateButton("Set user/pass", 472, 192, 75, 25, 0)
$Button7 = GUICtrlCreateButton("Set user/pass", 472, 248, 75, 25, 0)
$Button8 = GUICtrlCreateButton("Set user/pass", 472, 304, 75, 25, 0)
$Button9 = GUICtrlCreateButton("Set user/pass", 472, 360, 75, 25, 0)
$Button10 = GUICtrlCreateButton("Set user/pass", 472, 416, 75, 25, 0)
$Button11 = GUICtrlCreateButton("Set user/pass", 472, 472, 75, 25, 0)
$Button12 = GUICtrlCreateButton("Set user/pass", 472, 528, 75, 25, 0)
$Button13 = GUICtrlCreateButton("Set user/pass", 472, 584, 75, 25, 0)
$Button14 = GUICtrlCreateButton("Set user/pass", 472, 640, 75, 25, 0)
$Button15 = GUICtrlCreateButton("Set user/pass", 472, 696, 75, 25, 0)
$Button16 = GUICtrlCreateButton("Set user/pass", 472, 752, 75, 25, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button17 = GUICtrlCreateButton("Set user/pass", 472, 808, 75, 25, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button18 = GUICtrlCreateButton("Save Settings", 472, 864, 75, 25, 0)
GUICtrlSetBkColor(-1, 0x316AC5)
$Button19 = GUICtrlCreateButton("...", 344, 24, 27, 25, 0)
$Button20 = GUICtrlCreateButton("...", 344, 80, 27, 25, 0)
$Button21 = GUICtrlCreateButton("...", 344, 136, 27, 25, 0)
$Button22 = GUICtrlCreateButton("...", 344, 192, 27, 25, 0)
$Button23 = GUICtrlCreateButton("...", 344, 248, 27, 25, 0)
$Button24 = GUICtrlCreateButton("...", 344, 304, 27, 25, 0)
$Button25 = GUICtrlCreateButton("...", 344, 360, 27, 25, 0)
$Button26 = GUICtrlCreateButton("...", 344, 416, 27, 25, 0)
$Button27 = GUICtrlCreateButton("...", 344, 472, 27, 25, 0)
$Button28 = GUICtrlCreateButton("...", 344, 528, 27, 25, 0)
$Button29 = GUICtrlCreateButton("...", 344, 584, 27, 25, 0)
$Button30 = GUICtrlCreateButton("...", 344, 640, 27, 25, 0)
$Button31 = GUICtrlCreateButton("...", 344, 696, 27, 25, 0)
$Button32 = GUICtrlCreateButton("...", 344, 752, 27, 25, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button33 = GUICtrlCreateButton("...", 344, 808, 27, 25, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
loadsettings()
$user1 = ""
$pw1 = ""
$char1 = ""
$user2 = ""
$pw2 = ""
$char2 = ""
$user3 = ""
$pw3 = ""
$char3 = ""
$user4 = ""
$pw4 = ""
$char4 = ""
$user5 = ""
$pw5 = ""
$char5 = ""
$user6 = ""
$pw6 = ""
$char6 = ""
$user7 = ""
$pw7 = ""
$char7 = ""
$user8 = ""
$pw8 = ""
$char8 = ""
$user9 = ""
$pw9 = ""
$char9 = ""
$user10 = ""
$pw10 = ""
$char10 = ""
$user11 = ""
$pw11 = ""
$char11 = ""
$user12 = ""
$pw12 = ""
$char12 = ""
$user13 = ""
$pw13 = ""
$char13 = ""
$user14 = ""
$pw14 = ""
$char14 = ""
$user15 = ""
$pw15 = ""
$char15 = ""
$pass1 = ""
$pass2 = ""
$pass3 = ""
$pass4 = ""
$pass5 = ""
$pass6 = ""
$pass7 = ""
$pass8 = ""
$pass9 = ""
$pass10 = ""
$pass11 = ""
$pass12 = ""
$pass13 = ""
$pass14 = ""
$pass15 = ""
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button2
            Exit
        Case $Button3
            Setup()
        Case $Button4
            Setup2()
        Case $Button5
            Setup3()
        Case $Button6
            Setup4()
        Case $Button7
            Setup5()
        Case $Button8
            Setup6()
        Case $Button9
            Setup7()
        Case $Button10
            Setup8()
        Case $Button11
            Setup9()
        Case $Button12
            Setup10()
        Case $Button13
            Setup11()
        Case $Button14
            Setup12()
        Case $Button15
            Setup13()
        Case $Button16
            Setup14()
        Case $Button17
            Setup15()
        Case $Button18
            Savestngs()
        Case $Button19
            setdir1()
        Case $Button20
            setdir2()
        Case $Button21
            setdir3()
        Case $Button22
            setdir4()
        Case $Button23
            setdir5()
        Case $Button24
            setdir6()
        Case $Button25
            setdir7()
        Case $Button26
            setdir8()
        Case $Button27
            setdir9()
        Case $Button28
            setdir10()
        Case $Button29
            setdir11()
        Case $Button30
            setdir12()
        Case $Button31
            setdir13()
        Case $Button32
            setdir14()
        Case $Button33
            setdir15()

        Case $Checkbox1
            If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
                accenable1()
            Else
                accdisable1()
            EndIf

        Case $Checkbox2
            If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
                accenable2()
            Else
                accdisable2()
            EndIf
        Case $Checkbox3
            If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then
                accenable3()
            Else
                accdisable3()
            EndIf
        Case $Checkbox4
            If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then
                accenable4()
            Else
                accdisable4()
            EndIf
        Case $Checkbox5
            If GUICtrlRead($Checkbox5) = $GUI_CHECKED Then
                accenable5()
            Else
                accdisable5()
            EndIf
        Case $Checkbox6
            If GUICtrlRead($Checkbox6) = $GUI_CHECKED Then
                accenable6()
            Else
                accdisable6()
            EndIf
        Case $Checkbox7
            If GUICtrlRead($Checkbox7) = $GUI_CHECKED Then
                accenable7()
            Else
                accdisable7()
            EndIf
        Case $Checkbox8
            If GUICtrlRead($Checkbox8) = $GUI_CHECKED Then
                accenable8()
            Else
                accdisable8()
            EndIf
        Case $Checkbox9
            If GUICtrlRead($Checkbox9) = $GUI_CHECKED Then
                accenable9()
            Else
                accdisable9()
            EndIf
        Case $Checkbox10
            If GUICtrlRead($Checkbox10) = $GUI_CHECKED Then
                accenable10()
            Else
                accdisable10()
            EndIf
        Case $Checkbox11
            If GUICtrlRead($Checkbox11) = $GUI_CHECKED Then
                accenable11()
            Else
                accdisable11()
            EndIf
        Case $Checkbox12
            If GUICtrlRead($Checkbox12) = $GUI_CHECKED Then
                accenable12()
            Else
                accdisable12()
            EndIf
        Case $Checkbox13
            If GUICtrlRead($Checkbox13) = $GUI_CHECKED Then
                accenable13()
            Else
                accdisable13()
            EndIf
        Case $Checkbox14
            If GUICtrlRead($Checkbox14) = $GUI_CHECKED Then
                accenable14()
            Else
                accdisable14()
            EndIf
        Case $Checkbox15
            If GUICtrlRead($Checkbox15) = $GUI_CHECKED Then
                accenable15()
            Else
                accdisable15()
            EndIf
        Case $Button1
            prestart()
    EndSwitch
WEnd
Func Setup()
    $user1 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass1 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw1 = _StringEncrypt(1, $pass1, "sss", 1)
    $char1 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group1, $char1)
EndFunc   ;==>Setup
Func Setup2()
    $user2 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass2 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw2 = _StringEncrypt(1, $pass2, "sss", 1)
    $char2 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group2, $char2)
EndFunc   ;==>Setup2
Func Setup3()
    $user3 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass3 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw3 = _StringEncrypt(1, $pass3, "sss", 1)
    $char3 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group3, $char3)
EndFunc   ;==>Setup3
Func Setup4()
    $user4 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass4 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw4 = _StringEncrypt(1, $pass4, "sss", 1)
    $char4 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group4, $char4)
EndFunc   ;==>Setup4
Func Setup5()
    $user5 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass5 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw5 = _StringEncrypt(1, $pass5, "sss", 1)
    $char5 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group5, $char5)
EndFunc   ;==>Setup5
Func Setup6()
    $user6 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass6 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw6 = _StringEncrypt(1, $pass6, "sss", 1)
    $char6 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group6, $char6)
EndFunc   ;==>Setup6
Func Setup7()
    $user7 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass7 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw7 = _StringEncrypt(1, $pass7, "sss", 1)
    $char7 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group7, $char7)
EndFunc   ;==>Setup7
Func Setup8()
    $user8 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass8 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw8 = _StringEncrypt(1, $pass8, "sss", 1)
    $char8 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group8, $char8)
EndFunc   ;==>Setup8
Func Setup9()
    $user9 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass9 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw9 = _StringEncrypt(1, $pass9, "sss", 1)
    $char9 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group9, $char9)
EndFunc   ;==>Setup9
Func Setup10()
    $user10 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass10 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw10 = _StringEncrypt(1, $pass10, "sss", 1)
    $char10 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group10, $char10)
EndFunc   ;==>Setup10
Func Setup11()
    $user11 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass11 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw11 = _StringEncrypt(1, $pass11, "sss", 1)
    $char11 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group11, $char11)
EndFunc   ;==>Setup11
Func Setup12()
    $user12 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass12 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw12 = _StringEncrypt(1, $pass12, "sss", 1)
    $char12 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group12, $char12)
EndFunc   ;==>Setup12
Func Setup13()
    $user13 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass13 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw13 = _StringEncrypt(1, $pass13, "sss", 1)
    $char13 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group13, $char13)
EndFunc   ;==>Setup13
Func Setup14()
    $user14 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass14 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw14 = _StringEncrypt(1, $pass14, "sss", 1)
    $char14 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group14, $char14)
EndFunc   ;==>Setup14
Func Setup15()
    $user15 = InputBox("Silkroad Login Helper", "Please , Enter your desired username")
    $pass15 = InputBox("Silkroad Login Helper", "Please , Enter your desired Password", "", "#")
    $pw15 = _StringEncrypt(1, $pass15, "sss", 1)
    $char15 = InputBox("Silkroad Login Helper", "Please , Enter your desired char name (Case Sensetive)")
    GUICtrlSetData($Group15, $char15)
EndFunc   ;==>Setup15
Func Savestngs()
    IniWrite("settings.ini", "Char 1", "directory", GUICtrlRead($input1))
    IniWrite("settings.ini", "Char 1", "username", $user1)
    IniWrite("settings.ini", "Char 1", "password", $pw1)
    IniWrite("settings.ini", "Char 1", "char", $char1)
    IniWrite("settings.ini", "Char 2", "directory", GUICtrlRead($input2))
    IniWrite("settings.ini", "Char 2", "username", $user2)
    IniWrite("settings.ini", "Char 2", "password", $pw2)
    IniWrite("settings.ini", "Char 2", "char", $char2)
    IniWrite("settings.ini", "Char 3", "directory", GUICtrlRead($input3))
    IniWrite("settings.ini", "Char 3", "username", $user3)
    IniWrite("settings.ini", "Char 3", "password", $pw3)
    IniWrite("settings.ini", "Char 3", "char", $char3)
    IniWrite("settings.ini", "Char 4", "directory", GUICtrlRead($input4))
    IniWrite("settings.ini", "Char 4", "username", $user4)
    IniWrite("settings.ini", "Char 4", "password", $pw4)
    IniWrite("settings.ini", "Char 4", "char", $char4)
    IniWrite("settings.ini", "Char 5", "directory", GUICtrlRead($input5))
    IniWrite("settings.ini", "Char 5", "username", $user5)
    IniWrite("settings.ini", "Char 5", "password", $pw5)
    IniWrite("settings.ini", "Char 5", "char", $char5)
    IniWrite("settings.ini", "Char 6", "directory", GUICtrlRead($input6))
    IniWrite("settings.ini", "Char 6", "username", $user6)
    IniWrite("settings.ini", "Char 6", "password", $pw6)
    IniWrite("settings.ini", "Char 6", "char", $char6)
    IniWrite("settings.ini", "Char 7", "directory", GUICtrlRead($input7))
    IniWrite("settings.ini", "Char 7", "username", $user7)
    IniWrite("settings.ini", "Char 7", "password", $pw7)
    IniWrite("settings.ini", "Char 7", "char", $char7)
    IniWrite("settings.ini", "Char 8", "directory", GUICtrlRead($input8))
    IniWrite("settings.ini", "Char 8", "username", $user8)
    IniWrite("settings.ini", "Char 8", "password", $pw8)
    IniWrite("settings.ini", "Char 8", "char", $char8)
    IniWrite("settings.ini", "Char 9", "directory", GUICtrlRead($input9))
    IniWrite("settings.ini", "Char 9", "username", $user9)
    IniWrite("settings.ini", "Char 9", "password", $pw9)
    IniWrite("settings.ini", "Char 9", "char", $char9)
    IniWrite("settings.ini", "Char 10", "directory", GUICtrlRead($input10))
    IniWrite("settings.ini", "Char 10", "username", $user10)
    IniWrite("settings.ini", "Char 10", "password", $pw10)
    IniWrite("settings.ini", "Char 10", "char", $char10)
    IniWrite("settings.ini", "Char 11", "directory", GUICtrlRead($input11))
    IniWrite("settings.ini", "Char 11", "username", $user11)
    IniWrite("settings.ini", "Char 11", "password", $pw11)
    IniWrite("settings.ini", "Char 12", "char", $char11)
    IniWrite("settings.ini", "Char 12", "directory", GUICtrlRead($input12))
    IniWrite("settings.ini", "Char 12", "username", $user12)
    IniWrite("settings.ini", "Char 12", "password", $pw12)
    IniWrite("settings.ini", "Char 13", "char", $char12)
    IniWrite("settings.ini", "Char 13", "directory", GUICtrlRead($input13))
    IniWrite("settings.ini", "Char 13", "username", $user13)
    IniWrite("settings.ini", "Char 13", "password", $pw13)
    IniWrite("settings.ini", "Char 14", "char", $char13)
    IniWrite("settings.ini", "Char 14", "directory", GUICtrlRead($input14))
    IniWrite("settings.ini", "Char 14", "username", $user14)
    IniWrite("settings.ini", "Char 14", "password", $pw14)
    IniWrite("settings.ini", "Char 15", "char", $char14)
    IniWrite("settings.ini", "Char 15", "directory", GUICtrlRead($input15))
    IniWrite("settings.ini", "Char 15", "username", $user15)
    IniWrite("settings.ini", "Char 15", "password", $pw15)
    IniWrite("settings.ini", "Char 1", "char", $char15)
    msgbox(0,"Silkroad login helper","Settings saved successfully")
EndFunc   ;==>Savestngs
Func setdir1()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input1, $var)
EndFunc   ;==>setdir1
Func setdir2()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input2, $var)
EndFunc   ;==>setdir2
Func setdir3()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input3, $var)
EndFunc   ;==>setdir3
Func setdir4()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input4, $var)
EndFunc   ;==>setdir4
Func setdir5()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input5, $var)
EndFunc   ;==>setdir5
Func setdir6()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input6, $var)
EndFunc   ;==>setdir6
Func setdir7()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input7, $var)
EndFunc   ;==>setdir7
Func setdir8()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input8, $var)
EndFunc   ;==>setdir8
Func setdir9()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input9, $var)
EndFunc   ;==>setdir9
Func setdir10()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input10, $var)
EndFunc   ;==>setdir10
Func setdir11()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input11, $var)
EndFunc   ;==>setdir11
Func setdir12()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input12, $var)
EndFunc   ;==>setdir12
Func setdir13()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input13, $var)
EndFunc   ;==>setdir13
Func setdir14()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input14, $var)
EndFunc   ;==>setdir14
Func setdir15()
    $var = FileOpenDialog("Select the Sbot exe", @DesktopCommonDir & "\", "exe files (*.exe)")
    If Not @error Then GUICtrlSetData($input15, $var)
EndFunc   ;==>setdir15
Func accenable1()
    GUICtrlSetState($input1, $GUI_enABLE)
    GUICtrlSetState($Label1, $GUI_enABLE)
    GUICtrlSetBkColor($Label1, 0xFF0000)
    GUICtrlSetColor($Label1, 0x000000)
    GUICtrlSetData($Label1, "Idle")
    GUICtrlSetState($Button3, $GUI_enABLE)
    GUICtrlSetState($Button19, $GUI_enABLE)
    $acc1 = "1"
EndFunc   ;==>accenable1
Func accdisable1()
    GUICtrlSetState($input1, $GUI_DISABLE)
    GUICtrlSetState($Label1, $GUI_DISABLE)
    GUICtrlSetBkColor($Label1, 0x000000)
    GUICtrlSetColor($Label1, 0xFFFFFF)
    GUICtrlSetData($Label1, "Disabled")
    GUICtrlSetState($Button3, $GUI_DISABLE)
    GUICtrlSetState($Button19, $GUI_DISABLE)
    $acc1="0"
EndFunc   ;==>accdisable1
Func accenable2()
    GUICtrlSetState($input2, $GUI_enABLE)
    GUICtrlSetState($Label2, $GUI_enABLE)
    GUICtrlSetBkColor($Label2, 0xFF0000)
    GUICtrlSetColor($Label2, 0x000000)
    GUICtrlSetData($Label2, "Idle")
    GUICtrlSetState($Button4, $GUI_enABLE)
    GUICtrlSetState($Button20, $GUI_enABLE)
    $acc2="1"
EndFunc   ;==>accenable2
Func accdisable2()
    GUICtrlSetState($input2, $GUI_DISABLE)
    GUICtrlSetState($Label2, $GUI_DISABLE)
    GUICtrlSetBkColor($Label2, 0x000000)
    GUICtrlSetColor($Label2, 0xFFFFFF)
    GUICtrlSetData($Label2, "Disabled")
    GUICtrlSetState($Button4, $GUI_DISABLE)
    GUICtrlSetState($Button20, $GUI_DISABLE)
    $acc2="0"
EndFunc   ;==>accdisable2
Func accenable3()
    GUICtrlSetState($input3, $GUI_enABLE)
    GUICtrlSetState($Label3, $GUI_enABLE)
    GUICtrlSetBkColor($Label3, 0xFF0000)
    GUICtrlSetColor($Label3, 0x000000)
    GUICtrlSetData($Label3, "Idle")
    GUICtrlSetState($Button5, $GUI_enABLE)
    GUICtrlSetState($Button21, $GUI_enABLE)
    $acc3="1"
EndFunc   ;==>accenable3
Func accdisable3()
    GUICtrlSetState($input3, $GUI_DISABLE)
    GUICtrlSetState($Label3, $GUI_DISABLE)
    GUICtrlSetBkColor($Label3, 0x000000)
    GUICtrlSetColor($Label3, 0xFFFFFF)
    GUICtrlSetData($Label3, "Disabled")
    GUICtrlSetState($Button5, $GUI_DISABLE)
    GUICtrlSetState($Button21, $GUI_DISABLE)
    $acc3="0"
EndFunc   ;==>accdisable3
Func accenable4()
    GUICtrlSetState($input4, $GUI_enABLE)
    GUICtrlSetState($Label4, $GUI_enABLE)
    GUICtrlSetBkColor($Label4, 0xFF0000)
    GUICtrlSetColor($Label4, 0x000000)
    GUICtrlSetData($Label4, "Idle")
    GUICtrlSetState($Button6, $GUI_enABLE)
    GUICtrlSetState($Button22, $GUI_enABLE)
    $acc4="1"
EndFunc   ;==>accenable4
Func accdisable4()
    GUICtrlSetState($input4, $GUI_DISABLE)
    GUICtrlSetState($Label4, $GUI_DISABLE)
    GUICtrlSetBkColor($Label4, 0x000000)
    GUICtrlSetColor($Label4, 0xFFFFFF)
    GUICtrlSetData($Label4, "Disabled")
    GUICtrlSetState($Button6, $GUI_DISABLE)
    GUICtrlSetState($Button22, $GUI_DISABLE)
    $acc4="0"
EndFunc   ;==>accdisable4
Func accenable5()
    GUICtrlSetState($input5, $GUI_enABLE)
    GUICtrlSetState($Label5, $GUI_enABLE)
    GUICtrlSetBkColor($Label5, 0xFF0000)
    GUICtrlSetColor($Label5, 0x000000)
    GUICtrlSetData($Label5, "Idle")
    GUICtrlSetState($Button7, $GUI_enABLE)
    GUICtrlSetState($Button23, $GUI_enABLE)
    $acc5="1"
EndFunc   ;==>accenable5
Func accdisable5()
    GUICtrlSetState($input5, $GUI_DISABLE)
    GUICtrlSetState($Label5, $GUI_DISABLE)
    GUICtrlSetBkColor($Label5, 0x000000)
    GUICtrlSetColor($Label5, 0xFFFFFF)
    GUICtrlSetData($Label5, "Disabled")
    GUICtrlSetState($Button7, $GUI_DISABLE)
    GUICtrlSetState($Button23, $GUI_DISABLE)
    $acc5="0"
EndFunc   ;==>accdisable5
Func accenable6()
    GUICtrlSetState($input6, $GUI_enABLE)
    GUICtrlSetState($Label6, $GUI_enABLE)
    GUICtrlSetBkColor($Label6, 0xFF0000)
    GUICtrlSetColor($Label6, 0x000000)
    GUICtrlSetData($Label6, "Idle")
    GUICtrlSetState($Button8, $GUI_enABLE)
    GUICtrlSetState($Button24, $GUI_enABLE)
    $acc6="1"
EndFunc   ;==>accenable6
Func accdisable6()
    GUICtrlSetState($input6, $GUI_DISABLE)
    GUICtrlSetState($Label6, $GUI_DISABLE)
    GUICtrlSetBkColor($Label6, 0x000000)
    GUICtrlSetColor($Label6, 0xFFFFFF)
    GUICtrlSetData($Label6, "Disabled")
    GUICtrlSetState($Button8, $GUI_DISABLE)
    GUICtrlSetState($Button24, $GUI_DISABLE)
    $acc6="0"
EndFunc   ;==>accdisable6
Func accenable7()
    GUICtrlSetState($input7, $GUI_enABLE)
    GUICtrlSetState($Label7, $GUI_enABLE)
    GUICtrlSetBkColor($Label7, 0xFF0000)
    GUICtrlSetColor($Label7, 0x000000)
    GUICtrlSetData($Label7, "Idle")
    GUICtrlSetState($Button9, $GUI_enABLE)
    GUICtrlSetState($Button25, $GUI_enABLE)
    $acc7="1"
EndFunc   ;==>accenable7
Func accdisable7()
    GUICtrlSetState($input7, $GUI_DISABLE)
    GUICtrlSetState($Label7, $GUI_DISABLE)
    GUICtrlSetBkColor($Label7, 0x000000)
    GUICtrlSetColor($Label7, 0xFFFFFF)
    GUICtrlSetData($Label7, "Disabled")
    GUICtrlSetState($Button9, $GUI_DISABLE)
    GUICtrlSetState($Button25, $GUI_DISABLE)
    $acc7="0"
EndFunc   ;==>accdisable7
Func accenable8()
    GUICtrlSetState($input8, $GUI_enABLE)
    GUICtrlSetState($Label8, $GUI_enABLE)
    GUICtrlSetBkColor($Label8, 0xFF0000)
    GUICtrlSetColor($Label8, 0x000000)
    GUICtrlSetData($Label8, "Idle")
    GUICtrlSetState($Button10, $GUI_enABLE)
    GUICtrlSetState($Button26, $GUI_enABLE)
    $acc8="1"
EndFunc   ;==>accenable8
Func accdisable8()
    GUICtrlSetState($input8, $GUI_DISABLE)
    GUICtrlSetState($Label8, $GUI_DISABLE)
    GUICtrlSetBkColor($Label8, 0x000000)
    GUICtrlSetColor($Label8, 0xFFFFFF)
    GUICtrlSetData($Label8, "Disabled")
    GUICtrlSetState($Button10, $GUI_DISABLE)
    GUICtrlSetState($Button26, $GUI_DISABLE)
    $acc8="0"
EndFunc   ;==>accdisable8
Func accenable9()
    GUICtrlSetState($input9, $GUI_enABLE)
    GUICtrlSetState($Label9, $GUI_enABLE)
    GUICtrlSetBkColor($Label9, 0xFF0000)
    GUICtrlSetColor($Label9, 0x000000)
    GUICtrlSetData($Label9, "Idle")
    GUICtrlSetState($Button11, $GUI_enABLE)
    GUICtrlSetState($Button27, $GUI_enABLE)
    $acc9="1"
EndFunc   ;==>accenable9
Func accdisable9()
    GUICtrlSetState($input9, $GUI_DISABLE)
    GUICtrlSetState($Label9, $GUI_DISABLE)
    GUICtrlSetBkColor($Label9, 0x000000)
    GUICtrlSetColor($Label9, 0xFFFFFF)
    GUICtrlSetData($Label9, "Disabled")
    GUICtrlSetState($Button11, $GUI_DISABLE)
    GUICtrlSetState($Button27, $GUI_DISABLE)
    $acc9="0"
EndFunc   ;==>accdisable9
Func accenable10()
    GUICtrlSetState($input10, $GUI_enABLE)
    GUICtrlSetState($Label10, $GUI_enABLE)
    GUICtrlSetBkColor($Label10, 0xFF0000)
    GUICtrlSetColor($Label10, 0x000000)
    GUICtrlSetData($Label10, "Idle")
    GUICtrlSetState($Button12, $GUI_enABLE)
    GUICtrlSetState($Button28, $GUI_enABLE)
    $acc10="1"
EndFunc   ;==>accenable10
Func accdisable10()
    GUICtrlSetState($input10, $GUI_DISABLE)
    GUICtrlSetState($Label10, $GUI_DISABLE)
    GUICtrlSetBkColor($Label10, 0x000000)
    GUICtrlSetColor($Label10, 0xFFFFFF)
    GUICtrlSetData($Label10, "Disabled")
    GUICtrlSetState($Button12, $GUI_DISABLE)
    GUICtrlSetState($Button28, $GUI_DISABLE)
    $acc10="0"
EndFunc   ;==>accdisable10
Func accenable11()
    GUICtrlSetState($input11, $GUI_enABLE)
    GUICtrlSetState($Label11, $GUI_enABLE)
    GUICtrlSetBkColor($Label11, 0xFF0000)
    GUICtrlSetColor($Label11, 0x000000)
    GUICtrlSetData($Label11, "Idle")
    GUICtrlSetState($Button13, $GUI_enABLE)
    GUICtrlSetState($Button29, $GUI_enABLE)
    $acc11="1"
EndFunc   ;==>accenable11
Func accdisable11()
    GUICtrlSetState($input11, $GUI_DISABLE)
    GUICtrlSetState($Label11, $GUI_DISABLE)
    GUICtrlSetBkColor($Label11, 0x000000)
    GUICtrlSetColor($Label11, 0xFFFFFF)
    GUICtrlSetData($Label11, "Disabled")
    GUICtrlSetState($Button13, $GUI_DISABLE)
    GUICtrlSetState($Button29, $GUI_DISABLE)
    $acc11="0"
EndFunc   ;==>accdisable11
Func accenable12()
    GUICtrlSetState($input12, $GUI_enABLE)
    GUICtrlSetState($Label12, $GUI_enABLE)
    GUICtrlSetBkColor($Label12, 0xFF0000)
    GUICtrlSetColor($Label12, 0x000000)
    GUICtrlSetData($Label12, "Idle")
    GUICtrlSetState($Button14, $GUI_enABLE)
    GUICtrlSetState($Button30, $GUI_enABLE)
    $acc12="1"
EndFunc   ;==>accenable12
Func accdisable12()
    GUICtrlSetState($input12, $GUI_DISABLE)
    GUICtrlSetState($Label12, $GUI_DISABLE)
    GUICtrlSetBkColor($Label12, 0x000000)
    GUICtrlSetColor($Label12, 0xFFFFFF)
    GUICtrlSetData($Label12, "Disabled")
    GUICtrlSetState($Button14, $GUI_DISABLE)
    GUICtrlSetState($Button30, $GUI_DISABLE)
    $acc12="0"
EndFunc   ;==>accdisable12
Func accenable13()
    GUICtrlSetState($input13, $GUI_enABLE)
    GUICtrlSetState($Label13, $GUI_enABLE)
    GUICtrlSetBkColor($Label13, 0xFF0000)
    GUICtrlSetColor($Label13, 0x000000)
    GUICtrlSetData($Label13, "Idle")
    GUICtrlSetState($Button15, $GUI_enABLE)
    GUICtrlSetState($Button31, $GUI_enABLE)
    $acc13="1"
EndFunc   ;==>accenable13
Func accdisable13()
    GUICtrlSetState($input13, $GUI_DISABLE)
    GUICtrlSetState($Label13, $GUI_DISABLE)
    GUICtrlSetBkColor($Label13, 0x000000)
    GUICtrlSetColor($Label13, 0xFFFFFF)
    GUICtrlSetData($Label13, "Disabled")
    GUICtrlSetState($Button15, $GUI_DISABLE)
    GUICtrlSetState($Button31, $GUI_DISABLE)
    $acc13="0"
EndFunc   ;==>accdisable13
Func accenable14()
    GUICtrlSetState($input14, $GUI_enABLE)
    GUICtrlSetState($Label14, $GUI_enABLE)
    GUICtrlSetBkColor($Label14, 0xFF0000)
    GUICtrlSetColor($Label14, 0x000000)
    GUICtrlSetData($Label14, "Idle")
    GUICtrlSetState($Button16, $GUI_enABLE)
    GUICtrlSetState($Button32, $GUI_enABLE)
    $acc14="1"
EndFunc   ;==>accenable14
Func accdisable14()
    GUICtrlSetState($input14, $GUI_DISABLE)
    GUICtrlSetState($Label14, $GUI_DISABLE)
    GUICtrlSetBkColor($Label14, 0x000000)
    GUICtrlSetColor($Label14, 0xFFFFFF)
    GUICtrlSetData($Label14, "Disabled")
    GUICtrlSetState($Button16, $GUI_DISABLE)
    GUICtrlSetState($Button32, $GUI_DISABLE)
    $acc14="0"
EndFunc   ;==>accdisable14
Func accenable15()
    GUICtrlSetState($input15, $GUI_enABLE)
    GUICtrlSetState($Label15, $GUI_enABLE)
    GUICtrlSetBkColor($Label15, 0xFF0000)
    GUICtrlSetColor($Label15, 0x000000)
    GUICtrlSetData($Label15, "Idle")
    GUICtrlSetState($Button17, $GUI_enABLE)
    GUICtrlSetState($Button33, $GUI_enABLE)
    $acc15="1"
EndFunc   ;==>accenable15
Func accdisable15()
    GUICtrlSetState($input15, $GUI_DISABLE)
    GUICtrlSetState($Label15, $GUI_DISABLE)
    GUICtrlSetBkColor($Label15, 0x000000)
    GUICtrlSetColor($Label15, 0xFFFFFF)
    GUICtrlSetData($Label15, "Disabled")
    GUICtrlSetState($Button17, $GUI_DISABLE)
    GUICtrlSetState($Button33, $GUI_DISABLE)
    $acc15="0"
EndFunc   ;==>accdisable15

Func loadsettings()
    $dirsr1 = IniRead("settings.ini", "Char 1", "directory", "")
    GUICtrlSetData($input1, $dirsr1)
    $user1 = IniRead("settings.ini", "Char 1", "username", "")
    $pw1 = IniRead("settings.ini", "Char 1", "password", "")
    $pass1 = _StringEncrypt(0, $pw1, "sss", 1)
    $char1 = IniRead("settings.ini", "Char 1", "char", "")
    If $char1 = "" Then
        GUICtrlSetData($Group1, "Account 1")
    Else
        GUICtrlSetData($Group1, $char1)
    EndIf
    $dirsr2 = IniRead("settings.ini", "Char 2", "directory", "")
    GUICtrlSetData($input2, $dirsr2)
    $user2 = IniRead("settings.ini", "Char 2", "username", "")
    $pw2 = IniRead("settings.ini", "Char 2", "password", "")
    $pass2 = _StringEncrypt(0, $pw2, "sss", 1)
    $char2 = IniRead("settings.ini", "Char 2", "char", "")
    If $char2 = "" Then
        GUICtrlSetData($Group2, "Account 2")
    Else
        GUICtrlSetData($Group2, $char2)
    EndIf
    $dirsr3 = IniRead("settings.ini", "Char 3", "directory", "")
    GUICtrlSetData($input3, $dirsr3)
    $user3 = IniRead("settings.ini", "Char 3", "username", "")
    $pw3 = IniRead("settings.ini", "Char 3", "password", "")
    $pass3 = _StringEncrypt(0, $pw3, "sss", 1)
    $char3 = IniRead("settings.ini", "Char 3", "char", "")
    If $char3 = "" Then
        GUICtrlSetData($Group3, "Account 3")
    Else
        GUICtrlSetData($Group3, $char3)
    EndIf
    $dirsr4 = IniRead("settings.ini", "Char 4", "directory", "")
    GUICtrlSetData($input4, $dirsr4)
    $user4 = IniRead("settings.ini", "Char 4", "username", "")
    $pw4 = IniRead("settings.ini", "Char 4", "password", "")
    $pass4 = _StringEncrypt(0, $pw4, "sss", 1)
    $char4 = IniRead("settings.ini", "Char 4", "char", "")
    If $char4 = "" Then
        GUICtrlSetData($Group4, "Account 4")
    Else
        GUICtrlSetData($Group4, $char4)
    EndIf
    $dirsr5 = IniRead("settings.ini", "Char 5", "directory", "")
    GUICtrlSetData($input5, $dirsr5)
    $user5 = IniRead("settings.ini", "Char 5", "username", "")
    $pw5 = IniRead("settings.ini", "Char 5", "password", "")
    $pass5 = _StringEncrypt(0, $pw5, "sss", 1)
    $char5 = IniRead("settings.ini", "Char 5", "char", "")
    If $char5 = "" Then
        GUICtrlSetData($Group5, "Account 5")
    Else
        GUICtrlSetData($Group5, $char5)
    EndIf
    $dirsr6 = IniRead("settings.ini", "Char 6", "directory", "")
    GUICtrlSetData($input6, $dirsr6)
    $user6 = IniRead("settings.ini", "Char 6", "username", "")
    $pw6 = IniRead("settings.ini", "Char 6", "password", "")
    $pass6 = _StringEncrypt(0, $pw6, "sss", 1)
    $char6 = IniRead("settings.ini", "Char 6", "char", "")
    If $char6 = "" Then
        GUICtrlSetData($Group6, "Account 6")
    Else
        GUICtrlSetData($Group6, $char6)
    EndIf
    $dirsr7 = IniRead("settings.ini", "Char 7", "directory", "")
    GUICtrlSetData($input7, $dirsr7)
    $user7 = IniRead("settings.ini", "Char 7", "username", "")
    $pw7 = IniRead("settings.ini", "Char 7", "password", "")
    $pass7 = _StringEncrypt(0, $pw7, "sss", 1)
    $char7 = IniRead("settings.ini", "Char 7", "char", "")
    If $char7 = "" Then
        GUICtrlSetData($Group7, "Account 7")
    Else
        GUICtrlSetData($Group7, $char7)
    EndIf
    $dirsr8 = IniRead("settings.ini", "Char 8", "directory", "")
    GUICtrlSetData($input8, $dirsr8)
    $user8 = IniRead("settings.ini", "Char 8", "username", "")
    $pw8 = IniRead("settings.ini", "Char 8", "password", "")
    $pass8 = _StringEncrypt(0, $pw8, "sss", 1)
    $char8 = IniRead("settings.ini", "Char 8", "char", "")
    If $char8 = "" Then
        GUICtrlSetData($Group8, "Account 8")
    Else
        GUICtrlSetData($Group8, $char8)
    EndIf
    $dirsr9 = IniRead("settings.ini", "Char 9", "directory", "")
    GUICtrlSetData($input9, $dirsr9)
    $user9 = IniRead("settings.ini", "Char 9", "username", "")
    $pw9 = IniRead("settings.ini", "Char 9", "password", "")
    $pass9 = _StringEncrypt(0, $pw9, "sss", 1)
    $char9 = IniRead("settings.ini", "Char 9", "char", "")
    If $char9 = "" Then
        GUICtrlSetData($Group9, "Account 9")
    Else
        GUICtrlSetData($Group9, $char9)
    EndIf
    $dirsr10 = IniRead("settings.ini", "Char 10", "directory", "")
    GUICtrlSetData($input10, $dirsr10)
    $user10 = IniRead("settings.ini", "Char 10", "username", "")
    $pw10 = IniRead("settings.ini", "Char 10", "password", "")
    $pass10 = _StringEncrypt(0, $pw10, "sss", 1)
    $char10 = IniRead("settings.ini", "Char 10", "char", "")
    If $char10 = "" Then
        GUICtrlSetData($Group10, "Account 10")
    Else
        GUICtrlSetData($Group10, $char10)
    EndIf
    $dirsr11 = IniRead("settings.ini", "Char 11", "directory", "")
    GUICtrlSetData($input11, $dirsr11)
    $user11 = IniRead("settings.ini", "Char 11", "username", "")
    $pw11 = IniRead("settings.ini", "Char 11", "password", "")
    $pass11 = _StringEncrypt(0, $pw11, "sss", 1)
    $char11 = IniRead("settings.ini", "Char 11", "char", "")
    If $char11 = "" Then
        GUICtrlSetData($Group11, "Account 11")
    Else
        GUICtrlSetData($Group11, $char11)
    EndIf
    $dirsr12 = IniRead("settings.ini", "Char 12", "directory", "")
    GUICtrlSetData($input12, $dirsr12)
    $user12 = IniRead("settings.ini", "Char 12", "username", "")
    $pw12 = IniRead("settings.ini", "Char 12", "password", "")
    $pass12 = _StringEncrypt(0, $pw12, "sss", 1)
    $char12 = IniRead("settings.ini", "Char 12", "char", "")
    If $char12 = "" Then
        GUICtrlSetData($Group12, "Account 12")
    Else
        GUICtrlSetData($Group12, $char12)
    EndIf
    $dirsr13 = IniRead("settings.ini", "Char 13", "directory", "")
    GUICtrlSetData($input13, $dirsr13)
    $user13 = IniRead("settings.ini", "Char 13", "username", "")
    $pw13 = IniRead("settings.ini", "Char 13", "password", "")
    $pass13 = _StringEncrypt(0, $pw13, "sss", 1)
    $char13 = IniRead("settings.ini", "Char 13", "char", "")
    If $char13 = "" Then
        GUICtrlSetData($Group13, "Account 13")
    Else
        GUICtrlSetData($Group13, $char13)
    EndIf
    $dirsr14 = IniRead("settings.ini", "Char 14", "directory", "")
    GUICtrlSetData($input14, $dirsr14)
    $user14 = IniRead("settings.ini", "Char 14", "username", "")
    $pw14 = IniRead("settings.ini", "Char 14", "password", "")
    $pass14 = _StringEncrypt(0, $pw14, "sss", 1)
    $char14 = IniRead("settings.ini", "Char 14", "char", "")
    If $char14 = "" Then
        GUICtrlSetData($Group14, "Account 14")
    Else
        GUICtrlSetData($Group14, $char14)
    EndIf
    $dirsr15 = IniRead("settings.ini", "Char 15", "directory", "")
    GUICtrlSetData($input15, $dirsr15)
    $user15 = IniRead("settings.ini", "Char 15", "username", "")
    $pw15 = IniRead("settings.ini", "Char 15", "password", "")
    $pass15 = _StringEncrypt(0, $pw15, "sss", 1)
    $char15 = IniRead("settings.ini", "Char 15", "char", "")
    If $char15 = "" Then
        GUICtrlSetData($Group15, "Account 15")
    Else
        GUICtrlSetData($Group15, $char15)
    EndIf
EndFunc   ;==>loadsettings
Func logincheck()
    $loginchk = ControlGetText('SBot v1.32d (C)2008,2009 by bot-cave.net', "", "[CLASS:Static; INSTANCE:7]")
    If $loginchk = "Error - Connection failed!" Then
        MsgBox(0, "Silkroad Login Helper", "Sbot connection failed Please retry")
        Exit
    EndIf
EndFunc   ;==>logincheck
Func prestart()
    global $dirsr1 , $dirsr2 , $dirsr3 ,$dirsr4 ,$dirsr5 ,$dirsr6 ,$dirsr7 ,$dirsr8 ,$dirsr9 ,$dirsr10 ,$dirsr11 ,$dirsr12 ,$dirsr13 ,$dirsr14 ,$dirsr15
    
    $dirsr1 = GUICtrlRead($input1)
    $dirsr2 = GUICtrlRead($input2)
    $dirsr3 = GUICtrlRead($input3)
    $dirsr4 = GUICtrlRead($input4)
    $dirsr5 = GUICtrlRead($input5)
    $dirsr6 = GUICtrlRead($input6)
    $dirsr7 = GUICtrlRead($input7)
    $dirsr8 = GUICtrlRead($input8)
    $dirsr9 = GUICtrlRead($input9)
    $dirsr10 = GUICtrlRead($input10)
    $dirsr11 = GUICtrlRead($input11)
    $dirsr12 = GUICtrlRead($input12)
    $dirsr13 = GUICtrlRead($input13)
    $dirsr14 = GUICtrlRead($input14)
    $dirsr15 = GUICtrlRead($input15)
    start()
EndFunc   ;==>prestart
Func start()
    Run($dirsr1)
    WinWaitActive('SBot v1.32d (C)2008,2009 by bot-cave.net')
    Sleep(3000)
    logincheck()
EndFunc   ;==>start

ill be really thankful for your help ^^

Share this post


Link to post
Share on other sites



Is there anyway to optimize my script ???

Have a look at Arrays and For...To...Step...Next


[font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]

Share this post


Link to post
Share on other sites

Hi, as colafrysen said arrays and loops would make your code a lot shorter.

I had a play with your code, maybe you can get some ideas from what I changed.

I don't play silkroad so I didn't bother trying the connection side of things.

Mainly I just played with the gui and generating the controls in a briefer manner.

Sorry I used 10 slots instead of 15 as my laptop res only has 1024x768...lol

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

Opt("GUIOnEventMode", 1)

Global $Ini = @ScriptDir & "\SRHelper.ini"
Global $hGui, $aCID[11][9], $iX = 5, $iY = 5, $Start
Global $hDetail, $Name, $Pass, $Char

$hGui = GUICreate("Silkroad Connect Helper", 550, 600, -1, -1)
GUISetBkColor(0xffffff)
GUISetOnEvent($GUI_EVENT_CLOSE, "GuiEvent", $hGui)
For $i = 1 To UBound($aCID, 1) -1
    $aCID[$i][0] = GUICtrlCreateGroup("Account " & $i, $iX, $iY, 540, 50)
    $aCID[$i][1] = GUICtrlCreateCheckbox("Enable", $iX + 10, $iY + 20, 55, 20)
    GUICtrlSetState(-1, $GUI_CHECKED)
    GUICtrlSetOnEvent(-1, "CheckBox")
    $aCID[$i][2] = GUICtrlCreateInput("Path not currently set", $iX + 70, $iY + 20, 260, 20, $ES_READONLY)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $aCID[$i][3] = GUICtrlCreateButton("...", $iX + 340, $iY + 20, 25, 20)
    GUICtrlSetOnEvent(-1, "Browse")
    GUICtrlSetTip(-1, "Click to browse for Sbot exe for Account " & $i)
    $aCID[$i][4] = GUICtrlCreateLabel("Idle", $iX + 375, $iY + 20, 70, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
    GUICtrlSetBkColor(-1, 0xFF0000)
    $aCID[$i][5] = GUICtrlCreateButton("Login Details", $iX + 455, $iY + 20, 75, 20)
    GUICtrlSetOnEvent(-1, "Details")
    $iY += 55
Next
$Start = GUICtrlCreateButton("Start", 225, 555, 100, 40)
GUICtrlSetOnEvent(-1, "Start")
Load()
GUISetState(@SW_SHOW, $hGui)

$hDetail = GUICreate("", 285, 200, -1, -1, $WS_CAPTION, $WS_EX_TOPMOST)
GUICtrlCreateLabel("Username:", 5, 5, 55, 20, $BS_CENTER)
GUICtrlCreateLabel("Password:", 5, 30, 55, 20, $BS_CENTER)
GUICtrlCreateLabel("Character:", 5, 55, 55, 20, $BS_CENTER)
$Name = GUICtrlCreateInput("", 70, 5, 200, 20)
$Pass = GUICtrlCreateInput("", 70, 30, 200, 20, $ES_PASSWORD)
$Char = GUICtrlCreateInput("", 70, 55, 200, 20)
GUICtrlSetTip(-1, "Enter you character name (Case Sensitive)")
$Ok = GUICtrlCreateButton("Ok", 50, 90, 60, 20)
GUICtrlSetOnEvent(-1, "SetDetails")
$Cancel = GUICtrlCreateButton("Cancel", 120, 90, 60, 20)
GUICtrlSetOnEvent(-1, "SetDetails")
GUISetState(@SW_HIDE, $hDetail)

While 1
    Sleep(100)
WEnd

Func GuiEvent()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE
            Save()
            Exit
        Case $GUI_EVENT_MINIMIZE

        Case $GUI_EVENT_RESTORE
            
    EndSwitch
EndFunc

Func CheckBox()
    Local $cID = @GUI_CtrlId
    For $i = 1 To Ubound($aCID, 1) -1
        If $cID == $aCID[$i][1] Then
            CheckBoxState($i)
            Return
        EndIf
    Next    
EndFunc

Func CheckBoxState($iD)
    Local $State, $BkClr, $Clr, $sTxt
    If BitAnd(GUICtrlRead($aCID[$iD][1]), $GUI_CHECKED) Then
        $State = $GUI_ENABLE
        $BkClr = 0xFF0000
        $Clr = 0x000000
        $sTxt = "Idle"
    Else    
        $State = $GUI_DISABLE
        $BkClr = 0x000000
        $Clr = 0xFF0000
        $sTxt = "Disabled"
    EndIf
    GUICtrlSetState($aCID[$iD][2], $State)
    GUICtrlSetState($aCID[$iD][3], $State)
    GUICtrlSetBkColor($aCID[$iD][4], $BkClr)
    GUICtrlSetColor($aCID[$iD][4], $Clr)
    GUICtrlSetData($aCID[$iD][4], $sTxt)
    GUICtrlSetState($aCID[$iD][5], $State)  
EndFunc 

Func Browse()
    Local $cID = @GUI_CtrlId
    For $i = 1 To Ubound($aCID, 1) -1
        If $cID == $aCID[$i][3] Then
            Local $FOD
            $FOD = FileOpenDialog("Select the Sbot exe for " & GUICtrlRead($aCID[$i][0]), @DesktopCommonDir, "exe files (*.exe)", 3, "", $hGui)
            If Not @error Then 
                GUICtrlSetData($aCID[$i][2], $FOD)
                Save()
            EndIf   
            Return
        EndIf
    Next
EndFunc

Func Details()
    Local $cID = @GUI_CtrlId
    For $i = 1 To Ubound($aCID, 1) -1
        If $cID == $aCID[$i][5] Then
            GUISetState(@SW_HIDE, $hGui)
            $aCID[0][0] = $i
            WinSetTitle($hDetail, "", "Silkroad login details for " & GUICtrlRead($aCID[$i][0]))
            GUICtrlSetData($Name, $aCID[$i][6])
            GUICtrlSetData($Pass, $aCID[$i][7])
            GUICtrlSetData($Char, GUICtrlRead($aCID[$i][0]))
            Save()
            GUISetState(@SW_SHOW, $hDetail)
            Return
        EndIf
    Next    
EndFunc

Func SetDetails()
    If @GUI_CtrlId = $Ok Then
        $aCID[$aCID[0][0]][6] = GUICtrlRead($Name)
        $aCID[$aCID[0][0]][7] = GUICtrlRead($Pass)
        $aCID[$aCID[0][0]][8] = GUICtrlRead($Char)
        GUICtrlSetData($aCID[$aCID[0][0]][0], $aCID[$aCID[0][0]][8])
        Save()
    EndIf
    GUISetState(@SW_HIDE, $hDetail)
    GUISetState(@SW_SHOW, $hGui)
    $aCID[0][0] = 0
EndFunc

Func Save()
    For $i = 1 To Ubound($aCID, 1) -1
        IniWrite($Ini, "Char" & $i, "GroupName", GUICtrlRead($aCID[$i][0]))
        IniWrite($Ini, "Char" & $i, "Enabled", GUICtrlRead($aCID[$i][1]))
        IniWrite($Ini, "Char" & $i, "Directory", GUICtrlRead($aCID[$i][2]))
        IniWrite($Ini, "Char" & $i, "UserName", $aCID[$i][6])
        IniWrite($Ini, "Char" & $i, "Password", $aCID[$i][7])
        IniWrite($Ini, "Char" & $i, "CharName", $aCID[$i][8])
    Next    
EndFunc

Func Load()
    Local $IRSN, $IRS 
    $IRSN = IniReadSectionNames($Ini)
    If @error Or Not IsArray($IRSN) Then Return
    For $i = 1 To $IRSN[0]
        $IRS = IniReadSection($Ini, $IRSN[$i])
        If @error Or Not IsArray($IRS) Then ContinueLoop
        GUICtrlSetData($aCID[$i][0], $IRS[1][1])
        GUICtrlSetTip($aCID[$i][0], "Click to enable or disable " & $IRS[1][1])
        GUICtrlSetState($aCID[$i][1], $IRS[2][1])
        CheckBoxState($i)
        GUICtrlSetData($aCID[$i][2], $IRS[3][1])
        $aCID[$i][6] = $IRS[4][1]
        $aCID[$i][7] = $IRS[5][1]
        $aCID[$i][8] = $IRS[6][1]
    Next        
EndFunc

Func Start()
    GUICtrlSetState($Start, $GUI_DISABLE)
    For $i = 1 To UBound($aCID, 1) -1
        If BitAnd(GUICtrlRead($aCID[$i][1]), $GUI_CHECKED) Then
            If FileExists(GUICtrlRead($aCID[$i][2])) And $aCID[$i][6] <> "" And $aCID[$i][7] <> "" And $aCID[$i][8] <> "" Then

                Run(GUICtrlRead($aCID[$i][2]))
                WinWaitActive('SBot v1.32d (C)2008,2009 by bot-cave.net', "", 5)
                Sleep(3000)
                
                If Not LoginCheck($i) Then Return GUICtrlSetState($Start, $GUI_ENABLE)      
            EndIf
        EndIf
    Next
    GUICtrlSetState($Start, $GUI_ENABLE)
EndFunc

Func LoginCheck($iD)
    Local $loginchk, $MB
    $loginchk = ControlGetText('SBot v1.32d (C)2008,2009 by bot-cave.net', "", "[CLASS:Static; INSTANCE:7]")
    If @error Or ($loginchk = "Error - Connection failed!") Then
        $MB = MsgBox(36, "Silkroad Login Helper", "Sbot connection failed Login with Account " & $iD & @LF & _
                    "FilePath: " & GUICtrlRead($aCID[$iD][2]) & @LF & _
                    "UserName: " & $aCID[$iD][6] & @LF & _
                    "Password: " & $aCID[$iD][7] & @LF & _
                    "Character: " & $aCID[$iD][8] & @LF & @LF & _
                    "Continue login with next Account?")
        Switch $MB
            Case 6
                Return 1
            Case Else
                Return 0
        EndSwitch       
    EndIf
EndFunc

Cheers

Share this post


Link to post
Share on other sites

Thx for your efforts colafrysen and smashly,

and thanks smashly for writing the script , ill need a few hours to analyze and understand it but at the end ill learn something ^_-

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0