xXm0dzXx

c

Sep 30th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. rednet.open( "top" )
  2.  
  3. function sendToAll( message )
  4. for i=574, 577 do
  5. rednet.send( i, message )
  6. end
  7. end
  8.  
  9. x = 0
  10. y = 0
  11.  
  12. sendToAll( "_getSize" )
  13. for i=1,4 do
  14. id, message = rednet.receive()
  15. if id >= 574 and id <= 577 then
  16. size = textutils.unserialize( message )
  17.  
  18. x = x + size[1]
  19. y = y + size[2]
  20. else
  21. i = i-1
  22. end
  23. end
  24.  
  25. function update()
  26. while true do
  27. os.pullEvent("redstone")
  28. if redstone.getInput("left") then
  29. sendToAll( "_update" )
  30. end
  31. end
  32. end
  33.  
  34. function sshell()
  35. shell.run("shell")
  36. end
  37.  
  38. term.clear()
  39. term.setCursorPos(1,1)
  40. print("Screen Size: ")
  41. print(x .. " / " .. y)
  42. print( string.rep( "-", term.getSize() -1 ) )
  43. parallel.waitForAny( update, sshell )
Advertisement
Add Comment
Please, Sign In to add comment