Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local shell = require("shell")
- local function terminal()
- local component = require("component")
- local xorg = component.gpu
- local term = require("term")
- local shell = require("shell")
- local colors = require("colors")
- local w, h = xorg.getResolution()
- xorg.setBackground(0xeeeFFF)
- xorg.setForeground(0xFFFFFF)
- xorg.fill(1, 1, w, h, " ")
- term.setCursor(1, 1)
- print("tde terminal emulator")
- while true do
- xorg.setForeground(0xFFFFFFe)
- io.write("> ")
- xorg.setForeground(0xFFFFFF)
- cmd = io.read()
- if cmd == "exit" then
- break
- else
- shell.execute(cmd)
- end
- end
- end
- local function menu()
- terminal_icon_1 = {
- " ",
- " ",
- " ",
- " >_ ",
- " "
- }
- local component = require("component")
- local xorg = component.gpu
- local colors = require("colors")
- local term = require("term")
- local w, h = xorg.getResolution()
- local event = require("event")
- xorg.setBackground(0x000000)
- xorg.setForeground(0xFFFFFF)
- xorg.fill(1, 1, w, h, " ")
- term.setCursor(1, 1)
- io.write("[<--] back")
- term.setCursor(3, 4)
- xorg.setBackground(0xeeeFFF)
- i = 1
- while i <= 4 do
- term.setCursor(3, 3 + i)
- if i == 3 then
- io.write(" >_ ")
- else
- io.write(" ")
- end
- i = i + 1
- end
- xorg.setBackground(0x000000)
- term.setCursor(2, 10)
- io.write("Terminal")
- xorg.setBackground(0xFF0000)
- i = 1
- while i <= 4 do
- term.setCursor(13, 3 + i)
- io.write(" ")
- i = i + 1
- end
- xorg.setBackground(0x000000)
- term.setCursor(13, 10)
- io.write("Redstone")
- local event, adress, arg1, arg2, arg3 = event.pull()
- if event == "touch" then
- X = arg1
- Y = arg2
- if X >= 2 and X <= 10 and Y >= 4 and Y <= 10 then
- terminal()
- elseif X >= 13 and X <= 13 + 8 and Y >= 4 and Y <= 10 then
- local shell = require("shell")
- shell.execute("tde-redstone")
- end
- end
- end
- local component = require("component")
- local colors = require("colors")
- local xorg = component.gpu
- local w, h = xorg.getResolution()
- local term = require("term")
- local event = require("event")
- while true do
- xorg.setBackground(0xFFFFFF)
- xorg.setForeground(0x000000)
- xorg.fill(1, 1, w, h, " ")
- xorg.setBackground(0x000000)
- xorg.setForeground(0xFFFFFF)
- xorg.fill(1, 1, w, 1, " ")
- term.setCursor(3, 1)
- io.write("[Menu]")
- term.setCursor(3, h - 1)
- io.write("[exit]")
- xorg.setBackground(0xCCFFF)
- xorg.setForeground(0xFFFFFF)
- xorg.fill(w/2, 2, w, h - 2, " ")
- term.setCursor(w/2 + 3, 2 + 3)
- io.write("TDE Desktop OpenComputers Edition")
- local event, adress, arg1,arg2, arg3 = event.pull()
- if event == "touch" then
- X = arg1
- Y = arg2
- if X >= 3 and X <= 6 and Y == h - 1 then
- xorg.setBackground(0x000000)
- xorg.setForeground(0xFFFFFF)
- term.clear()
- xorg.fill(1, 1, w, h, " ")
- term.setCursor(1, 1)
- print("*** TDE DESKTOP FOR OPENCOMPUTERS ***")
- print(" Thanks for using ")
- break
- elseif X >= 3 and X <= 8 and Y == 1 then
- menu()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement