Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Basic website code to be run by user; by PaymentOption --
- VERSION = "ALPHA"
- ------------------------------------------------------------
- -- VARS --
- tArgs = { ... }
- server = tArgs[1]
- selection = 1
- ----------
- -- Helper Functions --
- function cPrint(height, string)
- local w, h = term.getSize()
- local xPosition = w/2 - string.len(string)/2
- term.setCursorPos(xPosition, height)
- term.write(string)
- end
- function rPrint(height, string)
- local w,h = term.getSize()
- local xPos = w - string.len(string)
- term.setCursorPos(xPos, height)
- term.write(string)
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- ----------------------
- -- Networking related functions --
- function disconnect(server)
- rednet.send(tonumber(server), "disconnect")
- fs.delete("NeXuS/Website/"..tostring(server).."/code")
- clear()
- clear()
- shell.run("browser")
- end
- ----------------------------------
- -- Menues and other screens --
- function printMenu()
- cPrint(1, "NeXuS Test Website")
- rPrint(16, "Version: "..VERSION)
- if selection == 1 then cPrint(6, "[Other Function]")
- else cPrint(6, " Other Function ") end
- if selection == 2 then cPrint(7, " [Disconnect] ")
- else cPrint(7, " Disconnect ") end
- end
- ------------------------------
- while true do
- clear()
- printMenu()
- event, key = os.pullEvent("key")
- if key == 200 and selection > 1 then selection = selection-1
- elseif key == 208 and selection < 2 then selection = selection+1
- end
- if key == 28 and selection == 1 then clear(); cPrint(6, "DAFUQ DID I JUST SAY?!"); sleep(1.3)
- elseif key == 28 and selection == 2 then disconnect(server)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment