Advertisement
Guest User

startup

a guest
Apr 26th, 2015
1,151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. shell.run("bg")
  2. a = peripheral.wrap("tealtar_0")
  3. m = peripheral.wrap("top")
  4.  
  5. function info(tab)
  6.   print("LP: "..tab["amount"])
  7.   m.write("LP: "..tab["amount"])
  8.   m.setCursorPos(1,3)
  9.   print("Capacity: "..tab["capacity"])
  10.   m.write("Capacity: "..tab["capacity"])
  11. end
  12.  
  13. function item(tab2)
  14.   print("Item: "..tab2["name"])
  15.   m.setCursorPos(1,5)
  16.   m.write("Item: "..tab2["name"])
  17. end
  18.  
  19. while true do
  20.   t = a.getTankInfo("up")
  21.   t = t[1]
  22.   r = a.getAllStacks()
  23.   r = r[1]
  24.   info(t)
  25.   if not r == nil then
  26.     item(r)
  27.   end
  28.   sleep(0.2)
  29.   term.clear()
  30.   m.clear()
  31.   term.setCursorPos(1,1)
  32.   m.setCursorPos(1,1)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement