Advertisement
Guest User

invmon

a guest
Nov 23rd, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. term.clear()
  2. invSys = peripheral.wrap("bottom")
  3. mon = peripheral.wrap("right")
  4.  
  5. mon.clear()
  6. mon.setCursorPos(1,1)
  7. mon.setTextScale(1)
  8.  
  9. term.redirect(mon)
  10.  
  11. print("Thunderbirds are go!\n\n")
  12.  
  13. inv = {}
  14.  
  15. inv["silicon"] = { id = 4362, meta = 13, stock = 128, order = 32 }
  16.  
  17. for n,i in pairs(inv) do
  18.  
  19.     count=invSys.countOfItemType(i.id,i.meta)
  20.    
  21.     if (count<i.stock) then
  22.  
  23.         status = "More needed."
  24.  
  25.   stack = { qty = i.order, id = i.id, dmg = i.meta }
  26.  
  27.   invSys.requestCrafting(stack)
  28.  
  29.    
  30.     else
  31.  
  32.         status = "Quantity ok."
  33.  
  34.     end
  35.  
  36.     print(n)
  37.  print("        on hand: "..count)
  38.  print("  reorder level: "..i.stock)
  39.  print("  "..status)
  40.  
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement