Jump to content

Multiple GUI's with individual actions


nbourg8
 Share

Recommended Posts

I would like to use multiple gui's in one script such that the Main GUI opens a sub-GUI that, for the purpose of simplicity, has 1 button which has a function associated to it. I am able to accomplish mutliple GUI's using the help file but when I try to call the button in the 2nd GUI, nothing happens. Below is the code I have so far without the 2nd gui's button function added. This is what I was hoping someone here could show me, where am I able to allow for the if $msg = button2 then do statement commands.

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=CrazyEye_Anger.ico
#AutoIt3Wrapper_outfile=2bot.exe
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiMenu.au3>
#include <GUIConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>
#include <WinAPI.au3>
#include <File.au3>
Global $inifile = "config.ini"
Global $inusername, $inpassword
Global Enum $idSkillSetup = 1000, $idAutoPot, $idColorSetup, $idExit, $idabout, $idinfo
If Not FileExists($inifile) Then
    _FileCreate($inifile)
Else
;2bot main menu
    $username = IniRead($inifile, "login", "username", "")
    $password = IniRead($inifile, "login", "password", "")
    $cbsave = IniRead($inifile, "2bot", "cbsave", "0")
    $cbaa = IniRead($inifile, "2bot", "cbaa", "0")
    $cbap = IniRead($inifile, "2bot", "cbap", "0")
    $cbfb = IniRead($inifile, "2bot", "cbfb", "0")
    $cbal = IniRead($inifile, "2bot", "cbal", "0")
;Skill Setup menu
    $cb11 = IniRead($inifile, "SkillSetup", "cb11", "0")
    $cb12 = IniRead($inifile, "SkillSetup", "cb12", "0")
    $cb13 = IniRead($inifile, "SkillSetup", "cb13", "0")
    $cb14 = IniRead($inifile, "SkillSetup", "cb14", "0")
    $cb15 = IniRead($inifile, "SkillSetup", "cb15", "0")
    $cb16 = IniRead($inifile, "SkillSetup", "cb16", "0")
    $cb17 = IniRead($inifile, "SkillSetup", "cb17", "0")
    $cb18 = IniRead($inifile, "SkillSetup", "cb18", "0")
    $cb19 = IniRead($inifile, "SkillSetup", "cb19", "0")
EndIf


Local $hFile, $hSettings, $hinfo
#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form1.kxf
; Create GUI
$2botForm = GUICreate("2bot", 371, 150, 193, 125)

; Create File menu
$hSettings = _GUICtrlMenu_CreateMenu()
_GUICtrlMenu_InsertMenuItem($hSettings, 0, "&Skill Setup", $idSkillSetup)
_GUICtrlMenu_InsertMenuItem($hSettings, 1, "&Auto Pot", $idAutoPot)
_GUICtrlMenu_InsertMenuItem($hSettings, 2, "&Color Setup", $idColorSetup)
_GUICtrlMenu_InsertMenuItem($hSettings, 3, "", 0)
_GUICtrlMenu_InsertMenuItem($hSettings, 4, "E&xit", $idExit)

; Create Info menu
$hinfo = _GUICtrlMenu_CreateMenu()
_GUICtrlMenu_InsertMenuItem($hinfo, 0, "&About", $idabout)
_GUICtrlMenu_InsertMenuItem($hinfo, 1, "&Information", $idinfo)

; Create Main menu
$hMain = _GUICtrlMenu_CreateMenu()
_GUICtrlMenu_InsertMenuItem($hMain, 0, "&Settings", 0, $hSettings)
_GUICtrlMenu_InsertMenuItem($hMain, 1, "&Info", 0, $hinfo)

; Set window menu
_GUICtrlMenu_SetMenu($2botForm, $hMain)

GUICtrlCreateLabel("Username :", 16, 24, 58, 17)
GUICtrlCreateLabel("Password :", 16, 48, 56, 17)
$inusername = GUICtrlCreateInput($username, 80, 16, 121, 21)
$inpassword = GUICtrlCreateInput($password, 80, 40, 121, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
GUICtrlCreateGroup("Login", 8, 0, 209, 81)

$Checkbox1 = GUICtrlCreateCheckbox("Auto Attack", 240, 8, 97, 17)
If $cbaa = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox2 = GUICtrlCreateCheckbox("Auto Pot", 240, 24, 97, 17)
If $cbap = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox3 = GUICtrlCreateCheckbox("Fishing Bot", 240, 40, 97, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
If $cbfb = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox4 = GUICtrlCreateCheckbox("Auto Loot", 240, 56, 97, 17)
If $cbal = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Button1 = GUICtrlCreateButton("Start", 232, 80, 99, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Checkbox5 = GUICtrlCreateCheckbox("Save username / pass", 48, 96, 153, 17)
If $cbsave = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form2.kxf
$SkillSetupForm = GUICreate("Skill Setup", 268, 307, 192, 290)
$Checkbox11 = GUICtrlCreateCheckbox("1", 16, 24, 97, 17)
If $cb11 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox12 = GUICtrlCreateCheckbox("2", 16, 48, 97, 17)
If $cb12 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox13 = GUICtrlCreateCheckbox("3", 16, 72, 97, 17)
If $cb13 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox14 = GUICtrlCreateCheckbox("4", 16, 96, 97, 17)
If $cb14 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox15 = GUICtrlCreateCheckbox("5", 16, 120, 97, 17)
If $cb15 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox16 = GUICtrlCreateCheckbox("6", 16, 144, 97, 17)
If $cb16 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox17 = GUICtrlCreateCheckbox("7", 16, 168, 97, 17)
If $cb17 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox18 = GUICtrlCreateCheckbox("8", 16, 192, 97, 17)
If $cb18 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox19 = GUICtrlCreateCheckbox("9", 16, 216, 97, 17)
If $cb19 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
GUICtrlCreateGroup("Hotkey'd Skillz", 8, 8, 97, 233)
$indelay1 = GUICtrlCreateInput("", 128, 24, 121, 21)
$indelay2 = GUICtrlCreateInput("", 128, 48, 121, 21)
$indelay3 = GUICtrlCreateInput("", 128, 72, 121, 21)
$indelay4 = GUICtrlCreateInput("", 128, 96, 121, 21)
$indelay5 = GUICtrlCreateInput("", 128, 120, 121, 21)
$indelay6 = GUICtrlCreateInput("", 128, 144, 121, 21)
$indelay7 = GUICtrlCreateInput("", 128, 168, 121, 21)
$indelay8 = GUICtrlCreateInput("", 128, 192, 121, 21)
$indelay9 = GUICtrlCreateInput("", 128, 216, 121, 21)
GUICtrlCreateGroup("Skill Delay (ms)", 112, 8, 145, 233)
GUICtrlCreateLabel("1000 ms = 1 second", 8, 248, 118, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("60000 ms = 1 minute", 8, 264, 121, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("600000 ms = 10 minutes", 8, 280, 141, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Button2 = GUICtrlCreateButton("Save Settings", 136, 248, 107, 25, 0)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form3.kxf
$AutoPotForm = GUICreate("Auto Pot Settings", 453, 256, 476, 311)
$inhp = GUICtrlCreateInput("", 45, 30, 121, 21)
$inmp = GUICtrlCreateInput("", 45, 130, 121, 21)
GUICtrlCreateGroup("HP/Pots", 8, 8, 233, 89)
GUICtrlCreateLabel("Pots", 16, 64, 25, 17)
$Radio1 = GUICtrlCreateRadio("F1", 48, 64, 33, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radio2 = GUICtrlCreateRadio("F2", 88, 64, 41, 17)
$Radio3 = GUICtrlCreateRadio("F3", 128, 64, 41, 17)
GUICtrlCreateLabel("HP", 16, 32, 19, 17)
GUICtrlCreateGroup("MP/Pots", 8, 112, 233, 89)
GUICtrlCreateLabel("Pots", 16, 168, 25, 17)
$Radio4 = GUICtrlCreateRadio("F1", 48, 168, 33, 17)
$Radio5 = GUICtrlCreateRadio("F2", 88, 168, 41, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radio6 = GUICtrlCreateRadio("F3", 128, 168, 41, 17)
GUICtrlCreateLabel("MP", 16, 136, 19, 17)
$inresleft = GUICtrlCreateInput("", 280, 40, 49, 21)
$inresright = GUICtrlCreateInput("", 352, 40, 49, 21)
GUICtrlCreateGroup("Resolution", 256, 8, 169, 65)
GUICtrlCreateLabel("*", 336, 40, 8, 17)
GUICtrlCreateLabel("Your game resolution must be the same as your display resolution !", 72, 208, 315, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("You need to use the game in Windows Mode !", 120, 232, 223, 17)
GUICtrlSetColor(-1, 0xFF0000)
$Button2 = GUICtrlCreateButton("Save Settings", 288, 120, 115, 41, 0)
#EndRegion ### END Koda GUI section ####include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form4.kxf
$ColorSetupForm = GUICreate("Color Setup", 374, 216, 657, 695)
$incolor1 = GUICtrlCreateInput("", 24, 40, 73, 21)
$incolor2 = GUICtrlCreateInput("", 104, 40, 65, 21)
GUICtrlCreateLabel("Color 1:", 24, 24, 40, 17)
GUICtrlCreateLabel("Color 2:", 104, 24, 40, 17)
$incolor3 = GUICtrlCreateInput("", 24, 80, 73, 21)
$incolor4 = GUICtrlCreateInput("", 104, 80, 65, 21)
GUICtrlCreateLabel("Color 3:", 24, 64, 40, 17)
GUICtrlCreateLabel("Color 4:", 104, 64, 40, 17)
GUICtrlCreateGroup("Colors: (Decimal Value)", 8, 8, 177, 161)
$Button3 = GUICtrlCreateButton("Color Finder", 96, 120, 75, 33, 0)
$intolerance = GUICtrlCreateInput("", 208, 40, 33, 21)
GUICtrlCreateLabel("1 (default) = exact", 247, 43, 89, 17)
$inleft = GUICtrlCreateInput("", 240, 80, 33, 21)
$inright = GUICtrlCreateInput("", 240, 104, 33, 21)
$intop = GUICtrlCreateInput("", 320, 80, 33, 21)
$inbottom = GUICtrlCreateInput("", 320, 104, 33, 21)
GUICtrlCreateLabel("Left:", 208, 80, 25, 17)
GUICtrlCreateLabel("Right:", 208, 104, 32, 17)
GUICtrlCreateLabel("Top:", 288, 80, 26, 17)
GUICtrlCreateLabel("Bottom:", 280, 104, 40, 17)
GUICtrlCreateLabel("Search Tolerance (1-255)", 208, 24, 125, 17)
GUICtrlCreateGroup("Search Settings", 192, 8, 169, 161)
$Button4 = GUICtrlCreateButton("Default Search Area", 248, 136, 107, 25, 0)
$Button5 = GUICtrlCreateButton("Save Settings", 208, 176, 123, 25, 0)
#EndRegion ### END Koda GUI section ###

GUISetState(@SW_SHOW, $2botForm)
While 1
    $msg = GUIGetMsg(1)
    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
    Select
        Case $msg[0] = $GUI_EVENT_CLOSE
            If $msg[1] = $2botForm Then
                Exit
            ElseIf $msg[1] = $SkillSetupForm Then
                GUISetState(@SW_ENABLE, $2botForm)
                GUISetState(@SW_HIDE, $SkillSetupForm)
            ElseIf $msg[1] = $AutoPotForm Then
                GUISetState(@SW_ENABLE, $2botForm)
                GUISetState(@SW_HIDE, $AutoPotForm)
            ElseIf $msg[1] = $ColorSetupForm Then
                GUISetState(@SW_ENABLE, $2botForm)
                GUISetState(@SW_HIDE, $ColorSetupForm)
            EndIf
        Case $msg[0] = $Button1
            saveinfo()
    EndSelect
WEnd

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    Switch _WinAPI_LoWord($iwParam)
        Case $idSkillSetup
            GUISetState(@SW_SHOW, $SkillSetupForm)
        Case $idAutoPot
            GUISetState(@SW_SHOW, $AutoPotForm)
        Case $idColorSetup
            GUISetState(@SW_SHOW, $ColorSetupForm)
        Case $idExit
            Exit
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc  ;==>WM_COMMAND

Func saveinfo()
    If GUICtrlRead($Checkbox5) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbsave", "1")
        IniWrite($inifile, "login", "username", GUICtrlRead($inusername))
        IniWrite($inifile, "login", "password", GUICtrlRead($inpassword))
    Else
        IniWrite($inifile, "2bot", "cbsave", "0")
    EndIf
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbaa", "1")
    Else
        IniWrite($inifile, "2bot", "cbaa", "0")
    EndIf
    If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbap", "1")
    Else
        IniWrite($inifile, "2bot", "cbap", "0")
    EndIf
    If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbfb", "1")
    Else
        IniWrite($inifile, "2bot", "cbfb", "0")
    EndIf
    If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbal", "1")
    Else
        IniWrite($inifile, "2bot", "cbal", "0")
    EndIf
    If GUICtrlRead($Checkbox11) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb11", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb11", "0")
    EndIf
    If GUICtrlRead($Checkbox12) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb12", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb12", "0")
    EndIf
    If GUICtrlRead($Checkbox13) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb13", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb13", "0")
    EndIf
    If GUICtrlRead($Checkbox14) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb14", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb14", "0")
    EndIf
    If GUICtrlRead($Checkbox15) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb15", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb15", "0")
    EndIf
    If GUICtrlRead($Checkbox16) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb16", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb16", "0")
    EndIf
    If GUICtrlRead($Checkbox17) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb17", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb17", "0")
    EndIf
    If GUICtrlRead($Checkbox18) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb18", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb18", "0")
    EndIf
    If GUICtrlRead($Checkbox19) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb19", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb19", "0")
    EndIf
    IniWrite($inifile, "SkillSetup", "indelay1", GUICtrlRead($indelay1))
    IniWrite($inifile, "SkillSetup", "indelay2", GUICtrlRead($indelay2))
    IniWrite($inifile, "SkillSetup", "indelay3", GUICtrlRead($indelay3))
    IniWrite($inifile, "SkillSetup", "indelay4", GUICtrlRead($indelay4))
    IniWrite($inifile, "SkillSetup", "indelay5", GUICtrlRead($indelay5))
    IniWrite($inifile, "SkillSetup", "indelay6", GUICtrlRead($indelay6))
    IniWrite($inifile, "SkillSetup", "indelay7", GUICtrlRead($indelay7))
    IniWrite($inifile, "SkillSetup", "indelay8", GUICtrlRead($indelay8))
    IniWrite($inifile, "SkillSetup", "indelay9", GUICtrlRead($indelay9))
    return
EndFunc  ;==>saveinfo
Edited by nbourg8
Link to comment
Share on other sites

glad you caught that

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=CrazyEye_Anger.ico
#AutoIt3Wrapper_outfile=2bot.exe
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiMenu.au3>
#include <GUIConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>
#include <WinAPI.au3>
#include <File.au3>
Global $inifile = "config.ini" 
Global $inusername, $inpassword
Global Enum $idSkillSetup = 1000, $idAutoPot, $idColorSetup, $idExit, $idabout, $idinfo
If Not FileExists($inifile) Then
    _FileCreate($inifile)
Else
    ;2bot main menu
    $username = IniRead($inifile, "login", "username", "")
    $password = IniRead($inifile, "login", "password", "")
    $cbsave = IniRead($inifile, "2bot", "cbsave", "0")
    $cbaa = IniRead($inifile, "2bot", "cbaa", "0")
    $cbap = IniRead($inifile, "2bot", "cbap", "0")
    $cbfb = IniRead($inifile, "2bot", "cbfb", "0")
    $cbal = IniRead($inifile, "2bot", "cbal", "0")
    ;Skill Setup menu
    $cb11 = IniRead($inifile, "SkillSetup", "cb11", "0")
    $cb12 = IniRead($inifile, "SkillSetup", "cb12", "0")
    $cb13 = IniRead($inifile, "SkillSetup", "cb13", "0")
    $cb14 = IniRead($inifile, "SkillSetup", "cb14", "0")
    $cb15 = IniRead($inifile, "SkillSetup", "cb15", "0")
    $cb16 = IniRead($inifile, "SkillSetup", "cb16", "0")
    $cb17 = IniRead($inifile, "SkillSetup", "cb17", "0")
    $cb18 = IniRead($inifile, "SkillSetup", "cb18", "0")
    $cb19 = IniRead($inifile, "SkillSetup", "cb19", "0")
EndIf


Local $hFile, $hSettings, $hinfo
#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form1.kxf
; Create GUI
$2botForm = GUICreate("2bot", 371, 150, 193, 125)

; Create File menu
$hSettings = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hSettings, 0, "&Skill Setup", $idSkillSetup)
_GUICtrlMenu_InsertMenuItem ($hSettings, 1, "&Auto Pot", $idAutoPot)
_GUICtrlMenu_InsertMenuItem ($hSettings, 2, "&Color Setup", $idColorSetup)
_GUICtrlMenu_InsertMenuItem ($hSettings, 3, "", 0)
_GUICtrlMenu_InsertMenuItem ($hSettings, 4, "E&xit", $idExit)

; Create Info menu
$hinfo = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hinfo, 0, "&About", $idabout)
_GUICtrlMenu_InsertMenuItem ($hinfo, 1, "&Information", $idinfo)

; Create Main menu
$hMain = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hMain, 0, "&Settings", 0, $hSettings)
_GUICtrlMenu_InsertMenuItem ($hMain, 1, "&Info", 0, $hinfo)

; Set window menu
_GUICtrlMenu_SetMenu ($2botForm, $hMain)

GUICtrlCreateLabel("Username :", 16, 24, 58, 17)
GUICtrlCreateLabel("Password :", 16, 48, 56, 17)
$inusername = GUICtrlCreateInput($username, 80, 16, 121, 21)
$inpassword = GUICtrlCreateInput($password, 80, 40, 121, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
GUICtrlCreateGroup("Login", 8, 0, 209, 81)

$Checkbox1 = GUICtrlCreateCheckbox("Auto Attack", 240, 8, 97, 17)
If $cbaa = 1 Then GUICtrlSetState(-1, $GUI_CHECKED)
; note how the above will work ****************************************
$Checkbox2 = GUICtrlCreateCheckbox("Auto Pot", 240, 24, 97, 17)
If $cbap = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox3 = GUICtrlCreateCheckbox("Fishing Bot", 240, 40, 97, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
If $cbfb = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox4 = GUICtrlCreateCheckbox("Auto Loot", 240, 56, 97, 17)
If $cbal = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Start_btn = GUICtrlCreateButton("Start", 232, 80, 99, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Checkbox5 = GUICtrlCreateCheckbox("Save username / pass", 48, 96, 153, 17)
If $cbsave = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form2.kxf
$SkillSetupForm = GUICreate("Skill Setup", 268, 307, 192, 290)
$Checkbox11 = GUICtrlCreateCheckbox("1", 16, 24, 97, 17)
If $cb11 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox12 = GUICtrlCreateCheckbox("2", 16, 48, 97, 17)
If $cb12 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox13 = GUICtrlCreateCheckbox("3", 16, 72, 97, 17)
If $cb13 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox14 = GUICtrlCreateCheckbox("4", 16, 96, 97, 17)
If $cb14 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox15 = GUICtrlCreateCheckbox("5", 16, 120, 97, 17)
If $cb15 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox16 = GUICtrlCreateCheckbox("6", 16, 144, 97, 17)
If $cb16 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox17 = GUICtrlCreateCheckbox("7", 16, 168, 97, 17)
If $cb17 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox18 = GUICtrlCreateCheckbox("8", 16, 192, 97, 17)
If $cb18 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
$Checkbox19 = GUICtrlCreateCheckbox("9", 16, 216, 97, 17)
If $cb19 = "1"  Then
    GUICtrlSetState(-1, $GUI_CHECKED)
EndIf
GUICtrlCreateGroup("Hotkey'd Skillz", 8, 8, 97, 233)
$indelay1 = GUICtrlCreateInput("", 128, 24, 121, 21)
$indelay2 = GUICtrlCreateInput("", 128, 48, 121, 21)
$indelay3 = GUICtrlCreateInput("", 128, 72, 121, 21)
$indelay4 = GUICtrlCreateInput("", 128, 96, 121, 21)
$indelay5 = GUICtrlCreateInput("", 128, 120, 121, 21)
$indelay6 = GUICtrlCreateInput("", 128, 144, 121, 21)
$indelay7 = GUICtrlCreateInput("", 128, 168, 121, 21)
$indelay8 = GUICtrlCreateInput("", 128, 192, 121, 21)
$indelay9 = GUICtrlCreateInput("", 128, 216, 121, 21)
GUICtrlCreateGroup("Skill Delay (ms)", 112, 8, 145, 233)
GUICtrlCreateLabel("1000 ms = 1 second", 8, 248, 118, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("60000 ms = 1 minute", 8, 264, 121, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("600000 ms = 10 minutes", 8, 280, 141, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Save_Skill = GUICtrlCreateButton("Save Settings", 136, 248, 107, 25, 0)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form3.kxf
$AutoPotForm = GUICreate("Auto Pot Settings", 453, 256, 476, 311)
$inhp = GUICtrlCreateInput("", 45, 30, 121, 21)
$inmp = GUICtrlCreateInput("", 45, 130, 121, 21)
GUICtrlCreateGroup("HP/Pots", 8, 8, 233, 89)
GUICtrlCreateLabel("Pots", 16, 64, 25, 17)
$Radio1 = GUICtrlCreateRadio("F1", 48, 64, 33, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radio2 = GUICtrlCreateRadio("F2", 88, 64, 41, 17)
$Radio3 = GUICtrlCreateRadio("F3", 128, 64, 41, 17)
GUICtrlCreateLabel("HP", 16, 32, 19, 17)
GUICtrlCreateGroup("MP/Pots", 8, 112, 233, 89)
GUICtrlCreateLabel("Pots", 16, 168, 25, 17)
$Radio4 = GUICtrlCreateRadio("F1", 48, 168, 33, 17)
$Radio5 = GUICtrlCreateRadio("F2", 88, 168, 41, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$Radio6 = GUICtrlCreateRadio("F3", 128, 168, 41, 17)
GUICtrlCreateLabel("MP", 16, 136, 19, 17)
$inresleft = GUICtrlCreateInput("", 280, 40, 49, 21)
$inresright = GUICtrlCreateInput("", 352, 40, 49, 21)
GUICtrlCreateGroup("Resolution", 256, 8, 169, 65)
GUICtrlCreateLabel("*", 336, 40, 8, 17)
GUICtrlCreateLabel("Your game resolution must be the same as your display resolution !", 72, 208, 315, 17)
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("You need to use the game in Windows Mode !", 120, 232, 223, 17)
GUICtrlSetColor(-1, 0xFF0000)
$Save_Auto = GUICtrlCreateButton("Save Settings", 288, 120, 115, 41, 0)
#EndRegion ### END Koda GUI section ####include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form4.kxf
$ColorSetupForm = GUICreate("Color Setup", 374, 216, 657, 695)
$incolor1 = GUICtrlCreateInput("", 24, 40, 73, 21)
$incolor2 = GUICtrlCreateInput("", 104, 40, 65, 21)
GUICtrlCreateLabel("Color 1:", 24, 24, 40, 17)
GUICtrlCreateLabel("Color 2:", 104, 24, 40, 17)
$incolor3 = GUICtrlCreateInput("", 24, 80, 73, 21)
$incolor4 = GUICtrlCreateInput("", 104, 80, 65, 21)
GUICtrlCreateLabel("Color 3:", 24, 64, 40, 17)
GUICtrlCreateLabel("Color 4:", 104, 64, 40, 17)
GUICtrlCreateGroup("Colors: (Decimal Value)", 8, 8, 177, 161)
$Button3 = GUICtrlCreateButton("Color Finder", 96, 120, 75, 33, 0)
$intolerance = GUICtrlCreateInput("", 208, 40, 33, 21)
GUICtrlCreateLabel("1 (default) = exact", 247, 43, 89, 17)
$inleft = GUICtrlCreateInput("", 240, 80, 33, 21)
$inright = GUICtrlCreateInput("", 240, 104, 33, 21)
$intop = GUICtrlCreateInput("", 320, 80, 33, 21)
$inbottom = GUICtrlCreateInput("", 320, 104, 33, 21)
GUICtrlCreateLabel("Left:", 208, 80, 25, 17)
GUICtrlCreateLabel("Right:", 208, 104, 32, 17)
GUICtrlCreateLabel("Top:", 288, 80, 26, 17)
GUICtrlCreateLabel("Bottom:", 280, 104, 40, 17)
GUICtrlCreateLabel("Search Tolerance (1-255)", 208, 24, 125, 17)
GUICtrlCreateGroup("Search Settings", 192, 8, 169, 161)
$Button4 = GUICtrlCreateButton("Default Search Area", 248, 136, 107, 25, 0)
$Button5 = GUICtrlCreateButton("Save Settings", 208, 176, 123, 25, 0)
#EndRegion ### END Koda GUI section ###

GUISetState(@SW_SHOW, $2botForm)
While 1
    $msg = GUIGetMsg(1)
    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
    Select
        Case $msg[0] = $GUI_EVENT_CLOSE
            If $msg[1] = $2botForm Then
                Exit
            ElseIf $msg[1] = $SkillSetupForm Then
                GUISetState(@SW_ENABLE, $2botForm)
                GUISetState(@SW_HIDE, $SkillSetupForm)
            ElseIf $msg[1] = $AutoPotForm Then
                GUISetState(@SW_ENABLE, $2botForm)
                GUISetState(@SW_HIDE, $AutoPotForm)
            ElseIf $msg[1] = $ColorSetupForm Then
                GUISetState(@SW_ENABLE, $2botForm)
                GUISetState(@SW_HIDE, $ColorSetupForm)
            EndIf
        Case $msg[0] = $Start_btn
            MsgBox(0x0,"info", "You pressed the start button    ", 4)
            ;saveinfo()
        Case $msg[0] = $Save_Skill
            MsgBox(0x0,"info", "You pressed the save skill button    ", 4)
        Case $msg[0] = $Save_Auto
            MsgBox(0x0,"info", "You pressed the save Auto pot button    ", 4)
    EndSelect
WEnd

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    Switch _WinAPI_LoWord ($iwParam)
        Case $idSkillSetup
            GUISetState(@SW_SHOW, $SkillSetupForm)
        Case $idAutoPot
            GUISetState(@SW_SHOW, $AutoPotForm)
        Case $idColorSetup
            GUISetState(@SW_SHOW, $ColorSetupForm)
        Case $idExit
            Exit
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func saveinfo()
    If GUICtrlRead($Checkbox5) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbsave", "1")
        IniWrite($inifile, "login", "username", GUICtrlRead($inusername))
        IniWrite($inifile, "login", "password", GUICtrlRead($inpassword))
    Else
        IniWrite($inifile, "2bot", "cbsave", "0")
    EndIf
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbaa", "1")
    Else
        IniWrite($inifile, "2bot", "cbaa", "0")
    EndIf
    If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbap", "1")
    Else
        IniWrite($inifile, "2bot", "cbap", "0")
    EndIf
    If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbfb", "1")
    Else
        IniWrite($inifile, "2bot", "cbfb", "0")
    EndIf
    If GUICtrlRead($Checkbox4) = $GUI_CHECKED Then
        IniWrite($inifile, "2bot", "cbal", "1")
    Else
        IniWrite($inifile, "2bot", "cbal", "0")
    EndIf
    If GUICtrlRead($Checkbox11) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb11", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb11", "0")
    EndIf
    If GUICtrlRead($Checkbox12) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb12", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb12", "0")
    EndIf
    If GUICtrlRead($Checkbox13) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb13", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb13", "0")
    EndIf
    If GUICtrlRead($Checkbox14) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb14", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb14", "0")
    EndIf
    If GUICtrlRead($Checkbox15) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb15", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb15", "0")
    EndIf
    If GUICtrlRead($Checkbox16) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb16", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb16", "0")
    EndIf
    If GUICtrlRead($Checkbox17) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb17", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb17", "0")
    EndIf
    If GUICtrlRead($Checkbox18) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb18", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb18", "0")
    EndIf
    If GUICtrlRead($Checkbox19) = $GUI_CHECKED Then
        IniWrite($inifile, "SkillSetup", "cb19", "1")
    Else
        IniWrite($inifile, "SkillSetup", "cb19", "0")
    EndIf
    IniWrite($inifile, "SkillSetup", "indelay1", GUICtrlRead($indelay1))
    IniWrite($inifile, "SkillSetup", "indelay2", GUICtrlRead($indelay2))
    IniWrite($inifile, "SkillSetup", "indelay3", GUICtrlRead($indelay3))
    IniWrite($inifile, "SkillSetup", "indelay4", GUICtrlRead($indelay4))
    IniWrite($inifile, "SkillSetup", "indelay5", GUICtrlRead($indelay5))
    IniWrite($inifile, "SkillSetup", "indelay6", GUICtrlRead($indelay6))
    IniWrite($inifile, "SkillSetup", "indelay7", GUICtrlRead($indelay7))
    IniWrite($inifile, "SkillSetup", "indelay8", GUICtrlRead($indelay8))
    IniWrite($inifile, "SkillSetup", "indelay9", GUICtrlRead($indelay9))
    Return
EndFunc   ;==>saveinfo

8)

NEWHeader1.png

Link to comment
Share on other sites

Great job for your first post, Welcome to the forums!!!

... heres a little example using "arrays" in your script

#include <GUIConstants.au3>
#include <File.au3>
Global $inifile = "config.ini" 

Global Enum $idSkillSetup = 1000, $idAutoPot, $idColorSetup, $idExit, $idabout, $idinfo
If Not FileExists($inifile) Then
    _FileCreate($inifile)
Else
    ;2bot main menu
    $username = IniRead($inifile, "login", "username", "")
    $password = IniRead($inifile, "login", "password", "")
    $cbsave = IniRead($inifile, "2bot", "cbsave", "0")
    $cbaa = IniRead($inifile, "2bot", "cbaa", "0")
    $cbap = IniRead($inifile, "2bot", "cbap", "0")
    $cbfb = IniRead($inifile, "2bot", "cbfb", "0")
    $cbal = IniRead($inifile, "2bot", "cbal", "0")
    ;Skill Setup menu
    $cb11 = IniRead($inifile, "SkillSetup", "cb11", "0")
    $cb12 = IniRead($inifile, "SkillSetup", "cb12", "0")
    $cb13 = IniRead($inifile, "SkillSetup", "cb13", "0")
    $cb14 = IniRead($inifile, "SkillSetup", "cb14", "0")
    $cb15 = IniRead($inifile, "SkillSetup", "cb15", "0")
    $cb16 = IniRead($inifile, "SkillSetup", "cb16", "0")
    $cb17 = IniRead($inifile, "SkillSetup", "cb17", "0")
    $cb18 = IniRead($inifile, "SkillSetup", "cb18", "0")
    $cb19 = IniRead($inifile, "SkillSetup", "cb19", "0")
EndIf


Local $hFile, $hSettings, $hinfo
Global $Checkbox[10], $indelay[10]

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form2.kxf
$SkillSetupForm = GUICreate("Skill Setup", 268, 307, 192, 290)
$Checkbox[1] = GUICtrlCreateCheckbox("1", 16, 24, 97, 17)
If $cb11 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[2] = GUICtrlCreateCheckbox("2", 16, 48, 97, 17)
If $cb12 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[3] = GUICtrlCreateCheckbox("3", 16, 72, 97, 17)
If $cb13 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[4] = GUICtrlCreateCheckbox("4", 16, 96, 97, 17)
If $cb14 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[5] = GUICtrlCreateCheckbox("5", 16, 120, 97, 17)
If $cb15 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[6] = GUICtrlCreateCheckbox("6", 16, 144, 97, 17)
If $cb16 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[7] = GUICtrlCreateCheckbox("7", 16, 168, 97, 17)
If $cb17 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[8] = GUICtrlCreateCheckbox("8", 16, 192, 97, 17)
If $cb18 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[9] = GUICtrlCreateCheckbox("9", 16, 216, 97, 17)
If $cb19 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("Hotkey'd Skillz", 8, 8, 97, 233)
$indelay[1] = GUICtrlCreateInput("", 128, 24, 121, 21)
$indelay[2] = GUICtrlCreateInput("", 128, 48, 121, 21)
$indelay[3] = GUICtrlCreateInput("", 128, 72, 121, 21)
$indelay[4] = GUICtrlCreateInput("", 128, 96, 121, 21)
$indelay[5] = GUICtrlCreateInput("", 128, 120, 121, 21)
$indelay[6] = GUICtrlCreateInput("", 128, 144, 121, 21)
$indelay[7] = GUICtrlCreateInput("", 128, 168, 121, 21)
$indelay[8] = GUICtrlCreateInput("", 128, 192, 121, 21)
$indelay[9] = GUICtrlCreateInput("", 128, 216, 121, 21)
GUICtrlCreateGroup("Skill Delay (ms)", 112, 8, 145, 233)
GUICtrlCreateLabel("1000 ms = 1 second", 8, 248, 118, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("60000 ms = 1 minute", 8, 264, 121, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("600000 ms = 10 minutes", 8, 280, 141, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Save_Skill = GUICtrlCreateButton("Save Settings", 136, 248, 107, 25, 0)
#EndRegion ### END Koda GUI section ###


GUISetState()
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then Exit
    
    If $msg = $Save_Skill Then
        For $x = 1 To UBound($Checkbox) - 1
            If _IsChecked($Checkbox[$x]) Then
                MsgBox(0x0, "info #" & $x, "Input read = " & GUICtrlRead($indelay[$x]), 2)
                ; save settings or ?????
            EndIf
        Next
    EndIf
    
WEnd

Func _IsChecked($control)
    Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED
EndFunc   ;==>_IsChecked

8)

NEWHeader1.png

Link to comment
Share on other sites

Great job for your first post, Welcome to the forums!!!

... heres a little example using "arrays" in your script

#include <GUIConstants.au3>
#include <File.au3>
Global $inifile = "config.ini" 

Global Enum $idSkillSetup = 1000, $idAutoPot, $idColorSetup, $idExit, $idabout, $idinfo
If Not FileExists($inifile) Then
    _FileCreate($inifile)
Else
    ;2bot main menu
    $username = IniRead($inifile, "login", "username", "")
    $password = IniRead($inifile, "login", "password", "")
    $cbsave = IniRead($inifile, "2bot", "cbsave", "0")
    $cbaa = IniRead($inifile, "2bot", "cbaa", "0")
    $cbap = IniRead($inifile, "2bot", "cbap", "0")
    $cbfb = IniRead($inifile, "2bot", "cbfb", "0")
    $cbal = IniRead($inifile, "2bot", "cbal", "0")
    ;Skill Setup menu
    $cb11 = IniRead($inifile, "SkillSetup", "cb11", "0")
    $cb12 = IniRead($inifile, "SkillSetup", "cb12", "0")
    $cb13 = IniRead($inifile, "SkillSetup", "cb13", "0")
    $cb14 = IniRead($inifile, "SkillSetup", "cb14", "0")
    $cb15 = IniRead($inifile, "SkillSetup", "cb15", "0")
    $cb16 = IniRead($inifile, "SkillSetup", "cb16", "0")
    $cb17 = IniRead($inifile, "SkillSetup", "cb17", "0")
    $cb18 = IniRead($inifile, "SkillSetup", "cb18", "0")
    $cb19 = IniRead($inifile, "SkillSetup", "cb19", "0")
EndIf


Local $hFile, $hSettings, $hinfo
Global $Checkbox[10], $indelay[10]

#Region ### START Koda GUI section ### Form=c:\users\nick\desktop\moonbot\2bot\form2.kxf
$SkillSetupForm = GUICreate("Skill Setup", 268, 307, 192, 290)
$Checkbox[1] = GUICtrlCreateCheckbox("1", 16, 24, 97, 17)
If $cb11 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[2] = GUICtrlCreateCheckbox("2", 16, 48, 97, 17)
If $cb12 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[3] = GUICtrlCreateCheckbox("3", 16, 72, 97, 17)
If $cb13 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[4] = GUICtrlCreateCheckbox("4", 16, 96, 97, 17)
If $cb14 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[5] = GUICtrlCreateCheckbox("5", 16, 120, 97, 17)
If $cb15 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[6] = GUICtrlCreateCheckbox("6", 16, 144, 97, 17)
If $cb16 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[7] = GUICtrlCreateCheckbox("7", 16, 168, 97, 17)
If $cb17 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[8] = GUICtrlCreateCheckbox("8", 16, 192, 97, 17)
If $cb18 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
$Checkbox[9] = GUICtrlCreateCheckbox("9", 16, 216, 97, 17)
If $cb19 = "1"  Then GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("Hotkey'd Skillz", 8, 8, 97, 233)
$indelay[1] = GUICtrlCreateInput("", 128, 24, 121, 21)
$indelay[2] = GUICtrlCreateInput("", 128, 48, 121, 21)
$indelay[3] = GUICtrlCreateInput("", 128, 72, 121, 21)
$indelay[4] = GUICtrlCreateInput("", 128, 96, 121, 21)
$indelay[5] = GUICtrlCreateInput("", 128, 120, 121, 21)
$indelay[6] = GUICtrlCreateInput("", 128, 144, 121, 21)
$indelay[7] = GUICtrlCreateInput("", 128, 168, 121, 21)
$indelay[8] = GUICtrlCreateInput("", 128, 192, 121, 21)
$indelay[9] = GUICtrlCreateInput("", 128, 216, 121, 21)
GUICtrlCreateGroup("Skill Delay (ms)", 112, 8, 145, 233)
GUICtrlCreateLabel("1000 ms = 1 second", 8, 248, 118, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("60000 ms = 1 minute", 8, 264, 121, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("600000 ms = 10 minutes", 8, 280, 141, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Save_Skill = GUICtrlCreateButton("Save Settings", 136, 248, 107, 25, 0)
#EndRegion ### END Koda GUI section ###


GUISetState()
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then Exit
    
    If $msg = $Save_Skill Then
        For $x = 1 To UBound($Checkbox) - 1
            If _IsChecked($Checkbox[$x]) Then
                MsgBox(0x0, "info #" & $x, "Input read = " & GUICtrlRead($indelay[$x]), 2)
                ; save settings or ?????
            EndIf
        Next
    EndIf
    
WEnd

Func _IsChecked($control)
    Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED
EndFunc   ;==>_IsChecked

8)

wow that makes my code so much easier to read and so much shorter! thanks
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...