Skip to content

Instantly share code, notes, and snippets.

View dmillerw's full-sized avatar

Dylan Miller dmillerw

View GitHub Profile
if split_args.length ~= 2 then
channel.send("Incorrect usage! !set [key] [value]")
else
channel.send(storage.setf(split_args[1], split_args[2]))
end
if split_args.length ~= 1 then
channel.send("Incorrect usage! !get [key]")
else
channel.send(storage.getf(split_args[1]))
end
function send_to_all(channels, msg)
for k, v in pairs(channels) do
v.send(msg)
end
end
function onWebRequest(method, path, parameters, channels)
for k, v in pairs(parameters) do
send_to_all(channels, k .. " = " .. v)
end
function onWebRequest(method)
print(method)
return "202"
end
register_callback(CALLBACK_HTTP_REQUEST, onWebRequest)
function onMessage(channel, user, message)
channel.send(message.message)
end
register_callback(CALLBACK_CHANNEL_MESSAGE, onMessage)
function onUserPart(channel, user)
channel.send("Goodbye " .. user.nickname)
end
register_callback(CALLBACK_USER_PART, onUserPart)
function split(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
function split(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
message:reply("Echoing...")
message:reply(message:get_message())
{
"category": "bonusChest",
"force_reload": false,
"count_min": 10,
"count_max": 10,
"loot": [
{
"item": "minecraft:stick",
"damage": 0,
"nbt": {},