Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- levels = {
- 0, --Bottom Floor
- 15, --Middle Floor
- 18 --Top Floor
- };
- print ("+------------------------------------------------+")
- print ("| |")
- print ("| -- Elevator Control Terminal -- |")
- print ("| |")
- print ("| |")
- print ("| From Level: [ ] |")
- print ("| To Level: [ ] |")
- print ("| |")
- print ("|------------------------------------------------|")
- print ("| Version 0.1 |")
- print ("+------------------------------------------------+")
- term.setCursorPos(30, 7)
- from = read()
- term.setCursorPos(30, 8)
- 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