Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cPrint = function(text)
- local x2,y2 = term.getCursorPos()
- local x,y = term.getSize()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- textutils.slowPrint(text)
- end
- cPrint2 = function(text)
- local x2,y2 = term.getCursorPos()
- local x,y = term.getSize()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- print(text)
- end
- term.clear()
- term.setCursorPos(1,1)
- cPrint("Hello, welcome to NYT head computer.")
- while true do
- cPrint("Enter editor name")
- EN = read()
- if fs.exists("Editors/" ..EN) == true then
- file = fs.open("Editors/" ..EN, "r")
- local fileData = {}
- local line = file.readLine()
- repeat
- table.insert(fileData,line)
- line = file.readLine()
- until line == nil
- file.close()
- local PassFile = fileData[1]
- break
- else
- cPrint("No Editor Found... Create One?")
- sleep(1)
- yyN()
- end
- end
- local PW = false
- repeat
- cPrint("Please insert Password")
- local pss = read()
- if pss == PassFile or PW then
- cPrint("Welcome!")
- break
- else
- cPrint("Wrong Pass..")
- end
- until pss == PassFile
- -----Start Buttons----------------
- os.loadAPI("gridAPI")
- local bob = true
- local run = true
- gridAPI.setRowCount(3) --three rows, holla
- gridAPI.setColumnCount(2) --Only 2 Colums? Lame
- gridAPI.setWindowColor(colors.black) --Window is black,racist
- local mainButton = gridAPI.Button:new() --Look, a fuction
- mainButton.name = "mainButton" --You too were named at birth
- mainButton.text = "RedNet" --It's the text
- mainButton.textColor = colors.black --Again, text color is racist
- mainButton.backColor = colors.red --The button is red now
- mainButton.gridX = 1 --You got me. Idk what this is
- mainButton.gridY = 1 --Still don't know...
- local Monitor = gridAPI.Button:new()
- Monitor.name = "Monitor"
- Monitor.text = "Monitor Controls"
- Monitor.textColor = colors.black
- Monitor.backColor = colors.red
- Monitor.gridX = 1
- Monitor.gridY = 3
- function mainButton:leftClicked()
- bob = false
- run = false
- end
- function Monitor:leftClicked()
- self.text = "No"
- end
- -- local updateCount = 0 --obviously updateCount is 0
- -- function mainButton:asyncUpdate() --wat
- -- updateCount = updateCount + 1 --So it updated I think
- -- self.text = "Right click to see the truth(" ..updateCount .. ")" --Oh I get it it's a time
- -- end
- local color = {
- colors.white,
- colors.blue,
- colors.green,
- colors,red,
- colors.orange,
- colors.pink }
- gridAPI.addButton(mainButton)
- gridAPI.addButton(Monitor)
- while run do
- gridAPI.handleEventAsync()
- end
- while not run and not bob do
- shell.run("rednet")
- break
- end
- term.clear()
- term.setCursorPos(1,1)
Advertisement
Add Comment
Please, Sign In to add comment