-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcoin.lua
More file actions
42 lines (39 loc) · 875 Bytes
/
coin.lua
File metadata and controls
42 lines (39 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function shuffleArray(array)
randseed = os.time()
math.randomseed(randseed)
local arrayCount = #array
for i = arrayCount, 2, -1 do
local j = math.random(1, i)
array[i], array[j] = array[j], array[i]
end
return array
end
local intro_words = {
"Безусловно ",
"Вероятно, ",
"Видимо, ",
"Все-таки, ",
"Думается, ",
"Кажется, ",
"Конечно, ",
"Наверное, ",
"Непременно ",
"Несомненно, ",
"Очевидно, ",
"Разумеется, ",
"Скорее всего, "
}
function run(msg, matches)
intro = shuffleArray(intro_words)
choice = matches[math.random(2)]
return intro_words[1]..choice
end
return {
description = "Coin!",
usage = "!coin [one] or [another]",
patterns = {
"(.*) !или (.*)",
"(.*) !or (.*)"
},
run = run
}