Arimus

Inventory Counter

Apr 13th, 2014
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,2)
  3. print("Storage Counter")
  4. print("A program devoloped by joelzaper.")
  5. mon = peripheral.wrap("top")
  6. net = peripheral.wrap("bottom")
  7. mon.setTextScale(1.5)
  8. input = function()
  9.   saplings = net.countOfItemType(6,0)
  10.   wood = net.countOfItemType(17,0)
  11.   apples = net.countOfItemType(260,0)
  12.   charcoal = net.countOfItemType(263,1)
  13. end
  14.      
  15. fg = function()
  16.   mon.setTextColor(colors.green)
  17. end
  18. fw = function()
  19.   mon.setTextColor(colors.white)
  20. end
  21.      
  22. settings = function()
  23.   event,side,x,y = os.pullEvent("monitor_touch")
  24.   if x == 19 and y == 8 then
  25.     mon.setCursorPos(6,8)
  26.     mon.setTextColor(colors.red)
  27.     mon.write("Settings Menu Unfinished.")
  28.   end  
  29. end  
  30.      
  31. while true do
  32.   input()
  33.   mon.clear()
  34.   mon.setTextColor(colors.red)
  35.   mon.setCursorPos(19,8)
  36.   mon.write("S")
  37.   fw()
  38.   mon.setTextColor(colors.blue)
  39.   mon.setCursorPos(2,1)
  40.   mon.write("Currently Storing")
  41.   mon.setCursorPos(1,3)
  42.   mon.setTextScale(1.5)
  43.   fw()
  44.   mon.write("Saplings: ")
  45.   fg()
  46.   mon.write(saplings)
  47.   mon.setCursorPos(1,4)
  48.   fw()
  49.   mon.write("Wood:     ")
  50.   fg()
  51.   mon.write(wood)
  52.   fw()
  53.   mon.setCursorPos(1,5)
  54.   mon.write("Apples:   ")
  55.   fg()
  56.   mon.write(apples)
  57.   fw()
  58.   mon.setCursorPos(1,6)
  59.   mon.write("Charcoal: ")
  60.   fg()
  61.   mon.write(charcoal)
  62. end
Advertisement
Add Comment
Please, Sign In to add comment