Nore wrote:Looks good! However, you have to specify a license (for example, CC0), because public domain is not one.
Mito551 wrote:most people here are european. if i'm not wrong. funny pic, lol
JBR wrote:Nore wrote:Looks good! However, you have to specify a license (for example, CC0), because public domain is not one.
Well I don't like the minetest's version of public domain because it has swearing in it and I think public domain is perfectly valid.
PilzAdam wrote:JBR wrote:Nore wrote:Looks good! However, you have to specify a license (for example, CC0), because public domain is not one.
Well I don't like the minetest's version of public domain because it has swearing in it and I think public domain is perfectly valid.
First of all, WTFPL is not "minetest's version of public domain", its a valid and wiedly used license.
Second: public domain is not a license in some countries, thus its not accepted in this forum.
Third: Choose CC0 if you dont like the "swearing" in WTFPL.
JBR wrote:PilzAdam wrote:JBR wrote:
Well I don't like the minetest's version of public domain because it has swearing in it and I think public domain is perfectly valid.
First of all, WTFPL is not "minetest's version of public domain", its a valid and wiedly used license.
Second: public domain is not a license in some countries, thus its not accepted in this forum.
Third: Choose CC0 if you dont like the "swearing" in WTFPL.
Ok, though what does CC0 stand for?
Hybrid Dog wrote:You could use
0130608124237 Noob message
instead of
(09/06/13 12:42:37) [Noob]: message
to make it more simple.
PilzAdam wrote:JBR wrote:PilzAdam wrote:First of all, WTFPL is not "minetest's version of public domain", its a valid and wiedly used license.
Second: public domain is not a license in some countries, thus its not accepted in this forum.
Third: Choose CC0 if you dont like the "swearing" in WTFPL.
Ok, though what does CC0 stand for?
http://creativecommons.org/publicdomain/zero/1.0/ 0.5 seconds search in the internet.
JBR wrote:rubenwardy wrote:Is chat not logged in debug.txt?
It's not on mine
debug_level = 2
local chatlog = minetest.get_worldpath().."/chatlog.txt"
function playerspeak(name,msg)
f = io.open(chatlog, "a")
f:write(os.date("(%m/%d/%y %X) [")..name.."]: "..msg.."\n")
f:close()
end
minetest.register_on_chat_message(playerspeak)
CraigyDavi wrote:A crash occurs when someone uses the percentage sign (%) in the chat.
For anyone wanting to use this mod, you could use this code instead to fix it:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local chatlog = minetest.get_worldpath().."/chatlog.txt"
function playerspeak(name,msg)
f = io.open(chatlog, "a")
f:write(os.date("(%m/%d/%y %X) [")..name.."]: "..msg.."\n")
f:close()
end
minetest.register_on_chat_message(playerspeak)
os.date("%x") -> date
os.date("%x %X") -> date time
local chatlog = minetest.get_worldpath().."/chatlog.txt"
local chatdate = (os.date("%Y%m%d")) --chatdate will be, for example, 20150127.txt -->> YYYY MM DD (year month day)
local chatlog = minetest.get_worldpath().."/chatlog/"..chatdate..".txt"
-- Helper function for loading optional values
local function getValid(value, default)
v = minetest.setting_get(value)
return (v == nil and default or v)
end
-- Default values
local defaultFile = 'chatlog.%Y-%m-%d.log'
local defaultDate = '%X'
local defaultLine = '[%date%] <%name%> %message%\n'
-- Read values from minetest.conf or set default values
chatlogFilename = getValid('chatlog_logfile_name', defaultFile)
chatlogDateString = getValid('chatlog_date_string', defaultDate)
chatlogLineFormat = getValid('chatlog_line_format', defaultLine)
function chatlogWriteLine(name, message)
local logfileName = os.date(chatlogFilename)
local line = chatlogLineFormat
line = line:gsub('%%date%%', os.date(chatlogDateString))
line = line:gsub('%%name%%', name)
line = line:gsub('%%message%%', message)
f = io.open(minetest.get_worldpath()..'/'..logfileName, 'a')
f:write(line)
f:close()
end
minetest.register_on_chat_message(chatlogWriteLine)
-- Helper function for loading optional values
local function getValid(value, default)
v = minetest.setting_get(value)
return (v == nil and default or v)
end
-- Default values
local defaultFile = 'chatlog.%Y-%m-%d.log'
local defaultDate = '%X'
local defaultLine = '[%date%] <%name%> %message%\n'
-- Read values from minetest.conf or set default values
chatlogFilename = getValid('chatlog_logfile_name', defaultFile)
chatlogDateString = getValid('chatlog_date_string', defaultDate)
chatlogLineFormat = getValid('chatlog_line_format', defaultLine)
function chatlogWriteLine(name, message)
local logfileName = os.date(chatlogFilename)
local line = chatlogLineFormat
line = line:gsub('%%date%%', os.date(chatlogDateString))
line = line:gsub('%%name%%', name)
line = line:gsub('%%message%%', message)
f = io.open(minetest.get_worldpath()..'/'..logfileName, 'a')
f:write(line)
f:close()
end
minetest.register_on_chat_message(chatlogWriteLine)
2017-02-13 02:09:42: ERROR[Main]: ServerError: Lua: Runtime error from mod 'chatlog' in callback on_chat_message(): .../STABLE/minetest/bin/../mods/chatlog/init.lua:24: invalid capture index
2017-02-13 02:09:42: ERROR[Main]: stack traceback:
2017-02-13 02:09:42: ERROR[Main]: [C]: in function 'gsub'
2017-02-13 02:09:42: ERROR[Main]: /STABLE/minetest/bin/../mods/chatlog/init.lua:24: in function <.../STABLE/minetest/bin/../mods/chatlog/init.lua:19>
2017-02-13 02:09:42: ERROR[Main]: .../STABLE/minetest/bin/../builtin/game/register.lua:412: in function <.../STABLE/minetest/bin/../builtin/game/register.lua:392>
$ minetest --version
Minetest 0.4.15 (Linux)
Using Irrlicht 1.8.4
Build info: VER=0.4.15 BUILD_TYPE=Release RUN_IN_PLACE=0 USE_GETTEXT=1 USE_SOUND=1 USE_CURL=1 USE_FREETYPE=1 USE_LUAJIT=1 STATIC_SHAREDIR="/usr/share/minetest"
$ lua5.2 -v
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
$ luajit -v
LuaJIT 2.0.4 -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
$ uname -rms
Linux 4.9.6-1-ARCH x86_64
Users browsing this forum: No registered users and 10 guests