Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function clearScreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function dial(address)
- interface = peripheral.find("crystal_interface")
- local addressLength = #address
- local start = interface.getChevronsEngaged() + 1
- for chevron = start,addressLength,1
- do
- interface.engageSymbol(address[chevron])
- os.sleep(0.5)
- print("Symbol Engaged: " .. address[chevron])
- end
- end
- -- Define destinations with labels and addresses
- local destinations = {
- {label = "Citadel", address = {14,6,10,2,20,33,23,17,0}},
- {label = "A-Base", address = {14,26,30,21,35,2,18,22,0}},
- {label = "Spawn", address = {18,2,12,20,31,5,28,25,0}},
- {label = "Nether", address = {28,25,14,19,18,26,32,31,0}},
- {label = "Stripmine", address = {32,9,1,12,31,10,24,23,0}},
- {label = "Abydos", address = {26,6,14,31,11,29,0}},
- {label = "The End", address = {14,30,6,13,17,23,0}},
- {label = "Cavum Tenebrae", address = {18,7,3,36,25,15,0}},
- {label = "Chulak", address = {8,1,22,14,36,19,0}},
- {label = "Backup", address = {15,5,4,30,6,35,19,20,0}},
- {label = "Otherside", address = {21,38,36,34,35,37,0}}
- }
- clearScreen()
- -- Print available destinations
- print("Available destinations:")
- for i, dest in ipairs(destinations) do
- print(i .. " = " .. dest.label)
- end
- -- Get user input
- print("Select a destination:")
- local input = tonumber(io.read()) -- Read input as number
- -- Dial the selected destination if input is valid
- if input and input >= 1 and input <= #destinations then
- clearScreen()
- print("Dialing...")
- dial(destinations[input].address) -- Dial the address of the selected destination
- elseif input == 404 then
- dial({15,5,4,30,6,35,19,20,0})
- print("Error...")
- else
- print("Invalid input")
- end
- shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement