Jump to content

Ini Troubles


Denied
 Share

Recommended Posts

For some reason or another this isn't working, and its driving me nuts, maybe one of you guys can shed some light on it for me.

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.1.0

; Author: A.N.Other <myemail@nowhere.com>

;

; Script Function:

; Template AutoIt script.

;

; ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>

; Options

Opt("MouseCoordMode",2)

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("TrayIconDebug",1)

Opt("GUIOnEventMode", 1)

Opt("PixelCoordMode", 2)

; Check To See If Macros Is Already Running

$g_szVersion = "Stuff"

If WinExists($g_szVersion) Then Exit

AutoItWinSetTitle($g_szVersion)

; Start GUI

GuiCreate("Stuff", 665, 125,(@DesktopWidth-665)/2, (@DesktopHeight)/(@DesktopHeight) , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

GUISetOnEvent($GUI_EVENT_CLOSE, "CloseButton")

GUISetState(@SW_SHOW)

; Start Button

$Start = GuiCtrlCreateButton(" Start", 290, 55, 75, 35)

GUICtrlSetOnEvent($Start, "StartButton")

$LI1 = "0000"

; Read Saved Last Config

$LastBob = IniRead("Config.ini", "Info", "$Bob", "")

; Stuff

$Stuff = GuiCtrlCreateTreeView(500, 40, 150, 80, $TVS_CHECKBOXES)

$BobData = GuiCtrlCreateTreeViewItem("Bob", $Stuff)

If $LastBob = 1 Then GuiCtrlSetState($BobData, $GUI_CHECKED)

While 1

Sleep(100)

WEnd

Func CloseButton()

Exit

EndFunc

Func StartButton()

; Saving Current Info

$Bob = GUICtrlRead($BobData)

If $Bob = $GUI_CHECKED Then IniWrite("Config.ini", "Info", "$LastBob", 1)

If $Bob = $GUI_CHECKED Then $LI1 = "1111"

EndFunc

It doesn't save a "1" to the Config.ini when the box is checked and start is pressed.

Link to comment
Share on other sites

Try:

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template AutoIt script.
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <GUIConstants.au3>


; Options
Opt("MouseCoordMode", 2)
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("TrayIconDebug", 1)
Opt("GUIOnEventMode", 1)
Opt("PixelCoordMode", 2)

; Check To See If Macros Is Already Running
$g_szVersion = "Stuff"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)

; Start GUI
GUICreate("Stuff", 665, 125, (@DesktopWidth - 665) / 2, (@DesktopHeight) / (@DesktopHeight), $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseButton")
GUISetState(@SW_SHOW)

; Start Button
$Start = GUICtrlCreateButton(" Start", 290, 55, 75, 35)
GUICtrlSetOnEvent($Start, "StartButton")

$LI1 = "0000"

; Read Saved Last Config
$LastBob = IniRead(@ScriptDir & "\Config.ini", "Info", "Bob", 0)

; Stuff
$Stuff = GUICtrlCreateTreeView(500, 40, 150, 80, $TVS_CHECKBOXES)
$BobData = GUICtrlCreateTreeViewItem("Bob", $Stuff)
If $LastBob = 1 Then GUICtrlSetState($BobData, $GUI_CHECKED)

While 1
    Sleep(100)
WEnd

Func CloseButton()
    Exit
EndFunc   ;==>CloseButton

Func StartButton()
    ; Saving Current Info
    $LastBob = BitAND(GUICtrlRead($BobData),$GUI_CHECKED)
    IniWrite(@ScriptDir & "\Config.ini", "Info", "Bob", $LastBob)
    If $LastBob Then 
        $LI1 = "1111"
    Else
        $LI1 = "0000"
    EndIf
EndFunc   ;==>StartButton

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Would it be too much to ask that you highlight the changes so others can learn withouth having to go through line by line? Justwondering :D

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

Would it be too much to ask that you highlight the changes so others can learn withouth having to go through line by line? Justwondering :D

Just follow $BobData and $LastBob

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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...