lol production changes
This commit is contained in:
parent
95d1bf7084
commit
d6b92f0593
2 changed files with 30 additions and 12 deletions
|
@ -44,12 +44,12 @@ plugin.AddCommand('at', 0, function(Username, Channel)
|
||||||
local Last = Parts[#Parts]
|
local Last = Parts[#Parts]
|
||||||
Parts[#Parts] = nil
|
Parts[#Parts] = nil
|
||||||
|
|
||||||
Line = table.concat(Parts, ", ") .. " and " .. Last
|
Line = table.concat(Parts, ", ") .. ", " .. Last
|
||||||
end
|
end
|
||||||
if #Users == 0 then
|
if #Users == 0 then
|
||||||
Line = Line:gsub("^%l", string.upper) .. "."
|
Line = Line:gsub("^%l", string.upper) .. "."
|
||||||
else
|
else
|
||||||
Line = Line .. "."
|
Line = Line .. " and five lathes."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -423,8 +423,8 @@ plugin.AddCommand('gimbaza', 1, function(Username, Channel, Target)
|
||||||
end
|
end
|
||||||
end, "Remove gimbaza")
|
end, "Remove gimbaza")
|
||||||
|
|
||||||
plugin.AddCommand('play', 1, function(Username, Channel)
|
plugin.AddCommand('play', -1, function(Username, Channel, Song)
|
||||||
Channel:Say("ɴᴏᴡ ᴘʟᴀʏɪɴɢ: Despacito")
|
Channel:Say("ɴᴏᴡ ᴘʟᴀʏɪɴɢ: " .. Song)
|
||||||
Channel:Say("───────────────⚪────────────────────────────")
|
Channel:Say("───────────────⚪────────────────────────────")
|
||||||
Channel:Say("◄◄⠀▐▐ ⠀►►⠀⠀ ⠀ 1:17 / 3:48 ⠀ ───○ 🔊⠀ ᴴᴰ ⚙ ❐ ⊏⊐")
|
Channel:Say("◄◄⠀▐▐ ⠀►►⠀⠀ ⠀ 1:17 / 3:48 ⠀ ───○ 🔊⠀ ᴴᴰ ⚙ ❐ ⊏⊐")
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -44,29 +44,47 @@ local function CheckMate(IRC, Force)
|
||||||
for _, ID in pairs(Redis:smembers("paczkomate:ids")) do
|
for _, ID in pairs(Redis:smembers("paczkomate:ids")) do
|
||||||
local LastChecked = tonumber(Redis:hget("paczkomate:objects:" .. ID, "lastchecked"))
|
local LastChecked = tonumber(Redis:hget("paczkomate:objects:" .. ID, "lastchecked"))
|
||||||
local LastStatus = Redis:hget("paczkomate:objects:" .. ID, "status")
|
local LastStatus = Redis:hget("paczkomate:objects:" .. ID, "status")
|
||||||
|
local Channel = Redis:hget("paczkomate:objects:" .. ID, "channel")
|
||||||
|
if Channel == nil then
|
||||||
|
Channel = "#hackerspace-pl-members"
|
||||||
|
end
|
||||||
|
local User = Redis:hget("paczkomate:objects:" .. ID, "user")
|
||||||
if Now > LastChecked + 600 or Force then
|
if Now > LastChecked + 600 or Force then
|
||||||
Redis:hset("paczkomate:objects:" .. ID, "lastchecked", Now)
|
Redis:hset("paczkomate:objects:" .. ID, "lastchecked", Now)
|
||||||
local NewStatus = GetPackStatus(ID)
|
local NewStatus = GetPackStatus(ID)
|
||||||
if NewStatus ~= LastStatus then
|
if NewStatus ~= nil and NewStatus ~= LastStatus then
|
||||||
Redis:hset("paczkomate:objects:" .. ID, "status", NewStatus)
|
Redis:hset("paczkomate:objects:" .. ID, "status", NewStatus)
|
||||||
local Message = string.format("Paczkomate %s status changed (%s -> %s)", ID, LastStatus, NewStatus)
|
local Message = string.format("Paczkomate %s status changed (%s -> %s)", ID, LastStatus, NewStatus)
|
||||||
IRC:Say("#hackerspace-pl-members", Message)
|
if User ~= nil then
|
||||||
|
Message = User .. ": " .. Message
|
||||||
|
end
|
||||||
|
IRC:Say(Channel, Message)
|
||||||
|
end
|
||||||
|
if NewStatus == "Delivered" then
|
||||||
|
local Message = string.format("Paczkomate %s done, removing.", ID)
|
||||||
|
if User ~= nil then
|
||||||
|
Message = User .. ": " .. Message
|
||||||
|
end
|
||||||
|
IRC:Say(Channel, Message)
|
||||||
|
Redis:srem("paczkomate:ids", ID)
|
||||||
|
Redis:del("paczkomate:objects:" .. ID)
|
||||||
end
|
end
|
||||||
if NewStatus == "Delivered" then
|
|
||||||
local Message = string.format("Paczkomate %s done, removing.", ID)
|
|
||||||
IRC:Say("#hackerspace-pl-members", Message)
|
|
||||||
Redis:srem("paczkomate:ids", ID)
|
|
||||||
Redis:del("paczkomate:objects:" .. ID)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Redis:quit()
|
Redis:quit()
|
||||||
end
|
end
|
||||||
|
|
||||||
plugin.AddCommand('add-paczkomate', 1, function(Username, Channel, ID)
|
plugin.AddCommand('add-paczkomate', 1, function(Username, Channel, ID)
|
||||||
|
local Status = GetPackStatus(ID)
|
||||||
|
if Status == nil then
|
||||||
|
Channel:Say(Username .. ": i am not aware of such rubber")
|
||||||
|
return
|
||||||
|
end
|
||||||
local Redis = GetRedisClient()
|
local Redis = GetRedisClient()
|
||||||
Redis:transaction(function(t)
|
Redis:transaction(function(t)
|
||||||
t:sadd('paczkomate:ids', ID)
|
t:sadd('paczkomate:ids', ID)
|
||||||
|
t:hset("paczkomate:objects:" .. ID, "channel", Channel.Name)
|
||||||
|
t:hset("paczkomate:objects:" .. ID, "user", Username)
|
||||||
t:hset("paczkomate:objects:" .. ID, "lastchecked", 0)
|
t:hset("paczkomate:objects:" .. ID, "lastchecked", 0)
|
||||||
t:hset("paczkomate:objects:" .. ID, "status", "none")
|
t:hset("paczkomate:objects:" .. ID, "status", "none")
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue