Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---- By: Goodle
- -- Variables
- width,height = term.getSize()
- CnWidth = width / 2
- CnHeight = height / 2
- time = os.time()
- formattedTime = textutils.formatTime( time, false)
- isMenu = false
- isDesktop = false
- isStartup = false
- -- Functions
- message = function()
- term.clear()
- messageis=true
- term.setCursorPos(1,1)
- term.setTextColor( colors.red )
- local response = http.get("http://pastebin.com/raw.php?i=FWci8qcj")
- local file = fs.open( "tiat", "w" )
- file.write( sResponse )
- file.close()
- while messageis==true do
- local event, keyPressed = os.pullEvent('key')
- if keyPressed == 15 then
- messageis=false
- end
- end
- term.clear()
- end
- startup = function()
- isStartup = true
- term.clear()
- term.setCursorPos(CnWidth-5,height-1)
- term.setTextColour( colours.blue )
- term.write("GoCraftOS by")
- term.setCursorPos(CnWidth-7,height)
- term.write("Goodle Software")
- term.setCursorPos(CnWidth-3,CnHeight-1)
- term.setTextColour( colours.lightBlue )
- term.write("Loading")
- term.setCursorPos(CnWidth-6,CnHeight)
- term.write(";")
- term.setCursorPos(CnWidth+6,CnHeight)
- term.write(";")
- term.setBackgroundColour( colours.black )
- term.setCursorPos(CnWidth,CnHeight+1)
- term.write('0%')
- sleep(1)
- paintutils.drawLine(CnWidth-5,CnHeight, CnWidth,CnHeight, colours.green )
- term.setBackgroundColour( colours.black )
- term.setCursorPos(CnWidth-1,CnHeight+1)
- term.write("50%")
- sleep(0.5)
- paintutils.drawLine(CnWidth,CnHeight, CnWidth+4,CnHeight, colours.green )
- term.setBackgroundColour( colours.black )
- term.setCursorPos(CnWidth-1,CnHeight+1)
- term.clearLine()
- term.write("78%")
- sleep(0.3)
- term.setCursorPos(CnWidth-1,CnHeight+1)
- term.clearLine()
- term.write("80%")
- sleep(0.5)
- paintutils.drawLine(CnWidth+4,CnHeight, CnWidth+5,CnHeight, colours.green )
- term.setBackgroundColour( colours.black )
- term.setCursorPos(CnWidth-1,CnHeight+1)
- term.clearLine()
- term.write("100%")
- term.setCursorPos(CnWidth-3,CnHeight-1)
- term.clearLine()
- term.setBackgroundColour( colours.black )
- term.write("Welcome!")
- sleep(3)
- isStartup = false
- desktop()
- end
- desktop = function()
- isDesktop = true
- term.clear()
- pixelsDown = 1
- pixelsDownLimit = height
- -- Desktop drawing
- while pixelsDown ~= height
- do paintutils.drawLine(1,pixelsDown, width,pixelsDown, colours.white )
- pixelsDown = pixelsDown + 1
- end
- paintutils.drawLine(1,height, width,height, colours.blue )
- term.setCursorPos(1,height)
- term.setTextColour( colours.white )
- term.setBackgroundColour( colours.lime )
- term.write(' menu ')
- -- Clock Drawing
- term.setCursorPos(width-6,height)
- term.setTextColour( colours.white )
- term.setBackgroundColour( colours.blue )
- term.write(formattedTime)
- -- Text Input Impeder
- while isDesktop == true do
- term.setBackgroundColour( colours.white )
- term.setCursorPos(1,1)
- term.setTextColour( colours.white )
- read(" ")
- local event, keyPressed = os.pullEvent('key')
- if keyPressed == 15 then
- break
- end
- end
- end
- drawWindow = function()
- term.clear()
- end
- drawMenu = function()
- isMenu = true
- local menuPD = 1 -- Menu pixels down
- local menuPDL = height -- Menu pixels down limit
- local menuPUL = height-10 -- Menu pixels up limit
- -- Menu pixels right limit is = 15
- while menuPD < menuPDL do
- paintutils.drawLine(1, menuPUL, 15, menuPUL, colors.blue )
- menuPUL = menuPUL + 1
- menuPD = menuPD + 1
- end
- term.setCursorPos(1,height)
- term.setTextColour( colours.white )
- term.setBackgroundColour( colours.green )
- term.write(" menu ")
- while isMenu == true do
- local event, keyPressed2 = os.pullEvent("key")
- if keyPressed2 == 15 then
- isMenu = false
- desktop()
- break
- end
- end
- end
- -- Program execution
- message()
- startup()
- drawMenu()
- while isDesktop == true do
- drawMenu()
- end
Advertisement
Add Comment
Please, Sign In to add comment