Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Load the required components
- local monitor = peripheral.find("monitor", function(name) return name == "monitor_2" end) -- Monitor peripheral named monitor_2
- -- Function to display line 1 from create_target_1 on monitor_2
- function displayLine()
- -- Get the line 1 from create_target_1
- local line = peripheral.call("create_target_1", "getLine", 1)
- -- Clear the monitor
- monitor.clear()
- -- Set cursor position at (1,1)
- monitor.setCursorPos(1, 1)
- -- Display the line on monitor
- monitor.write(line)
- end
- -- Main function
- function main()
- while true do
- displayLine()
- sleep(1) -- Adjust the sleep time as needed
- end
- end
- -- Run the main function
- main()
Advertisement
Add Comment
Please, Sign In to add comment