Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = term.getSize()
- local screenData = {}
- rednet.open("back")
- write("Enter the ID: ")
- input = read()
- function getFrom( iddd, message )
- repeat
- rednet.send( tonumber(iddd), tostring(message.. "") )
- event, id, message1 = os.pullEvent()
- until id == tonumber(iddd) and event == "rednet_message"
- return message1
- end
- function see()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- screenData = textutils.unserialize( getFrom(input, "getScreen") )
- local shouldBlink = textutils.unserialize( getFrom(input, "getBlink") )
- if shouldBlink == true or shouldBlink == false then
- term.setCursorBlink( shouldBlink )
- end
- for i=1,#screenData do
- local scr = screenData[i]
- term.setCursorPos(scr["x"], scr["y"])
- term.setBackgroundColour( scr["bgcolor"] )
- term.setTextColour( scr["color"] )
- term.write( scr["text"] )
- end
- local positions = textutils.unserialize( getFrom(input, "getPos") )
- if type(positions) == "table" then
- for i,v in pairs( positions ) do
- print( v )
- end
- term.setCursorPos( positions["x"], positions["y"] )
- end
- local colz = textutils.unserialize( getFrom(input, "getColz") )
- if type(colz) == "table" then
- term.setBackgroundColour( colz["bg"] )
- term.setTextColour( colz["tc"] )
- end
- sleep(0)
- end
- end
- function addTo( lol, str )
- if lol then
- str = str.. ":" ..lol
- end
- return str
- end
- function sendz( _sFilter )
- local event, p1, p2, p3, p4, p5 = os.pullEventRaw( _sFilter )
- str = event
- if str == "char" or str == "key" or str == "terminate" or str == "mouse_click" or str == "mouse_drag" or str == "mouse_scroll" then
- str = addTo( p1, str )
- str = addTo( p2, str )
- str = addTo( p3, str )
- str = addTo( p4, str )
- str = addTo( p5, str )
- rednet.send( tonumber(input), tostring(str) )
- end
- return event, p1, p2, p3, p4, p5
- end
- sleep(0)
- os.pullEvent = sendz
- see()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement