About ini
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

About ini

Started by Themaster, 20 October, 2004, 16:30:13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

if i want to make my script so that the .ini are where it change the settings in my script have can i do that

like this in my ini

Word = 1   --1 allow or 0 disallow

i will made so that it can turn on or off

ect

peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Herodes

#1
As always there are two ways ...

1. Simple :

use
dofile("filename.ini")
to load up the variables and their values in the memory

Advantages :
-- Simple to use ..

Disadvantages :
-- you cant save any settings
unless by editing the file directly
-- You may not find the file where you are looking for it ..
to solve this use assert(condition, error_message)
assert Example :
assert( 1==1 , "One is not one") 
-- this will be ok because 1 is equal to 1
assert( 1==2, "One is not one")
-- this will issue a message "One is not one" in the debug/error output...
so if dofile returns ' nil ' which isnt ' true ' then assert will catch it and inform about the errror ...
Common use :
file = "filename.txt"
assert(dofile(file), "ERROR!!, "..file.." wasn't found..")

2. Complicated :
The complicated way involves using some sort of saveToFile* function that stores the values in the file ... overwriting contents if the exist in the file previously ...

* Look for Serialize, pickle ...  in here there are Lua4 versions of those ... Clients can use Lua 5 pickle function look for ' libsimplepickle.lua ' in the scripts folder ...

Themaster

i Cant get it work write... i do have this in my ini file there shoot be 1 allow or 0 disallow

replaced = 0	-- 1 Allow or 0 Disallow
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

SMF spam blocked by CleanTalk