Sign in to follow this  
Followers 0
sean5470

Difficulty with second GUI button(s)

9 posts in this topic

I've created a GUI tool, that hopefully will let me manually keep track of specific data, instead of writing it on paper every time. I am aware of site rules, and since this has zero interaction with any game, or any other program for that matter, it should be alright. Nutshell, it's a personal, visual, data tracking program. I just wanted a nicer, easier, neat way to keep track of this information. And learning AutoIt more at the same time. ;) (If I am incorrect about the rules as they are written, then I apologize ahead of time)

Anyhow, I have everything on the main GUI functioning. It shows, updates the INI file, minimizes and exit as designed. My issue is when I click the button to show the second GUI. So far, everything up to the point of the 2nd showing works. The first GUI will minimize, and the second shows up. It also lets me drag it around as designed. However, I have come to a stand still, and complete loss, as to why the 'exit' button on this second GUI isn't working. This is designed as an "OnEvent" mode script, as it seems easier for me to understand and manage myself. (though not opposed to learning the other way for GUI's).

Things I have tried so far: (extensive list of different coding. Some I knew wouldn't work, but tried anyhow O_o)
Searched and tried numerous related & semi-related options from threads in the forums.
Tried designing out both GUI's in the same function and nesting out the Cases based on the buttons pressed. (while hiding and/or showing which GUI was needed). Sometimes the second GUI would show up as wanted, sometimes I had something wrong and it wouldn't.
Numerous attempts at using GUIswitch() (though still new to that feature so may, or may not, have been using it in the correct spot.)
Honestly, I've spent the last few days, and many hours, writing, rewriting, searching trying. Trying to get this second GUI to react. All to no avail. So, as my last resort I am left with, is to bow down and ask for help here.

What is supposed to happen, and does thus far, is the mainGUI shows up. I can click a button, one of the 32, the minimize, the Update, or the Exit, and those function as intended. i.e., pictures change, INI is updated, etc. etc..  (The Update Button is what calls the second GUI)

This GUI has numerous pictures. All of which I will include, along with the source (as well as post the source in this thread), and the INI configuration file this uses. (though it does create one if it can't find it, I figured I'd include it so someone don't freak by seeing the prompts it's creating it on first run if someone chooses to run it and wonder WTH it's doing.) for anyone that can possibly help me out. I'm sure it's something simply, though I've tried so many different routes, I think I have lost track of perspective with this. The source is my latest version, that fully functions up to the point I am lost. The pressing and calling a function from the second "Exit" button on the second GUI. This isn't completed as there will again be another set of BMP buttons on the second GUI. (after I figure out what I'm doing wrong here). That part I can handle as I have already got the first one working and it's really nothing more than changing what is wrote to the INI file on execution.

Again,

All pictures, AutoIt source (same as posted), and an INI file are all included in the attached ZIP file.

Anyhow, here's the code as I have it now.
(Long code, but since I see mostly examples of the NON-OnEvent mode, I just include everything for this to run as is right now)
 

#comments-start ------------------------------------------------------------------------------------------------------------------
#
#   This is a little tool, that shows a simple 'button-style' GUI, in which the user
#   can click on a button and have it keep track, visually, of which invasion summons one has
#   It allows for both, adding of 'on-hand' invasions to the list, as well as updates when
#   one is used.
#
#   This program was written and compiled in AutoIt v3, by Sean
#   on a WIndow 7 x64 Ultimate system.
#
#   Release Notes:------------------------------------------------------------------------
#   1.0.0.0 xx/xx/xxxx  Initial Release.
#
#   --------------------------------------------------------------------------------------
#   Specifics of this released version:
#       This version is a Testing/Beta release.
#
#comments-end ------------------------------------------------------------------------------------------------------------------


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <File.au3>


Global $Config = @ScriptDir & "\cogs.ini"
Global $IMGs = @ScriptDIR & "\images\"

CheckINI()

Func CheckINI() ;  ~-------- Checks for the Config File --------------------------
    If FileExists($Config) Then
        ReadINI()
        Initialization()
        MainGUI()
    ElseIf Not FileExists($Config) Then
        CreateIni()
        Initialization()
        MainGUI()
    EndIf
EndFunc

Func ReadINI() ;  ~-------- Reads the Config File Data --------------------------
    Global $Boss = IniReadSection($Config, "Boss")
    If $Boss = @error Then
        CreateIni()
    EndIf
    Global $Law = IniReadSection($Config, "Law")
    If $Law = @error Then
        CreateIni()
    EndIf
    Global $Cash = IniReadSection($Config, "Cash")
    If $Cash = @error Then
        CreateIni()
    EndIf
    Global $Sell = IniReadSection($Config, "Sell")
    If $Sell = @error Then
        CreateIni()
    EndIf
EndFunc

Func CreateIni() ;  ~-------- Config File Creation --------------------------
    MsgBox(262160, "Invalid Configuration File", "Couldn't Read Configuration File" & @CR & "Creating A New One With Default Values")
    For $Boss2 = 1 To 8 Step 1
        IniDelete( $Config, "B" & $Boss2 )
        IniWrite( $Config, "Boss", "B" & $Boss2, 1 )
    Next
    For $Law2 = 1 To 8 Step 1
        IniDelete( $Config, "L" & $Law2 )
        IniWrite( $Config, "Law", "L" & $Law2, 1 )
    Next
    For $Cash2 = 1 To 8 Step 1
        IniDelete( $Config, "C" & $Cash2 )
        IniWrite( $Config, "Cash", "C" & $Cash2, 1 )
    Next
    For $Sell2 = 1 To 8 Step 1
        IniDelete( $Config, "S" & $Sell2 )
        IniWrite( $Config, "Sell", "S" & $Sell2, 1 )
    Next
MsgBox(262160, "New Configuration File", "New Configuration File Created")
ReadINI()
EndFunc

Func Initialization() ;  ~-------- Initialization of Variables & Options --------------------------
;  ------------ Initializes All The Setup Options -------------------------------------------------
    AutoItSetOption("GUICloseOnESC",0)
    Opt("GUICoordMode", 1)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)
;  ------------ GUI Cog Button Sizes:  ------------
    Global $BX = 36 ; Button Size "X"
    Global $BY = 50 ; Button Size "Y"
;  ------------ "X" Coordinate Variables for GUI Buttons:  ------------
    Global $MainGUI
    Global $CL1 = 18    ; Button Column Number One "X" Location
    Global $CL2 = $CL1 + 34 ; Button Column Number Two "X" Location
    Global $CL3 = $CL2 + 34 ; Button Column Number Three "X" Location
    Global $CL4 = $CL3 + 34 ; Button Column Number Four "X" Location
    Global $CL5 = $CL4 + 35 ; Button Column Number Five "X" Location
    Global $CL6 = $CL5 + 34 ; Button Column Number Six "X" Location
    Global $CL7 = $CL6 + 34 ; Button Column Number Seven "X" Location
    Global $CL8 = $CL7 + 34 ; Button Column Number Eight "X" Location
;  ------------ "Y" Coordinate Variables for GUI Buttons:  ------------
    Global $ROW1 = 56 ; Button Row Number One "Y" Location
    Global $ROW2 = $ROW1 + 49 ; Button Row Number Two "Y" Location
    Global $ROW3 = $ROW2 + 48 ; Button Row Number Three "Y" Location
    Global $ROW4 = $ROW3 + 49 ; Button Row Number Four "Y" Location
EndFunc

Func MainGUI()  ;  ------------ Create GUI's and all Buttons ------------------------------------
;  ------------ Create Main GUI ------------------------------------
    _GDIPlus_Startup()
    Global $MainGUI = GUICreate("Invasion On Hand", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    Global $GUI1_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($MainGUI, 0xFFFFFF, 255)
    GuiCtrlSetState($GUI1_BKGRD,$GUI_DISABLE)

;  ------------ Calls Main GUI Button Creation Functions ------------------------------------
    GUIBoss()
    GUILaw()
    GUICash()
    GUISell()
    Minimize_BTN()
    Update_Summons_BTN()
    Exit_BTN()

;~  GUISetState()



;~  GUISwitch($UpdateGUI)
;~  GUISetState()

;~  GUISwitch($MainGUI)

    GUISetState(@SW_SHOW, $MainGUI)

;  ------------ Loop to keep everything running  ------------------------------------
While 1
    Sleep(10)
    Select
        Case $GUI_EVENT_PRIMARYDOWN
            _SendMessage($MainGUI, $WM_SYSCOMMAND, 0xF012, 0)
    EndSelect
WEnd
EndFunc

Func GUIBoss()  ;  ------------ Bossbot Buttons  ------------------------------------
;~  MsgBox(64, "", $Boss[1][1])
    If $Boss[1][1] = 1 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky.bmp")
        GUICtrlSetOnEvent($Flunky, "Flunky")
    ElseIf $Boss[1][1] = 0 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
        GUICtrlSetOnEvent($Flunky, "")
    EndIf

    If $Boss[2][1] = 1 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PencilPusher.bmp")
        GUICtrlSetOnEvent(-1, "PencilPusher")
    ElseIf $Boss[2][1] = 0 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
        GUICtrlSetOnEvent($PencilPusher, "")
    EndIf

    If $Boss[3][1] = 1 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman.bmp")
        GUICtrlSetOnEvent($Yesman, "Yesman")
    ElseIf $Boss[3][1] = 0 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
        GUICtrlSetOnEvent($Yesman, "")
    EndIf

    If $Boss[4][1] = 1 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager.bmp")
        GUICtrlSetOnEvent($MicroManager, "MicroManager")
    ElseIf $Boss[4][1] = 0 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
        GUICtrlSetOnEvent($MicroManager, "")
    EndIf

    If $Boss[5][1] = 1 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer.bmp")
        GUICtrlSetOnEvent($Downsizer, "Downsizer")
    ElseIf $Boss[5][1] = 0 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
        GUICtrlSetOnEvent($Downsizer, "")
    EndIf

    If $Boss[6][1] = 1 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter.bmp")
        GUICtrlSetOnEvent($HeadHunter, "HeadHunter")
    ElseIf $Boss[6][1] = 0 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
        GUICtrlSetOnEvent($HeadHunter, "")
    EndIf

    If $Boss[7][1] = 1 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "CorporateRaider")
    ElseIf $Boss[7][1] = 0 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "")
    EndIf

    If $Boss[8][1] = 1 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese.bmp")
        GUICtrlSetOnEvent($BigCheese, "BigCheese")
    ElseIf $Boss[8][1] = 0 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
        GUICtrlSetOnEvent($BigCheese, "")
    EndIf
EndFunc

Func GUILaw()   ;  ------------ Lawbot Buttons  ------------------------------------
    If $Law[1][1] = 1 Then
        Global $BottomFeeder = GUICtrlCreateButton("BottomFeeder", $CL1, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder.bmp")
        GUICtrlSetOnEvent($BottomFeeder, "BottomFeeder")
    ElseIf $Law[1][1] = 0 Then
        Global $BottomFeeder = GUICtrlCreateButton("BottomFeeder", $CL1, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder2.bmp")
        GUICtrlSetOnEvent($BottomFeeder, "")
    EndIf

    If $Law[2][1] = 1 Then
        Global $Bloodsucker = GUICtrlCreateButton("Bloodsucker", $CL2, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "Bloodsucker.bmp")
        GUICtrlSetOnEvent(-1, "Bloodsucker")
    ElseIf $Law[2][1] = 0 Then
        Global $Bloodsucker = GUICtrlCreateButton("Bloodsucker", $CL2, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Bloodsucker, $IMGs & "Bloodsucker2.bmp")
        GUICtrlSetOnEvent($Bloodsucker, "")
    EndIf

    If $Law[3][1] = 1 Then
        Global $DoubleTalker = GUICtrlCreateButton("DoubleTalker", $CL3, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker.bmp")
        GUICtrlSetOnEvent($DoubleTalker, "DoubleTalker")
    ElseIf $Law[3][1] = 0 Then
        Global $DoubleTalker = GUICtrlCreateButton("DoubleTalker", $CL3, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker2.bmp")
        GUICtrlSetOnEvent($DoubleTalker, "")
    EndIf

    If $Law[4][1] = 1 Then
        Global $AmbulanceChaser = GUICtrlCreateButton("AmbulanceChaser", $CL4, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser.bmp")
        GUICtrlSetOnEvent($AmbulanceChaser, "AmbulanceChaser")
    ElseIf $Law[4][1] = 0 Then
        Global $AmbulanceChaser = GUICtrlCreateButton("AmbulanceChaser", $CL4, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser2.bmp")
        GUICtrlSetOnEvent($AmbulanceChaser, "")
    EndIf

    If $Law[5][1] = 1 Then
        Global $Backstabber = GUICtrlCreateButton("Backstabber", $CL5, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Backstabber, $IMGs & "Backstabber.bmp")
        GUICtrlSetOnEvent($Backstabber, "Backstabber")
    ElseIf $Law[5][1] = 0 Then
        Global $Backstabber = GUICtrlCreateButton("Backstabber", $CL5, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Backstabber, $IMGs & "Backstabber2.bmp")
        GUICtrlSetOnEvent($Backstabber, "")
    EndIf

    If $Law[6][1] = 1 Then
        Global $SpinDoctor = GUICtrlCreateButton("SpinDoctor", $CL6, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor.bmp")
        GUICtrlSetOnEvent($SpinDoctor, "SpinDoctor")
    ElseIf $Law[6][1] = 0 Then
        Global $SpinDoctor = GUICtrlCreateButton("SpinDoctor", $CL6, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor2.bmp")
        GUICtrlSetOnEvent($SpinDoctor, "")
    EndIf

    If $Law[7][1] = 1 Then
        Global $LegalEagle = GUICtrlCreateButton("LegalEagle", $CL7, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle.bmp")
        GUICtrlSetOnEvent($LegalEagle, "LegalEagle")
    ElseIf $Law[7][1] = 0 Then
        Global $LegalEagle = GUICtrlCreateButton("LegalEagle", $CL7, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle2.bmp")
        GUICtrlSetOnEvent($LegalEagle, "")
    EndIf

    If $Law[8][1] = 1 Then
        Global $BigWig= GUICtrlCreateButton("BigWig", $CL8, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigWig, $IMGs & "BigWig.bmp")
        GUICtrlSetOnEvent($BigWig, "BigWig")
    ElseIf $Law[8][1] = 0 Then
        Global $BigWig= GUICtrlCreateButton("BigWig", $CL8, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigWig, $IMGs & "BigWig2.bmp")
        GUICtrlSetOnEvent($BigWig, "")
    EndIf
EndFunc

Func GUICash()  ;  ------------ Cashbot Buttons  ------------------------------------
    If $Cash[1][1] = 1 Then
        Global $ShortChange = GUICtrlCreateButton("ShortChange", $CL1, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ShortChange, $IMGs & "ShortChange.bmp")
        GUICtrlSetOnEvent($ShortChange, "ShortChange")
    ElseIf $Cash[1][1] = 0 Then
        Global $ShortChange = GUICtrlCreateButton("ShortChange", $CL1, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ShortChange, $IMGs & "ShortChange2.bmp")
        GUICtrlSetOnEvent($ShortChange, "")
    EndIf

    If $Cash[2][1] = 1 Then
        Global $PennyPincher = GUICtrlCreateButton("PennyPincher", $CL2, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PennyPincher.bmp")
        GUICtrlSetOnEvent(-1, "PennyPincher")
    ElseIf $Cash[2][1] = 0 Then
        Global $PennyPincher = GUICtrlCreateButton("PennyPincher", $CL2, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PennyPincher, $IMGs & "PennyPincher2.bmp")
        GUICtrlSetOnEvent($PennyPincher, "")
    EndIf

    If $Cash[3][1] = 1 Then
        Global $Tightwad = GUICtrlCreateButton("Tightwad", $CL3, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Tightwad, $IMGs & "Tightwad.bmp")
        GUICtrlSetOnEvent($Tightwad, "Tightwad")
    ElseIf $Cash[3][1] = 0 Then
        Global $Tightwad = GUICtrlCreateButton("Tightwad", $CL3, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Tightwad, $IMGs & "Tightwad2.bmp")
        GUICtrlSetOnEvent($Tightwad, "")
    EndIf

    If $Cash[4][1] = 1 Then
        Global $BeanCounter= GUICtrlCreateButton("BeanCounter", $CL4, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter.bmp")
        GUICtrlSetOnEvent($BeanCounter, "BeanCounter")
    ElseIf $Cash[4][1] = 0 Then
        Global $BeanCounter= GUICtrlCreateButton("BeanCounter", $CL4, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter2.bmp")
        GUICtrlSetOnEvent($BeanCounter, "")
    EndIf

    If $Cash[5][1] = 1 Then
        Global $NumberCruncher = GUICtrlCreateButton("NumberCruncher", $CL5, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher.bmp")
        GUICtrlSetOnEvent($NumberCruncher, "NumberCruncher")
    ElseIf $Cash[5][1] = 0 Then
        Global $NumberCruncher = GUICtrlCreateButton("NumberCruncher", $CL5, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher2.bmp")
        GUICtrlSetOnEvent($NumberCruncher, "")
    EndIf

    If $Cash[6][1] = 1 Then
        Global $MoneyBags = GUICtrlCreateButton("MoneyBags", $CL6, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags.bmp")
        GUICtrlSetOnEvent($MoneyBags, "MoneyBags")
    ElseIf $Cash[6][1] = 0 Then
        Global $MoneyBags = GUICtrlCreateButton("MoneyBags", $CL6, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags2.bmp")
        GUICtrlSetOnEvent($MoneyBags, "")
    EndIf

    If $Cash[7][1] = 1 Then
        Global $LoanShark = GUICtrlCreateButton("LoanShark", $CL7, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LoanShark, $IMGs & "LoanShark.bmp")
        GUICtrlSetOnEvent($LoanShark, "LoanShark")
    ElseIf $Cash[7][1] = 0 Then
        Global $LoanShark = GUICtrlCreateButton("LoanShark", $CL7, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LoanShark, $IMGs & "LoanShark2.bmp")
        GUICtrlSetOnEvent($LoanShark, "")
    EndIf

    If $Cash[8][1] = 1 Then
        Global $RobberBaron= GUICtrlCreateButton("RobberBaron", $CL8, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron.bmp")
        GUICtrlSetOnEvent($RobberBaron, "RobberBaron")
    ElseIf $Cash[8][1] = 0 Then
        Global $RobberBaron= GUICtrlCreateButton("RobberBaron", $CL8, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron2.bmp")
        GUICtrlSetOnEvent($RobberBaron, "")
    EndIf
EndFunc

Func GUISell()  ;  ------------ Sellbot Buttons  ------------------------------------
    If $Sell[1][1] = 1 Then
        Global $ColdCaller = GUICtrlCreateButton("ColdCaller", $CL1, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller.bmp")
        GUICtrlSetOnEvent($ColdCaller, "ColdCaller")
    ElseIf $Sell[1][1] = 0 Then
        Global $ColdCaller = GUICtrlCreateButton("ColdCaller", $CL1, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller2.bmp")
        GUICtrlSetOnEvent($ColdCaller, "")
    EndIf

    If $Sell[2][1] = 1 Then
        Global $TeleMarketer = GUICtrlCreateButton("TeleMarketer", $CL2, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "TeleMarketer.bmp")
        GUICtrlSetOnEvent(-1, "TeleMarketer")
    ElseIf $Sell[2][1] = 0 Then
        Global $TeleMarketer = GUICtrlCreateButton("TeleMarketer", $CL2, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TeleMarketer, $IMGs & "TeleMarketer2.bmp")
        GUICtrlSetOnEvent($TeleMarketer, "")
    EndIf

    If $Sell[3][1] = 1 Then
        Global $NameDropper = GUICtrlCreateButton("NameDropper,", $CL3, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NameDropper, $IMGs & "NameDropper.bmp")
        GUICtrlSetOnEvent($NameDropper, "NameDropper")
    ElseIf $Sell[3][1] = 0 Then
        Global $NameDropper = GUICtrlCreateButton("NameDropper", $CL3, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NameDropper, $IMGs & "NameDropper2.bmp")
        GUICtrlSetOnEvent($NameDropper, "")
    EndIf

    If $Sell[4][1] = 1 Then
        Global $GladHander= GUICtrlCreateButton("GladHander", $CL4, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($GladHander, $IMGs & "GladHander.bmp")
        GUICtrlSetOnEvent($GladHander, "GladHander")
    ElseIf $Sell[4][1] = 0 Then
        Global $GladHander= GUICtrlCreateButton("GladHander", $CL4, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($GladHander, $IMGs & "GladHander2.bmp")
        GUICtrlSetOnEvent($GladHander, "")
    EndIf

    If $Sell[5][1] = 1 Then
        Global $MoverShaker = GUICtrlCreateButton("MoverShaker", $CL5, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker.bmp")
        GUICtrlSetOnEvent($MoverShaker, "MoverShaker")
    ElseIf $Sell[5][1] = 0 Then
        Global $MoverShaker = GUICtrlCreateButton("MoverShaker", $CL5, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker2.bmp")
        GUICtrlSetOnEvent($MoverShaker, "")
    EndIf

    If $Sell[6][1] = 1 Then
        Global $TwoFace = GUICtrlCreateButton("TwoFace", $CL6, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TwoFace, $IMGs & "TwoFace.bmp")
        GUICtrlSetOnEvent($TwoFace, "TwoFace")
    ElseIf $Sell[6][1] = 0 Then
        Global $TwoFace = GUICtrlCreateButton("TwoFace", $CL6, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TwoFace, $IMGs & "TwoFace2.bmp")
        GUICtrlSetOnEvent($TwoFace, "")
    EndIf

    If $Sell[7][1] = 1 Then
        Global $TheMingler = GUICtrlCreateButton("TheMingler", $CL7, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TheMingler, $IMGs & "TheMingler.bmp")
        GUICtrlSetOnEvent($TheMingler, "TheMingler")
    ElseIf $Sell[7][1] = 0 Then
        Global $TheMingler = GUICtrlCreateButton("TheMingler", $CL7, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TheMingler, $IMGs & "TheMingler2.bmp")
        GUICtrlSetOnEvent($TheMingler, "")
    EndIf

    If $Sell[8][1] = 1 Then
        Global $MrHollywood= GUICtrlCreateButton("MrHollywood", $CL8, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood.bmp")
        GUICtrlSetOnEvent($MrHollywood, "MrHollywood")
    ElseIf $Sell[8][1] = 0 Then
        Global $MrHollywood= GUICtrlCreateButton("MrHollywood", $CL8, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood2.bmp")
        GUICtrlSetOnEvent($MrHollywood, "")
    EndIf
EndFunc

Func Minimize_BTN() ;  ------------ Minimize Button  ------------------------------------
    $Minimize_BTN = GUICtrlCreateButton("Minimize", 15, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Minimize_BTN, $IMGs & "Minimize_btn-1.bmp", "", 0)
    GUICtrlSetStyle($Minimize_BTN, -1, $WS_EX_TRANSPARENT)
    GUICtrlSetOnEvent($Minimize_BTN, "GUIMinimize")
    GuiCtrlSetState($Minimize_BTN, $GUI_NOFOCUS)
EndFunc

Func Update_Summons_BTN()   ;  ------------ Update Summons on Hand Button Creation ------------------------------------
    $Update_Summons_BTN = GUICtrlCreateButton("Pick_Window", 120, 0, 79, 32, $BS_BITMAP)
    GUICtrlSetImage($Update_Summons_BTN, $IMGs & "Update_Summons-1.bmp", "", 0)
    GUICtrlSetStyle($Update_Summons_BTN, -1, $WS_EX_TRANSPARENT)
    GUICtrlSetOnEvent($Update_Summons_BTN, "UpdateGUI")
    GuiCtrlSetState($Update_Summons_BTN, $GUI_NOFOCUS)
EndFunc

Func Exit_BTN() ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Exit_BTN, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetStyle($Exit_BTN, -1, $WS_EX_TRANSPARENT)
    GUICtrlSetOnEvent($Exit_BTN, "Scram")
    GuiCtrlSetState($Exit_BTN, $GUI_NOFOCUS)
EndFunc

Func GUIMinimize()
    GUISetState(@SW_MINIMIZE, $MainGUI)
EndFunc

Func UpdateGUI();  ------------ Create Update Summons GUI ------------------------------------
    GUISetState(@SW_MINIMIZE, $MainGUI)
    Global $UpdateGUI = GUICreate("Update Summons", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    Global $GUI2_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($UpdateGUI, 0xFFFFFF, 255)
    GuiCtrlSetState($GUI2_BKGRD,$GUI_DISABLE)

;~  GUISwitch($UpdateGUI)

    GUISetState(@SW_SHOW, $UpdateGUI)

;  ------------ Calls GUI Button Creation Functions ------------------------------------
    Exit_BTN2()

;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
        Select
            Case $GUI_EVENT_PRIMARYDOWN
                _SendMessage($UpdateGUI, $WM_SYSCOMMAND, 0xF012, 0)
        EndSelect
    WEnd
EndFunc

Func Exit_BTN2()    ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN2 = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Exit_BTN2, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetStyle($Exit_BTN2, -1, $WS_EX_TRANSPARENT)
    GUICtrlSetOnEvent($Exit_BTN2, "UpdateGUI_Hide")
    GuiCtrlSetState($Exit_BTN2, $GUI_NOFOCUS)
EndFunc

Func UpdateGUI_Hide()
    GUISetState(@SW_HIDE, $UpdateGUI)
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

;  ------------ Bossbot Functions  ------------
Func Flunky()
    Initialization()
    IniWrite( $Config, "Boss", "B1", 0 )
    GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
    GUICtrlSetOnEvent($Flunky, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func PencilPusher()
    Initialization()
    IniWrite( $Config, "Boss", "B2", 0 )
    GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
    GUICtrlSetOnEvent($PencilPusher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Yesman()
    Initialization()
    IniWrite( $Config, "Boss", "B3", 0 )
    GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
    GUICtrlSetOnEvent($Yesman, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func MicroManager()
    Initialization()
    IniWrite( $Config, "Boss", "B4", 0 )
    GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
    GUICtrlSetOnEvent($MicroManager, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Downsizer()
    Initialization()
    IniWrite( $Config, "Boss", "B5", 0 )
    GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
    GUICtrlSetOnEvent($Downsizer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func HeadHunter()
    Initialization()
    IniWrite( $Config, "Boss", "B6", 0 )
    GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
    GUICtrlSetOnEvent($HeadHunter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func CorporateRaider()
    Initialization()
    IniWrite( $Config, "Boss", "B7", 0 )
    GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
    GUICtrlSetOnEvent($CorporateRaider, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func BigCheese()
    Initialization()
    IniWrite( $Config, "Boss", "B8", 0 )
    GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
    GUICtrlSetOnEvent($BigCheese, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

;  ------------ Lawbot Functions  ------------
Func BottomFeeder()
    Initialization()
    IniWrite( $Config, "Law", "L1", 0 )
    GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder2.bmp")
    GUICtrlSetOnEvent($BottomFeeder, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Bloodsucker()
    Initialization()
    IniWrite( $Config, "Law", "L2", 0 )
    GUICtrlSetImage($Bloodsucker, $IMGs & "Bloodsucker2.bmp")
    GUICtrlSetOnEvent($Bloodsucker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func DoubleTalker()
    Initialization()
    IniWrite( $Config, "Law", "L3", 0 )
    GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker2.bmp")
    GUICtrlSetOnEvent($DoubleTalker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func AmbulanceChaser()
    Initialization()
    IniWrite( $Config, "Law", "L4", 0 )
    GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser2.bmp")
    GUICtrlSetOnEvent($AmbulanceChaser, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Backstabber()
    Initialization()
    IniWrite( $Config, "Law", "L5", 0 )
    GUICtrlSetImage($Backstabber, $IMGs & "Backstabber2.bmp")
    GUICtrlSetOnEvent($Backstabber, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func SpinDoctor()
    Initialization()
    IniWrite( $Config, "Law", "L6", 0 )
    GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor2.bmp")
    GUICtrlSetOnEvent($SpinDoctor, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func LegalEagle()
    Initialization()
    IniWrite( $Config, "Law", "L7", 0 )
    GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle2.bmp")
    GUICtrlSetOnEvent($LegalEagle, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func BigWig()
    Initialization()
    IniWrite( $Config, "Law", "L8", 0 )
    GUICtrlSetImage($BigWig, $IMGs & "BigWig2.bmp")
    GUICtrlSetOnEvent($BigWig, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

;  ------------ Cashbot Functions  ------------
Func ShortChange()
    Initialization()
    IniWrite( $Config, "Cash", "C1", 0 )
    GUICtrlSetImage($ShortChange, $IMGs & "ShortChange2.bmp")
    GUICtrlSetOnEvent($ShortChange, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func PennyPincher()
    Initialization()
    IniWrite( $Config, "Cash", "C2", 0 )
    GUICtrlSetImage($PennyPincher, $IMGs & "PennyPincher2.bmp")
    GUICtrlSetOnEvent($PennyPincher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Tightwad()
    Initialization()
    IniWrite( $Config, "Cash", "C3", 0 )
    GUICtrlSetImage($Tightwad, $IMGs & "Tightwad2.bmp")
    GUICtrlSetOnEvent($Tightwad, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func BeanCounter()
    Initialization()
    IniWrite( $Config, "Cash", "C4", 0 )
    GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter2.bmp")
    GUICtrlSetOnEvent($BeanCounter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func NumberCruncher()
    Initialization()
    IniWrite( $Config, "Cash", "C5", 0 )
    GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher2.bmp")
    GUICtrlSetOnEvent($NumberCruncher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func MoneyBags()
    Initialization()
    IniWrite( $Config, "Cash", "C6", 0 )
    GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags2.bmp")
    GUICtrlSetOnEvent($MoneyBags, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func LoanShark()
    Initialization()
    IniWrite( $Config, "Cash", "C7", 0 )
    GUICtrlSetImage($LoanShark, $IMGs & "LoanShark2.bmp")
    GUICtrlSetOnEvent($LoanShark, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func RobberBaron()
    Initialization()
    IniWrite( $Config, "Cash", "C8", 0 )
    GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron2.bmp")
    GUICtrlSetOnEvent($RobberBaron, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

;  ------------ Sellbot Functions  ------------
Func ColdCaller()
    Initialization()
    IniWrite( $Config, "Sell", "S1", 0 )
    GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller2.bmp")
    GUICtrlSetOnEvent($ColdCaller, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func TeleMarketer()
    Initialization()
    IniWrite( $Config, "Sell", "S2", 0 )
    GUICtrlSetImage($TeleMarketer, $IMGs & "TeleMarketer2.bmp")
    GUICtrlSetOnEvent($TeleMarketer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func NameDropper()
    Initialization()
    IniWrite( $Config, "Sell", "S3", 0 )
    GUICtrlSetImage($NameDropper, $IMGs & "NameDropper2.bmp")
    GUICtrlSetOnEvent($NameDropper, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func GladHander()
    Initialization()
    IniWrite( $Config, "Sell", "S4", 0 )
    GUICtrlSetImage($GladHander, $IMGs & "GladHander2.bmp")
    GUICtrlSetOnEvent($GladHander, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func MoverShaker()
    Initialization()
    IniWrite( $Config, "Sell", "S5", 0 )
    GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker2.bmp")
    GUICtrlSetOnEvent($MoverShaker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func TwoFace()
    Initialization()
    IniWrite( $Config, "Sell", "S6", 0 )
    GUICtrlSetImage($TwoFace, $IMGs & "TwoFace2.bmp")
    GUICtrlSetOnEvent($TwoFace, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func TheMingler()
    Initialization()
    IniWrite( $Config, "Sell", "S7", 0 )
    GUICtrlSetImage($TheMingler, $IMGs & "TheMingler2.bmp")
    GUICtrlSetOnEvent($TheMingler, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func MrHollywood()
    Initialization()
    IniWrite( $Config, "Sell", "S8", 0 )
    GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood2.bmp")
    GUICtrlSetOnEvent($MrHollywood, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Scram()    ;  ------------ Exit Script Function  ------------
    Local $i = MsgBox(262145, "Exit Script", "Are you sure you want to Exit?")
    If $i = 1 Then
        _GDIPlus_Shutdown()
        GUIDelete( $MainGUI )
        GUIDelete( $UpdateGUI )
        Exit
    Else
    EndIf
EndFunc

I thank anyone in advance that is able to let me know just what it is I am being ignorant about and overlooking here.

Sean

Summons_GUI_Test.zip

Share this post


Link to post
Share on other sites



Game Automation isn't allowed according to the Forum Rules(link at the bottom right corner of every page)

Sorry, you won't receive any help regarding this topic.


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

Launching, automation or script interaction with games or game servers, regardless of the game.

 

????  I know this. This isn't any form of game automation as I mentioned in my post. This interfaces with no other program what so ever. It's all in my first post. 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Much of your code could be simplified

As an example check For Next Loops and Arrays

Func GUIBoss()  ;  ------------ Bossbot Buttons  ------------------------------------
;~  MsgBox(64, "", $Boss[1][1])
    If $Boss[1][1] = 1 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky.bmp")
        GUICtrlSetOnEvent($Flunky, "Flunky")
    ElseIf $Boss[1][1] = 0 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
        GUICtrlSetOnEvent($Flunky, "")
    EndIf

    If $Boss[2][1] = 1 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PencilPusher.bmp")
        GUICtrlSetOnEvent(-1, "PencilPusher")
    ElseIf $Boss[2][1] = 0 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
        GUICtrlSetOnEvent($PencilPusher, "")
    EndIf

    If $Boss[3][1] = 1 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman.bmp")
        GUICtrlSetOnEvent($Yesman, "Yesman")
    ElseIf $Boss[3][1] = 0 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
        GUICtrlSetOnEvent($Yesman, "")
    EndIf

    If $Boss[4][1] = 1 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager.bmp")
        GUICtrlSetOnEvent($MicroManager, "MicroManager")
    ElseIf $Boss[4][1] = 0 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
        GUICtrlSetOnEvent($MicroManager, "")
    EndIf

    If $Boss[5][1] = 1 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer.bmp")
        GUICtrlSetOnEvent($Downsizer, "Downsizer")
    ElseIf $Boss[5][1] = 0 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
        GUICtrlSetOnEvent($Downsizer, "")
    EndIf

    If $Boss[6][1] = 1 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter.bmp")
        GUICtrlSetOnEvent($HeadHunter, "HeadHunter")
    ElseIf $Boss[6][1] = 0 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
        GUICtrlSetOnEvent($HeadHunter, "")
    EndIf

    If $Boss[7][1] = 1 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "CorporateRaider")
    ElseIf $Boss[7][1] = 0 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "")
    EndIf

    If $Boss[8][1] = 1 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese.bmp")
        GUICtrlSetOnEvent($BigCheese, "BigCheese")
    ElseIf $Boss[8][1] = 0 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
        GUICtrlSetOnEvent($BigCheese, "")
    EndIf
EndFunc

;  ------------ Bossbot Functions  ------------
Func Flunky()
    Initialization()
    IniWrite( $Config, "Boss", "B1", 0 )
    GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
    GUICtrlSetOnEvent($Flunky, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func PencilPusher()
    Initialization()
    IniWrite( $Config, "Boss", "B2", 0 )
    GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
    GUICtrlSetOnEvent($PencilPusher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Yesman()
    Initialization()
    IniWrite( $Config, "Boss", "B3", 0 )
    GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
    GUICtrlSetOnEvent($Yesman, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func MicroManager()
    Initialization()
    IniWrite( $Config, "Boss", "B4", 0 )
    GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
    GUICtrlSetOnEvent($MicroManager, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func Downsizer()
    Initialization()
    IniWrite( $Config, "Boss", "B5", 0 )
    GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
    GUICtrlSetOnEvent($Downsizer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func HeadHunter()
    Initialization()
    IniWrite( $Config, "Boss", "B6", 0 )
    GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
    GUICtrlSetOnEvent($HeadHunter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func CorporateRaider()
    Initialization()
    IniWrite( $Config, "Boss", "B7", 0 )
    GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
    GUICtrlSetOnEvent($CorporateRaider, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Func BigCheese()
    Initialization()
    IniWrite( $Config, "Boss", "B8", 0 )
    GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
    GUICtrlSetOnEvent($BigCheese, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc

Could be simplified to 

Func GUIBoss() ;  ------------ Bossbot Buttons  ------------------------------------

    Local $aArray[8] = ["Flunky", "PencilPusher", "Yesman", "MicroManager", "Downsizer", "HeadHunter", "CorporateRaider", "BigCheese"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW1, $BX, $BY, $BS_BITMAP), 2)

        If $Boss[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "BossBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUIBoss


Func BossBot_Implementation()

    Local $aArray[8] = ["Flunky", "PencilPusher", "Yesman", "MicroManager", "Downsizer", "HeadHunter", "CorporateRaider", "BigCheese"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Boss", "B" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>BossBot_Implementation

I would check out your full script.

Hold a while

Regards ;)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

Much of your code could be simplified

As an example check For Next Loops and Arrays

I would check out your full script.

Hold a while

 

Regards ;)

Please, feel free and TY. No rush. I've got till I die. LOL. Everything is there as I intend it to be. I know I could have had it just 'toggle' from the one GUI the pictures, but that would then defeat my purpose of learning multiple GUI's. Regardless of what 'could be modified' to do devious minded things,, as truly, what script couldn't be?? That isn't my intent and I did stated everything so everyone knew ahead of time. (Though I do understand and respect your concerns at the same time.)

Sean

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

As you wish.

Here is the simplified script

#comments-start ------------------------------------------------------------------------------------------------------------------
    #
    #   This is a little tool, that shows a simple 'button-style' GUI, in which the user
    #   can click on a button and have it keep track, visually, of which invasion summons one has
    #   It allows for both, adding of 'on-hand' invasions to the list, as well as updates when
    #   one is used.
    #
    #   This program was written and compiled in AutoIt v3, by Sean
    #   on a WIndow 7 x64 Ultimate system.
    #
    #   Release Notes:------------------------------------------------------------------------
    #   1.0.0.0 xx/xx/xxxx  Initial Release.
    #
    #   --------------------------------------------------------------------------------------
    #   Specifics of this released version:
    #       This version is a Testing/Beta release.
    #
#comments-end ------------------------------------------------------------------------------------------------------------------


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <File.au3>


Global $Config = @ScriptDir & "\cogs.ini"
Global $IMGs = @ScriptDir & "\images\"
Global $UpdateGUI

CheckINI()

Func CheckINI() ;  ~-------- Checks for the Config File --------------------------
    If FileExists($Config) Then
        ReadINI()
        Initialization()
        MainGUI()
    ElseIf Not FileExists($Config) Then
        CreateIni()
        Initialization()
        MainGUI()
    EndIf
EndFunc   ;==>CheckINI

Func ReadINI() ;  ~-------- Reads the Config File Data --------------------------

    Global $Boss = IniReadSection($Config, "Boss")
    If @error Then CreateIni()

    Global $Law = IniReadSection($Config, "Law")
    If @error Then CreateIni()

    Global $Cash = IniReadSection($Config, "Cash")
    If @error Then CreateIni()

    Global $Sell = IniReadSection($Config, "Sell")
    If @error Then CreateIni()

EndFunc   ;==>ReadINI

Func CreateIni() ;  ~-------- Config File Creation --------------------------
    MsgBox(262160, "Invalid Configuration File", "Couldn't Read Configuration File" & @CR & "Creating A New One With Default Values")
    For $Boss2 = 1 To 8 Step 1
        IniDelete($Config, "B" & $Boss2)
        IniWrite($Config, "Boss", "B" & $Boss2, 1)
    Next
    For $Law2 = 1 To 8 Step 1
        IniDelete($Config, "L" & $Law2)
        IniWrite($Config, "Law", "L" & $Law2, 1)
    Next
    For $Cash2 = 1 To 8 Step 1
        IniDelete($Config, "C" & $Cash2)
        IniWrite($Config, "Cash", "C" & $Cash2, 1)
    Next
    For $Sell2 = 1 To 8 Step 1
        IniDelete($Config, "S" & $Sell2)
        IniWrite($Config, "Sell", "S" & $Sell2, 1)
    Next
    MsgBox(262160, "New Configuration File", "New Configuration File Created")
    ReadINI()
EndFunc   ;==>CreateIni

Func Initialization() ;  ~-------- Initialization of Variables & Options --------------------------
    ;  ------------ Initializes All The Setup Options -------------------------------------------------
    AutoItSetOption("GUICloseOnESC", 0)
    Opt("GUICoordMode", 1)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)
    ;  ------------ GUI Cog Button Sizes:  ------------
    Global $BX = 36 ; Button Size "X"
    Global $BY = 50 ; Button Size "Y"
    ;  ------------ "X" Coordinate Variables for GUI Buttons:  ------------
    Global $MainGUI
    Global $CL1 = 18 ; Button Column Number One "X" Location
    Global $CL2 = $CL1 + 34 ; Button Column Number Two "X" Location
    Global $CL3 = $CL2 + 34 ; Button Column Number Three "X" Location
    Global $CL4 = $CL3 + 34 ; Button Column Number Four "X" Location
    Global $CL5 = $CL4 + 35 ; Button Column Number Five "X" Location
    Global $CL6 = $CL5 + 34 ; Button Column Number Six "X" Location
    Global $CL7 = $CL6 + 34 ; Button Column Number Seven "X" Location
    Global $CL8 = $CL7 + 34 ; Button Column Number Eight "X" Location
    ;  ------------ "Y" Coordinate Variables for GUI Buttons:  ------------
    Global $ROW1 = 56 ; Button Row Number One "Y" Location
    Global $ROW2 = $ROW1 + 49 ; Button Row Number Two "Y" Location
    Global $ROW3 = $ROW2 + 48 ; Button Row Number Three "Y" Location
    Global $ROW4 = $ROW3 + 49 ; Button Row Number Four "Y" Location
EndFunc   ;==>Initialization

Func MainGUI() ;  ------------ Create GUI's and all Buttons ------------------------------------
    ;  ------------ Create Main GUI ------------------------------------

    Global $MainGUI = GUICreate("Invasion On Hand", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragGUI")

    Global $GUI1_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($MainGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI1_BKGRD, $GUI_DISABLE)

    ;  ------------ Calls Main GUI Button Creation Functions ------------------------------------
    GUIBoss()
    GUILaw()
    GUICash()
    GUISell()
    Minimize_BTN()
    Update_Summons_BTN()
    Exit_BTN()

    GUISetState(@SW_SHOW, $MainGUI)

    UpdateGUI()

    ;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>MainGUI

Func DragGUI()
    _SendMessage(@GUI_WinHandle, $WM_SYSCOMMAND, 0xF012, 0)
EndFunc   ;==>DragGUI

Func GUIBoss() ;  ------------ Bossbot Buttons  ------------------------------------

    Local $aArray[8] = ["Flunky", "PencilPusher", "Yesman", "MicroManager", "Downsizer", "HeadHunter", "CorporateRaider", "BigCheese"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW1, $BX, $BY, $BS_BITMAP), 2)

        If $Boss[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "BossBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUIBoss

Func GUILaw() ;  ------------ Lawbot Buttons  ------------------------------------

    Local $aArray[8] = ["BottomFeeder", "Bloodsucker", "DoubleTalker", "AmbulanceChaser", "Backstabber", "SpinDoctor", "LegalEagle", "BigWig"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW2, $BX, $BY, $BS_BITMAP), 2)

        If $Law[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "LawBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUILaw

Func GUICash() ;  ------------ Cashbot Buttons  ------------------------------------

    Local $aArray[8] = ["ShortChange", "PennyPincher", "Tightwad", "BeanCounter", "NumberCruncher", "MoneyBags", "LoanShark", "RobberBaron"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW3, $BX, $BY, $BS_BITMAP), 2)

        If $Law[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "CashBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUICash

Func GUISell() ;  ------------ Sellbot Buttons  ------------------------------------

    Local $aArray[8] = ["ColdCaller", "TeleMarketer", "NameDropper", "GladHander", "MoverShaker", "TwoFace", "TheMingler", "MrHollywood"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW4, $BX, $BY, $BS_BITMAP), 2)

        If $Law[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "SellBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUISell

;  ------------ Bossbot Functions  ------------

Func BossBot_Implementation()

    Local $aArray[8] = ["Flunky", "PencilPusher", "Yesman", "MicroManager", "Downsizer", "HeadHunter", "CorporateRaider", "BigCheese"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Boss", "B" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>BossBot_Implementation

;  ------------ Lawbot Functions  ------------

Func LawBot_Implementation()

    Local $aArray[8] = ["BottomFeeder", "Bloodsucker", "DoubleTalker", "AmbulanceChaser", "Backstabber", "SpinDoctor", "LegalEagle", "BigWig"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Law", "L" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>LawBot_Implementation

;  ------------ Cashbot Functions  ------------

Func CashBot_Implementation()

    Local $aArray[8] = ["ShortChange", "PennyPincher", "Tightwad", "BeanCounter", "NumberCruncher", "MoneyBags", "LoanShark", "RobberBaron"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Cash", "C" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>CashBot_Implementation

;  ------------ Sellbot Functions  ------------
Func SellBot_Implementation()

    Local $aArray[8] = ["ColdCaller", "TeleMarketer", "NameDropper", "GladHander", "MoverShaker", "TwoFace", "TheMingler", "MrHollywood"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Sell", "S" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>SellBot_Implementation


Func Minimize_BTN() ;  ------------ Minimize Button  ------------------------------------
    $Minimize_BTN = GUICtrlCreateButton("Minimize", 15, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Minimize_BTN, $IMGs & "Minimize_btn-1.bmp", "", 0)
    GUICtrlSetOnEvent($Minimize_BTN, "GUIMinimize")
    GUICtrlSetState($Minimize_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Minimize_BTN

Func Update_Summons_BTN() ;  ------------ Update Summons on Hand Button Creation ------------------------------------
    $Update_Summons_BTN = GUICtrlCreateButton("Pick_Window", 120, 0, 79, 32, $BS_BITMAP)
    GUICtrlSetImage($Update_Summons_BTN, $IMGs & "Update_Summons-1.bmp", "", 0)
    GUICtrlSetOnEvent($Update_Summons_BTN, "ShowUpdateGUI")
    GUICtrlSetState($Update_Summons_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Update_Summons_BTN

Func Exit_BTN() ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "Scram")
    GUICtrlSetState(-1, $GUI_NOFOCUS)
EndFunc   ;==>Exit_BTN

Func Exit_BTN2()    ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN2 = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "UpdateGUI_Hide")
    GuiCtrlSetState(-1, $GUI_NOFOCUS)
EndFunc

Func GUIMinimize()
    GUISetState(@SW_MINIMIZE, $MainGUI)
EndFunc   ;==>GUIMinimize

Func ShowUpdateGUI()
    GUISetState(@SW_MINIMIZE, $MainGUI)
    GUISetState(@SW_SHOW, $UpdateGUI)
EndFunc

Func UpdateGUI();  ------------ Create Update Summons GUI ------------------------------------

    $UpdateGUI = GUICreate("Update Summons", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISwitch($UpdateGUI)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragGUI")

    Global $GUI2_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($UpdateGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI2_BKGRD, $GUI_DISABLE)

    ;  ------------ Calls GUI Button Creation Functions ------------------------------------
    Exit_BTN2()

    ;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>UpdateGUI


Func UpdateGUI_Hide()
    GUISetState(@SW_HIDE, $UpdateGUI)
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>UpdateGUI_Hide

Func Scram() ;  ------------ Exit Script Function  ------------
    Local $i = MsgBox(262145, "Exit Script", "Are you sure you want to Exit?")
    If $i = 1 Then
        GUIDelete($MainGUI)
        GUIDelete($UpdateGUI)
        Exit
    EndIf
EndFunc   ;==>Scram

Here is the one without any simplifications as you wanted

#comments-start ------------------------------------------------------------------------------------------------------------------
    #
    #   This is a little tool, that shows a simple 'button-style' GUI, in which the user
    #   can click on a button and have it keep track, visually, of which invasion summons one has
    #   It allows for both, adding of 'on-hand' invasions to the list, as well as updates when
    #   one is used.
    #
    #   This program was written and compiled in AutoIt v3, by Sean
    #   on a WIndow 7 x64 Ultimate system.
    #
    #   Release Notes:------------------------------------------------------------------------
    #   1.0.0.0 xx/xx/xxxx  Initial Release.
    #
    #   --------------------------------------------------------------------------------------
    #   Specifics of this released version:
    #       This version is a Testing/Beta release.
    #
#comments-end ------------------------------------------------------------------------------------------------------------------


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <File.au3>

Global $Config = @ScriptDir & "\cogs.ini"
Global $IMGs = @ScriptDir & "\images\"
Global $UpdateGUI

CheckINI()

Func CheckINI() ;  ~-------- Checks for the Config File --------------------------
    If FileExists($Config) Then
        ReadINI()
        Initialization()
        MainGUI()
    ElseIf Not FileExists($Config) Then
        CreateIni()
        Initialization()
        MainGUI()
    EndIf
EndFunc   ;==>CheckINI

Func ReadINI() ;  ~-------- Reads the Config File Data --------------------------
    Global $Boss = IniReadSection($Config, "Boss")
    If $Boss = @error Then
        CreateIni()
    EndIf
    Global $Law = IniReadSection($Config, "Law")
    If $Law = @error Then
        CreateIni()
    EndIf
    Global $Cash = IniReadSection($Config, "Cash")
    If $Cash = @error Then
        CreateIni()
    EndIf
    Global $Sell = IniReadSection($Config, "Sell")
    If $Sell = @error Then
        CreateIni()
    EndIf
EndFunc   ;==>ReadINI

Func CreateIni() ;  ~-------- Config File Creation --------------------------
    MsgBox(262160, "Invalid Configuration File", "Couldn't Read Configuration File" & @CR & "Creating A New One With Default Values")
    For $Boss2 = 1 To 8 Step 1
        IniDelete($Config, "B" & $Boss2)
        IniWrite($Config, "Boss", "B" & $Boss2, 1)
    Next
    For $Law2 = 1 To 8 Step 1
        IniDelete($Config, "L" & $Law2)
        IniWrite($Config, "Law", "L" & $Law2, 1)
    Next
    For $Cash2 = 1 To 8 Step 1
        IniDelete($Config, "C" & $Cash2)
        IniWrite($Config, "Cash", "C" & $Cash2, 1)
    Next
    For $Sell2 = 1 To 8 Step 1
        IniDelete($Config, "S" & $Sell2)
        IniWrite($Config, "Sell", "S" & $Sell2, 1)
    Next
    MsgBox(262160, "New Configuration File", "New Configuration File Created")
    ReadINI()
EndFunc   ;==>CreateIni

Func Initialization() ;  ~-------- Initialization of Variables & Options --------------------------
    ;  ------------ Initializes All The Setup Options -------------------------------------------------
    AutoItSetOption("GUICloseOnESC", 0)
    Opt("GUICoordMode", 1)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)
    ;  ------------ GUI Cog Button Sizes:  ------------
    Global $BX = 36 ; Button Size "X"
    Global $BY = 50 ; Button Size "Y"
    ;  ------------ "X" Coordinate Variables for GUI Buttons:  ------------
    Global $MainGUI
    Global $CL1 = 18 ; Button Column Number One "X" Location
    Global $CL2 = $CL1 + 34 ; Button Column Number Two "X" Location
    Global $CL3 = $CL2 + 34 ; Button Column Number Three "X" Location
    Global $CL4 = $CL3 + 34 ; Button Column Number Four "X" Location
    Global $CL5 = $CL4 + 35 ; Button Column Number Five "X" Location
    Global $CL6 = $CL5 + 34 ; Button Column Number Six "X" Location
    Global $CL7 = $CL6 + 34 ; Button Column Number Seven "X" Location
    Global $CL8 = $CL7 + 34 ; Button Column Number Eight "X" Location
    ;  ------------ "Y" Coordinate Variables for GUI Buttons:  ------------
    Global $ROW1 = 56 ; Button Row Number One "Y" Location
    Global $ROW2 = $ROW1 + 49 ; Button Row Number Two "Y" Location
    Global $ROW3 = $ROW2 + 48 ; Button Row Number Three "Y" Location
    Global $ROW4 = $ROW3 + 49 ; Button Row Number Four "Y" Location
EndFunc   ;==>Initialization

Func MainGUI() ;  ------------ Create GUI's and all Buttons ------------------------------------
    ;  ------------ Create Main GUI ------------------------------------
    Global $MainGUI = GUICreate("Invasion On Hand", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Drag")


    Global $GUI1_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($MainGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI1_BKGRD, $GUI_DISABLE)

    ;  ------------ Calls Main GUI Button Creation Functions ------------------------------------
    GUIBoss()
    GUILaw()
    GUICash()
    GUISell()
    Minimize_BTN()
    Update_Summons_BTN()
    Exit_BTN()
    UpdateGUI() ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<   Create the GUI but hidden
    GUISwitch($MainGUI)
    GUISetState(@SW_SHOW, $MainGUI)


    ;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
    WEnd

EndFunc   ;==>MainGUI

Func GUIBoss() ;  ------------ Bossbot Buttons  ------------------------------------
;~  MsgBox(64, "", $Boss[1][1])
    If $Boss[1][1] = 1 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky.bmp")
        GUICtrlSetOnEvent($Flunky, "Flunky")
    ElseIf $Boss[1][1] = 0 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
        GUICtrlSetOnEvent($Flunky, "")
    EndIf

    If $Boss[2][1] = 1 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PencilPusher.bmp")
        GUICtrlSetOnEvent(-1, "PencilPusher")
    ElseIf $Boss[2][1] = 0 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
        GUICtrlSetOnEvent($PencilPusher, "")
    EndIf

    If $Boss[3][1] = 1 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman.bmp")
        GUICtrlSetOnEvent($Yesman, "Yesman")
    ElseIf $Boss[3][1] = 0 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
        GUICtrlSetOnEvent($Yesman, "")
    EndIf

    If $Boss[4][1] = 1 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager.bmp")
        GUICtrlSetOnEvent($MicroManager, "MicroManager")
    ElseIf $Boss[4][1] = 0 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
        GUICtrlSetOnEvent($MicroManager, "")
    EndIf

    If $Boss[5][1] = 1 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer.bmp")
        GUICtrlSetOnEvent($Downsizer, "Downsizer")
    ElseIf $Boss[5][1] = 0 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
        GUICtrlSetOnEvent($Downsizer, "")
    EndIf

    If $Boss[6][1] = 1 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter.bmp")
        GUICtrlSetOnEvent($HeadHunter, "HeadHunter")
    ElseIf $Boss[6][1] = 0 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
        GUICtrlSetOnEvent($HeadHunter, "")
    EndIf

    If $Boss[7][1] = 1 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "CorporateRaider")
    ElseIf $Boss[7][1] = 0 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "")
    EndIf

    If $Boss[8][1] = 1 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese.bmp")
        GUICtrlSetOnEvent($BigCheese, "BigCheese")
    ElseIf $Boss[8][1] = 0 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
        GUICtrlSetOnEvent($BigCheese, "")
    EndIf
EndFunc   ;==>GUIBoss

Func GUILaw() ;  ------------ Lawbot Buttons  ------------------------------------
    If $Law[1][1] = 1 Then
        Global $BottomFeeder = GUICtrlCreateButton("BottomFeeder", $CL1, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder.bmp")
        GUICtrlSetOnEvent($BottomFeeder, "BottomFeeder")
    ElseIf $Law[1][1] = 0 Then
        Global $BottomFeeder = GUICtrlCreateButton("BottomFeeder", $CL1, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder2.bmp")
        GUICtrlSetOnEvent($BottomFeeder, "")
    EndIf

    If $Law[2][1] = 1 Then
        Global $Bloodsucker = GUICtrlCreateButton("Bloodsucker", $CL2, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "Bloodsucker.bmp")
        GUICtrlSetOnEvent(-1, "Bloodsucker")
    ElseIf $Law[2][1] = 0 Then
        Global $Bloodsucker = GUICtrlCreateButton("Bloodsucker", $CL2, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Bloodsucker, $IMGs & "Bloodsucker2.bmp")
        GUICtrlSetOnEvent($Bloodsucker, "")
    EndIf

    If $Law[3][1] = 1 Then
        Global $DoubleTalker = GUICtrlCreateButton("DoubleTalker", $CL3, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker.bmp")
        GUICtrlSetOnEvent($DoubleTalker, "DoubleTalker")
    ElseIf $Law[3][1] = 0 Then
        Global $DoubleTalker = GUICtrlCreateButton("DoubleTalker", $CL3, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker2.bmp")
        GUICtrlSetOnEvent($DoubleTalker, "")
    EndIf

    If $Law[4][1] = 1 Then
        Global $AmbulanceChaser = GUICtrlCreateButton("AmbulanceChaser", $CL4, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser.bmp")
        GUICtrlSetOnEvent($AmbulanceChaser, "AmbulanceChaser")
    ElseIf $Law[4][1] = 0 Then
        Global $AmbulanceChaser = GUICtrlCreateButton("AmbulanceChaser", $CL4, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser2.bmp")
        GUICtrlSetOnEvent($AmbulanceChaser, "")
    EndIf

    If $Law[5][1] = 1 Then
        Global $Backstabber = GUICtrlCreateButton("Backstabber", $CL5, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Backstabber, $IMGs & "Backstabber.bmp")
        GUICtrlSetOnEvent($Backstabber, "Backstabber")
    ElseIf $Law[5][1] = 0 Then
        Global $Backstabber = GUICtrlCreateButton("Backstabber", $CL5, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Backstabber, $IMGs & "Backstabber2.bmp")
        GUICtrlSetOnEvent($Backstabber, "")
    EndIf

    If $Law[6][1] = 1 Then
        Global $SpinDoctor = GUICtrlCreateButton("SpinDoctor", $CL6, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor.bmp")
        GUICtrlSetOnEvent($SpinDoctor, "SpinDoctor")
    ElseIf $Law[6][1] = 0 Then
        Global $SpinDoctor = GUICtrlCreateButton("SpinDoctor", $CL6, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor2.bmp")
        GUICtrlSetOnEvent($SpinDoctor, "")
    EndIf

    If $Law[7][1] = 1 Then
        Global $LegalEagle = GUICtrlCreateButton("LegalEagle", $CL7, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle.bmp")
        GUICtrlSetOnEvent($LegalEagle, "LegalEagle")
    ElseIf $Law[7][1] = 0 Then
        Global $LegalEagle = GUICtrlCreateButton("LegalEagle", $CL7, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle2.bmp")
        GUICtrlSetOnEvent($LegalEagle, "")
    EndIf

    If $Law[8][1] = 1 Then
        Global $BigWig = GUICtrlCreateButton("BigWig", $CL8, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigWig, $IMGs & "BigWig.bmp")
        GUICtrlSetOnEvent($BigWig, "BigWig")
    ElseIf $Law[8][1] = 0 Then
        Global $BigWig = GUICtrlCreateButton("BigWig", $CL8, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigWig, $IMGs & "BigWig2.bmp")
        GUICtrlSetOnEvent($BigWig, "")
    EndIf
EndFunc   ;==>GUILaw

Func GUICash() ;  ------------ Cashbot Buttons  ------------------------------------
    If $Cash[1][1] = 1 Then
        Global $ShortChange = GUICtrlCreateButton("ShortChange", $CL1, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ShortChange, $IMGs & "ShortChange.bmp")
        GUICtrlSetOnEvent($ShortChange, "ShortChange")
    ElseIf $Cash[1][1] = 0 Then
        Global $ShortChange = GUICtrlCreateButton("ShortChange", $CL1, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ShortChange, $IMGs & "ShortChange2.bmp")
        GUICtrlSetOnEvent($ShortChange, "")
    EndIf

    If $Cash[2][1] = 1 Then
        Global $PennyPincher = GUICtrlCreateButton("PennyPincher", $CL2, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PennyPincher.bmp")
        GUICtrlSetOnEvent(-1, "PennyPincher")
    ElseIf $Cash[2][1] = 0 Then
        Global $PennyPincher = GUICtrlCreateButton("PennyPincher", $CL2, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PennyPincher, $IMGs & "PennyPincher2.bmp")
        GUICtrlSetOnEvent($PennyPincher, "")
    EndIf

    If $Cash[3][1] = 1 Then
        Global $Tightwad = GUICtrlCreateButton("Tightwad", $CL3, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Tightwad, $IMGs & "Tightwad.bmp")
        GUICtrlSetOnEvent($Tightwad, "Tightwad")
    ElseIf $Cash[3][1] = 0 Then
        Global $Tightwad = GUICtrlCreateButton("Tightwad", $CL3, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Tightwad, $IMGs & "Tightwad2.bmp")
        GUICtrlSetOnEvent($Tightwad, "")
    EndIf

    If $Cash[4][1] = 1 Then
        Global $BeanCounter = GUICtrlCreateButton("BeanCounter", $CL4, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter.bmp")
        GUICtrlSetOnEvent($BeanCounter, "BeanCounter")
    ElseIf $Cash[4][1] = 0 Then
        Global $BeanCounter = GUICtrlCreateButton("BeanCounter", $CL4, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter2.bmp")
        GUICtrlSetOnEvent($BeanCounter, "")
    EndIf

    If $Cash[5][1] = 1 Then
        Global $NumberCruncher = GUICtrlCreateButton("NumberCruncher", $CL5, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher.bmp")
        GUICtrlSetOnEvent($NumberCruncher, "NumberCruncher")
    ElseIf $Cash[5][1] = 0 Then
        Global $NumberCruncher = GUICtrlCreateButton("NumberCruncher", $CL5, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher2.bmp")
        GUICtrlSetOnEvent($NumberCruncher, "")
    EndIf

    If $Cash[6][1] = 1 Then
        Global $MoneyBags = GUICtrlCreateButton("MoneyBags", $CL6, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags.bmp")
        GUICtrlSetOnEvent($MoneyBags, "MoneyBags")
    ElseIf $Cash[6][1] = 0 Then
        Global $MoneyBags = GUICtrlCreateButton("MoneyBags", $CL6, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags2.bmp")
        GUICtrlSetOnEvent($MoneyBags, "")
    EndIf

    If $Cash[7][1] = 1 Then
        Global $LoanShark = GUICtrlCreateButton("LoanShark", $CL7, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LoanShark, $IMGs & "LoanShark.bmp")
        GUICtrlSetOnEvent($LoanShark, "LoanShark")
    ElseIf $Cash[7][1] = 0 Then
        Global $LoanShark = GUICtrlCreateButton("LoanShark", $CL7, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LoanShark, $IMGs & "LoanShark2.bmp")
        GUICtrlSetOnEvent($LoanShark, "")
    EndIf

    If $Cash[8][1] = 1 Then
        Global $RobberBaron = GUICtrlCreateButton("RobberBaron", $CL8, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron.bmp")
        GUICtrlSetOnEvent($RobberBaron, "RobberBaron")
    ElseIf $Cash[8][1] = 0 Then
        Global $RobberBaron = GUICtrlCreateButton("RobberBaron", $CL8, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron2.bmp")
        GUICtrlSetOnEvent($RobberBaron, "")
    EndIf
EndFunc   ;==>GUICash

Func GUISell() ;  ------------ Sellbot Buttons  ------------------------------------
    If $Sell[1][1] = 1 Then
        Global $ColdCaller = GUICtrlCreateButton("ColdCaller", $CL1, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller.bmp")
        GUICtrlSetOnEvent($ColdCaller, "ColdCaller")
    ElseIf $Sell[1][1] = 0 Then
        Global $ColdCaller = GUICtrlCreateButton("ColdCaller", $CL1, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller2.bmp")
        GUICtrlSetOnEvent($ColdCaller, "")
    EndIf

    If $Sell[2][1] = 1 Then
        Global $TeleMarketer = GUICtrlCreateButton("TeleMarketer", $CL2, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "TeleMarketer.bmp")
        GUICtrlSetOnEvent(-1, "TeleMarketer")
    ElseIf $Sell[2][1] = 0 Then
        Global $TeleMarketer = GUICtrlCreateButton("TeleMarketer", $CL2, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TeleMarketer, $IMGs & "TeleMarketer2.bmp")
        GUICtrlSetOnEvent($TeleMarketer, "")
    EndIf

    If $Sell[3][1] = 1 Then
        Global $NameDropper = GUICtrlCreateButton("NameDropper,", $CL3, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NameDropper, $IMGs & "NameDropper.bmp")
        GUICtrlSetOnEvent($NameDropper, "NameDropper")
    ElseIf $Sell[3][1] = 0 Then
        Global $NameDropper = GUICtrlCreateButton("NameDropper", $CL3, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NameDropper, $IMGs & "NameDropper2.bmp")
        GUICtrlSetOnEvent($NameDropper, "")
    EndIf

    If $Sell[4][1] = 1 Then
        Global $GladHander = GUICtrlCreateButton("GladHander", $CL4, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($GladHander, $IMGs & "GladHander.bmp")
        GUICtrlSetOnEvent($GladHander, "GladHander")
    ElseIf $Sell[4][1] = 0 Then
        Global $GladHander = GUICtrlCreateButton("GladHander", $CL4, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($GladHander, $IMGs & "GladHander2.bmp")
        GUICtrlSetOnEvent($GladHander, "")
    EndIf

    If $Sell[5][1] = 1 Then
        Global $MoverShaker = GUICtrlCreateButton("MoverShaker", $CL5, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker.bmp")
        GUICtrlSetOnEvent($MoverShaker, "MoverShaker")
    ElseIf $Sell[5][1] = 0 Then
        Global $MoverShaker = GUICtrlCreateButton("MoverShaker", $CL5, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker2.bmp")
        GUICtrlSetOnEvent($MoverShaker, "")
    EndIf

    If $Sell[6][1] = 1 Then
        Global $TwoFace = GUICtrlCreateButton("TwoFace", $CL6, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TwoFace, $IMGs & "TwoFace.bmp")
        GUICtrlSetOnEvent($TwoFace, "TwoFace")
    ElseIf $Sell[6][1] = 0 Then
        Global $TwoFace = GUICtrlCreateButton("TwoFace", $CL6, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TwoFace, $IMGs & "TwoFace2.bmp")
        GUICtrlSetOnEvent($TwoFace, "")
    EndIf

    If $Sell[7][1] = 1 Then
        Global $TheMingler = GUICtrlCreateButton("TheMingler", $CL7, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TheMingler, $IMGs & "TheMingler.bmp")
        GUICtrlSetOnEvent($TheMingler, "TheMingler")
    ElseIf $Sell[7][1] = 0 Then
        Global $TheMingler = GUICtrlCreateButton("TheMingler", $CL7, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TheMingler, $IMGs & "TheMingler2.bmp")
        GUICtrlSetOnEvent($TheMingler, "")
    EndIf

    If $Sell[8][1] = 1 Then
        Global $MrHollywood = GUICtrlCreateButton("MrHollywood", $CL8, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood.bmp")
        GUICtrlSetOnEvent($MrHollywood, "MrHollywood")
    ElseIf $Sell[8][1] = 0 Then
        Global $MrHollywood = GUICtrlCreateButton("MrHollywood", $CL8, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood2.bmp")
        GUICtrlSetOnEvent($MrHollywood, "")
    EndIf
EndFunc   ;==>GUISell

Func Minimize_BTN() ;  ------------ Minimize Button  ------------------------------------
    $Minimize_BTN = GUICtrlCreateButton("Minimize", 15, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Minimize_BTN, $IMGs & "Minimize_btn-1.bmp", "", 0)
    GUICtrlSetOnEvent($Minimize_BTN, "GUIMinimize")
    GUICtrlSetState($Minimize_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Minimize_BTN

Func Update_Summons_BTN() ;  ------------ Update Summons on Hand Button Creation ------------------------------------
    $Update_Summons_BTN = GUICtrlCreateButton("Pick_Window", 120, 0, 79, 32, $BS_BITMAP)
    GUICtrlSetImage($Update_Summons_BTN, $IMGs & "Update_Summons-1.bmp", "", 0)
    GUICtrlSetOnEvent($Update_Summons_BTN, "ShowUpdateGUI")
    GUICtrlSetState($Update_Summons_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Update_Summons_BTN

Func Exit_BTN() ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "Scram")
    GUICtrlSetState(-1, $GUI_NOFOCUS)
EndFunc   ;==>Exit_BTN

Func Exit_BTN2()    ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN2 = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "UpdateGUI_Hide")
    GuiCtrlSetState(-1, $GUI_NOFOCUS)
EndFunc

Func GUIMinimize()
    GUISetState(@SW_MINIMIZE, $MainGUI)
EndFunc   ;==>GUIMinimize

Func ShowUpdateGUI()

    GUISetState(@SW_MINIMIZE, $MainGUI)
    GUISetState(@SW_SHOW, $UpdateGUI)

EndFunc   ;==>ShowUpdateGUI

Func UpdateGUI();  ------------ Create Update Summons GUI ------------------------------------
    Global $UpdateGUI = GUICreate("Update Summons", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Drag")

    Global $GUI2_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($UpdateGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI2_BKGRD, $GUI_DISABLE)

;~  GUISwitch($UpdateGUI)

    ;  ------------ Calls GUI Button Creation Functions ------------------------------------
    Exit_BTN2()

    ;  ------------ There is already a loop running therefore no need of another.---------
EndFunc   ;==>UpdateGUI

Func UpdateGUI_Hide()
    GUISetState(@SW_HIDE, $UpdateGUI)
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>UpdateGUI_Hide

;  ------------ Bossbot Functions  ------------
Func Flunky()
    Initialization()
    IniWrite($Config, "Boss", "B1", 0)
    GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
    GUICtrlSetOnEvent($Flunky, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Flunky

Func PencilPusher()
    Initialization()
    IniWrite($Config, "Boss", "B2", 0)
    GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
    GUICtrlSetOnEvent($PencilPusher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>PencilPusher

Func Yesman()
    Initialization()
    IniWrite($Config, "Boss", "B3", 0)
    GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
    GUICtrlSetOnEvent($Yesman, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Yesman

Func MicroManager()
    Initialization()
    IniWrite($Config, "Boss", "B4", 0)
    GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
    GUICtrlSetOnEvent($MicroManager, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MicroManager

Func Downsizer()
    Initialization()
    IniWrite($Config, "Boss", "B5", 0)
    GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
    GUICtrlSetOnEvent($Downsizer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Downsizer

Func HeadHunter()
    Initialization()
    IniWrite($Config, "Boss", "B6", 0)
    GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
    GUICtrlSetOnEvent($HeadHunter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>HeadHunter

Func CorporateRaider()
    Initialization()
    IniWrite($Config, "Boss", "B7", 0)
    GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
    GUICtrlSetOnEvent($CorporateRaider, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>CorporateRaider

Func BigCheese()
    Initialization()
    IniWrite($Config, "Boss", "B8", 0)
    GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
    GUICtrlSetOnEvent($BigCheese, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BigCheese

;  ------------ Lawbot Functions  ------------
Func BottomFeeder()
    Initialization()
    IniWrite($Config, "Law", "L1", 0)
    GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder2.bmp")
    GUICtrlSetOnEvent($BottomFeeder, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BottomFeeder

Func Bloodsucker()
    Initialization()
    IniWrite($Config, "Law", "L2", 0)
    GUICtrlSetImage($Bloodsucker, $IMGs & "Bloodsucker2.bmp")
    GUICtrlSetOnEvent($Bloodsucker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Bloodsucker

Func DoubleTalker()
    Initialization()
    IniWrite($Config, "Law", "L3", 0)
    GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker2.bmp")
    GUICtrlSetOnEvent($DoubleTalker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>DoubleTalker

Func AmbulanceChaser()
    Initialization()
    IniWrite($Config, "Law", "L4", 0)
    GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser2.bmp")
    GUICtrlSetOnEvent($AmbulanceChaser, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>AmbulanceChaser

Func Backstabber()
    Initialization()
    IniWrite($Config, "Law", "L5", 0)
    GUICtrlSetImage($Backstabber, $IMGs & "Backstabber2.bmp")
    GUICtrlSetOnEvent($Backstabber, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Backstabber

Func SpinDoctor()
    Initialization()
    IniWrite($Config, "Law", "L6", 0)
    GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor2.bmp")
    GUICtrlSetOnEvent($SpinDoctor, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>SpinDoctor

Func LegalEagle()
    Initialization()
    IniWrite($Config, "Law", "L7", 0)
    GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle2.bmp")
    GUICtrlSetOnEvent($LegalEagle, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>LegalEagle

Func BigWig()
    Initialization()
    IniWrite($Config, "Law", "L8", 0)
    GUICtrlSetImage($BigWig, $IMGs & "BigWig2.bmp")
    GUICtrlSetOnEvent($BigWig, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BigWig

;  ------------ Cashbot Functions  ------------
Func ShortChange()
    Initialization()
    IniWrite($Config, "Cash", "C1", 0)
    GUICtrlSetImage($ShortChange, $IMGs & "ShortChange2.bmp")
    GUICtrlSetOnEvent($ShortChange, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>ShortChange

Func PennyPincher()
    Initialization()
    IniWrite($Config, "Cash", "C2", 0)
    GUICtrlSetImage($PennyPincher, $IMGs & "PennyPincher2.bmp")
    GUICtrlSetOnEvent($PennyPincher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>PennyPincher

Func Tightwad()
    Initialization()
    IniWrite($Config, "Cash", "C3", 0)
    GUICtrlSetImage($Tightwad, $IMGs & "Tightwad2.bmp")
    GUICtrlSetOnEvent($Tightwad, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Tightwad

Func BeanCounter()
    Initialization()
    IniWrite($Config, "Cash", "C4", 0)
    GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter2.bmp")
    GUICtrlSetOnEvent($BeanCounter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BeanCounter

Func NumberCruncher()
    Initialization()
    IniWrite($Config, "Cash", "C5", 0)
    GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher2.bmp")
    GUICtrlSetOnEvent($NumberCruncher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>NumberCruncher

Func MoneyBags()
    Initialization()
    IniWrite($Config, "Cash", "C6", 0)
    GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags2.bmp")
    GUICtrlSetOnEvent($MoneyBags, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MoneyBags

Func LoanShark()
    Initialization()
    IniWrite($Config, "Cash", "C7", 0)
    GUICtrlSetImage($LoanShark, $IMGs & "LoanShark2.bmp")
    GUICtrlSetOnEvent($LoanShark, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>LoanShark

Func RobberBaron()
    Initialization()
    IniWrite($Config, "Cash", "C8", 0)
    GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron2.bmp")
    GUICtrlSetOnEvent($RobberBaron, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>RobberBaron

;  ------------ Sellbot Functions  ------------
Func ColdCaller()
    Initialization()
    IniWrite($Config, "Sell", "S1", 0)
    GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller2.bmp")
    GUICtrlSetOnEvent($ColdCaller, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>ColdCaller

Func TeleMarketer()
    Initialization()
    IniWrite($Config, "Sell", "S2", 0)
    GUICtrlSetImage($TeleMarketer, $IMGs & "TeleMarketer2.bmp")
    GUICtrlSetOnEvent($TeleMarketer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>TeleMarketer

Func NameDropper()
    Initialization()
    IniWrite($Config, "Sell", "S3", 0)
    GUICtrlSetImage($NameDropper, $IMGs & "NameDropper2.bmp")
    GUICtrlSetOnEvent($NameDropper, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>NameDropper

Func GladHander()
    Initialization()
    IniWrite($Config, "Sell", "S4", 0)
    GUICtrlSetImage($GladHander, $IMGs & "GladHander2.bmp")
    GUICtrlSetOnEvent($GladHander, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>GladHander

Func MoverShaker()
    Initialization()
    IniWrite($Config, "Sell", "S5", 0)
    GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker2.bmp")
    GUICtrlSetOnEvent($MoverShaker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MoverShaker

Func TwoFace()
    Initialization()
    IniWrite($Config, "Sell", "S6", 0)
    GUICtrlSetImage($TwoFace, $IMGs & "TwoFace2.bmp")
    GUICtrlSetOnEvent($TwoFace, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>TwoFace

Func TheMingler()
    Initialization()
    IniWrite($Config, "Sell", "S7", 0)
    GUICtrlSetImage($TheMingler, $IMGs & "TheMingler2.bmp")
    GUICtrlSetOnEvent($TheMingler, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>TheMingler

Func MrHollywood()
    Initialization()
    IniWrite($Config, "Sell", "S8", 0)
    GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood2.bmp")
    GUICtrlSetOnEvent($MrHollywood, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MrHollywood

Func Scram() ;  ------------ Exit Script Function  ------------
    Local $i = MsgBox(262145, "Exit Script", "Are you sure you want to Exit?")
    If $i = 1 Then
        GUIDelete($MainGUI)
        GUIDelete($UpdateGUI)
        Exit
    Else
    EndIf
EndFunc   ;==>Scram

Func Drag()
    _SendMessage(@GUI_WinHandle, $WM_SYSCOMMAND, 0xF012, 0)
EndFunc   ;==>DragGUI
 

Create the Update GUI at the time you create the MainGUI and show the Update GUI upon pressing the Update Summon button.

Some points I would like to tell you

  • Declare Global Variables on the top of the script and assign them values in your respective functions.
  • Use the @Gui_CtrlId and similar macros for your benefit when using OnEvent mode.
  • You have to use GUISetOnEvent for messages like $GUI_EVENT_PRIMARYDOWN when using OnEvent mode.
  • You can have an extensive use of For-Next loops and Arrays to shorten and simplify your script. I have done it somewhat but it could be done further.

Regards :)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

As you wish.

Here is the simplified script

#comments-start ------------------------------------------------------------------------------------------------------------------
    #
    #   This is a little tool, that shows a simple 'button-style' GUI, in which the user
    #   can click on a button and have it keep track, visually, of which invasion summons one has
    #   It allows for both, adding of 'on-hand' invasions to the list, as well as updates when
    #   one is used.
    #
    #   This program was written and compiled in AutoIt v3, by Sean
    #   on a WIndow 7 x64 Ultimate system.
    #
    #   Release Notes:------------------------------------------------------------------------
    #   1.0.0.0 xx/xx/xxxx  Initial Release.
    #
    #   --------------------------------------------------------------------------------------
    #   Specifics of this released version:
    #       This version is a Testing/Beta release.
    #
#comments-end ------------------------------------------------------------------------------------------------------------------


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <File.au3>


Global $Config = @ScriptDir & "\cogs.ini"
Global $IMGs = @ScriptDir & "\images\"
Global $UpdateGUI

CheckINI()

Func CheckINI() ;  ~-------- Checks for the Config File --------------------------
    If FileExists($Config) Then
        ReadINI()
        Initialization()
        MainGUI()
    ElseIf Not FileExists($Config) Then
        CreateIni()
        Initialization()
        MainGUI()
    EndIf
EndFunc   ;==>CheckINI

Func ReadINI() ;  ~-------- Reads the Config File Data --------------------------

    Global $Boss = IniReadSection($Config, "Boss")
    If @error Then CreateIni()

    Global $Law = IniReadSection($Config, "Law")
    If @error Then CreateIni()

    Global $Cash = IniReadSection($Config, "Cash")
    If @error Then CreateIni()

    Global $Sell = IniReadSection($Config, "Sell")
    If @error Then CreateIni()

EndFunc   ;==>ReadINI

Func CreateIni() ;  ~-------- Config File Creation --------------------------
    MsgBox(262160, "Invalid Configuration File", "Couldn't Read Configuration File" & @CR & "Creating A New One With Default Values")
    For $Boss2 = 1 To 8 Step 1
        IniDelete($Config, "B" & $Boss2)
        IniWrite($Config, "Boss", "B" & $Boss2, 1)
    Next
    For $Law2 = 1 To 8 Step 1
        IniDelete($Config, "L" & $Law2)
        IniWrite($Config, "Law", "L" & $Law2, 1)
    Next
    For $Cash2 = 1 To 8 Step 1
        IniDelete($Config, "C" & $Cash2)
        IniWrite($Config, "Cash", "C" & $Cash2, 1)
    Next
    For $Sell2 = 1 To 8 Step 1
        IniDelete($Config, "S" & $Sell2)
        IniWrite($Config, "Sell", "S" & $Sell2, 1)
    Next
    MsgBox(262160, "New Configuration File", "New Configuration File Created")
    ReadINI()
EndFunc   ;==>CreateIni

Func Initialization() ;  ~-------- Initialization of Variables & Options --------------------------
    ;  ------------ Initializes All The Setup Options -------------------------------------------------
    AutoItSetOption("GUICloseOnESC", 0)
    Opt("GUICoordMode", 1)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)
    ;  ------------ GUI Cog Button Sizes:  ------------
    Global $BX = 36 ; Button Size "X"
    Global $BY = 50 ; Button Size "Y"
    ;  ------------ "X" Coordinate Variables for GUI Buttons:  ------------
    Global $MainGUI
    Global $CL1 = 18 ; Button Column Number One "X" Location
    Global $CL2 = $CL1 + 34 ; Button Column Number Two "X" Location
    Global $CL3 = $CL2 + 34 ; Button Column Number Three "X" Location
    Global $CL4 = $CL3 + 34 ; Button Column Number Four "X" Location
    Global $CL5 = $CL4 + 35 ; Button Column Number Five "X" Location
    Global $CL6 = $CL5 + 34 ; Button Column Number Six "X" Location
    Global $CL7 = $CL6 + 34 ; Button Column Number Seven "X" Location
    Global $CL8 = $CL7 + 34 ; Button Column Number Eight "X" Location
    ;  ------------ "Y" Coordinate Variables for GUI Buttons:  ------------
    Global $ROW1 = 56 ; Button Row Number One "Y" Location
    Global $ROW2 = $ROW1 + 49 ; Button Row Number Two "Y" Location
    Global $ROW3 = $ROW2 + 48 ; Button Row Number Three "Y" Location
    Global $ROW4 = $ROW3 + 49 ; Button Row Number Four "Y" Location
EndFunc   ;==>Initialization

Func MainGUI() ;  ------------ Create GUI's and all Buttons ------------------------------------
    ;  ------------ Create Main GUI ------------------------------------

    Global $MainGUI = GUICreate("Invasion On Hand", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragGUI")

    Global $GUI1_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($MainGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI1_BKGRD, $GUI_DISABLE)

    ;  ------------ Calls Main GUI Button Creation Functions ------------------------------------
    GUIBoss()
    GUILaw()
    GUICash()
    GUISell()
    Minimize_BTN()
    Update_Summons_BTN()
    Exit_BTN()

    GUISetState(@SW_SHOW, $MainGUI)

    UpdateGUI()

    ;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>MainGUI

Func DragGUI()
    _SendMessage(@GUI_WinHandle, $WM_SYSCOMMAND, 0xF012, 0)
EndFunc   ;==>DragGUI

Func GUIBoss() ;  ------------ Bossbot Buttons  ------------------------------------

    Local $aArray[8] = ["Flunky", "PencilPusher", "Yesman", "MicroManager", "Downsizer", "HeadHunter", "CorporateRaider", "BigCheese"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW1, $BX, $BY, $BS_BITMAP), 2)

        If $Boss[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "BossBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUIBoss

Func GUILaw() ;  ------------ Lawbot Buttons  ------------------------------------

    Local $aArray[8] = ["BottomFeeder", "Bloodsucker", "DoubleTalker", "AmbulanceChaser", "Backstabber", "SpinDoctor", "LegalEagle", "BigWig"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW2, $BX, $BY, $BS_BITMAP), 2)

        If $Law[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "LawBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUILaw

Func GUICash() ;  ------------ Cashbot Buttons  ------------------------------------

    Local $aArray[8] = ["ShortChange", "PennyPincher", "Tightwad", "BeanCounter", "NumberCruncher", "MoneyBags", "LoanShark", "RobberBaron"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW3, $BX, $BY, $BS_BITMAP), 2)

        If $Law[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "CashBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUICash

Func GUISell() ;  ------------ Sellbot Buttons  ------------------------------------

    Local $aArray[8] = ["ColdCaller", "TeleMarketer", "NameDropper", "GladHander", "MoverShaker", "TwoFace", "TheMingler", "MrHollywood"]

    For $i = 0 To 7

        Assign($aArray[$i], GUICtrlCreateButton($aArray[$i], Eval("CL" & $i + 1), $ROW4, $BX, $BY, $BS_BITMAP), 2)

        If $Law[$i + 1][1] = 1 Then
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & ".bmp")
            GUICtrlSetOnEvent(-1, "SellBot_Implementation")
        Else
            GUICtrlSetImage(-1, $IMGs & $aArray[$i] & "2.bmp")
            GUICtrlSetOnEvent(-1, "")
        EndIf

    Next

EndFunc   ;==>GUISell

;  ------------ Bossbot Functions  ------------

Func BossBot_Implementation()

    Local $aArray[8] = ["Flunky", "PencilPusher", "Yesman", "MicroManager", "Downsizer", "HeadHunter", "CorporateRaider", "BigCheese"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Boss", "B" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>BossBot_Implementation

;  ------------ Lawbot Functions  ------------

Func LawBot_Implementation()

    Local $aArray[8] = ["BottomFeeder", "Bloodsucker", "DoubleTalker", "AmbulanceChaser", "Backstabber", "SpinDoctor", "LegalEagle", "BigWig"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Law", "L" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>LawBot_Implementation

;  ------------ Cashbot Functions  ------------

Func CashBot_Implementation()

    Local $aArray[8] = ["ShortChange", "PennyPincher", "Tightwad", "BeanCounter", "NumberCruncher", "MoneyBags", "LoanShark", "RobberBaron"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Cash", "C" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>CashBot_Implementation

;  ------------ Sellbot Functions  ------------
Func SellBot_Implementation()

    Local $aArray[8] = ["ColdCaller", "TeleMarketer", "NameDropper", "GladHander", "MoverShaker", "TwoFace", "TheMingler", "MrHollywood"]

    $aArrayIndex = @GUI_CtrlId - Eval($aArray[0])
    Initialization()
    IniWrite($Config, "Sell", "S" & $aArrayIndex + 1, 0)
    GUICtrlSetImage(@GUI_CtrlId, $IMGs & $aArray[$aArrayIndex] & "2.bmp")
    GUICtrlSetOnEvent(@GUI_CtrlId, "")
    GUISetState(@SW_RESTORE, $MainGUI)

EndFunc   ;==>SellBot_Implementation


Func Minimize_BTN() ;  ------------ Minimize Button  ------------------------------------
    $Minimize_BTN = GUICtrlCreateButton("Minimize", 15, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Minimize_BTN, $IMGs & "Minimize_btn-1.bmp", "", 0)
    GUICtrlSetOnEvent($Minimize_BTN, "GUIMinimize")
    GUICtrlSetState($Minimize_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Minimize_BTN

Func Update_Summons_BTN() ;  ------------ Update Summons on Hand Button Creation ------------------------------------
    $Update_Summons_BTN = GUICtrlCreateButton("Pick_Window", 120, 0, 79, 32, $BS_BITMAP)
    GUICtrlSetImage($Update_Summons_BTN, $IMGs & "Update_Summons-1.bmp", "", 0)
    GUICtrlSetOnEvent($Update_Summons_BTN, "ShowUpdateGUI")
    GUICtrlSetState($Update_Summons_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Update_Summons_BTN

Func Exit_BTN() ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "Scram")
    GUICtrlSetState(-1, $GUI_NOFOCUS)
EndFunc   ;==>Exit_BTN

Func Exit_BTN2()    ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN2 = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "UpdateGUI_Hide")
    GuiCtrlSetState(-1, $GUI_NOFOCUS)
EndFunc

Func GUIMinimize()
    GUISetState(@SW_MINIMIZE, $MainGUI)
EndFunc   ;==>GUIMinimize

Func ShowUpdateGUI()
    GUISetState(@SW_MINIMIZE, $MainGUI)
    GUISetState(@SW_SHOW, $UpdateGUI)
EndFunc

Func UpdateGUI();  ------------ Create Update Summons GUI ------------------------------------

    $UpdateGUI = GUICreate("Update Summons", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISwitch($UpdateGUI)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragGUI")

    Global $GUI2_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($UpdateGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI2_BKGRD, $GUI_DISABLE)

    ;  ------------ Calls GUI Button Creation Functions ------------------------------------
    Exit_BTN2()

    ;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>UpdateGUI


Func UpdateGUI_Hide()
    GUISetState(@SW_HIDE, $UpdateGUI)
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>UpdateGUI_Hide

Func Scram() ;  ------------ Exit Script Function  ------------
    Local $i = MsgBox(262145, "Exit Script", "Are you sure you want to Exit?")
    If $i = 1 Then
        GUIDelete($MainGUI)
        GUIDelete($UpdateGUI)
        Exit
    EndIf
EndFunc   ;==>Scram
Here is the one without any simplifications as you wanted

#comments-start ------------------------------------------------------------------------------------------------------------------
    #
    #   This is a little tool, that shows a simple 'button-style' GUI, in which the user
    #   can click on a button and have it keep track, visually, of which invasion summons one has
    #   It allows for both, adding of 'on-hand' invasions to the list, as well as updates when
    #   one is used.
    #
    #   This program was written and compiled in AutoIt v3, by Sean
    #   on a WIndow 7 x64 Ultimate system.
    #
    #   Release Notes:------------------------------------------------------------------------
    #   1.0.0.0 xx/xx/xxxx  Initial Release.
    #
    #   --------------------------------------------------------------------------------------
    #   Specifics of this released version:
    #       This version is a Testing/Beta release.
    #
#comments-end ------------------------------------------------------------------------------------------------------------------


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <File.au3>

Global $Config = @ScriptDir & "\cogs.ini"
Global $IMGs = @ScriptDir & "\images\"
Global $UpdateGUI

CheckINI()

Func CheckINI() ;  ~-------- Checks for the Config File --------------------------
    If FileExists($Config) Then
        ReadINI()
        Initialization()
        MainGUI()
    ElseIf Not FileExists($Config) Then
        CreateIni()
        Initialization()
        MainGUI()
    EndIf
EndFunc   ;==>CheckINI

Func ReadINI() ;  ~-------- Reads the Config File Data --------------------------
    Global $Boss = IniReadSection($Config, "Boss")
    If $Boss = @error Then
        CreateIni()
    EndIf
    Global $Law = IniReadSection($Config, "Law")
    If $Law = @error Then
        CreateIni()
    EndIf
    Global $Cash = IniReadSection($Config, "Cash")
    If $Cash = @error Then
        CreateIni()
    EndIf
    Global $Sell = IniReadSection($Config, "Sell")
    If $Sell = @error Then
        CreateIni()
    EndIf
EndFunc   ;==>ReadINI

Func CreateIni() ;  ~-------- Config File Creation --------------------------
    MsgBox(262160, "Invalid Configuration File", "Couldn't Read Configuration File" & @CR & "Creating A New One With Default Values")
    For $Boss2 = 1 To 8 Step 1
        IniDelete($Config, "B" & $Boss2)
        IniWrite($Config, "Boss", "B" & $Boss2, 1)
    Next
    For $Law2 = 1 To 8 Step 1
        IniDelete($Config, "L" & $Law2)
        IniWrite($Config, "Law", "L" & $Law2, 1)
    Next
    For $Cash2 = 1 To 8 Step 1
        IniDelete($Config, "C" & $Cash2)
        IniWrite($Config, "Cash", "C" & $Cash2, 1)
    Next
    For $Sell2 = 1 To 8 Step 1
        IniDelete($Config, "S" & $Sell2)
        IniWrite($Config, "Sell", "S" & $Sell2, 1)
    Next
    MsgBox(262160, "New Configuration File", "New Configuration File Created")
    ReadINI()
EndFunc   ;==>CreateIni

Func Initialization() ;  ~-------- Initialization of Variables & Options --------------------------
    ;  ------------ Initializes All The Setup Options -------------------------------------------------
    AutoItSetOption("GUICloseOnESC", 0)
    Opt("GUICoordMode", 1)
    Opt("GUIResizeMode", 1)
    Opt("GUIOnEventMode", 1)
    ;  ------------ GUI Cog Button Sizes:  ------------
    Global $BX = 36 ; Button Size "X"
    Global $BY = 50 ; Button Size "Y"
    ;  ------------ "X" Coordinate Variables for GUI Buttons:  ------------
    Global $MainGUI
    Global $CL1 = 18 ; Button Column Number One "X" Location
    Global $CL2 = $CL1 + 34 ; Button Column Number Two "X" Location
    Global $CL3 = $CL2 + 34 ; Button Column Number Three "X" Location
    Global $CL4 = $CL3 + 34 ; Button Column Number Four "X" Location
    Global $CL5 = $CL4 + 35 ; Button Column Number Five "X" Location
    Global $CL6 = $CL5 + 34 ; Button Column Number Six "X" Location
    Global $CL7 = $CL6 + 34 ; Button Column Number Seven "X" Location
    Global $CL8 = $CL7 + 34 ; Button Column Number Eight "X" Location
    ;  ------------ "Y" Coordinate Variables for GUI Buttons:  ------------
    Global $ROW1 = 56 ; Button Row Number One "Y" Location
    Global $ROW2 = $ROW1 + 49 ; Button Row Number Two "Y" Location
    Global $ROW3 = $ROW2 + 48 ; Button Row Number Three "Y" Location
    Global $ROW4 = $ROW3 + 49 ; Button Row Number Four "Y" Location
EndFunc   ;==>Initialization

Func MainGUI() ;  ------------ Create GUI's and all Buttons ------------------------------------
    ;  ------------ Create Main GUI ------------------------------------
    Global $MainGUI = GUICreate("Invasion On Hand", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Drag")


    Global $GUI1_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($MainGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI1_BKGRD, $GUI_DISABLE)

    ;  ------------ Calls Main GUI Button Creation Functions ------------------------------------
    GUIBoss()
    GUILaw()
    GUICash()
    GUISell()
    Minimize_BTN()
    Update_Summons_BTN()
    Exit_BTN()
    UpdateGUI() ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<   Create the GUI but hidden
    GUISwitch($MainGUI)
    GUISetState(@SW_SHOW, $MainGUI)


    ;  ------------ Loop to keep everything running  ------------------------------------
    While 1
        Sleep(10)
    WEnd

EndFunc   ;==>MainGUI

Func GUIBoss() ;  ------------ Bossbot Buttons  ------------------------------------
;~  MsgBox(64, "", $Boss[1][1])
    If $Boss[1][1] = 1 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky.bmp")
        GUICtrlSetOnEvent($Flunky, "Flunky")
    ElseIf $Boss[1][1] = 0 Then
        Global $Flunky = GUICtrlCreateButton("Flunky", $CL1, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
        GUICtrlSetOnEvent($Flunky, "")
    EndIf

    If $Boss[2][1] = 1 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PencilPusher.bmp")
        GUICtrlSetOnEvent(-1, "PencilPusher")
    ElseIf $Boss[2][1] = 0 Then
        Global $PencilPusher = GUICtrlCreateButton("PencilPusher", $CL2, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
        GUICtrlSetOnEvent($PencilPusher, "")
    EndIf

    If $Boss[3][1] = 1 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman.bmp")
        GUICtrlSetOnEvent($Yesman, "Yesman")
    ElseIf $Boss[3][1] = 0 Then
        Global $Yesman = GUICtrlCreateButton("Yesman", $CL3, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
        GUICtrlSetOnEvent($Yesman, "")
    EndIf

    If $Boss[4][1] = 1 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager.bmp")
        GUICtrlSetOnEvent($MicroManager, "MicroManager")
    ElseIf $Boss[4][1] = 0 Then
        Global $MicroManager = GUICtrlCreateButton("MicroManager", $CL4, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
        GUICtrlSetOnEvent($MicroManager, "")
    EndIf

    If $Boss[5][1] = 1 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer.bmp")
        GUICtrlSetOnEvent($Downsizer, "Downsizer")
    ElseIf $Boss[5][1] = 0 Then
        Global $Downsizer = GUICtrlCreateButton("Downsizer", $CL5, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
        GUICtrlSetOnEvent($Downsizer, "")
    EndIf

    If $Boss[6][1] = 1 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter.bmp")
        GUICtrlSetOnEvent($HeadHunter, "HeadHunter")
    ElseIf $Boss[6][1] = 0 Then
        Global $HeadHunter = GUICtrlCreateButton("HeadHunter", $CL6, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
        GUICtrlSetOnEvent($HeadHunter, "")
    EndIf

    If $Boss[7][1] = 1 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "CorporateRaider")
    ElseIf $Boss[7][1] = 0 Then
        Global $CorporateRaider = GUICtrlCreateButton("CorporateRaider", $CL7, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
        GUICtrlSetOnEvent($CorporateRaider, "")
    EndIf

    If $Boss[8][1] = 1 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese.bmp")
        GUICtrlSetOnEvent($BigCheese, "BigCheese")
    ElseIf $Boss[8][1] = 0 Then
        Global $BigCheese = GUICtrlCreateButton("BigCheese", $CL8, $ROW1, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
        GUICtrlSetOnEvent($BigCheese, "")
    EndIf
EndFunc   ;==>GUIBoss

Func GUILaw() ;  ------------ Lawbot Buttons  ------------------------------------
    If $Law[1][1] = 1 Then
        Global $BottomFeeder = GUICtrlCreateButton("BottomFeeder", $CL1, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder.bmp")
        GUICtrlSetOnEvent($BottomFeeder, "BottomFeeder")
    ElseIf $Law[1][1] = 0 Then
        Global $BottomFeeder = GUICtrlCreateButton("BottomFeeder", $CL1, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder2.bmp")
        GUICtrlSetOnEvent($BottomFeeder, "")
    EndIf

    If $Law[2][1] = 1 Then
        Global $Bloodsucker = GUICtrlCreateButton("Bloodsucker", $CL2, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "Bloodsucker.bmp")
        GUICtrlSetOnEvent(-1, "Bloodsucker")
    ElseIf $Law[2][1] = 0 Then
        Global $Bloodsucker = GUICtrlCreateButton("Bloodsucker", $CL2, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Bloodsucker, $IMGs & "Bloodsucker2.bmp")
        GUICtrlSetOnEvent($Bloodsucker, "")
    EndIf

    If $Law[3][1] = 1 Then
        Global $DoubleTalker = GUICtrlCreateButton("DoubleTalker", $CL3, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker.bmp")
        GUICtrlSetOnEvent($DoubleTalker, "DoubleTalker")
    ElseIf $Law[3][1] = 0 Then
        Global $DoubleTalker = GUICtrlCreateButton("DoubleTalker", $CL3, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker2.bmp")
        GUICtrlSetOnEvent($DoubleTalker, "")
    EndIf

    If $Law[4][1] = 1 Then
        Global $AmbulanceChaser = GUICtrlCreateButton("AmbulanceChaser", $CL4, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser.bmp")
        GUICtrlSetOnEvent($AmbulanceChaser, "AmbulanceChaser")
    ElseIf $Law[4][1] = 0 Then
        Global $AmbulanceChaser = GUICtrlCreateButton("AmbulanceChaser", $CL4, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser2.bmp")
        GUICtrlSetOnEvent($AmbulanceChaser, "")
    EndIf

    If $Law[5][1] = 1 Then
        Global $Backstabber = GUICtrlCreateButton("Backstabber", $CL5, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Backstabber, $IMGs & "Backstabber.bmp")
        GUICtrlSetOnEvent($Backstabber, "Backstabber")
    ElseIf $Law[5][1] = 0 Then
        Global $Backstabber = GUICtrlCreateButton("Backstabber", $CL5, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Backstabber, $IMGs & "Backstabber2.bmp")
        GUICtrlSetOnEvent($Backstabber, "")
    EndIf

    If $Law[6][1] = 1 Then
        Global $SpinDoctor = GUICtrlCreateButton("SpinDoctor", $CL6, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor.bmp")
        GUICtrlSetOnEvent($SpinDoctor, "SpinDoctor")
    ElseIf $Law[6][1] = 0 Then
        Global $SpinDoctor = GUICtrlCreateButton("SpinDoctor", $CL6, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor2.bmp")
        GUICtrlSetOnEvent($SpinDoctor, "")
    EndIf

    If $Law[7][1] = 1 Then
        Global $LegalEagle = GUICtrlCreateButton("LegalEagle", $CL7, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle.bmp")
        GUICtrlSetOnEvent($LegalEagle, "LegalEagle")
    ElseIf $Law[7][1] = 0 Then
        Global $LegalEagle = GUICtrlCreateButton("LegalEagle", $CL7, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle2.bmp")
        GUICtrlSetOnEvent($LegalEagle, "")
    EndIf

    If $Law[8][1] = 1 Then
        Global $BigWig = GUICtrlCreateButton("BigWig", $CL8, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigWig, $IMGs & "BigWig.bmp")
        GUICtrlSetOnEvent($BigWig, "BigWig")
    ElseIf $Law[8][1] = 0 Then
        Global $BigWig = GUICtrlCreateButton("BigWig", $CL8, $ROW2, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BigWig, $IMGs & "BigWig2.bmp")
        GUICtrlSetOnEvent($BigWig, "")
    EndIf
EndFunc   ;==>GUILaw

Func GUICash() ;  ------------ Cashbot Buttons  ------------------------------------
    If $Cash[1][1] = 1 Then
        Global $ShortChange = GUICtrlCreateButton("ShortChange", $CL1, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ShortChange, $IMGs & "ShortChange.bmp")
        GUICtrlSetOnEvent($ShortChange, "ShortChange")
    ElseIf $Cash[1][1] = 0 Then
        Global $ShortChange = GUICtrlCreateButton("ShortChange", $CL1, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ShortChange, $IMGs & "ShortChange2.bmp")
        GUICtrlSetOnEvent($ShortChange, "")
    EndIf

    If $Cash[2][1] = 1 Then
        Global $PennyPincher = GUICtrlCreateButton("PennyPincher", $CL2, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "PennyPincher.bmp")
        GUICtrlSetOnEvent(-1, "PennyPincher")
    ElseIf $Cash[2][1] = 0 Then
        Global $PennyPincher = GUICtrlCreateButton("PennyPincher", $CL2, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($PennyPincher, $IMGs & "PennyPincher2.bmp")
        GUICtrlSetOnEvent($PennyPincher, "")
    EndIf

    If $Cash[3][1] = 1 Then
        Global $Tightwad = GUICtrlCreateButton("Tightwad", $CL3, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Tightwad, $IMGs & "Tightwad.bmp")
        GUICtrlSetOnEvent($Tightwad, "Tightwad")
    ElseIf $Cash[3][1] = 0 Then
        Global $Tightwad = GUICtrlCreateButton("Tightwad", $CL3, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($Tightwad, $IMGs & "Tightwad2.bmp")
        GUICtrlSetOnEvent($Tightwad, "")
    EndIf

    If $Cash[4][1] = 1 Then
        Global $BeanCounter = GUICtrlCreateButton("BeanCounter", $CL4, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter.bmp")
        GUICtrlSetOnEvent($BeanCounter, "BeanCounter")
    ElseIf $Cash[4][1] = 0 Then
        Global $BeanCounter = GUICtrlCreateButton("BeanCounter", $CL4, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter2.bmp")
        GUICtrlSetOnEvent($BeanCounter, "")
    EndIf

    If $Cash[5][1] = 1 Then
        Global $NumberCruncher = GUICtrlCreateButton("NumberCruncher", $CL5, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher.bmp")
        GUICtrlSetOnEvent($NumberCruncher, "NumberCruncher")
    ElseIf $Cash[5][1] = 0 Then
        Global $NumberCruncher = GUICtrlCreateButton("NumberCruncher", $CL5, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher2.bmp")
        GUICtrlSetOnEvent($NumberCruncher, "")
    EndIf

    If $Cash[6][1] = 1 Then
        Global $MoneyBags = GUICtrlCreateButton("MoneyBags", $CL6, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags.bmp")
        GUICtrlSetOnEvent($MoneyBags, "MoneyBags")
    ElseIf $Cash[6][1] = 0 Then
        Global $MoneyBags = GUICtrlCreateButton("MoneyBags", $CL6, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags2.bmp")
        GUICtrlSetOnEvent($MoneyBags, "")
    EndIf

    If $Cash[7][1] = 1 Then
        Global $LoanShark = GUICtrlCreateButton("LoanShark", $CL7, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LoanShark, $IMGs & "LoanShark.bmp")
        GUICtrlSetOnEvent($LoanShark, "LoanShark")
    ElseIf $Cash[7][1] = 0 Then
        Global $LoanShark = GUICtrlCreateButton("LoanShark", $CL7, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($LoanShark, $IMGs & "LoanShark2.bmp")
        GUICtrlSetOnEvent($LoanShark, "")
    EndIf

    If $Cash[8][1] = 1 Then
        Global $RobberBaron = GUICtrlCreateButton("RobberBaron", $CL8, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron.bmp")
        GUICtrlSetOnEvent($RobberBaron, "RobberBaron")
    ElseIf $Cash[8][1] = 0 Then
        Global $RobberBaron = GUICtrlCreateButton("RobberBaron", $CL8, $ROW3, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron2.bmp")
        GUICtrlSetOnEvent($RobberBaron, "")
    EndIf
EndFunc   ;==>GUICash

Func GUISell() ;  ------------ Sellbot Buttons  ------------------------------------
    If $Sell[1][1] = 1 Then
        Global $ColdCaller = GUICtrlCreateButton("ColdCaller", $CL1, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller.bmp")
        GUICtrlSetOnEvent($ColdCaller, "ColdCaller")
    ElseIf $Sell[1][1] = 0 Then
        Global $ColdCaller = GUICtrlCreateButton("ColdCaller", $CL1, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller2.bmp")
        GUICtrlSetOnEvent($ColdCaller, "")
    EndIf

    If $Sell[2][1] = 1 Then
        Global $TeleMarketer = GUICtrlCreateButton("TeleMarketer", $CL2, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage(-1, $IMGs & "TeleMarketer.bmp")
        GUICtrlSetOnEvent(-1, "TeleMarketer")
    ElseIf $Sell[2][1] = 0 Then
        Global $TeleMarketer = GUICtrlCreateButton("TeleMarketer", $CL2, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TeleMarketer, $IMGs & "TeleMarketer2.bmp")
        GUICtrlSetOnEvent($TeleMarketer, "")
    EndIf

    If $Sell[3][1] = 1 Then
        Global $NameDropper = GUICtrlCreateButton("NameDropper,", $CL3, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NameDropper, $IMGs & "NameDropper.bmp")
        GUICtrlSetOnEvent($NameDropper, "NameDropper")
    ElseIf $Sell[3][1] = 0 Then
        Global $NameDropper = GUICtrlCreateButton("NameDropper", $CL3, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($NameDropper, $IMGs & "NameDropper2.bmp")
        GUICtrlSetOnEvent($NameDropper, "")
    EndIf

    If $Sell[4][1] = 1 Then
        Global $GladHander = GUICtrlCreateButton("GladHander", $CL4, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($GladHander, $IMGs & "GladHander.bmp")
        GUICtrlSetOnEvent($GladHander, "GladHander")
    ElseIf $Sell[4][1] = 0 Then
        Global $GladHander = GUICtrlCreateButton("GladHander", $CL4, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($GladHander, $IMGs & "GladHander2.bmp")
        GUICtrlSetOnEvent($GladHander, "")
    EndIf

    If $Sell[5][1] = 1 Then
        Global $MoverShaker = GUICtrlCreateButton("MoverShaker", $CL5, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker.bmp")
        GUICtrlSetOnEvent($MoverShaker, "MoverShaker")
    ElseIf $Sell[5][1] = 0 Then
        Global $MoverShaker = GUICtrlCreateButton("MoverShaker", $CL5, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker2.bmp")
        GUICtrlSetOnEvent($MoverShaker, "")
    EndIf

    If $Sell[6][1] = 1 Then
        Global $TwoFace = GUICtrlCreateButton("TwoFace", $CL6, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TwoFace, $IMGs & "TwoFace.bmp")
        GUICtrlSetOnEvent($TwoFace, "TwoFace")
    ElseIf $Sell[6][1] = 0 Then
        Global $TwoFace = GUICtrlCreateButton("TwoFace", $CL6, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TwoFace, $IMGs & "TwoFace2.bmp")
        GUICtrlSetOnEvent($TwoFace, "")
    EndIf

    If $Sell[7][1] = 1 Then
        Global $TheMingler = GUICtrlCreateButton("TheMingler", $CL7, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TheMingler, $IMGs & "TheMingler.bmp")
        GUICtrlSetOnEvent($TheMingler, "TheMingler")
    ElseIf $Sell[7][1] = 0 Then
        Global $TheMingler = GUICtrlCreateButton("TheMingler", $CL7, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($TheMingler, $IMGs & "TheMingler2.bmp")
        GUICtrlSetOnEvent($TheMingler, "")
    EndIf

    If $Sell[8][1] = 1 Then
        Global $MrHollywood = GUICtrlCreateButton("MrHollywood", $CL8, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood.bmp")
        GUICtrlSetOnEvent($MrHollywood, "MrHollywood")
    ElseIf $Sell[8][1] = 0 Then
        Global $MrHollywood = GUICtrlCreateButton("MrHollywood", $CL8, $ROW4, $BX, $BY, $BS_BITMAP)
        GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood2.bmp")
        GUICtrlSetOnEvent($MrHollywood, "")
    EndIf
EndFunc   ;==>GUISell

Func Minimize_BTN() ;  ------------ Minimize Button  ------------------------------------
    $Minimize_BTN = GUICtrlCreateButton("Minimize", 15, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage($Minimize_BTN, $IMGs & "Minimize_btn-1.bmp", "", 0)
    GUICtrlSetOnEvent($Minimize_BTN, "GUIMinimize")
    GUICtrlSetState($Minimize_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Minimize_BTN

Func Update_Summons_BTN() ;  ------------ Update Summons on Hand Button Creation ------------------------------------
    $Update_Summons_BTN = GUICtrlCreateButton("Pick_Window", 120, 0, 79, 32, $BS_BITMAP)
    GUICtrlSetImage($Update_Summons_BTN, $IMGs & "Update_Summons-1.bmp", "", 0)
    GUICtrlSetOnEvent($Update_Summons_BTN, "ShowUpdateGUI")
    GUICtrlSetState($Update_Summons_BTN, $GUI_NOFOCUS)
EndFunc   ;==>Update_Summons_BTN

Func Exit_BTN() ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "Scram")
    GUICtrlSetState(-1, $GUI_NOFOCUS)
EndFunc   ;==>Exit_BTN

Func Exit_BTN2()    ;  ------------ EXIT Button  ------------------------------------
    $Exit_BTN2 = GUICtrlCreateButton("Exit", 246, 22, 52, 22, $BS_BITMAP)
    GUICtrlSetImage(-1, $IMGs & "Exit_Btn-1.bmp", "", 0)
    GUICtrlSetOnEvent(-1, "UpdateGUI_Hide")
    GuiCtrlSetState(-1, $GUI_NOFOCUS)
EndFunc

Func GUIMinimize()
    GUISetState(@SW_MINIMIZE, $MainGUI)
EndFunc   ;==>GUIMinimize

Func ShowUpdateGUI()

    GUISetState(@SW_MINIMIZE, $MainGUI)
    GUISetState(@SW_SHOW, $UpdateGUI)

EndFunc   ;==>ShowUpdateGUI

Func UpdateGUI();  ------------ Create Update Summons GUI ------------------------------------
    Global $UpdateGUI = GUICreate("Update Summons", 300, 260, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Drag")

    Global $GUI2_BKGRD = GUICtrlCreatePic($IMGs & "Background.bmp", 0, 34, 300, 226)
    GUISetBkColor(0xFFFFFF)
    _WinAPI_SetLayeredWindowAttributes($UpdateGUI, 0xFFFFFF, 255)
    GUICtrlSetState($GUI2_BKGRD, $GUI_DISABLE)

;~  GUISwitch($UpdateGUI)

    ;  ------------ Calls GUI Button Creation Functions ------------------------------------
    Exit_BTN2()

    ;  ------------ There is already a loop running therefore no need of another.---------
EndFunc   ;==>UpdateGUI

Func UpdateGUI_Hide()
    GUISetState(@SW_HIDE, $UpdateGUI)
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>UpdateGUI_Hide

;  ------------ Bossbot Functions  ------------
Func Flunky()
    Initialization()
    IniWrite($Config, "Boss", "B1", 0)
    GUICtrlSetImage($Flunky, $IMGs & "Flunky2.bmp")
    GUICtrlSetOnEvent($Flunky, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Flunky

Func PencilPusher()
    Initialization()
    IniWrite($Config, "Boss", "B2", 0)
    GUICtrlSetImage($PencilPusher, $IMGs & "PencilPusher2.bmp")
    GUICtrlSetOnEvent($PencilPusher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>PencilPusher

Func Yesman()
    Initialization()
    IniWrite($Config, "Boss", "B3", 0)
    GUICtrlSetImage($Yesman, $IMGs & "Yesman2.bmp")
    GUICtrlSetOnEvent($Yesman, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Yesman

Func MicroManager()
    Initialization()
    IniWrite($Config, "Boss", "B4", 0)
    GUICtrlSetImage($MicroManager, $IMGs & "MicroManager2.bmp")
    GUICtrlSetOnEvent($MicroManager, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MicroManager

Func Downsizer()
    Initialization()
    IniWrite($Config, "Boss", "B5", 0)
    GUICtrlSetImage($Downsizer, $IMGs & "Downsizer2.bmp")
    GUICtrlSetOnEvent($Downsizer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Downsizer

Func HeadHunter()
    Initialization()
    IniWrite($Config, "Boss", "B6", 0)
    GUICtrlSetImage($HeadHunter, $IMGs & "HeadHunter2.bmp")
    GUICtrlSetOnEvent($HeadHunter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>HeadHunter

Func CorporateRaider()
    Initialization()
    IniWrite($Config, "Boss", "B7", 0)
    GUICtrlSetImage($CorporateRaider, $IMGs & "CorporateRaider2.bmp")
    GUICtrlSetOnEvent($CorporateRaider, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>CorporateRaider

Func BigCheese()
    Initialization()
    IniWrite($Config, "Boss", "B8", 0)
    GUICtrlSetImage($BigCheese, $IMGs & "BigCheese2.bmp")
    GUICtrlSetOnEvent($BigCheese, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BigCheese

;  ------------ Lawbot Functions  ------------
Func BottomFeeder()
    Initialization()
    IniWrite($Config, "Law", "L1", 0)
    GUICtrlSetImage($BottomFeeder, $IMGs & "BottomFeeder2.bmp")
    GUICtrlSetOnEvent($BottomFeeder, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BottomFeeder

Func Bloodsucker()
    Initialization()
    IniWrite($Config, "Law", "L2", 0)
    GUICtrlSetImage($Bloodsucker, $IMGs & "Bloodsucker2.bmp")
    GUICtrlSetOnEvent($Bloodsucker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Bloodsucker

Func DoubleTalker()
    Initialization()
    IniWrite($Config, "Law", "L3", 0)
    GUICtrlSetImage($DoubleTalker, $IMGs & "DoubleTalker2.bmp")
    GUICtrlSetOnEvent($DoubleTalker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>DoubleTalker

Func AmbulanceChaser()
    Initialization()
    IniWrite($Config, "Law", "L4", 0)
    GUICtrlSetImage($AmbulanceChaser, $IMGs & "AmbulanceChaser2.bmp")
    GUICtrlSetOnEvent($AmbulanceChaser, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>AmbulanceChaser

Func Backstabber()
    Initialization()
    IniWrite($Config, "Law", "L5", 0)
    GUICtrlSetImage($Backstabber, $IMGs & "Backstabber2.bmp")
    GUICtrlSetOnEvent($Backstabber, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Backstabber

Func SpinDoctor()
    Initialization()
    IniWrite($Config, "Law", "L6", 0)
    GUICtrlSetImage($SpinDoctor, $IMGs & "SpinDoctor2.bmp")
    GUICtrlSetOnEvent($SpinDoctor, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>SpinDoctor

Func LegalEagle()
    Initialization()
    IniWrite($Config, "Law", "L7", 0)
    GUICtrlSetImage($LegalEagle, $IMGs & "LegalEagle2.bmp")
    GUICtrlSetOnEvent($LegalEagle, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>LegalEagle

Func BigWig()
    Initialization()
    IniWrite($Config, "Law", "L8", 0)
    GUICtrlSetImage($BigWig, $IMGs & "BigWig2.bmp")
    GUICtrlSetOnEvent($BigWig, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BigWig

;  ------------ Cashbot Functions  ------------
Func ShortChange()
    Initialization()
    IniWrite($Config, "Cash", "C1", 0)
    GUICtrlSetImage($ShortChange, $IMGs & "ShortChange2.bmp")
    GUICtrlSetOnEvent($ShortChange, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>ShortChange

Func PennyPincher()
    Initialization()
    IniWrite($Config, "Cash", "C2", 0)
    GUICtrlSetImage($PennyPincher, $IMGs & "PennyPincher2.bmp")
    GUICtrlSetOnEvent($PennyPincher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>PennyPincher

Func Tightwad()
    Initialization()
    IniWrite($Config, "Cash", "C3", 0)
    GUICtrlSetImage($Tightwad, $IMGs & "Tightwad2.bmp")
    GUICtrlSetOnEvent($Tightwad, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>Tightwad

Func BeanCounter()
    Initialization()
    IniWrite($Config, "Cash", "C4", 0)
    GUICtrlSetImage($BeanCounter, $IMGs & "BeanCounter2.bmp")
    GUICtrlSetOnEvent($BeanCounter, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>BeanCounter

Func NumberCruncher()
    Initialization()
    IniWrite($Config, "Cash", "C5", 0)
    GUICtrlSetImage($NumberCruncher, $IMGs & "NumberCruncher2.bmp")
    GUICtrlSetOnEvent($NumberCruncher, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>NumberCruncher

Func MoneyBags()
    Initialization()
    IniWrite($Config, "Cash", "C6", 0)
    GUICtrlSetImage($MoneyBags, $IMGs & "MoneyBags2.bmp")
    GUICtrlSetOnEvent($MoneyBags, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MoneyBags

Func LoanShark()
    Initialization()
    IniWrite($Config, "Cash", "C7", 0)
    GUICtrlSetImage($LoanShark, $IMGs & "LoanShark2.bmp")
    GUICtrlSetOnEvent($LoanShark, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>LoanShark

Func RobberBaron()
    Initialization()
    IniWrite($Config, "Cash", "C8", 0)
    GUICtrlSetImage($RobberBaron, $IMGs & "RobberBaron2.bmp")
    GUICtrlSetOnEvent($RobberBaron, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>RobberBaron

;  ------------ Sellbot Functions  ------------
Func ColdCaller()
    Initialization()
    IniWrite($Config, "Sell", "S1", 0)
    GUICtrlSetImage($ColdCaller, $IMGs & "ColdCaller2.bmp")
    GUICtrlSetOnEvent($ColdCaller, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>ColdCaller

Func TeleMarketer()
    Initialization()
    IniWrite($Config, "Sell", "S2", 0)
    GUICtrlSetImage($TeleMarketer, $IMGs & "TeleMarketer2.bmp")
    GUICtrlSetOnEvent($TeleMarketer, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>TeleMarketer

Func NameDropper()
    Initialization()
    IniWrite($Config, "Sell", "S3", 0)
    GUICtrlSetImage($NameDropper, $IMGs & "NameDropper2.bmp")
    GUICtrlSetOnEvent($NameDropper, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>NameDropper

Func GladHander()
    Initialization()
    IniWrite($Config, "Sell", "S4", 0)
    GUICtrlSetImage($GladHander, $IMGs & "GladHander2.bmp")
    GUICtrlSetOnEvent($GladHander, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>GladHander

Func MoverShaker()
    Initialization()
    IniWrite($Config, "Sell", "S5", 0)
    GUICtrlSetImage($MoverShaker, $IMGs & "MoverShaker2.bmp")
    GUICtrlSetOnEvent($MoverShaker, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MoverShaker

Func TwoFace()
    Initialization()
    IniWrite($Config, "Sell", "S6", 0)
    GUICtrlSetImage($TwoFace, $IMGs & "TwoFace2.bmp")
    GUICtrlSetOnEvent($TwoFace, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>TwoFace

Func TheMingler()
    Initialization()
    IniWrite($Config, "Sell", "S7", 0)
    GUICtrlSetImage($TheMingler, $IMGs & "TheMingler2.bmp")
    GUICtrlSetOnEvent($TheMingler, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>TheMingler

Func MrHollywood()
    Initialization()
    IniWrite($Config, "Sell", "S8", 0)
    GUICtrlSetImage($MrHollywood, $IMGs & "MrHollywood2.bmp")
    GUICtrlSetOnEvent($MrHollywood, "")
    GUISetState(@SW_RESTORE, $MainGUI)
EndFunc   ;==>MrHollywood

Func Scram() ;  ------------ Exit Script Function  ------------
    Local $i = MsgBox(262145, "Exit Script", "Are you sure you want to Exit?")
    If $i = 1 Then
        GUIDelete($MainGUI)
        GUIDelete($UpdateGUI)
        Exit
    Else
    EndIf
EndFunc   ;==>Scram

Func Drag()
    _SendMessage(@GUI_WinHandle, $WM_SYSCOMMAND, 0xF012, 0)
EndFunc   ;==>DragGUI
 
Create the Update GUI at the time you create the MainGUI and show the Update GUI upon pressing the Update Summon button.

 

Some points I would like to tell you

  • Declare Global Variables on the top of the script and assign them values in your respective functions.
  • Use the @Gui_CtrlId and similar macros for your benefit when using OnEvent mode.
  • You have to use GUISetOnEvent for messages like $GUI_EVENT_PRIMARYDOWN when using OnEvent mode.
  • You can have an extensive use of For-Next loops and Arrays to shorten and simplify your script. I have done it somewhat but it could be done further.
Regards :)

Truly, I thank you so very much. Looking over your inserted notes, it does seem that it was, all in all, something minor I just hadn't the knowledge of yet, or couldn't get my head around. In time.

I copied and made a file of your simplified version as well. I'm certainly not up on the whole of the arrays use as of yet. I managed to figure/(fumble @ numerous attempts??) it out for the INI portion, but beyond that,, CONFUSION! rofl But it is something I look forward to looking over and getting a decent grip on, so thank you for taking the time to do that version for me, (and anyone else reading this), as it will certainly expand my workable knowledge of AutoIt in that area.

Also, I like the way you functioned out the to the "Drag" from the while 1 statements. I can understand the purpose of that. (certainly one thing I didn't try., or even think of.) I did, at one time, have the 2nd GUI being created right after the 1st, in the same function. Though my knowledge of the GUISwitch isn't at it's best as of yet, and I see now, I was using it incorrectly at times when I tried it all that way.

Thank you again for all your time and help on this. Very much appreciated and I love the extra information you added, will make a nice learning set for me as well.

Thanks!,

Sean

Edited by sean5470

Share this post


Link to post
Share on other sites

One thing I notice is you're declaring Global variables inside of Functions. Try to declare Global variables (if really required) at the top of your script, this will eradicate any errors happening.

Example:


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()