daily pastebin goal
62%
SHARE
TWEET

SmelteryMk2

skipper_is Jan 7th, 2018 (edited) 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local drain = peripheral.wrap("back")
  2.  
  3. function on(side,time)
  4.   redstone.setOutput(side,true)
  5.   sleep(1)
  6.   redstone.setOutput(side,false)
  7.   sleep(time-1)
  8. end
  9.  
  10. function getQuantity(drainObject)
  11.   local tank = drainObject.getTankInfo()[1]
  12.   local contentsTable = tank["contents"]
  13.   quantity = contentsTable["amount"]
  14.   return quantity
  15.  
  16. end
  17.  
  18. local ingotVol = 1296 --volume of a full ingot in mB
  19.  
  20.  
  21. while true do
  22.  
  23.   if getQuantity(drain) > ingotVol then
  24.     print("Contents is: "..getQuantity(drain))
  25.     on("back",15)
  26.     print("Contents is now: "..getQuantity(drain))
  27.   else
  28.     print("Quantity is less than 1 block")
  29.     sleep(15)
  30.   end
  31. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top