fi5hii

Untitled

May 11th, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. -- Load the required components
  2. local ccb = peripheral.find("ccbridge") -- CC: C Bridge peripheral
  3. local monitor = peripheral.find("monitor") -- 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 success, result = pcall(ccb.call, "target_block_0", "getLine")
  9.  
  10. if success then
  11. -- Clear the monitor
  12. monitor.clear()
  13.  
  14. -- Set cursor position at (1,1)
  15. monitor.setCursorPos(1, 1)
  16.  
  17. -- Display the line on monitor
  18. monitor.write(result)
  19. else
  20. print("Failed to get line from target_block_0")
  21. end
  22. end
  23.  
  24. -- Main function
  25. function main()
  26. while true do
  27. displayLine()
  28. sleep(1) -- Adjust the sleep time as needed
  29. end
  30. end
  31.  
  32. -- Run the main function
  33. main()
  34.  
Advertisement
Add Comment
Please, Sign In to add comment