Advertisement
AdamMathieson

Adam's Pressure Monitor

Jan 3rd, 2022 (edited)
804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. --
  2. ----     Adam's Pressure Monitor
  3. ----  Copyright 2022 Adam Mathieson
  4. --
  5.  
  6. -- Pull in Command Line Args
  7. args = {...}
  8.  
  9. -- Globals
  10. _Side = args[1]
  11. _Pressure = args[2]
  12.  
  13. _dir = "/disk10/pneumatics"
  14.  
  15. -- File Structure Setup
  16.  
  17. fs.makeDir(_dir.."/")
  18.  
  19. while true do
  20.     file = fs.open(_dir.."/currentPressure".._Pressure, "w")
  21.     file.writeLine(string.format("%i", redstone.getAnalogInput(_Side)))
  22.     file.close()
  23.  
  24. -- Yield to system
  25.     os.queueEvent("looperEvent");
  26.     os.pullEvent();
  27.     os.sleep(0.5)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement