Utoljára aktív 1693403813

tailnet.js Eredeti
1// Set finds to a list of keywords
2// finds = ["cat", "gopher"]
3let finds = null;
4
5function checkNames() {
6 if (finds === null) return `finds = ["cat", "gopher", ...]`;
7 const names = document.querySelectorAll('[name="tcd-rad"]');
8 for (let name of names) {
9 for (let find of finds){
10 if (name.value.startsWith(`${find}-`) || name.value.endsWith(`-${find}.ts.net`)) return name.value;
11 }
12 }
13 return null;
14}
15
16// When a keywords from finds is found, a confirmation appears
17// Esc/cancel to keep going
18// Enter/OK to stay on this roll to choose the found item
19async function nextFind() {
20 let cat = null;
21 const optBtn = document.querySelector('button.icon-parent:nth-child(3)');
22 while (true) {
23 cat = checkNames();
24 if (cat !== null) {
25 if (confirm(cat)) break;
26 }
27 optBtn.click();
28 await new Promise(r => setTimeout(r, 1000));
29 }
30}
31
32// Run in browser console with the re-roll modal open
33// await nextFind()