Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local manager = peripheral.find("inventoryManager")
- term.clear()
- term.setCursorPos(1,1)
- print("1. Copper Block")
- print("2. Zinc Block")
- print("3. Brass Block")
- print("4. Diamond Block")
- print("5. Netherite Block")
- local event2, key2 = os.pullEvent("key")
- if key2 == keys.one then
- term.clear()
- term.setCursorPos(1,1)
- print("How many?")
- local amount = read()
- local copper = tonumber(amount)
- local event3, key3 = os.pullEvent("key")
- print ("What kind?")
- print ("1. Create")
- print ("2. Thermal")
- print ("3. Mystical")
- if key3 == keys.one then manager.addItemFromPlayer("DOWN", 114, copper, "create:copper_block") end
- if key3 == keys.two then manager.addtemFromPlayer("DOWN", 114, copper, "thermal:copper_block") end
- if key3 == keys.three then manager.addItemFromPlayer("DOWN", 114, copper, "mysticalworld:copper_block") end
- withdrawamount = copper * .5
- local withdraw = fs.open(manager.getOwner(),"w")
- local data = withdraw.readAll()
- withdraw.write(data - withdrawamount)
- withdraw.close()
- elseif key2 == keys.two then
- term.clear()
- term.setCursorPos(1,1)
- print("How many?")
- local amount = read()
- local zinc = tonumber(amount)
- manager.addItemFromPlayer("DOWN", 114, zinc, "create:zinc_block")
- withdrawamount = zinc * 1
- local withdraw = fs.open(manager.getOwner(),"w")
- local data = withdraw.readAll()
- withdraw.write(data - withdrawamount)
- withdraw.close()
- elseif key2 == keys.three then
- term.clear()
- term.setCursorPos(1,1)
- print("How many?")
- local amount = read()
- local brass = tonumber(amount)
- manager.addItemFromPlayer("DOWN", 114, brass, "create:zinc_block")
- withdrawamount = brass * 2
- local withdraw = fs.open(manager.getOwner(),"w")
- local data = withdraw.readAll()
- withdraw.write(data - withdrawamount)
- withdraw.close()
- elseif key2 == keys.four then
- term.clear()
- term.setCursorPos(1,1)
- print("How many?")
- local amount = read()
- local diamond = tonumber(amount)
- manager.addItemFromPlayer("DOWN", 114, diamond, "minecraft:diamond_block")
- withdrawamount = diamond * 3
- local withdraw = fs.open(manager.getOwner(),"w")
- local data = withdraw.readAll()
- withdraw.write(data - withdrawamount)
- withdraw.close()
- elseif key2 == keys.five then
- term.clear()
- term.setCursorPos(1,1)
- print("How many?")
- local amount = read()
- local netherite = tonumber(amount)
- manager.addItemFromPlayer("DOWN", 114, netherite, "minecraft:diamond_block")
- withdrawamount = netherite * 5
- local withdraw = fs.open(manager.getOwner(),"w")
- local data = withdraw.readAll()
- withdraw.write(data - withdrawamount)
- withdraw.close()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement