1 local http, env, storage
2 local C = minetest.get_color_escape_sequence
9 function furrybot.get_waifu_name()
10 local state = math.random() < 0.5
11 local r = math.random(3, 8)
15 local tbl = state and furrybot.alphabeth.vowels or furrybot.alphabeth.consonants
16 str = str .. tbl[math.random(#tbl)]
21 return furrybot.uppercase(str)
24 function furrybot.random_distribution(tbl)
28 for i, v in ipairs(tbl) do
33 local r = math.random(accum)
35 for i, v in ipairs(tbl) do
42 function furrybot.get_waifu_species()
43 return furrybot.random_distribution({
52 {"Apache Helicopter", 1},
53 {"C++ Programmer", 1},
57 function furrybot.get_waifu_gender()
58 return furrybot.random_distribution({
65 function furrybot.get_waifu_hair()
66 return furrybot.random_distribution({
67 {{"Brown", "#DDAE92"}, 25},
68 {{"Black", "#433F3A"}, 25},
69 {{"Blonde", "#ECC87E"}, 20},
70 {{"Red", "#E2887F"}, 10},
74 function furrybot.get_waifu_eyes()
75 return furrybot.random_distribution({
76 {{"Brown", "#463230"}, 15},
77 {{"Blue", "#97C6FE"}, 10},
78 {{"Green", "#36CC4E"}, 5},
82 function furrybot.get_waifu_age()
83 local agetab = furrybot.random_distribution({
84 {{200, 600}, 25}, -- deamon
85 {{1000, 2000}, 5}, -- next level deamon
86 {{12, 16}, 50}, -- teen loli
87 {{18, 19}, 5}, -- legal loli
88 {{5, 9}, 5}, -- true loli
92 return agetab and math.random(agetab[1], agetab[2])
95 function furrybot.get_waifu(id)
96 id = id or math.random(0, 32767)
102 name = furrybot.get_waifu_name(),
103 species = furrybot.get_waifu_species(),
104 gender = furrybot.get_waifu_gender(),
105 hair = furrybot.get_waifu_hair(),
106 eyes = furrybot.get_waifu_eyes(),
107 age = furrybot.get_waifu_age(),
110 math.randomseed(os.time() + os.clock() + math.random())
115 furrybot.commands.waifu = {
116 func = function(name, id)
117 local waifu = furrybot.get_waifu(tonumber(id or ""))
118 furrybot.send(waifu.name
119 .. furrybot.colors.system .. (waifu.species and " | Species: " .. furrybot.colors.random .. waifu.species or "")
120 .. furrybot.colors.system .. " | Age: " .. furrybot.colors.random .. (waifu.age or "Unknown")
121 .. furrybot.colors.system .. " | Gender: " .. furrybot.colors.random .. waifu.gender
122 .. furrybot.colors.system .. " | " .. C(waifu.hair[2]) .. waifu.hair[1] .. furrybot.colors.system .. " Hair"
123 .. furrybot.colors.system .. " | " .. C(waifu.eyes[2]) .. waifu.eyes[1] .. furrybot.colors.system .. " Eyes"
124 .. furrybot.colors.system .. " | " .. "#" .. waifu.id .. ""
125 , furrybot.colors.random)
129 return function(_http, _env, _storage)
130 http, env, storage = _http, _env, _storage
142 local f = env.io.open("clientmods/furrybot/LICENSE", "r")
143 local src = f:read("*a")
146 local c = src:sub(i, i):lower()
148 if c:byte(1) >= bounds:byte(1) and c:byte(1) <= bounds:byte(2) then
149 table.insert(is_vowel[c] and furrybot.alphabeth.vowels or furrybot.alphabeth.consonants, c)