Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local homepage = "home";
- local website = "luit03.nl";
- 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 = ""
- local function openRednet()
- local listOfSides = rs.getSides()
- local listofPossibles = {}
- local counter1 = 0
- while true do
- counter1 = counter1 +1
- if peripheral.isPresent(tostring(listOfSides[counter1])) and peripheral.getType(listOfSides[counter1]) == "modem" then
- table.insert(listofPossibles,tostring(listOfSides[counter1]))
- end
- if counter1 == 6 and table.maxn(listofPossibles) == 0 then
- print("no wifi present")
- return nil
- end
- if counter1 == 6 and table.maxn(listofPossibles) ~= 0 then
- rednet.open(listofPossibles[1])
- return listofPossibles[1]
- end
- end
- end
- modemOn = openRednet()
- 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")
- 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()
Advertisement
Add Comment
Please, Sign In to add comment