const doc = eval('document'); /** @param {import(".").NS } ns */ export async function main(ns) { // ns.disableLog('ALL'); // const terminalInput = doc.getElementById("terminal-input"); // const handler = Object.keys(terminalInput)[1]; // terminalInput.value = "COMMAND"; // terminalInput[handler].onChange({ target: terminalInput }); // terminalInput[handler].onKeyDown({ key: 'Enter', preventDefault: () => null }); // const terminalButton = doc.querySelector(); let terminal; let city; let travel; for (const elem of doc.querySelectorAll('div.MuiDrawer-root.MuiDrawer-docked p')) { if (elem.textContent == 'Terminal') { terminal = elem; } if (elem.textContent == 'City') { city = elem; } if (elem.textContent == 'Travel') { travel = elem; } } city.click(); await ns.sleep(200); for (const alphaEnt of doc.querySelectorAll('div#root p')) { if (alphaEnt.textContent == ' o-----+---x----o 4 T [alpha ent.] o-------o /') { alphaEnt.querySelector('span').click(); await ns.sleep(200); break; } } for (const TOR of doc.querySelectorAll('div#root button')) { if (TOR.textContent == '') { // TOR.click(); await ns.sleep(200); break; } } travel.click(); await ns.sleep(200); for (const aevum of doc.querySelectorAll('div#root span')) { if (aevum.textContent == 'A') { aevum.click(); await ns.sleep(200); break; } } for (const travelConfirm of doc.querySelectorAll('div[role="presentation"] p')) { if (travelConfirm.textContent == 'Travel') { travelConfirm.click(); await ns.sleep(200); break; } } try { doc.querySelector('div[role="presentation"] button').click(); } catch (error) { } city.click(); await ns.sleep(200); for (const uni of doc.querySelectorAll('div#root span')) { if (uni.textContent == 'U') { uni.click(); await ns.sleep(200); break; } } for (const course of doc.querySelectorAll('div#root button')) { if (course.textContent == 'Take Algorithms course ($-1.280k / sec)') { course.click(); await ns.sleep(200); break; } } for (const closeCourse of doc.querySelectorAll('div#root button')) { if (closeCourse.textContent == 'Do something else simultaneously') { closeCourse.click(); await ns.sleep(200); break; } } await ns.sleep(1000); terminal.click(); }