itte/examples/ramenkan/ramenkan.config.lua

487 lines
18 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- ---------------------------------------------------------------------------
-- Ramen data
-- ---------------------------------------------------------------------------
local ramen = {}
ramen.noodle_broth_types = {
"thick noodles in rich",
"medium-thick noodles in mild",
"thin noodles in light",
}
ramen.noodle_shapes = {
"curly", "flat", "straight",
}
ramen.broths = {
"miso", "spicy miso", "soy sauce", "grilled soy sauce and Rishiri kelp",
"salt", "salt and soy sauce",
}
-- niboshi: dried little sardines
-- katsuoboshi, konbu: skipjack tuna, kelp
-- gyokai: anchovies/shrimp/squid/seaweed
-- miso and truffle: ramen by chef Ryu Takahashi
ramen.broths_meat = {
"Kobe beef bone", "tonkotsu", "pork bone and chicken",
"pork bone and niboshi", "pork bone, chicken and seafood",
"pork bone, chicken, tuna and kelp", "pork bone and soy sauce", "chicken",
"chicken, katsuoboshi and konbu", "fish", "gyokai", "gyokai tonkotsu",
"roasted tuna", "miso and truffle", "milk", "curry and milk",
}
-- wagyu: Japanese beef known for its higher fat percentage
-- kamaboko/surimi: fish paste
-- narutomaki: fish paste with a swirling pattern
-- kakuni: cubed braised pork
-- chashu: Japanese-style barbecued pork
ramen.meats = {
"Kobe beef fillet", "Kobe beef sirloin", "wagyu", "teppanyaki beef",
"beef shank", "chicken breast", "chicken meatballs", "teppanyaki chicken",
"crab", "crispy duck", "filet mignon", "kamaboko", "narutomaki", "kakuni",
"chashu", "pork confit", "pork cutlet", "pork belly", "pork shoulder",
"shrimp", "sea urchin", "scallops", "squid",
}
-- beni shoga: pickled ginger
-- menma: fermented bamboo shoots
-- kikurage: a type of fungi, known in some cultures as "wood ear"
-- karashi takana: spicy pickled mustard greens
-- negi: Welsh onion
ramen.toppings = {
"bean sprouts", "chili flakes", "sweet corn", "grated garlic",
"roasted garlic chips", "beni shoga", "bamboo shoots", "menma",
"dried mushrooms", "shiitake mushrooms", "kikurage", "karashi takana",
"negi", "white onions", "spring onions", "sichuan peppers", "nori", "wakame",
"sauerkraut", "sesame seeds", "scallions", "boiled spinach",
}
-- ajitama: egg marinated in soy sauce
ramen.toppings_egg = {
"egg yolk", "seasoned boiled egg", "ajitama",
}
ramen.sauce_verbs = {
"garnished", "sprinkled", "sprinkled lightly", "sprinkled liberally",
"drizzled", "drizzled lightly", "drizzled artfully", "brimming",
}
ramen.spice_verbs = {
"seasoned", "sprinkled", "sprinkled lightly", "sprinkled liberally",
}
-- rayu: chili oil
-- mayu: garlic oil
-- dashi: fish/seaweed stock
-- ponzu: citrus sauce
-- shichimi: spice blend
ramen.sauces = {
"butter", "rayu", "chili sauce", "mayu", "spicy garlic and ginger oil",
"sesame oil", "dashi", "ponzu",
}
ramen.spices = {
"black pepper", "white pepper", "chili peppers", "shichimi",
}
ramen.tapas = {
"edamame tossed in sea salt", "tofu nuggets", "picked daikon",
"cucumber salad", "seaweed salad",
}
ramen.tapas_meat = {
"gyoza", "karaage", "tako wasabi", "takoyaki", "corn and shrimp salad",
"crab salad", "beef enoki rolls",
}
ramen.sets = {
"Gunma konnyaku ramen in soy sauce broth",
"miso ramen with vegetable broth, cabbage and bean sprouts",
"ramen with shiitake mushrooms, kombu and sesame oil",
"ramen with soybean pork slices, kikurage, bamboo shoots and scallions",
"barley miso ramen with roasted vegetables",
}
ramen.sets_meat = {
"Korean kimchi ramyeon with tteok",
"Vancouver cold bonito beer broth ramen with egg whites",
"Hakata tonkotsu ramen with pickled mustard greens",
"Hakodate shio ramen with kelp, crab, shrimp, sea urchin and scallops",
"Hakodate shrimp ramen with a hard-boiled egg and white onions",
"Kagoshima tonkotsu ramen with chashu, dried sardines, kelp and scallions",
"Kitakata niboshi-tonkotsu ramen with chashu, naruto and spring onions",
"Kumamoto tonkotsu ramen with chashu, raw eggs, scallions and garlic chips",
"Muroran curry ramen with chashu, wakame and bean sprouts",
"Nagasaki champon with fried pork, scallions and seasonal greens",
"Osaka Kobe beef sirloin ramen with a soft-boiled egg and arugula",
"Sapporo miso ramen with scallops, sweet corn and bean sprouts",
"Tokyo ramen in chicken broth with pork, menma, a boiled egg and nori",
"Wakayama shoyu-tonkotsu ramen with pork slices, naruto and scallions",
"Yokohama ramen with chashu, spinach, a soft-boiled egg and negi",
}
-- Links to photos and resources
ramen.links = {
-- Photos of ramen vending machines
-- Ticket machines
"https://c2.staticflickr.com/6/5077/5902028877_7d8c65b23f_b.jpg",
"https://c1.staticflickr.com/3/2455/5777431350_36e147e719_z.jpg",
"https://i.pinimg.com/originals/72/08/1e/72081e68ff0989d54fd24a86fcac6f2b.jpg",
"https://i.pinimg.com/originals/9f/74/92/9f7492b7c456ac7ba350498a50c74b23.jpg",
"https://c1.staticflickr.com/9/8157/7105010129_cd4b0d7e27_c.jpg",
"https://c1.staticflickr.com/8/7600/27418644850_2c70342734_c.jpg",
"https://c3.staticflickr.com/3/2049/2229742287_8df3e823a9_z.jpg",
"https://c1.staticflickr.com/1/101/308523474_4295a27326_z.jpg",
"https://media-cdn.tripadvisor.com/media/photo-s/0b/b6/27/f6/ramen-shop-menu-banner.jpg",
"https://abroadabroad2011.files.wordpress.com/2013/03/sam_0040.jpg",
"https://c1.staticflickr.com/6/5753/22803130417_ba86ebb4fa_c.jpg",
"https://c1.staticflickr.com/6/5077/5902028877_7d8c65b23f_z.jpg",
"https://c1.staticflickr.com/8/7504/15210528573_2612010fc3_c.jpg",
"https://s3-media4.fl.yelpcdn.com/bphoto/iUHJczm_--xNqWEUzDS69Q/o.jpg",
"https://thewholeworldornothing.com/wp-content/uploads/2017/01/vending-machine-waiter.jpg",
"https://thebrunchingbooth.files.wordpress.com/2014/07/img_42681.jpg",
"https://c1.staticflickr.com/8/7426/16587852342_0cbfa4a63c_c.jpg",
"https://c1.staticflickr.com/9/8422/7535359482_b5537bbde0_c.jpg",
"https://c1.staticflickr.com/5/4037/4530351457_8666286b56_z.jpg",
"https://c1.staticflickr.com/1/97/244236130_0c22679f97_z.jpg",
"https://c1.staticflickr.com/4/3479/3465112347_1be2868ff0_z.jpg",
"https://1.bp.blogspot.com/_W-pG7tUmJk0/TDQ-J_vz9sI/AAAAAAAACac/xYjAvl8ZGOY/s1600/shinjuku_ramen_02.jpg",
"https://thefoodieflight.files.wordpress.com/2015/10/img_3749.jpg",
"https://static1.squarespace.com/static/57ad3b51c534a528e26a2e93/t/57f91e3be6f2e18cf1d11c82/1476472671797/",
"https://c1.staticflickr.com/1/166/417127513_e063ccf80a_z.jpg",
-- Instant cup noodles
"http://www.toxel.com/wp-content/uploads/2009/06/vendingmachine04.jpg",
"https://c1.staticflickr.com/3/2233/2347915323_9e9e2264a3_z.jpg",
"https://c1.staticflickr.com/4/3818/10186967173_237d38b86f_c.jpg",
"https://c1.staticflickr.com/8/7221/7175446233_076264a2b4_c.jpg",
"https://c7.alamy.com/comp/BCDJRG/a-cup-noodle-vending-machine-instant-ramen-museum-osaka-japan-1-december-BCDJRG.jpg",
-- Ramen can
"https://c1.staticflickr.com/4/3625/3374051074_641b371d23_z.jpg",
"https://c4.staticflickr.com/4/3214/2911821453_78c6178f54_z.jpg",
"https://smallbiztrends.com/wp-content/uploads/2015/06/P1020817-728x485.jpg",
"https://c1.staticflickr.com/9/8440/7745533776_7b9990be82_c.jpg",
"https://c1.staticflickr.com/3/2268/4507516049_e7aa354489_z.jpg",
-- Various ramen-related links
-- Places and shops
"Ramen, Soul Food Staple - " ..
"https://www3.nhk.or.jp/nhkworld/en/food/articles/51.html",
"Shin-Yokohama Ramen Museum, Yokohama - " ..
"http://www.raumen.co.jp/english/",
"Ramen Street, Tokyo - " ..
"https://en.wikipedia.org/wiki/Ramen_street",
"Sapporo Ramen Republic - " ..
"http://www.sapporo-esta.jp/ramen",
"Ramen DB, a directory of ramen shops in Japan - " ..
"https://ramendb.supleks.jp/",
"Ramen Adventures, a ramen shop review blog - " ..
"http://www.ramenadventures.com/",
-- Recipes
"15 Fantastic Ramen Recipes - " ..
"https://www3.nhk.or.jp/nhkworld/en/food/articles/131.html",
"Chef Rika's Miso Ramen - " ..
"https://www3.nhk.or.jp/nhkworld/en/ondemand/video/9999434/",
"Chef Rika's Shoyu Ramen - " ..
"https://www3.nhk.or.jp/nhkworld/en/ondemand/video/9999299/",
-- Instant noodles
"Momofuku Ando, inventor of instant ramen (1958) - " ..
"https://www.nissin.com/en_jp/about/founder/",
"Instant cup noodles (1971) - " ..
"https://en.wikipedia.org/wiki/Cup_Noodles",
"Instant noodles as emergency food in disaster relief - " ..
"https://instantnoodles.org/en/activities/support.html",
"Samyang, the first Korean instant ramen (1963) - " ..
"https://en.wikipedia.org/wiki/Samyang_ramen",
"The Ramen Rater, an instant ramen blog - " ..
"https://www.theramenrater.com/",
-- Ramen news
"Japan's leading ramen chain Ippudo goes vegan - " ..
"https://asia.nikkei.com/Business/Food-Beverage/Japan-s-leading-ramen-chain-Ippudo-goes-vegan",
-- Ramen in pop culture
"Ramen Manga, comic strips in Japanese about ramen - " ..
"https://www.ramenbank.com/manga/",
"Flower Boy Ramen Shop, romantic comedy drama (2011) - " ..
"https://en.wikipedia.org/wiki/Flower_Boy_Ramen_Shop",
"The Ramen Girl, romantic comedy film (2008) - " ..
"https://en.wikipedia.org/wiki/The_Ramen_Girl",
"Ms. Koizumi Loves Ramen Noodles, manga series (2013-) - " ..
"https://en.wikipedia.org/wiki/Ms._Koizumi_Loves_Ramen_Noodles",
"Muteki Kanban Musume, manga series (2002-2006) - " ..
"https://en.wikipedia.org/wiki/Muteki_Kanban_Musume",
"Detective Conan - Ramen So Good, It's to Die For, anime episode (2012) - " ..
"https://www.detectiveconanworld.com/wiki/Ramen_So_Good,_It%27s_to_Die_For",
"Ramen Teh, film (2018) - " ..
"https://en.wikipedia.org/wiki/Ramen_Teh",
"Ramen yori taisetsuna mono, documentary (2013) - " ..
"https://www.imdb.com/title/tt2945642/",
"Ramen Cake dessert looks just like the real thing, is probably just as bad for you - " ..
"https://soranews24.com/2013/10/24/ramen-cake-dessert-looks-just-like-the-real-thing-is-just-as-terrible-for-you/",
-- Audio
"Japan Eats! Episode 155 - Oisa Ramen (2019) - " ..
"https://heritageradionetwork.org/podcast/oisa-ramen-i-am-just-a-mom-who-cares-to-give-her-best",
-- Videos
"What Owning a Ramen Restaurant in Japan is Like - " ..
"https://www.youtube.com/watch?v=gmIwxqdwgrI",
"Begin Japanology - Ramen - " ..
"https://www.youtube.com/watch?v=RosUc9UVuos",
"Japanology Plus - Ramen - " ..
"https://www.youtube.com/watch?v=K2Jzt04QY7A",
"In Search of the Perfect Bowl of Ramen - " ..
"https://www.youtube.com/watch?v=bhiFtP9qVYc",
"Rahaku TV (The Shin-Yokohama Ramen Museum Youtube Channel) - " ..
"http://www.youtube.com/rahakutv",
"The History of Ramen Yamagoya - " ..
"https://www.youtube.com/watch?v=8NBwKbT5QSQ",
"Ramen Daruma - " ..
"https://www.youtube.com/watch?v=zkhDYTR789w",
"The God of Ramen, trailer (2013) - " ..
"https://www.youtube.com/watch?v=mtwunTGnnR4",
"Ramen Heads, trailer (2017) - " ..
"https://www.youtube.com/watch?v=u61b5R_S4TM",
"Ramenomania - Noodles, Asia's Second Obsession - " ..
"https://www.youtube.com/watch?v=tfW89yAoTNs",
"Noodle Me - " ..
"https://www.youtube.com/watch?v=r9jLJRZ6gnc",
"Visio Documentary - Fat Ramen - " ..
"https://www.youtube.com/watch?v=o78fy4rJFCw",
"Ramen Talk and Q+A With Chef Ryu Takahashi and Chef Matt Kimura - " ..
"https://www.youtube.com/watch?v=tMvArDklmGU",
}
-- ---------------------------------------------------------------------------
-- Ramen functions
-- ---------------------------------------------------------------------------
local util = require("itteutil")
function ramen.prep_noodles(mode)
local noodles = "ramen in a"
-- Dish type, noodle type linked to broth density
local d_roll = math.random(1, 10)
-- 20% chance of tsukemen, 40% chance of noodle thickness description
if d_roll <= 2 then
noodles = "tsukemen from a"
elseif (d_roll >= 3) and (d_roll <= 6) then
noodles = util.pick(itte_config.ramen.noodle_broth_types)[1]
end
-- Broth type
local broths = itte_config.ramen.broths
if mode == "meat" then
broths = itte_config.ramen.broths_meat
end
return noodles .. " " .. util.pick(broths)[1] .. " broth"
end
function ramen.prep_toppings(mode)
-- 2-5 toppings
local t_roll = math.random(2, 5)
local toppings = ""
-- Meat: reduce other toppings to max 3 ingredients
-- 25% chance of egg included
if mode == "meat" then
t_roll = math.random(2, 4)
toppings = util.pick(itte_config.ramen.meats)[1] .. ", "
local e_roll = math.random(1, 4)
if e_roll == 1 then
local egg = util.pick(itte_config.ramen.toppings_egg)[1]
toppings = toppings .. "{{toppings}} and " .. util.a_or_an(egg) .. " " ..
egg
end
end
local tops = util.pick(itte_config.ramen.toppings, t_roll)
-- Check for egg and insert toppings between meat and egg
if (util.is_substr(toppings, "and a")) then
toppings = string.gsub(toppings, "{{toppings}}", table.concat(tops, ", "))
toppings = string.gsub(toppings, " ", " ")
-- 2 toppings, no egg
elseif t_roll == 2 then
toppings = toppings .. table.concat(tops, " and ")
-- Multiple toppings, no egg
else
local last = tops[#tops]
table.remove(tops)
toppings = toppings .. table.concat(tops, ", ") .. " and " .. last
end
return toppings
end
function ramen.prep_condiments()
-- 20% chance of spices
local c_roll = math.random(1, 10)
local cond = util.pick(itte_config.ramen.sauce_verbs)[1] .. " with " ..
util.pick(ramen.sauces)[1]
if c_roll >= 9 then
cond = util.pick(itte_config.ramen.spice_verbs)[1] .. " with " ..
util.pick(ramen.spices)[1]
end
return cond
end
function ramen.prep_tapas(mode)
local tapas = util.pick(itte_config.ramen.tapas)[1]
if mode == "meat" then
tapas = util.pick(itte_config.ramen.tapas_meat)[1]
end
return "served with " .. tapas
end
function ramen.make_ramen(mode)
local r = ""
if mode == "veg" then
r = ramen.prep_noodles("veg") .. " with " ..
ramen.prep_toppings("veg") .. ", " .. ramen.prep_condiments()
elseif mode == "meat" then
r = ramen.prep_noodles("meat") .. " with " ..
ramen.prep_toppings("meat") .. ", " .. ramen.prep_condiments()
elseif mode == "veg_special" then
r = util.pick(itte_config.ramen.sets)[1]
elseif mode == "meat_special" then
r = util.pick(itte_config.ramen.sets_meat)[1]
end
-- 50% chance of serving with tapas
local t_roll = math.random(1, 2)
if (t_roll == 1) and (util.is_substr(mode, "veg")) then
r = r .. ". " .. util.first_upper(ramen.prep_tapas("veg")) .. "."
elseif (t_roll == 1) and (util.is_substr(mode, "meat")) then
r = r .. ". " .. util.first_upper(ramen.prep_tapas("meat")) .. "."
else
r = r .. "."
end
return util.first_upper(r)
end
-- ---------------------------------------------------------------------------
-- Config
-- ---------------------------------------------------------------------------
itte_config = {
debug = false,
messages = {
help = "一、二、三、らーめん缶! Hello, I am a ramen vending machine. " ..
"Please type a code for service: {{codes}} " ..
"Support: +81 012-700-1MIO どうぞめしあがれ。ヾ(^ω^ )",
join = ". . . aaand we're in! (*´∇`*)",
part = "Okay, okay, I'll leave. (´・ω・`)",
ping = "ポーン!",
quit = "noodling off",
reload = "Ramen matrix reloaded! (´∀`)",
},
errors = {
no_perm = "Can ... not, {{user}}. Sorry. " ..
"I'll get in hot water for that! Σ(°△°|||)︴",
notify_no_perm = "{{user}} attempted to use service code: {{code}}",
ns_auth_failed = "Error: Nickserv identification failed.",
sasl_auth_failed = "Error: SASL authentication failed.",
unknown_code = "What's that? Doesn't sound very noodly to me. (´・ω・`)?",
},
}
-- Custom variables
itte_config.ramen = ramen
itte_config.messages.serve = "{{ramen}} ⊂(・▽・⊂)"
itte_config.messages.special = "**SPECIAL!!!** {{ramen}} " ..
"☆*:・゚ o(^ ∀ ^ o)"
itte_config.messages.water = {
"\x01ACTION happily pours the hot liquid into a bowl of noodles " ..
"and offers it to {{user}}\x01",
"Cheers! 自o^_^ ",
"Water Level [/////////] 200% - Thanks! (^▽^ )",
"Thanks. Some people say I have a CRABby tempeRAMENt. I wonder why. " ..
"´-` ",
"Q. What do you call noodles made from the core of a tree? " ..
"A. DuRAMEN. *ba dum tss* ┐('∀`)┌",
"Q. What do you call noodles eaten on bulletin boards? " ..
"A. FoRAMEN. *ba dum tss* ┐('∀`)┌",
"Q. What kind of noodles can be found at TV stations? " ..
"A. CameRAMEN. *ba dum tss* ┐('∀`)┌",
"Ramen time anytime! 自o(´▽` )/",
}
-- ---------------------------------------------------------------------------
-- Handlers
-- ---------------------------------------------------------------------------
local irc = require("itte")
local h = {}
-- Serve ramen.
function h.ramen(cxt, msg)
-- 1% chance of special set
local roll = math.random(1, 100)
if roll == 77 then
irc.message(cxt, { msg.reply_to },
string.gsub(itte_config.messages.special, "{{ramen}}",
ramen.make_ramen("veg_special")))
else
irc.message(cxt, { msg.reply_to },
string.gsub(itte_config.messages.serve, "{{ramen}}",
ramen.make_ramen("veg")))
end
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")))
else
irc.message(cxt, recipients, string.gsub(itte_config.messages.serve,
"{{ramen}}", ramen.make_ramen("meat")))
end
end
-- Show help message.
function h.rollcall(cxt, msg)
irc._h.help(cxt, msg)
end
-- Reply with a random joke or link.
function h.water(cxt, msg)
local roll = math.random(1, 2)
local resp = util.pick(itte_config.messages.water)[1]
if roll == 2 then
resp = util.pick(itte_config.ramen.links)[1]
end
-- Replace user placeholder if present
if util.is_substr(resp, "{{user}}") then
resp = string.gsub(resp, "{{user}}", msg.sender)
end
irc.message(cxt, { msg.reply_to }, resp)
end
-- Serve ramen at the interval specified in the config.
function h.th_ramen(cxt, task)
h.ramen(cxt, task)
end
itte_handlers = h