~jordanreger/cc

51b7c72cb90209cd5c2d9685da5c964a9d2df461 — Jordan Reger 3 months ago 757a3ad main
feat(xNet): initial commit
4 files changed, 34 insertions(+), 1 deletions(-)

M xIndustries/Inventory/get.lua
A xNet/init.lua
A xNet/startup.lua
A xNet/xNet/main.lua
M xIndustries/Inventory/get.lua => xIndustries/Inventory/get.lua +1 -1
@@ 1,4 1,4 @@
rednet.open("left")
rednet.open("right")

local inventory = {
    ["minecraft:cooked_beef"] = vector.new(677, 95, 724),

A xNet/init.lua => xNet/init.lua +31 -0
@@ 0,0 1,31 @@
-- check for xNet directory
if not fs.exists("/xNet") then
    fs.makeDir("/xNet")
end

-- check for necessary files
if not fs.exists("/xNet/computer_name.txt") then
    local computer_name_file = fs.open("/xNet/computer_name.txt", "w")
    local computer_name = ""
    
    if os.computerLabel ~= nil then
        computer_name = os.computerLabel()
    else
        computer_name = os.computerID()
    end

    computer_name_file.write(computer_name)
    computer_name_file.close()
end

if not fs.exists("/xNet/main.lua") then
    local main_file = fs.open("/xNet/main.lua", "w")
    local get_main_file = http.get("https://git.sr.ht/~jordanreger/cc")

    main_file.write(get_main_file.readAll())

    main_file.close()
end

-- all good! run main process
shell.run("/xNet/main.lua")
\ No newline at end of file

A xNet/startup.lua => xNet/startup.lua +1 -0
@@ 0,0 1,1 @@
shell.run("init")
\ No newline at end of file

A xNet/xNet/main.lua => xNet/xNet/main.lua +1 -0
@@ 0,0 1,1 @@
print("xNet")
\ No newline at end of file