Updated localization files

pull/1/head
Astoria Floyd 3 years ago
parent 7639c9309c
commit 1e3017b4f6

@ -0,0 +1,6 @@
{
"Lua.diagnostics.globals": [
"messagepart2",
"messagePart2"
]
}

@ -3,17 +3,16 @@ local tools = require("./tools.lua")
function rng.d20() function rng.d20()
tools.reseed() tools.reseed()
dice = math.random(20) local dice = math.random(20)
messagePart1 = ('You rolled a ' .. dice .. ' out of 20') local messagePart1 = ('You rolled a ' .. dice .. ' out of 20')
messagepart2 = ""
if dice==20 then if dice==20 then
messagePart2 = ('Nat 20! Crititcal Hit') messagePart2 = ('Nat 20! Crititcal Hit')
else if dice==1 then else if dice==1 then
messagePart2 = ('Nat 1! Critical Shit!') messagePart2 = ('Nat 1! Critical Shit!')
else
messagePart2 = ""
end end
end end
message = messagePart1 .. '\n' .. messagePart2 local message = messagePart1 .. '\n' .. messagePart2
return message return message
end end

@ -2,21 +2,21 @@ local tools = {}
function tools.reseed() function tools.reseed()
seed = os.time() local seed = os.time()
math.randomseed(seed) math.randomseed(seed)
end end
function tools.printFile(file) function tools.printFile(file)
rawFile = io.open(file, r) local rawFile = io.open(file, r)
message = rawFile:read("*all") local message = rawFile:read("*all")
rawFile:close() rawFile:close()
return message return message
end end
function tools.messageDectection(message, search) function tools.messageDectection(message, search)
distinctMessage = message.content local distinctMessage = message.content
key = "!" local key = "!"
keyedSearch = key .. search local keyedSearch = key .. search
if string.find(distinctMessage, keyedSearch) == 1 then if string.find(distinctMessage, keyedSearch) == 1 then
return true return true
else else

Loading…
Cancel
Save