Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("cc")
- c = peripheral.find("chest")
- mon = peripheral.find("monitor")
- active = true
- sleepTime = 5
- if peripheral.isPresent("c") then
- print("Peripheral wrapped!")
- sleep(2)
- end
- function reset()
- c.pullItem("west", 1)
- end
- function chest(press)
- --[[
- print("Front of shop: Foran")
- print("Behind the shop: bagved")
- print("Manuvela's place: Manu")
- print("Sus, Kezza and Plazter's base: Sus/Kezza/Plaz")
- print("Robert's place: rob")
- input = read()
- --]]
- for i = 1, c.getInventorySize() do
- cSlot = c.getStackInSlot(i)
- if (cSlot) then -- why the ()?
- for name, data in pairs(cSlot) do
- if data == press then
- c.pushItem("west", i, 1)
- sleep(sleepTime)
- c.pullItem("west", 1)
- end
- end
- end
- end
- end
- function button(text, yLine, charm)
- if x >= 1 and x < 30 and y == yLine then
- mon.setCursorPos(1,yLine)
- mon.setBackgroundColor(colors.lime)
- cc.mWrite(text)
- chest(charm)
- sleep(.3)
- end
- end
- function but()
- mon.setBackgroundColor(colors.red)
- end
- function spacer()
- mon.setBackgroundColor(colors.black)
- end
- function text()
- spacer()
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- cc.mWrite("-----------------------")
- mon.setCursorPos(1,2)
- cc.mWrite("| Destination chooser |")
- mon.setCursorPos(1,3)
- cc.mWrite("-----------------------")
- mon.setCursorPos(1,5)
- but()
- cc.mWrite(" Plaz & Sus & Kezza ")
- mon.setCursorPos(1,6)
- spacer()
- cc.mWrite("---------------------")
- mon.setCursorPos(1,8)
- but()
- cc.mWrite(" Manuvela ")
- mon.setCursorPos(1,9)
- spacer()
- cc.mWrite("---------------------")
- mon.setCursorPos(1,11)
- but()
- cc.mWrite(" N0se ")
- mon.setCursorPos(1,12)
- spacer()
- cc.mWrite("---------------------")
- mon.setCursorPos(1,14)
- but()
- cc.mWrite(" Zathanial ")
- mon.setCursorPos(1,15)
- spacer()
- cc.mWrite("---------------------")
- mon.setCursorPos(1,17)
- but()
- cc.mWrite(" Rob_ert ")
- mon.setCursorPos(1,18)
- spacer()
- cc.mWrite("---------------------")
- mon.setCursorPos(1,20)
- but()
- cc.mWrite(" Ellors ")
- mon.setCursorPos(1,21)
- spacer()
- cc.mWrite("---------------------")
- end
- function click()
- event, side , x, y = os.pullEvent("monitor_touch")
- button(" Plaz & Sus & Kezza ", 5, "Sus/Kezza/Plaz")
- button(" Manuvela ", 8, "Manu")
- button(" N0se ", 11, "nose")
- button(" Zathanial ", 14, "zat")
- button(" Rob_ert ", 17, "rob")
- button(" Ellors ", 20, "el")
- end
- reset()
- while active do
- text()
- click()
- end
Add Comment
Please, Sign In to add comment