RubixYT1

Paste script (old, buggy)

Nov 28th, 2025
63
0
Never
6
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. async function autoType() {
  2. // Configurable starting coordinates
  3. let startX = 0;
  4. let startY = 0;
  5.  
  6. if (typeof w === 'undefined') {
  7. console.error('❌ w object not found!');
  8. return;
  9. }
  10.  
  11. // Get clipboard content
  12. let clipboardText;
  13. try {
  14. clipboardText = await navigator.clipboard.readText();
  15. } catch (err) {
  16. console.error('❌ Clipboard read failed:', err);
  17. return;
  18. }
  19.  
  20. if (!clipboardText || clipboardText.length === 0) {
  21. console.warn('⚠️ Clipboard is empty');
  22. return;
  23. }
  24.  
  25. // Teleport to starting position
  26. w.tp(startX, startY);
  27.  
  28. // Create coordList
  29. const coordList = [{ x: startX, y: startY, text: clipboardText }];
  30.  
  31. // Paste the clipboard (if w.paste exists)
  32. if (typeof w.paste === 'function') {
  33. w.paste();
  34. } else {
  35. // Fallback: type entire text
  36. for (let char of clipboardText) {
  37. await w.typeChar(char, 0);
  38. }
  39. }
  40.  
  41. console.log('✅ Pasted at', startX, startY);
  42. console.log('📋 coordList:', coordList);
  43.  
  44. return coordList;
  45. }
  46.  
  47. autoType();
Advertisement
Comments
Add Comment
Please, Sign In to add comment