Skortioth

[CC]: RFTools - Time Absorber Time Setter (redstone signale)

Jul 4th, 2020 (edited)
1,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local time = 13 -- set the time you want to absorb
  2. local side = "back" -- set the side for the redstone signal output (left/right/back/front/up/down)
  3.  
  4.  
  5. local args = {...}
  6. if(args[1] ~= nil)then
  7.     time = tonumber(args[1])
  8. end
  9.  
  10. if(args[2] ~= nil)then
  11.     side = args[2]
  12. end
  13.  
  14. if(time == nil)then
  15.     assert("Error: time is not a valid number")
  16. end
  17.  
  18. while true do
  19.     local cTime = os.time()
  20.     if(cTime >= time)and(cTime <= time+0.2)then
  21.         rs.setOutput(side, true)
  22.         os.sleep(0.5)
  23.         rs.setOutput(side, false)
  24.         os.sleep(5)
  25.     end
  26.     os.sleep(0.25)
  27. end
Add Comment
Please, Sign In to add comment