]> git.lizzy.rs Git - furrybot.git/blob - random.lua
d828ac31b3f1c2ec01baf683ae6ad063c01e317c
[furrybot.git] / random.lua
1 local http, env, storage
2 local C = minetest.get_color_escape_sequence
3
4 function furrybot.commands.rolldice(name)
5         furrybot.ping_message(name, "rolled a dice and got a " .. furrybot.random(1, 6, furrybot.colors.system) .. ".", furrybot.colors.system)
6 end
7
8 function furrybot.commands.coinflip(name)
9         furrybot.ping_message(name, "flipped a coin and got " .. furrybot.choose({"Heads", "Tails"}, furrybot.colors.system) .. ".", furrybot.colors.system)
10 end
11
12 function furrybot.commands.choose(name, ...)
13         local options = {...}
14         if #options > 1 then
15                 furrybot.ping_message(name, "I choose " .. furrybot.choose(options, "", furrybot.colors.system) .. ".", furrybot.colors.system)
16         else
17                 furrybot.error_message(name, "Not enough options")
18         end
19 end
20
21 function furrybot.commands.uwu()
22         local msg = ""
23
24         local m = math.random(10)
25
26         for i = 1, m do
27                 local u_list = {"u", "ü", "o", "ö"}
28
29                 local u = u_list[math.random(#u_list)]
30                 local w = "w"
31
32                 if math.random() < 0.5 then
33                         u = u:upper()
34                 end
35
36                 if math.random() < 0.5 then
37                         w = w:upper()
38                 end
39
40                 msg = msg .. u .. w .. u
41
42                 if i ~= m then
43                         msg = msg .. " "
44                 end
45         end
46
47         furrybot.send(msg, furrybot.colors.system)
48 end
49
50 function furrybot.commands.extinct(name, species)
51         if species then
52                 furrybot.ping_message(name, species:sub(1, 1):upper() .. species:sub(2, #species) .. (species:sub(#species, #species):lower() == "s" and "" or "s") .. " are " .. (furrybot.strrandom(species, 420, 0, 1) == 0 and "not " or "") .. "extinct." , furrybot.colors.system)
53         else
54                 furrybot.error_message(name, "You need to specify a species")
55         end
56 end
57
58 function furrybot.commands.german(name)
59         local messages = {
60                 "Schnauze!",
61                 "Sprich Deutsch, du Hurensohn!",
62                 "NEIN NEIN NEIN NEIN NEIN NEIN",
63                 "Deine Mutter",
64                 "Das war ein BEFEHL!",
65                 "Das bleibt hier alles so wie das hier ist!",
66                 "Scheißße",
67                 "Digga was falsch bei dir",
68                 "Lass mich deine Arschfalten sehen",
69                 "Krieg mal deinen Ödipuskomplex unter Kontrolle",
70                 "Meine Nudel ist 30cm lang und al dente",
71                 "Wie die Nase eines Mannes, so auch sein Johannes.",
72         }
73
74         local msg = messages[math.random(#messages)]
75         local stripe = math.floor(#msg / 3)
76
77         furrybot.ping_message(name, msg:sub(1, stripe) .. C("red") .. msg:sub(stripe + 1, stripe * 2) .. C("yellow") .. msg:sub(stripe * 2 + 1, #msg), C("black"))
78 end
79
80 return function(_http, _env, _storage)
81         http, env, storage = _http, _env, _storage
82 end