Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function autoType() {
- // Configurable starting coordinates
- let startX = 0;
- let startY = 0;
- if (typeof w === 'undefined') {
- console.error('❌ w object not found!');
- return;
- }
- // Get clipboard content
- let clipboardText;
- try {
- clipboardText = await navigator.clipboard.readText();
- } catch (err) {
- console.error('❌ Clipboard read failed:', err);
- return;
- }
- if (!clipboardText || clipboardText.length === 0) {
- console.warn('⚠️ Clipboard is empty');
- return;
- }
- // Teleport to starting position
- w.tp(startX, startY);
- // Create coordList
- const coordList = [{ x: startX, y: startY, text: clipboardText }];
- // Paste the clipboard (if w.paste exists)
- if (typeof w.paste === 'function') {
- w.paste();
- } else {
- // Fallback: type entire text
- for (let char of clipboardText) {
- await w.typeChar(char, 0);
- }
- }
- console.log('✅ Pasted at', startX, startY);
- console.log('📋 coordList:', coordList);
- return coordList;
- }
- autoType();
Advertisement