Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- term = require("term")
- table = require("table")
- sides = require("sides")
- computer = component.computer
- chestAccess = component.inventory_controller
- invAccess = component.transposer
- rs = component.redstone
- gpu = component.gpu
- gpu.setResolution(80,25)
- --made by StormWolf, for any non-profit use only
- version=00.4
- term.clear()
- print("StormWolf's TeleNet selector client version "..version)
- print("\n--------------------------------------")
- function client ()
- inventory = { }
- inventory = inventoryScanner()
- --i is starting position for inventory scanner
- i=1
- while i <= 15 do
- term.setCursor(1,i+3)
- term.clearLine()
- print("["..i.."] - "..tostring(inventory[i]))
- i=i+1
- end
- print("--------------------------------------------------")
- cursorPosition=i+4
- prevlocation=1
- while true do
- term.setCursor(1,cursorPosition)
- print("Input number for desired location followed by enter")
- term.clearLine()
- io.write("or enter 0 to select last location: ")
- location = io.read()
- if not tonumber(location) then
- client()
- elseif tonumber(location)==0 then
- location=tonumber(prevlocation)
- elseif tonumber(location)==-1 then
- print("Reloaded table.")
- client()
- elseif tonumber(location)<0 then
- print("Invalid option. Please try again.")
- client()
- else
- location = tonumber(location)
- end
- if not inventory[location] then
- print("Invalid option. Please try again.")
- client()
- end
- invAccess.transferItem(sides.bottom, sides.top, 1, location, 1)
- i=0
- while i<2 do
- term.setCursor(1,cursorPosition+2)
- term.clearLine()
- io.write("Loading location... {}")
- os.sleep(0.5)
- term.setCursor(1,cursorPosition+2)
- io.write("Loading location... { }")
- computer.beep()
- os.sleep(0.5)
- term.clearLine()
- i=i+1
- term.setCursor(1,2)
- term.clearLine()
- if location then
- io.write("Last location entered: "..inventory[location])
- end
- end
- term.setCursor(1,cursorPosition+1)
- term.clearLine()
- term.setCursor(1,cursorPosition+3)
- io.write("Initializing teleportation!")
- computer.beep()
- rs.setOutput(sides.bottom, 10)
- rs.setOutput(sides.bottom, 0)
- os.sleep(2)
- term.clearLine()
- end
- end
- function inventoryScanner()
- size = chestAccess.getInventorySize(sides.top)
- i = 1
- while i<size do
- item = chestAccess.getStackInSlot(sides.top, i)
- if not item then break end
- inventory[i] = tostring(item.label)
- i=i+1
- end
- return inventory
- end
- --actual shit thats executed at instant run:
- client()
Add Comment
Please, Sign In to add comment