Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --var--
- teleporter_num_in = "1"
- mon = peripheral.wrap("monitor_13")
- CableSide = "right"
- tout = peripheral.wrap("powered_tile_30")
- tin = peripheral.wrap("powered_tile_29")
- plus = 100
- power = true
- --func set tp num--
- teleporter_num_in = teleporter_num_in + plus
- function set_tp_num()
- tin.setFrequency(tonumber(teleporter_num_in))
- end
- --draw screen--
- function display()
- set_tp_num()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.setCursorPos(1,1)
- mon.write("X")
- x,y = mon.getSize()
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.black)
- for i = 1, y, 2 do
- mon.setCursorPos(x/2,i)
- mon.setBackgroundColor(colors.purple)
- mon.write(" "..i.." ")
- mon.setCursorPos(x/2,i+1)
- mon.setBackgroundColor(colors.lightBlue)
- mon.write(" "..(i+1).." ")
- end
- touch()
- end
- -- function teleport
- function teleport(data)
- data = data + plus
- if teleporter_num_in == data then
- mon.setBackgroundColor(colors.red)
- mon.clear()
- mon.setCursorPos(2,1)
- mon.write("Can't")
- mon.setCursorPos(3,2)
- mon.write("TP")
- mon.setCursorPos(1,3)
- mon.write("to me !")
- sleep(5)
- else
- mon.setBackgroundColor(colors.blue)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Telepor")
- mon.setCursorPos(3,2)
- mon.write("to")
- mon.setCursorPos(4,3)
- mon.write(data)
- tout.setFrequency(tonumber(data))
- rs.setBundledOutput(CableSide,colors.white) -- move cell and set pipe out for income off
- sleep(5)
- rs.setBundledOutput(CableSide,colors.black) -- off
- sleep(8)
- rs.setBundledOutput(CableSide,colors.blue) -- impulse load
- sleep(2)
- rs.setBundledOutput(CableSide,colors.orange) -- start tp and pipe to tess.
- sleep(10)
- rs.setBundledOutput(CableSide,colors.black) -- off
- sleep(1)
- end
- if power == true then
- display()
- end
- end
- -- func touch--
- function touch()
- input = false
- while input == false do
- event,side,x,y = os.pullEvent()
- if event == "monitor_touch" then
- if x == 1 and y == 1 then
- mon.setBackgroundColor(colors.black)
- mon.clear()
- shell.run("shutdown")
- else
- input = true
- dest = string.sub(y,1,1)
- teleport(dest)
- end
- end
- end
- end
- --program--
- display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement