Advertisement
Guest User

Untitled

a guest
Feb 14th, 2013
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. -- sets some variables
  2. local gatereader = peripheral.wrap("top")
  3. local data = gatereader.get()
  4. local cX,cY = term.getCursorPos()
  5.  
  6. -- creates a function we can use to go down on the next line in the terminal
  7. function newLine()
  8.   local _,cY= term.getCursorPos()
  9.   term.setCursorPos(1,cY+1)
  10. end
  11.  
  12. -- clears and resets the cursor position before writing the table
  13. term.clear()
  14. term.setCursorPos(1,1)
  15.  
  16. -- prints out what the gate reader can sense from the block(s) attached to it.
  17. for i, j in pairs(data) do
  18. term.write(tostring(i)..": "..tostring (j))
  19. newLine()
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement