zjford

Name Monitor

Aug 4th, 2025
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. -- Simple script to display a message on a monitor
  2.  
  3. -- Find the monitor connected to the computer
  4. -- "top", "bottom", "left", "right", "front", "back" are valid sides
  5. local monitor = peripheral.find("monitor")
  6.  
  7. -- Check if a monitor was actually found
  8. if monitor == nil then
  9.   print("Error: No monitor attached!")
  10.   return -- Stop the script if no monitor is found
  11. end
  12.  
  13. -- Clear the monitor of any previous text
  14. monitor.clear()
  15.  
  16. -- Set the cursor to the top-left corner (position 1, 1)
  17. monitor.setCursorPos(1, 1)
  18.  
  19. -- Write the message to the monitor
  20. monitor.write("Haydens Home")
Advertisement
Add Comment
Please, Sign In to add comment