Advertisement
DOGGYWOOF

Redstone checker

Apr 4th, 2024
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. -- Function to check if redstone is active on the right side of the computer
  2. local function isRedstoneActive()
  3. return redstone.getInput("right")
  4. end
  5.  
  6. -- Your code to run if redstone is active
  7. local function runCode()
  8. -- Insert your code here
  9. print("Redstone is active on the right side!")
  10. end
  11.  
  12. -- Main function to check and execute code
  13. local function main()
  14. while true do
  15. if isRedstoneActive() then
  16. runCode()
  17. end
  18. -- Sleep for a short period to avoid hogging resources
  19. os.sleep(0.5)
  20. end
  21. end
  22.  
  23. -- Run the main function
  24. main()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement