1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
| # Initialize PlaySound("Coin 1") ClearText() DisplayGraphics() Print("PJ568's Server System") Print(Bar()) Print(H()) Print(Bar()) array arr = [] arr[-1] = 0 arr[0] = GetHour() + ":" + GetMinute() + " > "
# array arr : last term things # number ans[-1] : switch function # string ans[0] : strings show when before input # var ans[1] to ans[infinite] : things to print, can be used the next term
loop string cmd = Input(arr[0]) arr = Main(cmd, arr) if Count(arr) - 2 >= 1 loop i from 1 to Count(arr) - 2 Print(arr) Sleep(0.1) end end end
array Main(string cmd, array arr) number id = -1 array ans = []
if arr[-1] == 0 if cmd == "cd" ans[1] = "ROOT" else if cmd == "h" or cmd == "help" or cmd == "?" or cmd == "H" ans[1] = "Available commands:" ans[2] = "-connect" ans[3] = "-tp:teleport to list" ans[4] = "-info:Show system info" ans[5] = "-findP:Locate Someone" ans[6] = "-slurp:Teleport to connected locations" ans[7] = "-break:Unlock a door" ans[8] = "-register:Register soda sales" ans[9] = "-GetMoney" ans[10] = "-store:Save Data" ans[11] = "-restore" ans[12] = "-remoteCall/rCall" # ans[13] = "-boot:boot from disk" else if cmd == "cls" or cmd == "clear" ans[1] = "Can't do." else if cmd == "connect" return loopInput(1, "ConnectName: ", ans) else if cmd == "break" ans[1] = "Breaking the door just connect..." if breakDoor(id) ans[2] = "Unlocked!" else ans[2] = "Nope..." end else if cmd == "register" return loopInput(2, "Sales: ", ans) else if cmd == "GetMoney" or cmd == "getmoney" return loopInput(3, "$ amount: ", ans) else if cmd == "tp" ans[1] = "@This is PJ568's teleport program." ans[2] = Bar() return loopInput(4, "TP to: ", ans) else if cmd == "info" Info() else if cmd == "slurp" ConnectAll() Slurp() else if cmd == "store" if HasFunction("SaveMemory") return loopInput(5, "Key: ", ans) else ans[1] = "SaveMemory() is not exist on this computer" end else if cmd == "restore" if HasFunction("LoadMemory") return loopInput(7, "Key: ", ans) else ans[1] = "LoadMemory() is not exist on this computer" end else if cmd == "remoteCall" or cmd == "remotecall" or cmd == "rCall" return loopInput(8, "Function name: ", ans) # else if cmd == "boot" # if HasFloppy() # BootFromFloppy() # else # Print("Floppy drive not found.") # end else if cmd == "FindP" or cmd == "findP" ans[1] = "Who do you want to find?" return loopInput(10, "name: ", ans) else ans[1] = "Can't understand command: " + cmd ans[2] = H() end else if arr[-1] == 1 id = Connect(cmd) ans[1] = "Connection id: " + id else if arr[-1] == 2 var wellspringer = Connect("Wellspringer") wellspringer.RegisterSeller("Sebastian", cmd) ans[1] = "OK!" else if arr[-1] == 3 var financeComputer = Connect("FinanceComputer") financeComputer.ChangeBalance("Sebastian", cmd) ans[1] = "OK!" else if arr[-1] == 4 if cmd == "h" or cmd == "help" or cmd == "?" or cmd == "H" ans[1] = "Available locations:" ans[2] = "-Home" ans[3] = "-Lodge:Where Pixie work" ans[4] = "-Pixie:Pexie's home" ans[5] = "-Plaza" ans[6] = "-Police" ans[7] = "-soda:Soda warehouse" ans[8] = "-Factory:Goods Factory" ans[8] = "-Internet" ans[9] = "To quit: quit" return continueMain(ans, arr) else if cmd == "home" or cmd == "Home" TP("DesolateHouseLobby_TriPodComputer_TriPodComputer_1") return continueMain(ans, arr) else if cmd == "Plaza" or cmd == "plaza" TP("Plaza_CurcuitLocker_4") return continueMain(ans, arr) else if cmd == "Factory" or cmd == "factory" TP("FactoryMachineA") return continueMain(ans, arr) else if cmd == "Pixie" or cmd == "pixie" TP("PlazaBackstreet_MediumSewerComputer_MediumSewerComputer_2") return continueMain(ans, arr) else if cmd == "Soda" or cmd == "soda" TP("SodaStorage_ComputerWithConsoleOutput_1") return continueMain(ans, arr) else if cmd == "Lodge" or cmd == "lodge" TP("Lodge_Room1_FuseBox_Poor_FuseBox_1") return continueMain(ans, arr) else if cmd == "Police" or cmd == "police" TP("PoliceOfficeInterior_ministryOfficeWorkstationComputer_1") return continueMain(ans, arr) else if cmd == "Internet" or cmd == "internet" TP("Internet_Internet_PoleComputer_1") return continueMain(ans, arr) else if cmd == "q" or cmd == "quit" or cmd == "Quit" or cmd == "Q" ans[1] = "exiting tp program..." else ans[1] = "Try to tp to " + cmd + "." TP(cmd) return continueMain(ans, arr) end else if arr[-1] == 5 ans[1] = cmd return loopInput(6, "Data: ", ans) else if arr[-1] == 6 SaveMemory(arr[1], cmd) ans[1] = "Data was saved." else if arr[-1] == 7 ans[1] = LoadMemory(cmd) else if arr[-1] == 8 RemoteFunctionCall(id, cmd, []) ans[1] = "OK?" else if arr[-1] == 10 var MF = Connect("MainFrame") ans[1] = MF.GetPosition(cmd) end return endMain(ans) end
var ServerConnectClient(string cname) var c = Connect(cname) return c end
bool breakDoor(var id) bool is_unlocked = false loop x from 0 to 99999 Print("Trying code: " + x) var success = id.Unlock(x) if success is_unlocked = true Print("Unlocked!") Bar() break end end return is_unlocked end
array loopInput(number level, string info, array ans) ans[-1] = level ans[0] = info return ans end
array endMain(array ans) ans[-1] = 0 ans[0] = GetHour() + ":" + GetMinute() + " > " return ans end
array continueMain(array ans, array arr) ans[-1] = arr[-1] ans[0] = arr[0] return ans end
void TP(string location) DisconnectAll() Connect(location) Slurp() end
void ConnectAll() Connect("DesolateHouseLobby_TriPodComputer_TriPodComputer_1") Connect("Lodge_Room1_FuseBox_Poor_FuseBox_1") Connect("Internet_Internet_PoleComputer_1") Connect("PlazaBackstreet_MediumSewerComputer_MediumSewerComputer_2") Connect("Plaza_CurcuitLocker_4") Connect("Ministry_Elevator4_Door1") Connect("Hotel_Exterior_CurcuitLocker_1") Connect("HarborWestHouseRoom1_FuseBox_Poor_FuseBox_1") Connect("CentralServer") Connect("FactoryMachineA") Connect("SodaStorage_ComputerWithConsoleOutput_1") Connect("PoliceOfficeInterior_ministryOfficeWorkstationComputer_1") Connect("HarborEast_StreetLight1") end
string H() return "? or h or help for help." end
string Bar() return "-----------------------" end
|