Advertisement
KingKevin23

ramp_button_controller

Mar 7th, 2022 (edited)
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local modem_pos = "right"
  2. local protocol = "door_control"
  3. local device_name = "ramp"
  4. local redstone_pos = "left"
  5.  
  6. rednet.open(modem_pos)
  7. while true do
  8.     os.pullEvent("redstone")
  9.     if redstone.getAnalogInput(redstone_pos) > 0 then
  10.         os.sleep(5)
  11.         local id = rednet.lookup(protocol, device_name)
  12.         rednet.send(id, "open", protocol)
  13.         os.sleep(3)
  14.         rednet.send(id, "close", protocol)
  15.     end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement