updated stuff

This commit is contained in:
Julian Brammer 2024-06-02 01:29:56 +02:00
parent ba3540d861
commit 647ff9c32d
2 changed files with 8 additions and 8 deletions

View File

@ -1,27 +1,27 @@
function clear_display() function clearDisplay()
term.clear() term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
end end
function write_to_file(file, content) function writeToFile(file, content)
file = fs.open(file, "w") file = fs.open(file, "w")
file.write(content) file.write(content)
file.close() file.close()
end end
function append_to_file(file, content) function appendToFile(file, content)
file = fs.open(file, "a") file = fs.open(file, "a")
file.write(content) file.write(content)
file.close() file.close()
end end
function append_to_file_nl(file, content) function appendToFileNl(file, content)
file = fs.open(file, "a") file = fs.open(file, "a")
file.writeLine(content) file.writeLine(content)
file.close() file.close()
end end
function read_file_oneline(file) function readFileOneline(file)
file = fs.open(file, "r") file = fs.open(file, "r")
data = file.readLine() data = file.readLine()
file.close() file.close()
@ -29,7 +29,7 @@ function read_file_oneline(file)
return data return data
end end
function read_file_all(file) function readFileAll(file)
file = fs.open(file, "r") file = fs.open(file, "r")
if (file == nil) then if (file == nil) then
print("File does not exist.") print("File does not exist.")
@ -40,7 +40,7 @@ function read_file_all(file)
return data return data
end end
function split_string_to_array(input_str) function splitStringToArray(input_str)
table = {} table = {}
i = 0 i = 0
for str in string.gmatch(input_str, "([^"..",".."]+)") do for str in string.gmatch(input_str, "([^"..",".."]+)") do

View File

@ -44,7 +44,7 @@ local function getState()
turtleState["script"] = "main/programs/turtle-miner-fibo.lua" turtleState["script"] = "main/programs/turtle-miner-fibo.lua"
turtleState["info"] = "" turtleState["info"] = ""
turtleState["fuelLevel"] = turtle.getFuelLevel() turtleState["fuelLevel"] = turtle.getFuelLevel()
trutleState["dataCurrentFibo"] = 2 turtle["dataCurrentFibo"] = 2
turtleState["dataGoalRows"] = 0 turtleState["dataGoalRows"] = 0
turtleState["dataGoalPathProgress"] = 0 turtleState["dataGoalPathProgress"] = 0
turtleState["dataCurrentRow"] = 0 turtleState["dataCurrentRow"] = 0