04-05-2013, 06:01 PM
Pages: 1 2
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).

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

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.
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...
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:
Call it with:
The code is free to use for whatever you like.
Code:
function split(string, pattern)
-- Define variables.
local t = {} -- NOTE: use {n = 0} in Lua-5.0
local fpat = "(.-)" .. pattern
local last_end = 1
local s, e, cap = string:find(fpat, 1)
-- Split the string.
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = string:find(fpat, last_end)
end
if last_end <= #string then
cap = string:sub(last_end)
table.insert(t, cap)
end
-- Return the table.
return t
end
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
Pages: 1 2