Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chests = {}
- chests[1] = {["name"]="Bram",["c1"]=colors.green,["c2"]=colors.red,["c3"]=colors.blue}
- chests[2] = {["name"]="Stefan",["c1"]=colors.blue,["c2"]=colors.pink,["c3"]=colors.green}
- function readInt()
- local r = read()
- local n = tonumber(r)
- while( n == nil ) do
- print(r.." is not a number")
- r = read()
- n = tonumber(r)
- end
- return n
- end
- local sign = peripheral.wrap("top")
- local c, lastChest
- while true do
- for key,data in pairs(chests) do
- print(key..". "..data.name)
- end
- if lastChest ~= nil then
- print((#chests+1)..". Last used chest: "..lastChest.name)
- end
- local choice = readInt()
- lastChest = c
- c = chests[choice]
- local ender = peripheral.wrap("left")
- ender.setColors(c.c1, c.c2, c.c3)
- print("Changed chest to "..c.name)
- print()
- if sign ~= nil then
- sign.setLine(1, "Current chest: ")
- sign.setLine(2, c.name)
- if lastChest ~= nil then
- sign.setLine(3, "Last chest: ")
- sign.setLine(4, lastChest.name)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement