################################################################################# # MAIN FRAME OS 0.10 # # http://todamax.net # ################################################################################# ClearText() var mf = Connect("MainFrame") var hugin = Connect("Hugin") Info() ############################################################################ loop # THE MAIN LOOP ############################################################################ PrintCommands() var cmd = Input("> ") ExecuteCommand(cmd) end ############################################################################ void ExecuteCommand(cmd) ############################################################################ if cmd == "disk" PrintDiskContent() else if cmd == "hd" Print("Please enter the name of the HD:") var HDname = Input("> ") PrintHDContent(HDname) Input("Any key to return to menu...") else if cmd == "mem" Print("Read which memory?") var key = Input("> ") Print(mf.LoadMemory(key)) Input("Any key to return to menu...") else if cmd == "room" FindRoomOfThing() else if cmd == "ppl" FindPeople() else if cmd == "rooms" ListRooms() else if cmd == "things" ListThingsInRoom() else if cmd == "tele" TeleportPerson() else if cmd == "tele2" Tele2() else if cmd == "q" Quit() end end ############################################################################ void PrintHDContent(string HDname) ############################################################################ Print ("Mounting...") mf.HD(HDname) PrintScrollingText(mf.GetMemories()) end ############################################################################ void ListRooms() ############################################################################ var rooms = mf.GetAllRooms() PrintScrollingText(rooms) end ############################################################################ void ListThingsInRoom() ############################################################################ loop Print("") Print("-- LIST THINGS IN ROOM -----------") var room = Input("Room or q > ") if room == "q" break end var things = mf.GetThingsInRoom(room) PrintScrollingText(things) end end ############################################################################ void FindRoomOfThing() # Asks for a thing and prints its room (in a loop ############################################################################ Print("") Print("-- FIND ROOM OF THING -----------") loop Print ("Enter thing or q to quit:") var thing = Input ("> ") if (thing == "q") break end Print(GetRoomOfThing(thing)) end end ############################################################################ string GetRoomOfThing(name) # Returns the name of the room the thing is in ############################################################################ var pos = mf.GetPosition(name) var roomName = "" bool pretrace = false bool trace = false loop char in pos if (char == ":") pretrace = true end if (char == ",") break end if trace roomName = roomName + char end if (char == " " && pretrace) trace = true end end if (pos == "Thing not found") roomName = "Thing not found" end return roomName end ############################################################################ void TeleportPerson() ############################################################################ Print("") Print("-- PEOPLE TELEPORT -----------") Print("Name your victim:") var person = Input ("> ") Print("Where to teleport to?") var targetRoom = Input ("> ") #var targetRoom = "Lodge_Room2" var recorderName = "Lodge_Room1_LargeRecorder_LargeRecorder_1" var recorderID = Connect(recorderName) #find room of person var opferRoom = GetRoomOfThing(person) # find an item to place the recorder next to in the opfer's room var things = mf.GetThingsInRoom(opferRoom) var thingAtOpfer = things[0] # SetPosition() the Recorder to there mf.SetPosition(recorderName,thingAtOpfer) # find an item in the target room things = mf.GetThingsInRoom(targetRoom) var thingAtTarget = things[0] Print("Putting " + person + " next to") Print(thingAtTarget) #Move the Opfer! recorderID.MovePerson(person,thingAtTarget) #Put the recorder back to the logde mf.SetPosition(recorderName,"Computer1") Print(person + " is now at " + GetRoomOfThing(person)) end ############################################################################ void Tele2() # works on PlayWife only, sorry :( ############################################################################ var ps = Connect("LongsonPlaystation") Print("Name your victim:") var person = Input ("> ") var victimRoom = ps.GetRoom(person) Print("Where to teleport to?") var targetRoom = Input ("> ") #var targetRoom = "Lodge_Room2" array stuff = ps.GetThingsInRoom(targetRoom) number index = Count(stuff)/2 var thing = stuff[index] Print("Putting " + person + " next to ") Print(thing) ps.SetPosition(person, thing) Print(person + " is now at: " + (GetRoomOfThing(person))) end void PrintDiskContent() if HasFloppy() var data = LoadData() PrintScrollingText(data) else Print("Please put a floppy in your hand, sugar.") end end void PrintScrollingText(array data) var i = 0 ClearText() loop dat in data Print(dat) i++ if i > 24 var inp = Input("Scrolling... (q to quit)") if inp == "q" break end i=0 ClearText() end end end void FindPeople() Print("") Print("-- PEOPLE FINDER -----------") loop Print("Name to look for:") Print("(q = quit)") var name = Input("> ") if name == "q" break end Print("Pos: " + mf.GetPosition(name)) Print("Act: " + mf.GetAction(name)) Print("Rom: " + mf.GetRoom(name)) end end void PrintCommands() Print("") Bar () Print ("Available commands:") Print("ppl - Find people") Print("room - Find the room of a thing") Print("disk - Read a floppy") Print("hd - Mount & read hard drive") Print("mem - Read memory from mounted HD") Print("rooms - List all rooms") Print("things - List things in a room") Print("tele - Teleport a person") Print("q - QUIT") end void Bar () Print ("=========================") end #PrintHDContent("MonadsApartment_HardDrive_1") #PrintHDContent("TestComputer2_HardDrive")