Rolcam

Computercraft Tutorial - Section 8.1 - Redstone Cont

Jun 14th, 2021 (edited)
373
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.1 - Redstone cont. \n ")
  26. print("redstone.getInput(\"back\") - Gets state of redstone input on the selected side as a Boolean (True/False)")
  27. print(" ")
  28. print("redstone.getOutput(\"back\") - Gets state of redstone output to the selected side as a Boolean")
  29. print(" ")
  30. print("redstone.getBundledOutput(\"side\") - Gets the colored cables that are active")
  31. print(" ")
  32. print("redstone.testBundledInput(\"side\", color) - Gets state of bundled cable input on the selected side as a Boolean")
  33. term.restore()
RAW Paste Data