SHOW:
|
|
- or go back to the newest paste.
| 1 | local modem = peripheral.find("modem") or error("No modem attached", 0)
| |
| 2 | CHANNEL = 43 | |
| 3 | modem.open(CHANNEL) | |
| 4 | ||
| 5 | local function receiveMessage() | |
| 6 | local event, _, channel, _, message = os.pullEvent("modem_message")
| |
| 7 | if channel == CHANNEL then | |
| 8 | return message | |
| 9 | else | |
| 10 | print("Failed: " .. message)
| |
| 11 | return receiveMessage() | |
| 12 | end | |
| 13 | end | |
| 14 | ||
| 15 | -- Print a line of dashes for aesthetics | |
| 16 | - | -- Print the welcome message |
| 16 | + | |
| 17 | - | print("Welcome to Monopoly OS by Monopoly Co.")
|
| 17 | + | |
| 18 | for i = 1, width do | |
| 19 | - | print("Current Time: " .. textutils.formatTime(os.time(), true))
|
| 19 | + | |
| 20 | end | |
| 21 | io.write("\n")
| |
| 22 | - | print("1. Bastion")
|
| 22 | + | |
| 23 | - | print("2. Automatic Bastion")
|
| 23 | + | |
| 24 | - | print("3. GPS")
|
| 24 | + | |
| 25 | - | print("4. Artillery Controller")
|
| 25 | + | |
| 26 | - | print("5. Teleport Controller")
|
| 26 | + | |
| 27 | - | print("6. Stargate Controller")
|
| 27 | + | |
| 28 | - | print("7. To-Do List")
|
| 28 | + | |
| 29 | - | print("8. Update")
|
| 29 | + | local function finalmessage() |
| 30 | - | print("9. Exit")
|
| 30 | + | for i = 1, 99 do |
| 31 | message = receiveMessage() | |
| 32 | clearScreen() | |
| 33 | print("Teleporter Controller")
| |
| 34 | lineBreak() | |
| 35 | print("Programming Complete")
| |
| 36 | - | shell.run("Bastion")
|
| 36 | + | lineBreak() |
| 37 | print(message) | |
| 38 | - | shell.run("RBastion")
|
| 38 | + | |
| 39 | ||
| 40 | - | shell.run("GPS")
|
| 40 | + | clearScreen() |
| 41 | - | elseif choice == "4" then |
| 41 | + | print("Teleporter Controller")
|
| 42 | - | shell.run("ArtilleryControl")
|
| 42 | + | lineBreak() |
| 43 | - | elseif choice == "5" then |
| 43 | + | print("Teleport Completed")
|
| 44 | - | shell.run("Teleport")
|
| 44 | + | lineBreak() |
| 45 | - | elseif choice == "6" then |
| 45 | + | X, Y, Z = gps.locate() |
| 46 | - | shell.run("psg")
|
| 46 | + | print("Final Position: " .. X .. " " .. Y .. " " .. Z)
|
| 47 | - | elseif choice == "7" then |
| 47 | + | |
| 48 | - | shell.run("todo")
|
| 48 | + | |
| 49 | - | elseif choice == "8" then |
| 49 | + | |
| 50 | - | shell.run("Update")
|
| 50 | + | print("Teleporter Controller")
|
| 51 | - | end |
| 51 | + | |
| 52 | print("Select a program to run:")
| |
| 53 | print("1. Recall")
| |
| 54 | print("2. Direct Teleport")
| |
| 55 | print("3. Relative Teleport")
| |
| 56 | print("4. Exit")
| |
| 57 | lineBreak() | |
| 58 | ||
| 59 | local choice = read() | |
| 60 | ||
| 61 | local dimensions = {
| |
| 62 | "minecraft:overworld", | |
| 63 | "minecraft:nether", | |
| 64 | "ad_astra:moon", | |
| 65 | "ad_astra:mars", | |
| 66 | "sgjourney:chulak", | |
| 67 | "sgjourney:abydos" | |
| 68 | } | |
| 69 | ||
| 70 | local function selectDimension() | |
| 71 | clearScreen() | |
| 72 | print("Teleporter Controller")
| |
| 73 | lineBreak() | |
| 74 | print("Select a Dimension:")
| |
| 75 | ||
| 76 | for i, dim in ipairs(dimensions) do | |
| 77 | print(i .. ". " .. dim) | |
| 78 | end | |
| 79 | ||
| 80 | lineBreak() | |
| 81 | io.write("Enter choice: ")
| |
| 82 | local dimChoice = tonumber(read()) | |
| 83 | ||
| 84 | if dimChoice and dimensions[dimChoice] then | |
| 85 | return dimensions[dimChoice] | |
| 86 | else | |
| 87 | print("Invalid selection. Try again.")
| |
| 88 | os.sleep(1) | |
| 89 | return selectDimension() | |
| 90 | end | |
| 91 | end | |
| 92 | ||
| 93 | if choice == "1" then | |
| 94 | clearScreen() | |
| 95 | print("Teleporter Controller")
| |
| 96 | lineBreak() | |
| 97 | modem.transmit(15, 43, "Recall") | |
| 98 | print("Recall Started")
| |
| 99 | os.sleep(1) | |
| 100 | finalmessage() | |
| 101 | elseif choice == "2" then | |
| 102 | dimension = selectDimension() | |
| 103 | ||
| 104 | clearScreen() | |
| 105 | print("Teleporter Controller")
| |
| 106 | lineBreak() | |
| 107 | print("Dimension: ")
| |
| 108 | print(dimension) | |
| 109 | print("X: ")
| |
| 110 | positionX = read() | |
| 111 | print("Y: ")
| |
| 112 | positionY = read() | |
| 113 | print("Z: ")
| |
| 114 | positionZ = read() | |
| 115 | ||
| 116 | clearScreen() | |
| 117 | print("Teleporter Controller")
| |
| 118 | lineBreak() | |
| 119 | print("Starting Programming")
| |
| 120 | lineBreak() | |
| 121 | modem.transmit(15, 43, "Teleport") | |
| 122 | os.sleep(0.2) | |
| 123 | modem.transmit(15, 43, positionX) | |
| 124 | print("X:"..positionX)
| |
| 125 | os.sleep(0.2) | |
| 126 | modem.transmit(15, 43, positionY) | |
| 127 | print("Y:"..positionY)
| |
| 128 | os.sleep(0.2) | |
| 129 | modem.transmit(15, 43, positionZ) | |
| 130 | print("Z:"..positionZ)
| |
| 131 | os.sleep(0.2) | |
| 132 | modem.transmit(15, 43, dimension) | |
| 133 | print("Dimension:"..dimension)
| |
| 134 | os.sleep(1) | |
| 135 | ||
| 136 | finalmessage() | |
| 137 | elseif choice == "3" then | |
| 138 | dimension = selectDimension() | |
| 139 | ||
| 140 | clearScreen() | |
| 141 | print("Teleporter Controller")
| |
| 142 | lineBreak() | |
| 143 | print("Dimension: ")
| |
| 144 | print(dimension) | |
| 145 | X, Y, Z = gps.locate() | |
| 146 | print("X: ")
| |
| 147 | positionX = X + read() | |
| 148 | print("Y: ")
| |
| 149 | positionY = Y + read() | |
| 150 | print("Z: ")
| |
| 151 | positionZ = Z + read() | |
| 152 | ||
| 153 | ||
| 154 | clearScreen() | |
| 155 | print("Teleporter Controller")
| |
| 156 | lineBreak() | |
| 157 | print("Starting Programming")
| |
| 158 | lineBreak() | |
| 159 | modem.transmit(15, 43, "Teleport") | |
| 160 | os.sleep(1) | |
| 161 | modem.transmit(15, 43, positionX) | |
| 162 | print("X:"..positionX)
| |
| 163 | os.sleep(1) | |
| 164 | modem.transmit(15, 43, positionY) | |
| 165 | print("Y:"..positionY)
| |
| 166 | os.sleep(1) | |
| 167 | modem.transmit(15, 43, positionZ) | |
| 168 | print("Z:"..positionZ)
| |
| 169 | os.sleep(1) | |
| 170 | modem.transmit(15, 43, dimension) | |
| 171 | print("Dimension:"..dimension)
| |
| 172 | os.sleep(1) | |
| 173 | ||
| 174 | finalmessage() | |
| 175 | end | |
| 176 | ||
| 177 | os.sleep(1) | |
| 178 | shell.run("Greeting") |