Sign in to follow this  
Followers 0
Thornhunt

gui reading problem

2 posts in this topic

ok i started back on my course and so i had to give the project a break. no i have come back to it i am ready to progress however

i have hit the problem with the GUI

i have set the GUI to save the data imput'd to a ini file. but it does no save what i want it to instead it save the origional number wich would be 0 and not the data the user places

i have attached my file below.. hopefully someone can understand what is happening


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites



ok i started back on my course and so i had to give the project a break. no i have come back to it i am ready to progress however

i have hit the problem with the GUI

i have set the GUI to save the data imput'd to a ini file. but it does no save what i want it to instead it save the origional number wich would be 0 and not the data the user places

i have attached my file below.. hopefully someone can understand what is happening

if $msg = $ItemSave Then

GUIDelete("Setup")

Save()

EndIf

Here error

Must be Save Before delete the GUID

if $msg = $ItemSave Then

Save()

GUIDelete("Setup")

EndIf

This is the correct

#include <GuiConstantsEx.au3>
#include <StaticConstants.au3>

;Attack cast time
$A1 = 0
$A2 = 0
$A3 = 0
$A4 = 0
$A5 = 0
$A6 = 0
$A7 = 0
$A8 = 0
$A9 = 0
$A0 = 0
;buffs Cooldown line 2
$BCO1 = 0
$BCO2 = 0
$BCO3 = 0
$BCO4 = 0
$BCO5 = 0
$BCO6 = 0
$BCO7 = 0
$BCO8 = 0
$BCO9 = 0
$BCO0 = 0
;buffs Cast time line 2
$BCA1 = 0
$BCA2 = 0
$BCA3 = 0
$BCA4 = 0
$BCA5 = 0
$BCA6 = 0
$BCA7 = 0
$BCA8 = 0
$BCA9 = 0
$BCA0 = 0
;unique Pargon
$PGNCA = 1.07
;unique Biglos
$BGLCA = 1.08


Setup()

Func Setup()

Local $MenuFile, $ItemOpen, $ItemSave, $ItemClose, $ItemRecent, $separator1
local $MenuHelp, $ItemHelp, $ItemAbout
Local $file, $msg, $GUI

;make GUI
$GUI = GuiCreate("Setup", 410, 400)

;Create the File menu
$MenuFile = GUICtrlCreateMenu("File")
$ItemOpen = GUICtrlCreateMenuItem("Open", $MenuFile, 0)
$ItemRecent = GUICtrlCreateMenu("Recent Files", $MenuFile, 1)
$ItemSave = GUICtrlCreateMenuItem("Save", $MenuFile, 2)
$separator1 = GUICtrlCreateMenuItem("", $MenuFile, 3)   ; create a separator line
$ItemClose = GUICtrlCreateMenuItem("Close", $MenuFile, 4)

;Create the Help menu
$MenuHelp = GUICtrlCreateMenu("Help")
$ItemHelp = GUICtrlCreateMenuItem("Help", $MenuHelp, 0)
$ItemAbout = GUICtrlCreateMenuItem("About", $MenuHelp, 1)

GuiCtrlCreateLabel("InfinityBot v0.01", 10,10,200,50)
GUICtrlSetFont(-1,14,1000,4)

;create attack slots

GuiCtrlCreateLabel("Attack castimes in seconds (leave blank if slot not used)", 10,60)
GuiCtrlCreateLabel("Slot1", 10,80)
$A1 = GuiCtrlCreateInput($A1, 50, 80)
GuiCtrlCreateLabel("Slot2", 10,100)
$A2 = GuiCtrlCreateInput($A2, 50, 100)

GuiCtrlCreateLabel("Slot3", 90,80)
$A3 = GuiCtrlCreateInput($A3, 130, 80)
GuiCtrlCreateLabel("Slot4", 90,100)
$A4 = GuiCtrlCreateInput($A4, 130, 100)

GuiCtrlCreateLabel("Slot5", 170,80)
$A5 = GuiCtrlCreateInput($A5, 210, 80)
GuiCtrlCreateLabel("Slot6", 170,100)
$A6 = GuiCtrlCreateInput($A6, 210, 100)

GuiCtrlCreateLabel("Slot7", 250,80)
$A7 = GuiCtrlCreateInput($A7, 290, 80)
GuiCtrlCreateLabel("Slot8", 250,100)
$A8 = GuiCtrlCreateInput($A8, 290, 100)

GuiCtrlCreateLabel("Slot9", 330,80)
$A9 = GuiCtrlCreateInput($A9, 370, 80)
GuiCtrlCreateLabel("Slot0", 330,100)
$A0 = GuiCtrlCreateInput($A0, 370, 100)


;Buff cast times
GuiCtrlCreateLabel("buff castimes in seconds (leave blank if slot not used)", 10,130)
GuiCtrlCreateLabel("Slot1", 10,150)
$BCA1 = GuiCtrlCreateInput($BCA1, 50, 150)
GuiCtrlCreateLabel("Slot2", 10,170)
$BCA2 = GuiCtrlCreateInput($BCA2, 50, 170)

GuiCtrlCreateLabel("Slot3", 90,150)
$BCA3 = GuiCtrlCreateInput($BCA3, 130, 150)
GuiCtrlCreateLabel("Slot4", 90,170)
$BCA4 = GuiCtrlCreateInput($BCA4, 130, 170)

GuiCtrlCreateLabel("Slot5", 170,150)
$BCA5 = GuiCtrlCreateInput($BCA5, 210, 150)
GuiCtrlCreateLabel("Slot6", 170,170)
$BCA6 = GuiCtrlCreateInput($BCA6, 210, 170)

GuiCtrlCreateLabel("Slot7", 250,150)
$BCA7 = GuiCtrlCreateInput($BCA7, 290, 150)
GuiCtrlCreateLabel("Slot8", 250,170)
$BCA8 = GuiCtrlCreateInput($BCA8, 290, 170)

GuiCtrlCreateLabel("Slot9", 330,150)
$BCA9 = GuiCtrlCreateInput($BCA9, 370, 150)
GuiCtrlCreateLabel("Slot0", 330,170)
$BCA0 = GuiCtrlCreateInput($BCA0, 370, 170)


;Buff cast times
GuiCtrlCreateLabel("buff cooldowns in seconds (leave blank if slot not used)", 10,200)
GuiCtrlCreateLabel("Slot1", 10,220)
$BCO1 = GuiCtrlCreateInput($BCO1, 50, 220)
GuiCtrlCreateLabel("Slot2", 10,240)
$BCA2 = GuiCtrlCreateInput($BCO2, 50, 240)

GuiCtrlCreateLabel("Slot3", 90,220)
$BCO3 = GuiCtrlCreateInput($BCO3, 130, 220)
GuiCtrlCreateLabel("Slot4", 90,240)
$BCO4 = GuiCtrlCreateInput($BCO4, 130, 240)

GuiCtrlCreateLabel("Slot5", 170,220)
$BCO5 = GuiCtrlCreateInput($BCO5, 210, 220)
GuiCtrlCreateLabel("Slot6", 170,240)
$BCO6 = GuiCtrlCreateInput($BCO6, 210, 240)

GuiCtrlCreateLabel("Slot7", 250,220)
$BCO7 = GuiCtrlCreateInput($BCO7, 290, 220)
GuiCtrlCreateLabel("Slot8", 250,240)
$BCO8 = GuiCtrlCreateInput($BCO8, 290, 240)

GuiCtrlCreateLabel("Slot9", 330,220)
$BCO9 = GuiCtrlCreateInput($BCO9, 370, 220)
GuiCtrlCreateLabel("Slot0", 330,240)
$BCO0 = GuiCtrlCreateInput($BCO0, 370, 240)







GUISetState()


While 1
    $msg = GUIGetMsg()

    ;FILE IF's
    If $msg = $ItemOpen Then
        $file = FileOpenDialog("Choose file...", @UserProfileDir, "All (*.*)")
        If @error <> 1 Then GUICtrlCreateMenuItem($file, $ItemRecent)
    EndIf

    if $msg = $ItemSave Then
    Save()
    GUIDelete("Setup")
    EndIf

    ;On the menu item close, closes script
    If $msg = $ItemClose Then Exit
    ;ON close button closes script
    If $msg = $GUI_EVENT_CLOSE then Exit
    ;Help If'Select
    if $msg = $ItemAbout Then MsgBox(0, "Info", "InfinityBot v: 0.01" & @CRLF & "By Paul Haywood" & @CRLF & "AutoIt v3 Coding" & @CRLF & "Copyright© Paul Haywood 2009")

WEnd

EndFunc

Func Save()
    Local $Savename
    $Savename = InputBox("Save", "Enter the name you wish to save with", "EnterHere") & ".ini"

    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A1", GuiCtrlRead($A1))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A2", GuiCtrlRead($A2))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A3", GuiCtrlRead($A3))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A4", GuiCtrlRead($A4))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A5", GuiCtrlRead($A5))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A6", GuiCtrlRead($A6))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A7", GuiCtrlRead($A7))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A8", GuiCtrlRead($A8))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A9", GuiCtrlRead($A9))
    IniWrite(@ScriptDir & "\" & $Savename, "AttackCasttimes", "A0", GuiCtrlRead($A0))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO1", GuiCtrlRead($BCO1))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO2", GuiCtrlRead($BCO2))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO3", GuiCtrlRead($BCO3))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO4", GuiCtrlRead($BCO4))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO5", GuiCtrlRead($BCO5))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO6", GuiCtrlRead($BCO6))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO7", GuiCtrlRead($BCO7))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO8", GuiCtrlRead($BCO8))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO9", GuiCtrlRead($BCO9))
        IniWrite(@ScriptDir & "\" & $Savename, "BuffCooldowns", "BCO0", GuiCtrlRead($BCO0))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA1", GuiCtrlRead($BCA1))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA2", GuiCtrlRead($BCA2))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA3", GuiCtrlRead($BCA3))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA4", GuiCtrlRead($BCA4))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA5", GuiCtrlRead($BCA5))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA6", GuiCtrlRead($BCA6))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA7", GuiCtrlRead($BCA7))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA8", GuiCtrlRead($BCA8))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA9", GuiCtrlRead($BCA9))
            IniWrite(@ScriptDir & "\" & $Savename, "BuffCasttimes", "BCA0", GuiCtrlRead($BCA0))


EndFunc

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0