Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local name = "laserconfig"
- local adaptername = "laser_amplifier"
- local component = require("component");
- local filesystem = require("filesystem");
- local serial = require("serialization");
- local term = require("term");
- local gpu = component.gpu
- gpu.setResolution(114,42)
- local w, h = gpu.getResolution();
- gpu.setForeground(0xC8DC46)
- gpu.setBackground(0x252525)
- gpu.fill(1, 1, w, h, " ");
- term.setCursorBlink(false);
- function fwrite(text)
- local file = io.open("/home/"..name.."/config","a")
- file:write(serial.serialize(text).."\n")
- file:close()
- end
- filesystem.remove("/home/"..name.."/")
- filesystem.makeDirectory("/home/"..name.."/")
- for address, type in component.list(adaptername) do
- print("Which number is this address: ".. address)
- local i = tonumber(io.read())
- fwrite(";"..i..";"..address)
- end
- os.exit()
- adaptername = "flux_gate"
- for address, type in component.list(adaptername) do
- fwrite(address)
- end
Add Comment
Please, Sign In to add comment