Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by Esbenmine
- term.clear()
- term.setCursorPos(1,1)
- Start = true
- ButtonWidth = 19
- ButtonHeight = 0
- ButtonX = 6
- ButtonY = 1
- MyID = os.getComputerID()
- ServerID = 1
- URL = " "
- Download = false
- monX, monY = term.getSize()
- rednet.open("top")
- Button = function()
- for x = ButtonX, ButtonX+ButtonWidth do
- for y = ButtonY, ButtonY+ButtonHeight do
- term.setCursorPos(x,y)
- term.setBackgroundColor(colors.red)
- print(" ")
- end
- end
- sleep(0.1)
- end
- Click = function()
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- if xPos >= ButtonX and xPos <= (ButtonX+ButtonWidth) and yPos >= ButtonY and yPos <= (ButtonY+ButtonHeight) then
- URL = " "
- ReloadTopBar()
- term.setCursorPos(6,1)
- URL = read()
- rednet.send(ServerID, URL)
- id, ConF = rednet.receive()
- if ConF == "ConnectionF" then
- term.setBackgroundColor(colors.black)
- term.setCursorPos(12,15)
- print("Connection to the website failed")
- sleep(1)
- else
- term.setBackgroundColor(colors.black)
- WebsiteW = fs.open("Website", "w")
- WebsiteW.write('Website = function()\n')
- id, Line = rednet.receive()
- WebsiteW.write(" ")
- WebsiteW.write(Line)
- WebsiteW.write('\n')
- WebsiteW.write('shell.run("Browser")')
- WebsiteW.write('end\n')
- WebsiteW.write('parallel.waitForAll(Website)\n')
- WebsiteW.close()
- Start = false
- shell.run("Website")
- end
- end
- end
- AndreTing = function()
- ReloadTopBar()
- end
- ReloadTopBar = function()
- term.setBackgroundColor(colors.black)
- term.clear()
- for i = 1, monX do
- term.setBackgroundColor(colors.red)
- term.setCursorPos(i,1)
- print(" ")
- end
- term.setCursorPos(1,1)
- print("URL: ",URL)
- end
- repeat
- term.setTextColor(1)
- parallel.waitForAll(Click, Button, AndreTing)
- until Start == false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement