Test = "Hello"
Print(Test)?
mkdir websites or in lua fs.makeDir("websites")
accessing it
/websites/filename or in lua fs.open("websites/filename")
mkdir websites or in lua fs.makeDir("websites")
accessing it
/websites/filename or in lua fs.open("websites/filename")
fs.open("filename", "w")
io.write("hello")
io.open("filename", "w+")
io.write("hello")
Should be something likefs.open("filename", "w") io.write("hello")
orio.open("filename", "w+") io.write("hello")
local homepage = "home";
local website = "www.newsite.com";
local nw = "";
local idd = os.computerID()
local port1 = idd * 32
local port2 = 0
local port3 = port2 / 32
local line1 = "This website is currently down or has not been edited. If you are the owner of this website please check your webservers or contact your webserver manager for further assistance."
local line2 = ""
local line3 = ""
local line4 = ""
local line5 = ""
rednet.open("right")
rednet.open("left")
rednet.open("front")
rednet.open("back")
local function cPrint(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
print(text)
end
function home()
print("Welcome to RedNet explorer! This requires you to have a wireless modem on the right side of your computer. This is the default homepage. A homepage option might be added in 1.2")
print("Host a website at: ")
print("www.newsite.com! ")
print(" -ComputerCraftFan11 ")
end
function newsite()
cPrint("Rednet Site Manager")
print("")
print("Welcome to the rednet site manager!")
print("To make a new website, enter a domain name (.com will NOT be added for you.):")
end
function newsite2()
cPrint("Rednet Site Manager")
print("")
print("People can connect to this site by going to www." ..nw.. "")
print("You can edit this site by going to www." ..nw.. "/editor/" ..idd)
id, message = rednet.receive()
if message == "www." ..nw.. "" then -- If someone tries to connect, it will send back the website
sleep(1)
rednet.send(id, line1)
rednet.send(id, line2)
rednet.send(id, line3)
rednet.send(id, line4)
rednet.send(id, line5)
elseif message == "www." ..nw.. "/editor/" ..idd then -- If someone tries to connect, it will send back the website
sleep(1)
rednet.send(id, "epanst")
else
line1 = message
id, message = rednet.receive()
line2 = message
id, message = rednet.receive()
line3 = message
id, message = rednet.receive()
line4 = message
id, message = rednet.receive()
line5 = message
end
drawScreen()
end
function drawScreen()
term.clear()
term.setCursorPos(1,1)
cPrint("Rednet Explorer 1.2")
cPrint("rdnt://"..website)
print("")
if website == "www.newsite.com" then
newsite()
elseif website == "www.newsite.com/nsite/index.php?/" then
newsite2()
else
write("Port:")
port = read()
port2 = port
port3 = port2 / 32
end
print("")
if website == "www.newsite.com" then
write("www.")
nw = read()
newsite = nw
website = "www.newsite.com/nsite/index.php?/"
drawScreen()
end
end
drawScreen()
I think it's easier just to copy the file: fs.copy("path/filename", "path/newFilename")