diff --git a/API/tools.lua b/API/tools.lua index 4b68a14..0472563 100644 --- a/API/tools.lua +++ b/API/tools.lua @@ -133,6 +133,10 @@ function tools.fumoLines() return(fumoFile) end +function tools.fumoClone() + os.execute("/bin/bash fumoCopy.sh") +end + function tools.fumoList() local lineList = tools.fumoLines() local fumoList = {} @@ -144,7 +148,6 @@ function tools.fumoList() fumoList[number]=file:read() end file:close() - print(fumoList[1]) return(fumoList) end diff --git a/commands/complexCommands.lua b/commands/complexCommands.lua index 555f608..bd85d30 100644 --- a/commands/complexCommands.lua +++ b/commands/complexCommands.lua @@ -25,6 +25,18 @@ local commands = { -- Define commands its a table that will contain our commands end }; +[prefix..'fumo'] = { -- To be implemented later.. +exec = function (message) + local fumoLines = tools.fumoLines() + local fumoList = tools.fumoList() + tools.fumoClone() + tools.seed() + local fumo = fumoList[math.random(fumoLines)] + local msg = "https://broken-moon.net/"..fumo + message.channel:send(msg) +end +}; + --[[ [prefix..'figlet'] = { -- Parrots input to figlet, then echos it to the same channel you are in. exec = function (message) diff --git a/commands/experimentalCommands.lua b/commands/experimentalCommands.lua index 405be3e..2265cf9 100644 --- a/commands/experimentalCommands.lua +++ b/commands/experimentalCommands.lua @@ -10,13 +10,6 @@ local commands = { -- Define commands its a table that will contain our commands end }; -[prefix..'fumo'] = { -- To be implemented later.. -exec = function (message) - local fumoLines = tools.fumoLines() - local fumoList = tools.fumoList() -end -}; - } function experimentalCommands.initialize() diff --git a/fumoCopy.sh b/fumoCopy.sh index fb49349..dd8da49 100755 --- a/fumoCopy.sh +++ b/fumoCopy.sh @@ -1 +1,2 @@ -echo "$(cp fumo/* /var/www/html/fumo)" \ No newline at end of file +echo "$(rm /var/www/html/fumo/*)" +echo "$(cp fumo/*.gif /var/www/html/fumo)" \ No newline at end of file