officedevil

computer craft script for a redstone pulse

Sep 29th, 2024
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | Source Code | 0 0
  1. -- Set the side to send the signal out of (e.g. "right")
  2. local side = "right"
  3.  
  4. -- Function to send a short redstone signal (like a button)
  5. function sendRedstonePulse()
  6.     -- Turning on the redstone signal on the selected side
  7.     redstone.setOutput(side, true)
  8.    
  9.     -- Wait for 1 second
  10.     sleep(1)
  11.    
  12.     -- Turning off the redstone signal
  13.     redstone.setOutput(side, false)
  14. end
  15.  
  16. -- Function call
  17. sendRedstonePulse()
  18.  
Advertisement
Add Comment
Please, Sign In to add comment