Advertisement
DuckStrom

Computercraft CTank Controller

Apr 19th, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. -- quick program to control a crystal tank
  2. max = 946000 * 1000
  3. rsdir = "left"
  4. ontime = 180
  5. offtime = 60
  6.  
  7. t = peripheral.find("cccrystaltankauxtile")
  8.  
  9. while (true) do
  10.   level = t.getTankInfo()[1].contents.amount
  11.  
  12.   if level/max < 0.9 then
  13.     redstone.setOutput(rsdir,true)
  14.     sleep(ontime)
  15.     redstone.setOutput(rsdir,false)
  16.   end
  17.  
  18.   sleep(offtime) -- leave some off time for other processing
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement