Jump to content

GUI to .ini help


njp988
 Share

Recommended Posts

Im trying to make my GUI write to an ini but no matter what i put into the input, when I push start, it always comes up with 14-22 in order for each input

script;

#include <GuiConstants.au3>

GuiCreate("DutchBot v3.00", 229, 419,(@DesktopWidth-229)/2, (@DesktopHeight-419)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)


;;;Labels
GuiCtrlCreateLabel("Chickens", 10, 10, 150, 20)
GuiCtrlCreateLabel("Panic Life %", 10, 40, 150, 20)
GuiCtrlCreateLabel("Chicken Life %", 10, 70, 150, 20)
GuiCtrlCreateLabel("Pickit Functions", 10, 100, 150, 20, $SS_LEFT)
GuiCtrlCreateLabel("Pickup Items", 10, 130, 150, 20)
GuiCtrlCreateLabel("Required Level", 10, 160, 150, 20)
GuiCtrlCreateLabel("Dexterity", 10, 190, 150, 20)
GuiCtrlCreateLabel("Strength", 10, 220, 150, 20)
GuiCtrlCreateLabel("D/S Combo Stats", 10, 250, 150, 20)
GuiCtrlCreateLabel("Intelligence", 10, 280, 150, 20)
GuiCtrlCreateLabel("Enhanced Effect", 10, 310, 150, 20)

;;;Inputs

$PanicLife = GuiCtrlCreateInput("", 180, 40, 40, 20)
$ChickenLife = GuiCtrlCreateInput("", 180, 70, 40, 20)
;$Input_VolumeLabel = GuiCtrlCreateInput("", 180, 130, 280, 20)
$PickItem = GuiCtrlCreateInput("", 180, 130, 40, 20)
$ReqLvl = GuiCtrlCreateInput("", 180, 160, 40, 20)
$Dex = GuiCtrlCreateInput("", 180, 190, 40, 20)
$Str = GuiCtrlCreateInput("", 180, 220, 40, 20)
$DexStr = GuiCtrlCreateInput("", 180, 250, 40, 20)
$Int = GuiCtrlCreateInput("N/A", 180, 280, 40, 20)
$EE = GuiCtrlCreateInput("", 180, 310, 40, 20)

$Button_1 = GuiCtrlCreateButton("Start", 60, 380, 100, 30)

GUISetState()
While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
        Exit
    Case $nMsg = $Button_1
        IniWrite ( "\PikIni.ini", "Chix", "PanicLife", $PanicLife )
        IniWrite ( "\PikIni.ini", "Chix", "ChickenLife", $ChickenLife )

;;;Pickup Items
        IniWrite ( "\PikIni.ini", "PickItems", "PickItem", $PickItem )

;;;Min Item Stats
        IniWrite ( "\PikIni.ini", "Stats", "ReqLvl", $ReqLvl )
        IniWrite ( "\PikIni.ini", "Stats", "Dex", $Dex )
        IniWrite ( "\PikIni.ini", "Stats", "Str", $Str )
        IniWrite ( "\PikIni.ini", "Stats", "DexStr", $DexStr )
        IniWrite ( "\PikIni.ini", "Stats", "Int", $Int )
        IniWrite ( "\PikIni.ini", "Stats", "EE", $EE )
    EndSelect
WEnd
Exit

ini results;

[Chix]
PanicLife=14
ChickenLife=15
[PickItems]
PickItem=16
[Stats]
ReqLvl=17
Dex=18
Str=19
DexStr=20
Int=21
EE=22
Link to comment
Share on other sites

Im trying to make my GUI write to an ini but no matter what i put into the input, when I push start, it always comes up with 14-22 in order for each input

script;

#include <GuiConstants.au3>
   
   GuiCreate("DutchBot v3.00", 229, 419,(@DesktopWidth-229)/2, (@DesktopHeight-419)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
   
   
;;;Labels
   GuiCtrlCreateLabel("Chickens", 10, 10, 150, 20)
   GuiCtrlCreateLabel("Panic Life %", 10, 40, 150, 20)
   GuiCtrlCreateLabel("Chicken Life %", 10, 70, 150, 20)
   GuiCtrlCreateLabel("Pickit Functions", 10, 100, 150, 20, $SS_LEFT)
   GuiCtrlCreateLabel("Pickup Items", 10, 130, 150, 20)
   GuiCtrlCreateLabel("Required Level", 10, 160, 150, 20)
   GuiCtrlCreateLabel("Dexterity", 10, 190, 150, 20)
   GuiCtrlCreateLabel("Strength", 10, 220, 150, 20)
   GuiCtrlCreateLabel("D/S Combo Stats", 10, 250, 150, 20)
   GuiCtrlCreateLabel("Intelligence", 10, 280, 150, 20)
   GuiCtrlCreateLabel("Enhanced Effect", 10, 310, 150, 20)
   
;;;Inputs
   
   $PanicLife = GuiCtrlCreateInput("", 180, 40, 40, 20)
   $ChickenLife = GuiCtrlCreateInput("", 180, 70, 40, 20)
;$Input_VolumeLabel = GuiCtrlCreateInput("", 180, 130, 280, 20)
   $PickItem = GuiCtrlCreateInput("", 180, 130, 40, 20)
   $ReqLvl = GuiCtrlCreateInput("", 180, 160, 40, 20)
   $Dex = GuiCtrlCreateInput("", 180, 190, 40, 20)
   $Str = GuiCtrlCreateInput("", 180, 220, 40, 20)
   $DexStr = GuiCtrlCreateInput("", 180, 250, 40, 20)
   $Int = GuiCtrlCreateInput("N/A", 180, 280, 40, 20)
   $EE = GuiCtrlCreateInput("", 180, 310, 40, 20)
   
   $Button_1 = GuiCtrlCreateButton("Start", 60, 380, 100, 30)
   
   GUISetState()
   While 1
       $nMsg = GUIGetMsg()
       Select
       Case $nMsg = $GUI_EVENT_CLOSE
           Exit
       Case $nMsg = $Button_1
           IniWrite ( "\PikIni.ini", "Chix", "PanicLife", $PanicLife )
           IniWrite ( "\PikIni.ini", "Chix", "ChickenLife", $ChickenLife )
   
;;;Pickup Items
           IniWrite ( "\PikIni.ini", "PickItems", "PickItem", $PickItem )
   
;;;Min Item Stats
           IniWrite ( "\PikIni.ini", "Stats", "ReqLvl", $ReqLvl )
           IniWrite ( "\PikIni.ini", "Stats", "Dex", $Dex )
           IniWrite ( "\PikIni.ini", "Stats", "Str", $Str )
           IniWrite ( "\PikIni.ini", "Stats", "DexStr", $DexStr )
           IniWrite ( "\PikIni.ini", "Stats", "Int", $Int )
           IniWrite ( "\PikIni.ini", "Stats", "EE", $EE )
       EndSelect
   WEnd
   Exit

ini results;

[Chix]
   PanicLife=14
   ChickenLife=15
   [PickItems]
   PickItem=16
   [Stats]
   ReqLvl=17
   Dex=18
   Str=19
   DexStr=20
   Int=21
   EE=22
Take this line for example
IniWrite ( "\PikIni.ini", "Chix", "PanicLife", $PanicLife )

$PaninLife is the ID of the input, which will be some integer depending on the order of creation in your gui. It is not the contents of the input.

Look up GuiCtrlRead because th econtents of an input would be saved like this

IniWrite ( "\PikIni.ini", "Chix", "PanicLife", GuiCtrlRead($PanicLife) )
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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