Browse Source

Changes to mode.lua, namely it is no longer mode.lua simply mode, as it has no need to be a lua file.

pull/5/head
Astoria Floyd 2 years ago
parent
commit
d4ecdae66a
  1. 3
      .gitignore
  2. 20
      API/tools.lua
  3. 2
      docs/mode.lua

3
.gitignore

@ -7,4 +7,5 @@ docs/reinitialize.lua
docs/mode.lua
docs/reinitialize.lua
docs/key.lua
docs/token.lua
docs/token.lua
docs/mode

20
API/tools.lua

@ -34,12 +34,12 @@ function tools.initialize()
end
end
--Sets mode.lua
--Sets mode
function tools.setMode(mode)
local file = io.open("./docs/mode.lua", "r+")
local file = io.open("./docs/mode", "r+")
io.input(file)
io.output(file)
file:seek("set", 7)
file:seek("set", 0)
if mode == "test" then
file:write("'test' ")
elseif mode == "normal" then
@ -52,14 +52,18 @@ function tools.setMode(mode)
end
function tools.getMode()
local file = io.open("./docs/mode.lua", "r")
local file = io.open("./docs/mode", "r+")
io.input(file)
file:seek("set", 7)
file:seek("set", 0)
local mode = file:read()
file:close()
mode = mode:gsub("%s+", "")
mode = mode:gsub("'", "")
return mode
if mode then
mode = mode:gsub("%s+", "")
mode = mode:gsub("'", "")
return mode
else
return "normal"
end
end
--Sets if we should reinitialize.

2
docs/mode.lua

@ -1,2 +0,0 @@
return 'normal'
--normal or test
Loading…
Cancel
Save