Sign in to follow this  
Followers 0
bleed

got stuck

5 posts in this topic

I`m stuck with this thing since last night. I have to make 15 tabs and each includes several input fields, and quite a bit of radios. The problem is, when I start the the script, it goes to a 2nd tab as a default insted of tab1. I can also save all the info in my .ini file from tab1, but not from tab2.

If someone can take a quick look at it and show me where and what am I doing wrong here?

Here is a code, and below is a DCAL.ini file part

Thanks

#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
    $charname1 = IniRead("DCAL.ini", "Char1", "CharName1", "")
    $charname2 = IniRead("DCAL.ini", "Char2", "CharName2", "")
    $charname3 = IniRead("DCAL.ini", "Char3", "CharName3", "")
    $charname4 = IniRead("DCAL.ini", "Char4", "CharName4", "")
    $charname5 = IniRead("DCAL.ini", "Char5", "CharName5", "")
    $charname6 = IniRead("DCAL.ini", "Char6", "CharName6", "")
    $charname7 = IniRead("DCAL.ini", "Char7", "CharName7", "")
    $charname8 = IniRead("DCAL.ini", "Char8", "CharName8", "")
    $charname9 = IniRead("DCAL.ini", "Char9", "CharName9", "")
    $charname10 = IniRead("DCAL.ini", "Char10", "CharName10", "")
    $charname11 = IniRead("DCAL.ini", "Char11", "CharName11", "")
    $charname12 = IniRead("DCAL.ini", "Char12", "CharName12", "")
    $charname13 = IniRead("DCAL.ini", "Char13", "CharName13", "")
    $charname14 = IniRead("DCAL.ini", "Char14", "CharName14", "")
    $charname15 = IniRead("DCAL.ini", "Char15", "CharName15", "")
    $charname = "[MyCharName]"
    $stuckcheck = IniRead("DCAL.ini", "General", "stuckcheck", "")
    
; GUI
$hGUI = GuiCreate("DC", 603, 430)
GuiSetIcon(@WorkingDir & "\DC.ico", 0)
GuiCtrlCreateTab(2, 5, 600, 295)
;--------------GENERAL-----------------------------
GUICtrlCreateLabel("General Settings:", 4, 310)
GUICtrlCreateLabel("Stuck protection every:", 4, 330)
If $stuckcheck = "OFF" Then
$stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60)
$stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60)
$stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60)
$stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60)
$stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60)
GUICtrlSetState($stuckprot5, $GUI_CHECKED)
    GUIStartGroup()
EndIf
If $stuckcheck = 15 Then
$stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60)
$stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60)
$stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60)
$stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60)
$stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60)
GUICtrlSetState($stuckprot1, $GUI_CHECKED)
    GUIStartGroup()
EndIf
If $stuckcheck = 30 Then
$stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60)
$stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60)
$stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60)
$stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60)
$stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60)
GUICtrlSetState($stuckprot2, $GUI_CHECKED)
    GUIStartGroup()
EndIf
If $stuckcheck = 45 Then
$stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60)
$stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60)
$stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60)
$stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60)
$stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60)
GUICtrlSetState($stuckprot3, $GUI_CHECKED)
    GUIStartGroup()
EndIf
If $stuckcheck = 60 Then
$stuckprot1 = GUICtrlCreateRadio("15 Min.", 158, 328, 60)
$stuckprot2 = GUICtrlCreateRadio("30 Min.", 225, 328, 60)
$stuckprot3 = GUICtrlCreateRadio("45 Min.", 290, 328, 60)
$stuckprot4 = GUICtrlCreateRadio("60 Min.", 358, 328, 60)
$stuckprot5 = GUICtrlCreateRadio("OFF", 418, 328, 60)
GUICtrlSetState($stuckprot4, $GUI_CHECKED)
    GUIStartGroup()
EndIf
$SaveAllSettings = GUICtrlCreateButton("Save general Settings", 50, 360, 110, 35)
$StopDCAL = GUICtrlCreateButton("Stop logging in", 250, 360, 110, 35)
$StartDCAL = GUICtrlCreateButton("Start logging in", 450, 360, 110, 35)
;If GUIGetMsg ($StopDCAL) Then 
;Call ("ExitDCAL")
    
;EndIf
;If GUIGetMsg ($StartDCAL) Then
;Call ("CharCheck1")
;EndIf
GUICtrlCreateTabItem("")

;-------------------------------------------------------------------------------------------
$Tab1 = GuiCtrlCreateTabItem($charname1)
GUISwitch($hGUI, $Tab1)
$sIniFile = @WorkingDir & "\DCAL.ini"
$sValue = IniRead (@WorkingDir & "\DCAL.ini", "Char1", "CharName1", "Empty")
$charname1 = GUICtrlCreateInput($sValue,50, 50, 130, 20)
$sValue1 = IniRead (@WorkingDir & "\DCAL.ini", "Char1", "ID", "Empty")
$charID1 = GUICtrlCreateInput($sValue1,50, 80, 130, 20)
$sValue2 = IniRead (@WorkingDir & "\DCAL.ini", "Char1", "PW", "Empty")
$charPW1 = GUICtrlCreateInput($sValue2, 50, 110, 130, 20)
$char1Pos1 = IniRead("DCAL.ini", "Char1", "Pos 1-4", "")
$autotrain1 = IniRead("DCAL.ini", "Char1", "Auto Training", "")
$killclient1 = IniRead("DCAL.ini", "Char1", "Kill the client", "")
$path1 = IniRead("DCAL.ini", "Char1", "Path Char1", "Path")
$charsnr = IniRead("DCAL.ini", "Char1", "Number of chars (1-4)", "")
$Label1 = GUICtrlCreateLabel("File name:", 200, 50, 230, 20)
$patch = GUICtrlCreateInput($path1, 200, 75, 230, 20)
$button = GUICtrlCreateButton("Browse", 450, 75, 50, 20)
GuiCtrlCreateLabel("Char 1", 4, 55)
GuiCtrlCreateLabel("ID", 4, 85)
GuiCtrlCreateLabel("PW", 4, 115)
GuiCtrlCreateLabel("Server Selection----- Not implemented yet", 4, 145) 
GuiCtrlCreateLabel("Pos 1-4:", 4, 175)
GuiCtrlCreateLabel("Number of chars (1-4):", 4, 205)
GUISetState()
            If $charsnr = 1 Then
$charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($charsnr1, $GUI_CHECKED)
EndIf
If $charsnr = 2 Then
$charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($charsnr2, $GUI_CHECKED)
EndIf
If $charsnr = 3 Then
$charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($charsnr3, $GUI_CHECKED)
EndIf
If $charsnr = 4 Then
$charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($charsnr4, $GUI_CHECKED)
EndIf
GUISetState()
GUIStartGroup()
GuiCtrlCreateLabel("Start Auto Training after logged in?", 4, 235)
If $autotrain1 = 1 Then
$RadioYesAutotraining = GuiCtrlCreateRadio("Yes", 260, 232, 45)
GUICtrlSetState($RadioYesAutotraining, $GUI_CHECKED)
$RadioNoAutotraining = GuiCtrlCreateRadio("No", 320, 232, 45)
GUIStartGroup()
EndIf
If $autotrain1 = 0 Then
$RadioYesAutotraining = GuiCtrlCreateRadio("Yes", 260, 232, 45)
$RadioNoAutotraining = GuiCtrlCreateRadio("No", 320, 232, 45)
GUICtrlSetState($RadioNoAutotraining, $GUI_CHECKED)
GUIStartGroup()
EndIf
GuiCtrlCreateLabel("Kill the client", 4, 265)
If $killclient1 = 1 Then
$RadioKillClientYes = GuiCtrlCreateRadio("Yes", 260, 262, 45)
GUICtrlSetState($RadioKillClientYes, $GUI_CHECKED)
$RadioKillClientNo = GuiCtrlCreateRadio("No", 320, 262, 45)
EndIf
If $killclient1 = 0 Then
$RadioKillClientYes = GuiCtrlCreateRadio("Yes", 260, 262, 45)
$RadioKillClientNo = GuiCtrlCreateRadio("No", 320, 262, 45)
GUICtrlSetState($RadioKillClientNo, $GUI_CHECKED)
EndIf

    Opt("GUICoordMode", 1)
    GUIStartGroup()
If $char1Pos1 = 1 Then
$Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($Ch1position1, $GUI_CHECKED)
EndIf
If $char1Pos1 = 2 Then
$Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($Ch1position2, $GUI_CHECKED)
EndIf
If $char1Pos1 = 3 Then
$Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($Ch1position3, $GUI_CHECKED)
EndIf
If $char1Pos1 = 4 Then
$Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($Ch1position4, $GUI_CHECKED)
EndIf
$Char1Save = GUICtrlCreateButton("Save Char Data!", 450, 200, 110, 48)
GUIStartGroup()

GUICtrlCreateTabItem("")
GUISetState()


;--------------char2----------------------------------------------------------
$Tab2 = GuiCtrlCreateTabItem($charname2)
GUISwitch($hGUI, $Tab2)
GUISetState()
$sIniFile = @WorkingDir & "\DCAL.ini"
$sValue2 = IniRead (@WorkingDir & "\DCAL.ini", "Char2", "CharName2", "Empty")
$charname2 = GUICtrlCreateInput($sValue2,50, 50, 130, 20)
$sValue12 = IniRead (@WorkingDir & "\DCAL.ini", "Char2", "ID", "Empty")
$charID2 = GUICtrlCreateInput($sValue12,50, 80, 130, 20)
$sValue22 = IniRead (@WorkingDir & "\DCAL.ini", "Char2", "PW", "Empty")
$charPW2 = GUICtrlCreateInput($sValue22, 50, 110, 130, 20)
$2char1Pos1 = IniRead("DCAL.ini", "Char2", "Pos 1-4", "")
$autotrain2 = IniRead("DCAL.ini", "Char2", "Auto Training", "")
$killclient2 = IniRead("DCAL.ini", "Char2", "Kill the client", "")
$path2 = IniRead("DCAL.ini", "Char2", "Path Char2", "Path")
$2charsnr = IniRead("DCAL.ini", "Char2", "Number of chars (1-4)", "")
$Label2 = GUICtrlCreateLabel("File name:", 200, 50, 230, 20)
$patch2 = GUICtrlCreateInput($path2, 200, 75, 230, 20)
$button2 = GUICtrlCreateButton("Browse", 450, 75, 50, 20)
GuiCtrlCreateLabel("Char 2", 4, 55)
GuiCtrlCreateLabel("ID", 4, 85)
GuiCtrlCreateLabel("PW", 4, 115)
GuiCtrlCreateLabel("Server Selection----- Not implemented yet", 4, 145) 
GuiCtrlCreateLabel("Pos 1-4:", 4, 175)
GuiCtrlCreateLabel("Number of chars (1-4):", 4, 205)
GUISetState()
            If $2charsnr = 1 Then
$2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($2charsnr1, $GUI_CHECKED)
EndIf
If $2charsnr = 2 Then
$2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($2charsnr2, $GUI_CHECKED)
EndIf
If $2charsnr = 3 Then
$2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($2charsnr3, $GUI_CHECKED)
EndIf
If $2charsnr = 4 Then
$2charsnr1 = GuiCtrlCreateRadio("1 Char", 125, 202, 60)
$2charsnr2 = GuiCtrlCreateRadio("2 Chars", 195, 202, 60)
$2charsnr3 = GuiCtrlCreateRadio("3 Chars", 260, 202, 60)
$2charsnr4 = GuiCtrlCreateRadio("4 Chars", 330, 202, 60)
GUICtrlSetState($2charsnr4, $GUI_CHECKED)
EndIf
        
GUISetState()
GUIStartGroup()
GuiCtrlCreateLabel("Start Auto Training after logged in?", 4, 235)
If $autotrain2 = 1 Then
$RadioYesAutotraining2 = GuiCtrlCreateRadio("Yes", 260, 232, 45)
GUICtrlSetState($RadioYesAutotraining2, $GUI_CHECKED)
$RadioNoAutotraining2 = GuiCtrlCreateRadio("No", 320, 232, 45)
GUIStartGroup()
EndIf
If $autotrain2 = 0 Then
$RadioYesAutotraining2 = GuiCtrlCreateRadio("Yes", 260, 232, 45)
$RadioNoAutotraining2 = GuiCtrlCreateRadio("No", 320, 232, 45)
GUICtrlSetState($RadioNoAutotraining2, $GUI_CHECKED)
GUIStartGroup()
EndIf
GuiCtrlCreateLabel("Kill the client", 4, 265)
If $killclient2 = 1 Then
$RadioKillClientYes2 = GuiCtrlCreateRadio("Yes", 260, 262, 45)
GUICtrlSetState($RadioKillClientYes2, $GUI_CHECKED)
$RadioKillClientNo2 = GuiCtrlCreateRadio("No", 320, 262, 45)
EndIf
If $killclient2 = 0 Then
$RadioKillClientYes2 = GuiCtrlCreateRadio("Yes", 260, 262, 45)
$RadioKillClientNo2 = GuiCtrlCreateRadio("No", 320, 262, 45)
GUICtrlSetState($RadioKillClientNo2, $GUI_CHECKED)
EndIf

    GUIStartGroup()
If $2char1Pos1 = 1 Then
$2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($2Ch1position1, $GUI_CHECKED)
EndIf
If $2char1Pos1 = 2 Then
$2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($2Ch1position2, $GUI_CHECKED)
EndIf
If $2char1Pos1 = 3 Then
$2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($2Ch1position3, $GUI_CHECKED)
EndIf
If $2char1Pos1 = 4 Then
$2Ch1position1 = GuiCtrlCreateRadio("Char Position 1", 60, 172, 100)
$2Ch1position2 = GuiCtrlCreateRadio("Char Position 2", 160, 172, 100)
$2Ch1position3 = GuiCtrlCreateRadio("Char Position 3", 260, 172, 100)
$2Ch1position4 = GuiCtrlCreateRadio("Char Position 4", 360, 172, 100)
GUICtrlSetState($2Ch1position4, $GUI_CHECKED)
EndIf
$Char2Save = GUICtrlCreateButton("Save Char Data!", 450, 200, 110, 48)
GUIStartGroup()
GUICtrlCreateTabItem("")
GUISetState()
While 1
    Switch GUIGetMsg()
        Case $Char1Save
                IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "CharName1", GUICtrlRead($Tab1))
                IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "ID", GUICtrlRead($charID1))
                IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "PW", GUICtrlRead($charPW1))
                IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Path Char1", GUICtrlRead($patch))
                    If GUICtrlRead($Ch1position1) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "1")
                        EndIf
                    If GUICtrlRead($Ch1position2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "2")
                        EndIf
                    If GUICtrlRead($Ch1position3) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "3")
                        EndIf
                    If GUICtrlRead($Ch1position4) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Pos 1-4", "4")
                    EndIf
                    If GUICtrlRead($RadioYesAutotraining) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Auto Training", "1")
                        EndIf
                    If GUICtrlRead($RadioNoAutotraining) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Auto Training", "0")
                    EndIf
                    If GUICtrlRead($RadioKillClientYes) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Kill the client", "1")
                        EndIf
                    If GUICtrlRead($RadioKillClientNo) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Kill the client", "0")
                    EndIf
                    If GUICtrlRead($charsnr1) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "1")
                        EndIf
                    If GUICtrlRead($charsnr2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "2")
                        EndIf
                    If GUICtrlRead($charsnr3) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "3")
                        EndIf
                    If GUICtrlRead($charsnr4) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char1", "Number of chars (1-4)", "4")
                    EndIf
                ;GENERAL SETTINGS BELOW
                    If GUICtrlRead($stuckprot1) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "15")
                        EndIf
                    If GUICtrlRead($stuckprot2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "30")
                        EndIf
                    If GUICtrlRead($stuckprot3) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "45")
                        EndIf
                    If GUICtrlRead($stuckprot4) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "60")
                        EndIf
                    If GUICtrlRead($stuckprot5) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "General", "stuckcheck", "OFF")
                    EndIf
                Case $Char2Save
                IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "CharName1", GUICtrlRead($Tab2))
                IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "ID", GUICtrlRead($charID2))
                IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "PW", GUICtrlRead($charPW2))
                IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Path Char1", GUICtrlRead($patch2))
                    If GUICtrlRead($2Ch1position1) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "1")
                        EndIf
                    If GUICtrlRead($2Ch1position2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "2")
                        EndIf
                    If GUICtrlRead($2Ch1position3) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "3")
                        EndIf
                    If GUICtrlRead($2Ch1position4) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Pos 1-4", "4")
                    EndIf
                    If GUICtrlRead($RadioYesAutotraining2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Auto Training", "1")
                        EndIf
                    If GUICtrlRead($RadioNoAutotraining2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Auto Training", "0")
                    EndIf
                    If GUICtrlRead($RadioKillClientYes2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Kill the client", "1")
                        EndIf
                    If GUICtrlRead($RadioKillClientNo2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Kill the client", "0")
                    EndIf
                    If GUICtrlRead($2charsnr1) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "1")
                        EndIf
                    If GUICtrlRead($2charsnr2) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "2")
                        EndIf
                    If GUICtrlRead($2charsnr3) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "3")
                        EndIf
                    If GUICtrlRead($2charsnr4) = $GUI_Checked Then 
                        IniWrite(@WorkingDir & "\DCAL.ini", "Char2", "Number of chars (1-4)", "4")
                    EndIf           
                ;GENERAL SETTINGS ABOVE
        Case $GUI_EVENT_CLOSE
                Exit
        Case $button
            $message = "Choose a file"
            $var = FileSelectFolder($message, "" & "\", "", 1 + 1)
            If @error Then
                MsgBox(4096, "", "No File(s) chosen")
            Else
                $var = FileGetLongName($var)
                $tmp = StringTrimLeft($var, 3)
                $tmp = StringRegExpReplace($tmp, '(?<=\\).*?(?=\\)', '...')
                $tmp = StringLeft($var, 3) & $tmp
                GUICtrlSetData($patch, $tmp)
            EndIf
        Case $button2
            $message = "Choose a file"
            $var = FileSelectFolder($message, "" & "\", "", 1 + 1)
            If @error Then
                MsgBox(4096, "", "No File(s) chosen")
            Else
                $var = FileGetLongName($var)
                $tmp = StringTrimLeft($var, 3)
                $tmp = StringRegExpReplace($tmp, '(?<=\\).*?(?=\\)', '...')
                $tmp = StringLeft($var, 3) & $tmp
                GUICtrlSetData($patch2, $tmp)
            EndIf   
        Case $GUI_EVENT_CLOSE 
            ExitLoop
    EndSwitch
WEnd

[General]
stuckcheck=15


[Char1]
CharName1=111
ID=111
PW=111
Pos 1-4=3
Number of chars (1-4)=3
Auto Training=1
Kill the client=1
Path Char1=C:\Documents and Settings\Administrator\Desktop\folder1


[Char2]
CharName2=VVVVVVVV
ID=gggggggggg
PW=gggggggggggggggg
Pos 1-4=3
Number of chars (1-4)=1
Auto Training=0
Kill the client=0
Path Char2=C:\Documents and Settings\Administrator\Desktop\Folder2


[Char3]
CharName3=VVVVVVVV
ID=gggggggggg
PW=gggggggggggggggg
Pos 1-4=3
Number of chars (1-4)=1
Auto Training=0
Kill the client=0
Path Char3=C:\Documents and Settings\Administrator\Desktop\Folder3

Share this post


Link to post
Share on other sites



It's rather a lot of code to read so I'll just note 2 things I noticed.

You seem to have created controls after you created the tab and in the area of the tab but before you created a tabitem. Maybe you thought that creating a tab automatically started with a tabitem?

You have clodsed the tab definitions before you have finished creating and populating all the tabs. I don't know if that causes a prolem but the usual approach is

create the tab

create the first tab item

create the controls on the first tab item. No need for GuiSwitch($gui,$Tabitem) here.

Create the next tabitem

create the controls on tab

etc

GuiCtrlCreateTabItem("");end all tab definitions.

So I suspect that what you need to do is

Create a tabitem immediately after creating the tab,

remove the end tab definitions untill after the last tab.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks Martin, I guess, I`ll go again from scratch. :)

Share this post


Link to post
Share on other sites

Thanks Martin, I guess, I`ll go again from scratch. :)

NP but I think you only need to make a couple of very small changes, don't start again from scratch and loose the work you've done. :party:


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

NP but I think you only need to make a couple of very small changes, don't start again from scratch and loose the work you've done. :)

Martin, after I did what you told me, everything is as it is supposed to be. I guess I have to learn how to walk, before I learn how to jump :party:

Thanks again

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