04-05-2013, 06:01 PM
Does anyone know if you can list the keys inside a section of an ini file using cIniFile? If so, how could you do it?
cIniFile help?
|
04-05-2013, 06:01 PM
Does anyone know if you can list the keys inside a section of an ini file using cIniFile? If so, how could you do it?
04-05-2013, 06:06 PM
Maybe this helps: https://code.google.com/p/mc-server/sour...354&r=1354 it shows a list of groups.
04-05-2013, 06:08 PM
Ok, thanks. It relies on that key numbers are just counting up from 0, instead of random numbers
(the dics didn't say what the key number was).
04-05-2013, 10:09 PM
Yeah, I really hate that cIniFile interface. But what can I do, if I rewrite everything I hate, there'd be nothing left
Anyway, feel free to enhance the docs, it's a wiki, after all. I'm trying, from time to time - at least the hook handlers are more or less documented now, but there's just too many classes with too many changes in them.
04-06-2013, 04:15 AM
Maybe we should build a new IniFile class? Or maybe we could even get a nice YAML parser (you can have more nesting) and deprecate the INI files, but keep IniFile in there for the old plugins.
Thanks given by: NiLSPACE
04-06-2013, 05:11 AM
An XML parser is planned in the API:
http://www.mc-server.org/support/index.p...ask_id=336 Later on...
04-06-2013, 05:32 AM
Seems sensible
04-06-2013, 09:06 PM
how to insert multiple things in a value? i did this:
Block:SetValue( KeyName, "I", Player:GetName() .. "," .. "Placed" .. "," .. os.date() .. "," .. Player:GetWorld():GetBlock(X, Y, Z) .. "," .. Player:GetWorld():GetBlockMeta(X, Y, Z) )to store the data and then this: Player,Broken,Date,BlockID,BlockMeta = Block:GetValue(KeyName, "I")to get the info but "Player" gets all the data "I" has stored in an ini file and "Broken" gets everything "KeyName" has.
04-06-2013, 10:39 PM
IDK, simplest way is to do what I do, use my split function:
Code: function split(string, pattern) Call it with: Code: Player = split(Block:GetValue(KeyName, "I"), ",") The code is free to use for whatever you like.
04-06-2013, 11:01 PM
and how can i then add something to Broken, Date, BlockID and BlockMeta with that function? i'm not realy good with tables :S
|
« Next Oldest | Next Newest »
|