Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap("left")
- local colors = {"white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black"}
- -- On Startup
- term.clear()
- term.setCursorPos(1,1)
- print("Possibles entries:")
- local whatColorFirst = 0
- local whatColorSecond = 0
- local whatColorThird = 0
- for i = 1, #colors,2 do
- print(colors[i].." | "..colors[i + 1])
- end
- print(" ")
- print("Give first color:")
- local first = read()
- print("Give second color:")
- local second = read()
- print("Give third color:")
- local third = read()
- -- Decide what color the first one is
- for i = 1, #colors do
- if first == colors[i] then whatColorFirst = i - 1 end
- end
- first = 2 ^ whatColorFirst
- -- Decide what color the second one is
- for i = 1, #colors do
- if second == colors[i] then whatColorSecond = i - 1 end
- end
- second = 2 ^ whatColorSecond
- -- Decide what color the third one is
- for i = 1, #colors do
- if third == colors[i] then whatColorThird = i - 1 end
- end
- third = 2 ^ whatColorThird
- print(first)
- print(second)
- print(third)
- -- OpenPeripherals (see below)
- -- net.callRemote("ender_chest_1", "setColors", first, second, third)
- chest.setColors(first, second, third)
- term.clear()
- term.setCursorPos(1,1)
- print("Your enderchest has been dyed!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement