!7 p { final File file = getProgramFile(#1007478, "my-universe.txt"); final JTextField tf = jtextfield(trim(loadTextFile(file, aGlobalID()))); showForm("Choose your universe", tf, r-thread { pcall-messagebox { S myUniverse = assertPossibleGlobalID(getTextTrim(tf)); saveTextFile(file, myUniverse); RemoteDB db = new RemoteDB(#1006463, true); // auto start AI Concepts L l = db.xlist("AIConcept"); bool haveUniverse = false; print("Found " + n(l, "concepts")); for (RC rc : l) { S id = rc.getString("globalID"); if (eq(id, myUniverse)) haveUniverse = true; S u = rc.getString("originatingUniverse"); print(rc.id + ": " + u); if (empty(u)) { print(" => Adopting to " + myUniverse + "!"); rc.set(originatingUniverse := myUniverse); } } if (!haveUniverse) { print("Making universe concept " + myUniverse); db.xnew("AIConcept", globalID := myUniverse, name := "My Universe", comment := "Feel free to rename this.", originatingUniverse := myUniverse); } db.close(); print("Done!"); } }); }