Compare commits
1 Commits
20fd463f5b
...
e9927fb1d7
Author | SHA1 | Date |
---|---|---|
mio | e9927fb1d7 |
|
@ -423,14 +423,22 @@ local h = {}
|
|||
|
||||
-- Serve ramen.
|
||||
function h.ramen(cxt, msg)
|
||||
local recipients = { msg.reply_to }
|
||||
local intro = ""
|
||||
-- Scheduled task recipients
|
||||
if msg.recipients ~= nil then
|
||||
recipients = msg.recipients
|
||||
intro = "Now serving! "
|
||||
end
|
||||
|
||||
-- 1% chance of special set
|
||||
local roll = math.random(1, 100)
|
||||
if roll == 77 then
|
||||
irc.message(cxt, { msg.reply_to },
|
||||
irc.message(cxt, recipients, intro ..
|
||||
string.gsub(itte_config.messages.special, "{{ramen}}",
|
||||
ramen.make_ramen("veg_special")))
|
||||
else
|
||||
irc.message(cxt, { msg.reply_to },
|
||||
irc.message(cxt, recipients, intro ..
|
||||
string.gsub(itte_config.messages.serve, "{{ramen}}",
|
||||
ramen.make_ramen("veg")))
|
||||
end
|
||||
|
@ -439,19 +447,16 @@ end
|
|||
|
||||
-- Serve meat-based ramen.
|
||||
function h.mramen(cxt, msg)
|
||||
local recipients = { msg.reply_to }
|
||||
-- Scheduled task recipients
|
||||
if msg.recipients ~= nil then
|
||||
recipients = msg.recipients
|
||||
end
|
||||
-- 1% chance of special set
|
||||
local roll = math.random(1, 100)
|
||||
if roll == 77 then
|
||||
irc.message(cxt, recipients, string.gsub(itte_config.messages.special,
|
||||
"{{ramen}}", ramen.make_ramen("meat_special")))
|
||||
irc.message(cxt, { msg.reply_to },
|
||||
string.gsub(itte_config.messages.special, "{{ramen}}",
|
||||
ramen.make_ramen("meat_special")))
|
||||
else
|
||||
irc.message(cxt, recipients, string.gsub(itte_config.messages.serve,
|
||||
"{{ramen}}", ramen.make_ramen("meat")))
|
||||
irc.message(cxt, { msg.reply_to },
|
||||
string.gsub(itte_config.messages.serve, "{{ramen}}",
|
||||
ramen.make_ramen("meat")))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue