fi5hii

Untitled

May 11th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. -- Load the required components
  2. local ccb = peripheral.wrap("ccbridge") -- CC: C Bridge peripheral
  3. local monitor = peripheral.wrap("monitor_0") -- Monitor peripheral
  4.  
  5. -- Function to display the line from target_block_0 on monitor_0
  6. function displayLine()
  7. -- Get the line from target_block_0
  8. local line = ccb.call("target_block_0", "getLine")
  9.  
  10. -- Clear the monitor
  11. monitor.clear()
  12.  
  13. -- Set cursor position at (1,1)
  14. monitor.setCursorPos(1, 1)
  15.  
  16. -- Display the line on monitor
  17. monitor.write(line)
  18. end
  19.  
  20. -- Main function
  21. function main()
  22. while true do
  23. displayLine()
  24. sleep(1) -- Adjust the sleep time as needed
  25. end
  26. end
  27.  
  28. -- Run the main function
  29. main()
  30.  
Advertisement
Add Comment
Please, Sign In to add comment