Advertisement
tjaccardi

TeleNet0_1

Mar 26th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. component = require("component")
  2. term = require("term")
  3. table = require("table")
  4. sides = require("sides")
  5. chestAccess = component.inventory_controller
  6. invAccess = component.transposer
  7.  
  8. --made by StormWolf, for any non-profit use only
  9.  
  10. --version 00.01
  11.  
  12. term.clear()
  13.  
  14.  
  15. print("StormWolf's TeleNet selector client")
  16. print("--------------------------------------")
  17. function client ()
  18.   term.setCursor(1,3)
  19.   inventory = { }
  20.   inventory = inventoryScanner()
  21.  
  22.   --i is starting position for inventory scanner
  23.   i=1
  24.   while i <= 15 do
  25.     term.setCursor(1,i+2)
  26.     term.clearLine()
  27.     print("["..i.."] - "..tostring(inventory[i]))
  28.     i=i+1
  29.     end
  30.   print("--------------------------------------------------")
  31.  
  32.  
  33.   while true do
  34.     term.setCursor(1,20)
  35.     print("Input number for desired location followed by enter")
  36.     term.clearLine()
  37.     io.write("or press only  enter to refresh list: ")
  38.     location = io.read()
  39.     location = tonumber(location)
  40.     if not location then client() end
  41.     invAccess.transferItem(sides.bottom, sides.top, 1, location, 1)
  42.     os.sleep(5)
  43.     end
  44.   end
  45.  
  46.  
  47. function inventoryScanner()
  48.   size = chestAccess.getInventorySize(sides.top)
  49.   i = 1
  50.   while i<size do
  51.       item = chestAccess.getStackInSlot(sides.top, i)
  52.       if not item then break end
  53.       inventory[i] = tostring(item.label)
  54.       i=i+1
  55.     end
  56.   return inventory
  57. end
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. --actual shit thats executed at instant run:
  65. client()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement