Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("monitor_3")
- redstone.setOutput('right',false)
- rednet.open('left')
- m.setBackgroundColor(32768)
- t = true
- f = false
- destsboo = {false,false,false,false,false,false}
- destsid = {48,49,51,1,1,1}
- dests = {"Crafting Room","Storage Unit","Server Room","Undefined","Undefined","Undefined"}
- function choose(x)
- if x then
- m.setBackgroundColor(8192)
- else
- m.setBackgroundColor(16384)
- end
- end
- function reset()
- update(f,t)
- os.sleep(0.25)
- redstone.setOutput('right',true)
- os.sleep(1.5)
- update()
- redstone.setOutput('right',false)
- end
- function embark()
- update(t,f)
- os.sleep(0.25)
- m.clear()
- m.setTextScale(5)
- for i = 1,5 do
- m.setCursorPos(1,1)
- m.write(string.format(-1*(i-6)))
- os.sleep(1)
- end
- m.setCursorPos(1,1)
- m.setTextColor(8192)
- m.write("GO")
- m.setTextColor(1)
- redstone.setOutput('right',true)
- os.sleep(5)
- redstone.setOutput('right',false)
- destsboo = {false,false,false,false,false,false}
- end
- function update(x,y)
- m.clear()
- m.setTextScale(0.5)
- m.setTextColor(1)
- m.setCursorPos(1,1)
- m.write("Choose dest(s)")
- for i = 1,6 do
- m.setCursorPos(1,i+1)
- choose(destsboo[i])
- m.write(dests[i])
- end
- m.setCursorPos(1,8)
- choose(x)
- m.write("EMBARK")
- m.setCursorPos(1,9)
- choose(y)
- m.write("RESET")
- m.setBackgroundColor(32768)
- end
- while true do
- update()
- event,side,x,y = os.pullEvent("monitor_touch")
- if y > 1 and y < 8 then
- if destsboo[y-1] then
- destsboo[y-1] = false
- id = destsid[y-1]
- rednet.send(id,'close')
- else
- destsboo[y-1] = true
- id = destsid[y-1]
- rednet.send(id,'open')
- end
- elseif y == 8 then
- embark()
- elseif y == 9 then
- reset()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement