Initial commit

master
Elias Fleckenstein 2021-03-17 20:49:02 +01:00
commit 26112c6631
3 changed files with 36 additions and 0 deletions

11
README Normal file
View File

@ -0,0 +1,11 @@
# libclamity
This is a dragonfire CSM (might work partly with vanilla minetest as well) that includes utilities to make clientmods specifically for Clamity Anarchy and it's modset.
Current features:
- Chat message parsing
Planned features:
- Death message parsing
- Parsing of /me output
- Get / set skin
- Badge parsing

22
init.lua Normal file
View File

@ -0,0 +1,22 @@
local libclamity = {}
function libclamity.parse_chat_message(rawmsg)
local msg = minetest.strip_colors(rawmsg)
local nameidx = msg:find("<")
local first_byte = rawmsg:byte(1)
if nameidx and (first_byte == 60 or first_byte == 27) then
local idx = msg:find(">")
local player = msg:sub(nameidx + 1, idx - 1)
local sidx = idx + 2
if msg:sub(idx + 1, idx + 1) == ":" then
sidx = sidx + 1
end
local message = msg:sub(sidx, #msg)
local discord = first_byte == 27 and rawmsg:sub(2, 12) == "(c@#63d269)" and nameidx == 1
return {
player = player,
message = message,
discord = discord,
}
end
end

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = libclamity
author = Fleckenstein
description = Everything you need to create clientmods for Clamity Anarchy