your explanation doesn't make sense I'll try to work with it.
Ok lets see if I can explain
First, I'd bet you have experience in another coding language. Just out of curiosity, what is it?
Second, I don't have any experience with the io API. Can we please switch to the fs api? It is really similar.
*assuming you said 'ok'*
So, with the fs API, first you need to open the file (I think its the same as the io API for this)
local file = fs.open("filename","w") --#'w' is obviously write mode, and 'filename' is the path.
Then you can write stuff in the file:
file.write("hi")
file.write("test")
If you did that, the file would just be 'hitest' because you didn't tell it to go to a new line.
To do that, use the new line thing (cant remember name): \n
So then this:
file.write("hi\n")
file.write("test")
Would put 'hi' and 'test' on two lines
You can also use multi-line strings with brackets: [[]]
file.write([[
hi
test
]])
This will also put 'hi' and 'test' on two lines.
In this case, you don't need the \n, because it pretty much just copies what you write.
Finally, you need to save and close the file.
file.close()
You can use 'file.flush()' to save it too, but that won't close it, so you can continue to add to the file.
Sorry if this is long, but hopefully it helped!
so, would this code work? (i cant test it right now :s)
term.clear()
term.setCursorPos(1, 1)
print("Set Shell to Client or Server?")
soc = read()
local startup = fs.open("startup", "w")
if soc == client then
fs.write("shell.setDir("disk")\n")
fs.write("local monitor = peripheral.wrap( "top" )\n")
fs.write("term.clear()\n")
fs.write("term.setCursorPos(1, 1)\n")
fs.write("monitor.setTextColor(colors.blue)\n")
fs.write("monitor.write("LazyOS v1.0 Client")\n")
fs.write("term.setTextColor(colors.blue)\n")
fs.write("print("LazyOS v1.0 Client")\n")
fs.write("term.setTextColor(colors.red)\n")
fs.write("print("Work in progress!")")
elseif soc == server then\n")
fs.write("shell.setDir("disk")\n")
fs.write("local monitor = peripheral.wrap( "top" )\n")
fs.write("term.clear()\n")
fs.write("term.setCursorPos(1, 1)\n")
fs.write("monitor.setTextColor(colors.orange)\n")
fs.write("monitor.write("LazyOS v1.0 Server")\n")
fs.write("term.setTextColor(colors.orange)\n")
fs.write("print("LazyOS v1.0 Server")\n")
fs.write("term.setTextColor(colors.red)\n")
fs.write("print("Work in progress!")")
else
term.clear()
term.setCursorPos(1, 1)
term.setTextColor(colors.red)
print("Incorrect Choice")
sleep(4)
os.reboot