IOFile
Description
-----------------------------------------------------------------------------
Installation
Copy one of these commands into your ComputerCraft terminal:
wget:
wget https://raw.githubusercontent.com/Caitlin-Sykes/ComputerCraft-Scripts/main/PlayerLog/IOFile.lua iofileArchive:
wget https://cc.shobie.xyz/cc/get/gh-Caitlin-Sykes-ComputerCraft-Scripts-playerlog-iofile iofile
Quick Install:
wget https://cc.shobie.xyz/cc/get/gh-Caitlin-Sykes-ComputerCraft-Scripts-playerlog-iofile IOFile
Usage
Run: IOFile
Tags
Source
View Original SourceCode Preview
-- -----------------------------------------------------------------------------
-- I/O Stuff
-- -----------------------------------------------------------------------------
-- Opens a file in append mode
function OpenFile()
return fs.open(PATH, "a")
end
-- Closes a file
function CloseFile(file)
file.close()
end
-- Writes to a file
function WriteFile(msg)
file = OpenFile()
file.writeLine(msg)
CloseFile(file)
end
-- -----------------------------------------------------------------------------
-- I/O Stuff
-- -----------------------------------------------------------------------------
-- Path to logging directory
PATH = "/logger/log.txt"