This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if split_args.length ~= 1 then | |
channel.send("Incorrect usage! !get [key]") | |
else | |
channel.send(storage.getf(split_args[1])) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onWebRequest(method) | |
print(method) | |
return "202" | |
end | |
register_callback(CALLBACK_HTTP_REQUEST, onWebRequest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onMessage(channel, user, message) | |
channel.send(message.message) | |
end | |
register_callback(CALLBACK_CHANNEL_MESSAGE, onMessage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onUserPart(channel, user) | |
channel.send("Goodbye " .. user.nickname) | |
end | |
register_callback(CALLBACK_USER_PART, onUserPart) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message:reply("Echoing...") | |
message:reply(message:get_message()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"category": "bonusChest", | |
"force_reload": false, | |
"count_min": 10, | |
"count_max": 10, | |
"loot": [ | |
{ | |
"item": "minecraft:stick", | |
"damage": 0, | |
"nbt": {}, |