Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- levels = {}
- levels[0] = 0
- levels[1] = 15
- levels[2] = 18
- print ("+------------------------------------------------+")
- print ("| |")
- print ("| -- Elevator Control Terminal -- |")
- print ("| |")
- print ("| |")
- print ("| From Level: [ ] |")
- print ("| To Level: [ ] |")
- print ("| |")
- print ("|------------------------------------------------|")
- print ("| Version 0.1 |")
- print ("+------------------------------------------------+")
- term.setCursorPos(21, 6)
- from = read()
- term.setCursorPos(21, 7)
- to = read()
- diff = levels[to] - levels[from]
- if (diff == 0) then
- else
- if (diff < 0) then
- diff = -1 * diff
- for i = 1, diff do
- rednet.broadcast("DOWN");
- end
- else
- for i = 1, diff do
- rednet.broadcast("UP");
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement