frosty8612

Test2

May 24th, 2014
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. array = {"rcirontankvalvetile_1","rcirontankvalvetile_2"}
  2. mon = peripheral.wrap("left")
  3.  
  4. -- loop so constantly updates
  5. while true do
  6.     local count = 1
  7.     shell.run('clear')
  8.     mon.clear()
  9.     mon.setCursorPos(1,1)
  10.     term.setCursorPos(1,1)
  11.    
  12.     for i,v in ipairs(v) do
  13.         m = peripheral.wrap(v)
  14.         tanksTable = m.getTankInfo("unknown")  
  15.         maintank = tanksTable[1] -- gets data for tank
  16.         -- prints all data to computer
  17.         print(tostring(i)..": "..tostring(v))
  18.         term.setCursorPos(1,count)
  19.         local count = count + 1
  20.    
  21.         for k, v in pairs(maintank) do
  22.             term.setCursorPos(1,count)
  23.             print(tostring(k)..": "..tostring(v))
  24.             local count = count + 1
  25.         end
  26.        
  27.         -- prints to monitor
  28.         mon.setCursorPos(1,count)
  29.         mon.write("Liquid: "..maintank.rawName)
  30.         local count = count + 1
  31.        
  32.         mon.setCursorPos(1,count)
  33.         mon.write("Capacity: "..maintank.capacity)
  34.         local count = count + 1
  35.        
  36.         mon.setCursorPos(1,count)
  37.         mon.write("Amount: "..maintank.amount)
  38.         local count = count + 1
  39.     end
  40.  
  41.     -- waits 5 seconds
  42.     sleep(5)
  43. end
  44. --pastebin get iFie8SsA test
Advertisement
Add Comment
Please, Sign In to add comment