Rolcam

Computercraft Tutorial - Section 8 - Redstone

Jun 14th, 2021 (edited)
452
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --This is part of a Computercraft Programming Teaching Program
  2.  
  3. tSides = {"left","right","bottom","top","front","back"}
  4.  
  5. for i = 1, #tSides do
  6.   monitor = peripheral.wrap(tSides[i])
  7.   if monitor then
  8.         side = tSides[i]
  9.         break
  10.   end
  11. end
  12. --Prevents program termination
  13. os.pullEvent = os.pullEventRaw
  14. term.redirect(peripheral.wrap(side))
  15.  
  16. -- Resets Screen
  17. function reset()
  18. term.setTextColor(colors.white)
  19. term.setBackgroundColor(colors.black)
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. end
  23.  
  24. reset()
  25. print("Section 8 - Redstone \n ")
  26. print("rs.setOutput(\"Side\", true/false) - Sets the redstone output for the computer. Sides: top, bottom, left, right, front, back")
  27. print(" ")
  28. print("rs.setBundledOutput(\"Side\",colors.red) - Sets the bundled redstone output for a computer. Only one state can be set per side")
  29. print(" ")
  30. print("To set multiple colors, use colors.combine(colors.red, colors.blue). This will set the output of red and blue to true.")
  31. print(" ")
  32. print("To turn off the bundled output, just use \"0\" instead of colors")
  33. term.restore()
RAW Paste Data