Sign in to follow this  
Followers 0
Noobcube

Ini Save

13 posts in this topic

$checkloot = GUICtrlCreateCheckbox("Loot?" , 48 , 32 , 97 , 17)

Iniwrite($Ininame, "Loot", :s, :s)

for it to save if the checkbox is checked or not what do i need to enter in the last 2 parts?

would it be

Iniwrite($Ininame, "Loot", $checkloot, :s) but i still dont know the last part

Thanks

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Ty

would load be the same?

Iniread("Config.ini", "Attack", "value", GUICtrlRead($checkloot))

so when i press a load button it will load the ini file?

or is there something missing because that doesnt load up for me

when saved check it is Value=1 and untick value=4

do i need to include that somewhere?

Edited by Noobcube

Share this post


Link to post
Share on other sites

No, the GUICtrlRead($checkloot) just reads the made checkbox, if it's checked or not.

The last value of if the Iniread() function is only used when there is NO value to read.

If you would like the checkbox to be ticked upon what's in the ini then use something like in your old post: Ini Save

So, a command like: GUICtrlSetState($checkloot, $GUI_CheckED)


My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

$checkloot1 = IniRead($Ininame, "Loot", "value", $GUI_Unchecked)

If $checkloot1 = "1" Or $checkloot = "" Then

GUICtrlSetState($checkloot, $GUI_CheckED)

Else

GUICtrlSetState($checkloot, $GUI_UNCheckED)

EndIf

put that in

but now it loads checked even if i didnt save it checked><

Edited by Noobcube

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

GUICtrlSetState($checkloot, IniRead($Ininame, "Loot", "value", 4))

Remember to do an IniWrite() to save the setting at some point, usually on exit or on a message from a control.

Edit: BTW the way to do the IniWrite is like this

IniWrite($Ininame, "Loot", "value", GUICtrlRead($checkloot)))

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

$checkloot11 = IniRead($Ininame, "Attack", "value10", $GUI_Unchecked)

If $checkloot11 = "10" Or $checkloot11 = "1" Then

GUICtrlSetState($Checkbox10, $GUI_CheckED)

Else

GUICtrlSetState($Checkbox10, $GUI_UNCheckED)

EndIf

thats working for me :)

Share this post


Link to post
Share on other sites

$checkloot11 = IniRead($Ininame, "Attack", "value10", $GUI_Unchecked)

If $checkloot11 = "10" Or $checkloot11 = "1" Then

GUICtrlSetState($Checkbox10, $GUI_CheckED)

Else

GUICtrlSetState($Checkbox10, $GUI_UNCheckED)

EndIf

thats working for me :)

Consider that a miracle.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

:)

i just have one more question if you could help me

is there way so when i name my .ini save

i dont need to type .ini

eg Iniwrite(($Ininame).ini ........

or is that not possible?

Share this post


Link to post
Share on other sites

:)

i just have one more question if you could help me

is there way so when i name my .ini save

i dont need to type .ini

eg Iniwrite(($Ininame).ini ........

or is that not possible?

You are going to have to run this past me one more time. $Ininame should be the fulll path and filename to the inifile and you don't use any file save routines with it.

$Ininame = "My_File.ini"

IniWrite($IniName, "Section", "Key", "Value")

The Ini file is automaticaly saved.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Ok

i have a input box to create a inin file name

( i will be using more than one)

so when i make one i need to type MyIniName.ini

anyway so i dont need to type the .ini? it will do it for me?

or is that not possible

Share this post


Link to post
Share on other sites

Man this is basic stuff. You need to read a tutorial or something. What you want is a simple string concatenation: $myfilename & ".ini"

Share this post


Link to post
Share on other sites

Man this is basic stuff. You need to read a tutorial or something. What you want is a simple string concatenation: $myfilename & ".ini"

Your right about that, but where are those tutorials?

We all had to learn somewhere, but where is that somewhere? The helpfile does not tell you how to do string 'concatenation' (never known that word...), and it SHOULD not ofcourse. There are a few examples in there, but it's a helpfile not a tutorial file. So where are the tutorials?

I personally think every beginner has to read the basic in the helpfile, but thats covered here I think.

Then read as much as possible simple scripts in the example forum.

So Noobcube, go there and learn! :)


My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

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