Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Created by eor84 and alakazard12
- -- Please give credit if used
- local config = {
- bg = colors.white;
- text = colors.black;
- bar = colors.cyan;
- ucol = colors.lightGray;
- }
- local logo = paintutils.loadImage("/chrome/logo")
- local function round(num)
- local ln = num - math.floor(num)
- if ln > .5 then
- return math.ceil(num)
- else
- return math.floor(num)
- end
- end
- webApis = {
- cPrint = function(txt)
- local w, h = term.getSize()
- local t, r = term.getSize()
- term.setCursorPos(round(round(w-#txt)/2), r)
- print(txt)
- end;
- }
- local function doUrl(url)
- if url == "test" then
- term.setCursorPos(1, 3)
- local rt = fs.open("/chrome/testpage", "r")
- loadstring(rt.readAll())()
- rt.close()
- end
- end
- local function getURL()
- term.setCursorPos(1, 2)
- term.setBackgroundColor(config.ucol)
- term.setTextColor(config.text)
- write("URL://")
- local url = read()
- doUrl(url)
- end
- local function loadM()
- term.setBackgroundColor(config.bg)
- term.clear()
- term.setTextColor(config.text)
- term.setBackgroundColor(config.bar)
- term.setCursorPos(1, 1)
- local w, h = term.getSize()
- write(string.rep(" ", w-1))
- term.setBackgroundColor(colors.red)
- write(" ")
- term.setBackgroundColor(config.bar)
- term.setCursorPos(1, 1)
- write("[Google Chrome V1.0]")
- term.setBackgroundColor(config.ucol)
- term.setCursorPos(1, 2)
- write(string.rep(" ", w))
- end
- local function loadImage(image)
- term.clear()
- term.setCursorPos(1,1)
- paintutils.drawImage(image, 1, 1)
- end
- local function loadLogo()
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.white)
- term.clear()
- paintutils.drawImage(logo, 1, 1)
- term.setTextColor(colors.blue)
- term.setBackgroundColor(colors.white)
- term.setCursorPos(19, 17)
- term.write("Google ")
- sleep(0.5)
- term.write(" Chrome")
- sleep(1)
- end
- loadLogo()
- loadM()
- term.setCursorPos(1,1)
- getURL()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement