RubixYT1

wordibot tw.2s4.me script (update)

Jan 11th, 2026 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.25 KB | None | 0 0
  1. (async function() {
  2. w.chat.send("WordiBot v1.1.5 online!, head to 10000, 5000 for to see Wordle game.");
  3.  
  4. let gameAnswer = "";
  5. let gameAttempts = 0;
  6. let wordLength = 0;
  7. const startX = 10000;
  8. const startY = -5000;
  9. let guessBarPositions = [];
  10. let gameActive = false;
  11. let attemptsCurrent = 0;
  12. let startTime = Date.now();
  13. let isChecking = false;
  14. let timerInterval = null;
  15.  
  16. const delay = () => new Promise(r => setTimeout(r, 10));
  17. const tpDelay = () => new Promise(r => setTimeout(r, 250));
  18. const initDelay = () => new Promise(r => setTimeout(r, 1500));
  19.  
  20. const safeGetCharInfo = (x, y) => {
  21. try {
  22. if (typeof getCharInfoXY === 'function') {
  23. let info = getCharInfoXY(x, y);
  24. if (info && typeof info === 'object') return info;
  25. }
  26. } catch (e) {}
  27. return null;
  28. };
  29.  
  30. const getAttemptsColor = (left) => {
  31. if (left >= 7) return 20;
  32. if (left === 6) return 12;
  33. if (left === 5) return 11;
  34. if (left === 4) return 9;
  35. if (left === 3) return 7;
  36. if (left === 2) return 5;
  37. if (left === 1) return 1;
  38. return 30;
  39. };
  40.  
  41. const getElapsed = () => {
  42. let diff = Date.now() - startTime;
  43. let ms = diff % 1000;
  44. let s = Math.floor(diff / 1000) % 60;
  45. let m = Math.floor(diff / 60000);
  46. return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}.${String(ms).padStart(3, '0')}`;
  47. };
  48.  
  49. const typeText = async (text) => {
  50. for (let i = 0; i < text.length; i++) {
  51. w.typeChar(text[i], 1);
  52. await delay();
  53. }
  54. };
  55.  
  56. const clearLine = async (len) => {
  57. for (let i = 0; i < len; i++) {
  58. w.typeChar(' ', 1);
  59. await delay();
  60. }
  61. };
  62.  
  63. const updateAttemptsDisplay = async () => {
  64. let displayX = startX + wordLength + 3;
  65. let left = gameAttempts - attemptsCurrent;
  66.  
  67. w.tp(displayX, startY);
  68. await tpDelay();
  69. w.changeColor(getAttemptsColor(left));
  70. await delay();
  71. await clearLine(30);
  72. w.tp(displayX, startY);
  73. await tpDelay();
  74. await typeText(`⚡ Attempts: ${attemptsCurrent}/${gameAttempts} (${left} left)`);
  75. };
  76.  
  77. const updateTimeDisplay = async () => {
  78. let displayX = startX + wordLength + 3;
  79.  
  80. w.tp(displayX, startY + 2);
  81. await tpDelay();
  82. w.changeColor(2);
  83. await delay();
  84. await clearLine(30);
  85. w.tp(displayX, startY + 2);
  86. await tpDelay();
  87. await typeText(`⏱ ${getElapsed()}`);
  88. };
  89.  
  90. const startTimer = () => {
  91. if (timerInterval) clearInterval(timerInterval);
  92. timerInterval = setInterval(async () => {
  93. if (gameActive && !isChecking) {
  94. await updateTimeDisplay();
  95. }
  96. }, 500);
  97. };
  98.  
  99. const stopTimer = () => {
  100. if (timerInterval) {
  101. clearInterval(timerInterval);
  102. timerInterval = null;
  103. }
  104. };
  105.  
  106. window.clear = async function() {
  107. if (!gameActive) throw new Error("No active game to clear!");
  108.  
  109. for (let row = 0; row < guessBarPositions.length; row++) {
  110. let pos = guessBarPositions[row];
  111. w.tp(pos.x, pos.y);
  112. await tpDelay();
  113. w.changeColor(1);
  114. await delay();
  115. for (let col = 0; col < wordLength; col++) {
  116. w.typeChar('_', 1);
  117. await delay();
  118. }
  119. }
  120.  
  121. attemptsCurrent = 0;
  122. startTime = Date.now();
  123. await updateAttemptsDisplay();
  124. await updateTimeDisplay();
  125.  
  126. w.tp(startX, startY);
  127. await tpDelay();
  128. };
  129.  
  130. window.wordi = async function(answer, attempts) {
  131. if (answer === undefined || attempts === undefined) {
  132. throw new Error("Both 'answer' and 'attempts' parameters are required!");
  133. }
  134.  
  135. stopTimer();
  136. gameAnswer = String(answer).toUpperCase();
  137. gameAttempts = Number(attempts);
  138. wordLength = gameAnswer.length;
  139. guessBarPositions = [];
  140. gameActive = true;
  141. attemptsCurrent = 0;
  142. startTime = Date.now();
  143.  
  144. w.tp(startX, startY);
  145. await initDelay();
  146.  
  147. w.tp(startX, startY - 2);
  148. await tpDelay();
  149. w.changeColor(9);
  150. await delay();
  151. await typeText(`✦ W O R D L E ✦`);
  152.  
  153. w.tp(startX, startY - 1);
  154. await tpDelay();
  155. w.changeColor(7);
  156. await delay();
  157. await typeText(`═`.repeat(wordLength));
  158.  
  159. let currentY = startY;
  160.  
  161. for (let row = 0; row < gameAttempts; row++) {
  162. guessBarPositions.push({ x: startX, y: currentY });
  163.  
  164. w.tp(startX, currentY);
  165. await tpDelay();
  166. w.changeColor(1);
  167. await delay();
  168.  
  169. for (let col = 0; col < wordLength; col++) {
  170. w.typeChar('_', 1);
  171. await delay();
  172. }
  173.  
  174. currentY += 2;
  175. }
  176.  
  177. w.tp(startX, startY + gameAttempts * 2);
  178. await tpDelay();
  179. w.changeColor(7);
  180. await delay();
  181. await typeText(`═`.repeat(wordLength));
  182.  
  183. await updateAttemptsDisplay();
  184. await updateTimeDisplay();
  185.  
  186. startTimer();
  187.  
  188. w.tp(startX, startY);
  189. await tpDelay();
  190.  
  191. console.log("=== Game Board Ready ===");
  192. console.log(`Word: ${wordLength} letters | Attempts: ${gameAttempts}`);
  193. };
  194.  
  195. window.check = async function() {
  196. if (!gameActive) throw new Error("No active game! Use wordi('answer', attempts) to start.");
  197.  
  198. isChecking = true;
  199. let gameWon = false;
  200. attemptsCurrent = 0;
  201.  
  202. for (let attempt = 0; attempt < gameAttempts; attempt++) {
  203. let pos = guessBarPositions[attempt];
  204. if (!pos) continue;
  205.  
  206. let guess = "";
  207.  
  208. for (let i = 0; i < wordLength; i++) {
  209. let charInfo = safeGetCharInfo(pos.x + i, pos.y);
  210. if (!charInfo || charInfo.char === ' ') { guess += '_'; continue; }
  211. guess += (charInfo.char && charInfo.char !== '_') ? String(charInfo.char).toUpperCase() : '_';
  212. }
  213.  
  214. if (guess.includes('_') || guess.length !== wordLength) continue;
  215.  
  216. attemptsCurrent++;
  217. let allCorrect = true;
  218.  
  219. w.tp(pos.x, pos.y);
  220. await tpDelay();
  221.  
  222. for (let i = 0; i < wordLength; i++) {
  223. let guessChar = guess[i];
  224. let answerChar = gameAnswer[i];
  225. if (!guessChar) continue;
  226.  
  227. if (guessChar === answerChar) {
  228. w.changeColor(9);
  229. } else if (gameAnswer.includes(guessChar)) {
  230. w.changeColor(7);
  231. allCorrect = false;
  232. } else {
  233. w.changeColor(1);
  234. allCorrect = false;
  235. }
  236.  
  237. await delay();
  238. w.typeChar(guessChar, 1);
  239. await delay();
  240. }
  241.  
  242. await updateAttemptsDisplay();
  243.  
  244. if (allCorrect) { gameWon = true; break; }
  245. }
  246.  
  247. if (gameWon) {
  248. w.chat.send("You found the answer");
  249. gameActive = false;
  250. stopTimer();
  251. } else if (attemptsCurrent >= gameAttempts) {
  252. w.chat.send("You lost! (answer is " + gameAnswer + ")");
  253. gameActive = false;
  254. stopTimer();
  255. } else {
  256. console.log(`${attemptsCurrent}/${gameAttempts} attempts used.`);
  257. }
  258.  
  259. isChecking = false;
  260. };
  261.  
  262. console.log("=== WordiBot v1.1.5 Loaded ===");
  263. console.log("wordi('answer', attempts) | check() | clear()");
  264. })();
Advertisement
Add Comment
Please, Sign In to add comment