Jump to content
Sign in to follow this  
ecstatic

[Solved] My Save Button Is Non Functional

Recommended Posts

ecstatic

OK im ganna immiedietly jump in with my code

;===========================================================
;===========================================================
;============D2 Insanity Bot; Version 1.0 Beta=============
;============Coded by Bionide and made in AutoIt============
;============Created for Project-Insanity.com ==============
;============Not to be used without Bionide's Permission====
;===========================================================
;===========================================================
;
; This Program is made for setting up the user's Configuration.ini for t3h n00bz0rs.
;
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIResizeMode", 1); Keeps the GUI window from being resized by the user
Global $OkButton
$Form1 = GUICreate("D2 Insanity's Configuration Tool", 633, 341, 193, 125)
$Username = GUICtrlCreateInput("", 128, 16, 121, 21)
$Account = GUICtrlCreateLabel("Your D2 Account Name:", 8, 16, 120, 17)
$Label1 = GUICtrlCreateLabel("Your D2 Password:", 8, 56, 95, 17)
$Label2 = GUICtrlCreateLabel("Your Character Slot:", 8, 96, 99, 17)
$Label3 = GUICtrlCreateLabel("On the login, which slot are you? Formated like so ", 376, 16, 241, 17)
$Label4 = GUICtrlCreateLabel("1      2", 480, 40, 43, 17)
$Label5 = GUICtrlCreateLabel("3      4", 480, 64, 43, 17)
$Label6 = GUICtrlCreateLabel("5      6", 480, 88, 43, 17)
$Password = GUICtrlCreateInput("", 128, 56, 121, 21)
$CharSlot = GUICtrlCreateInput("", 128, 96, 121, 21)
$RealmName = GUICtrlCreateLabel("Realm Name", 8, 136, 65, 17)
$Realm = GUICtrlCreateInput("", 128, 128, 121, 21)
$Label7 = GUICtrlCreateLabel("Class", 8, 232, 29, 17)
$Hammerdin = GUICtrlCreateRadio("Hammerdin", 128, 224, 113, 17)
$LSorc = GUICtrlCreateRadio("Lightning Sorc", 128, 240, 113, 17)
$SaveButton = GUICtrlCreateButton("Save", 256, 296, 139, 25, 0)
$OkButton = GUICtrlCreateButton("Exit", 100, 296, 139, 25, 0)
$Channel = GUICtrlCreateLabel("Home Channel Name", 8, 160, 105, 17)
$ChannelName = GUICtrlCreateInput("Op Legit", 128, 160, 121, 21)
$Label8 = GUICtrlCreateLabel("Channel Message!", 8, 192, 92, 17)
$ChannelMessage = GUICtrlCreateInput("Project-Insanity.com - Best Bot Around!", 128, 192, 121, 21)
$Label10 = GUICtrlCreateLabel("Your Game Name", 328, 136, 88, 17)
$Gamename = GUICtrlCreateInput("D2Mf-", 448, 128, 121, 21)
$Label11 = GUICtrlCreateLabel("Game Password", 328, 168, 81, 17)
$GamePass = GUICtrlCreateInput("123", 448, 160, 121, 21)
$Label12 = GUICtrlCreateLabel("Game Difficuluty", 328, 200, 81, 17)
$Difficuluty = GUICtrlCreateInput("Hell", 448, 192, 121, 21)
GUISetState(@SW_SHOW)
While 1
        $msg = GUIGetMsg();
        Switch $msg
    Case $GUI_EVENT_CLOSE, $OKButton; <- Change $ButtonCancel to what your Cancel Button is defined as
        ExitLoop
      ;Case $ButtonAdd; Code for other buttons
      ;Case $ButtonSubtract
    Case $SaveButton
            IniWrite("Configuration.ini", "Personal Information", "Username", $Account)
    IniWrite("Configuration.ini", "Personal Information", "Password", $Password)
    IniWrite("Configuration.ini", "Personal Information", "Character Slot", $CharSlot)
    IniWrite("Configuration.ini", "Personal Information", "Realm", $Realm)
    IniWrite("Configuration.ini", "Personal Information", "Class", $Hammerdin Or $LSorc)
    IniWrite("Configuration.ini", "Personal Information", "ChannelName", $Channel)
    IniWrite("Configuration.ini", "Personal Information", "ChannelMessage", $ChannelMessage)
    IniWrite("Configuration.ini", "Personal Information", "GamePass", $GamePass)
    IniWrite("Configuration.ini", "Personal Information", "GameName", $Gamename)
    IniWrite("Configuration.ini", "Personal Information", "GameDifficuluty", $Difficuluty)
EndSwitch

Wend

Everytime i hit save.

It posts this into Configuration.ini

[Personal Information]
Username=4
Password=11
Character Slot=12
Realm=14
Class=True
ChannelName=20
ChannelMessage=23
GamePass=27
GameName=25
GameDifficuluty=29

Why doesnt it post what i placed into the text boxs?

Edited by ecstatic

Share this post


Link to post
Share on other sites
MrMitchell

You need to use GUICtrlRead() I think

Edit: For example

IniWrite("Configuration.ini", "Personal Information", "GameDifficuluty", GUICtrlRead($Difficuluty))
Edited by MrMitchell

Share this post


Link to post
Share on other sites
ecstatic

Yep that worked thank you very much.

Do you know how i would incorporate that into identifiying 2 different radio buttons?

Mabey

IniWrite("Configuration.ini", "Personal Information", "Class", GUICtrlRead($Hammerdin Or $LSorc))

Share this post


Link to post
Share on other sites
MrMitchell

Since you only have two radios...

Dim $class

If GUICtrlRead($Hammerdin) Then
      $class = GUICtrlRead($Hammerdin, 1)
ElseIf GUICtrlRead($LSorc) Then
      $class = GUICtrlRead($LSorc, 1)
EndIf

IniWrite("Configuration.ini", "Personal Information", "Class", $class)

Try that. If it works, this is one way, probably not the best way though!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.