Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clr()
- term.clear()
- term.setCursorPos(1,1)
- end
- -- Location of the "Computer Interface" block
- local scr = peripheral.wrap("bottom")
- -- Quick Statistics
- print("Is the monitor connected?")
- test = scr.isLinked()
- if test == true then
- print("Ready")
- end
- print()
- print("What is the screen's position?")
- x, y, z = scr.getScreenPos()
- print("X: " .. x .. ", Y: " .. y .. ", Z: " .. z)
- sleep(1)
- clr()
- -- Main Body
- print[[Welcome to my ComputerCraft web browser, of sorts.
- 1 - Get Current URL
- 2 - Get New URL
- 3 - Enter New Text
- ]]
- write("What would you like to do? ")
- ans = read()
- if ans == "1" then
- currentUrl = scr.getUrl()
- print()
- print("Current url is " .. currentUrl)
- sleep(5)
- clr()
- elseif ans == "2" then
- print()
- write("Enter new url ")
- newUrl = read()
- scr.setUrl(newUrl)
- clr()
- elseif ans == "3" then
- print()
- webTxt = read()
- print(scr.type(webTxt))
- else
- scr.setUrl("about:blank")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement