B2BÍøÂçÈí¼þ

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á ÉóºËÍøÕ¾ºÅ:QQ:896757558
ËÑË÷
²é¿´: 5|»Ø¸´: 0
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ

AIWROKÈí¼þ°²×¿»ã¼¯Èí¼þµã»÷·½·¨Ê¾Àý

[¸´ÖÆÁ´½Ó]

1037

Ö÷Ìâ

1042

Ìû×Ó

7425

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

»ý·Ö
7425
Ìø×ªµ½Ö¸¶¨Â¥²ã
Â¥Ö÷


AIWROKÈí¼þ°²×¿»ã¼¯Èí¼þµã»÷·½·¨Ê¾Àý
AIWROKÈí¼þ°²×¿»ã¼¯Èí¼þµã»÷·½·¨Ê¾Àý B2BÍøÂçÈí¼þ
AIWROKÈí¼þ°²×¿»ã¼¯Èí¼þµã»÷·½·¨Ê¾Àý B2BÍøÂçÈí¼þ

AIWROKÈí¼þ°²×¿»ã¼¯Èí¼þµã»÷·½·¨Ê¾Àý B2BÍøÂçÈí¼þ


  1. // °²×¿AIWROK»ã¼¯Èí¼þµã»÷
  2. // 🍎½»Á÷QQȺ711841924Ⱥһ£¬Æ»¹ûÄÚ²âȺ£¬528816639
  3. // ¼æÈÝES5±ê×¼£¬½öÖ§³Ö°²×¿É豸ÔËÐÐ

  4. // ³õʼ»¯ÈÕÖ¾´°¿Ú
  5. if (typeof logWindow !== 'undefined') {
  6.     print.log(logWindow.show());
  7.     print.log(logWindow.clear());
  8.     print.log(logWindow.setHeight(2500));
  9.     print.log(logWindow.setWidth(1500));
  10.     print.log(logWindow.setNoClickModel());
  11. }

  12. // ¼æÈÝES5µÄÑÓ³Ùº¯Êý
  13. function es5Sleep(ms) {
  14.     if (typeof sleep !== 'undefined') {
  15.         if (typeof sleep.millisecond === 'function') {
  16.             sleep.millisecond(ms);
  17.         } else if (typeof sleep === 'function') {
  18.             sleep(ms);
  19.         }
  20.     } else {
  21.         // ´¿JavaScriptʵÏÖµÄÑÓ³Ù
  22.         var start = new Date().getTime();
  23.         while (new Date().getTime() - start < ms) {
  24.             // ¿ÕÑ­»·ÑÓ³Ù
  25.         }
  26.     }
  27. }



  28. // ==================== 1. °´Å¥µã»÷ʼþ¼àÌý ====================

  29. /**
  30. * ÉèÖð´Å¥µã»÷ʼþ¼àÌýÆ÷
  31. * @param {Object} button - °´Å¥¶ÔÏó
  32. * @param {Function} callback - µã»÷»Øµ÷º¯Êý
  33. */
  34. function setButtonClickListener(button, callback) {
  35.     if (button && button.setOnClickListener) {
  36.         try {
  37.             button.setOnClickListener(callback);
  38.             print.log("°´Å¥µã»÷ʼþ¼àÌýÆ÷ÉèÖóɹ¦");
  39.         } catch (e) {
  40.             print.log("ÉèÖð´Å¥µã»÷ʼþ¼àÌýÆ÷ʱ³ö´í: " + e);
  41.         }
  42.     } else {
  43.         print.log("ÎÞЧµÄ°´Å¥¶ÔÏó");
  44.     }
  45. }

  46. // ʾÀýÓ÷¨
  47. function buttonClickExample() {
  48.     // ¼ÙÉèÎÒÃÇÓÐÒ»¸ö°´Å¥¶ÔÏó
  49.     // var btn_start = f1.findViewById('startButton');
  50.    
  51.     // ÉèÖõã»÷ʼþ
  52.     /*
  53.     setButtonClickListener(btn_start, function() {
  54.         printl("Æô¶¯°´Å¥±»µã»÷");
  55.         // Ö´ÐÐÆô¶¯Âß¼­
  56.     });
  57.     */
  58.    
  59.     print.log("°´Å¥µã»÷ʼþʾÀýÑÝʾÍê³É");
  60. }

  61. // ==================== 2. ÆÁÄ»×ø±êµã»÷ ====================

  62. /**
  63. * µã»÷ÆÁĻָ¶¨×ø±ê
  64. * @param {number} x - x×ø±ê
  65. * @param {number} y - y×ø±ê
  66. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  67. */
  68. function clickScreen(x, y) {
  69.     try {
  70.         if (typeof auto !== 'undefined' && typeof auto.clickPoint === 'function') {
  71.             auto.clickPoint(x, y);
  72.             print.log("ʹÓÃauto.clickPointµã»÷×ø±ê (" + x + ", " + y + ")");
  73.             return true;
  74.         } else if (typeof hid !== 'undefined' && typeof hid.click === 'function') {
  75.             hid.click(x, y);
  76.             print.log("ʹÓÃhid.clickµã»÷×ø±ê (" + x + ", " + y + ")");
  77.             return true;
  78.         } else {
  79.             print.log("δÕÒµ½¿ÉÓõĵã»÷·½·¨");
  80.             return false;
  81.         }
  82.     } catch (e) {
  83.         print.log("µã»÷ÆÁĻʧ°Ü: " + e);
  84.         return false;
  85.     }
  86. }

  87. // ʾÀýÓ÷¨
  88. function screenClickExample() {
  89.     // µã»÷ÆÁÄ»ÖÐÐÄλÖÃ
  90.     var screenWidth = 1080; // ¼ÙÉèÆÁÄ»¿í¶È
  91.     var screenHeight = 1920; // ¼ÙÉèÆÁÄ»¸ß¶È
  92.     var centerX = screenWidth / 2;
  93.     var centerY = screenHeight / 2;
  94.    
  95.     clickScreen(centerX, centerY);
  96.     print.log("ÆÁÄ»×ø±êµã»÷ʾÀýÑÝʾÍê³É");
  97. }

  98. // ==================== 3. ´øÖØÊÔ»úÖÆµÄ°²È«µã»÷ ====================

  99. /**
  100. * °²È«µã»÷£¨´øÖØÊÔ»úÖÆ£©
  101. * @param {number} x - x×ø±ê
  102. * @param {number} y - y×ø±ê
  103. * @param {number} retries - ÖØÊÔ´ÎÊý
  104. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  105. */
  106. function safeClick(x, y, retries) {
  107.     if (typeof retries === 'undefined') retries = 3;
  108.    
  109.     for (var i = 0; i < retries; i++) {
  110.         try {
  111.             if (typeof hid !== 'undefined' && typeof hid.click === 'function') {
  112.                 hid.click(x, y);
  113.                 print.log("µã»÷×ø±ê (" + x + ", " + y + ") ³É¹¦");
  114.                 return true;
  115.             } else if (typeof auto !== 'undefined' && typeof auto.clickPoint === 'function') {
  116.                 auto.clickPoint(x, y);
  117.                 print.log("µã»÷×ø±ê (" + x + ", " + y + ") ³É¹¦");
  118.                 return true;
  119.             }
  120.         } catch (error) {
  121.             print.log("µã»÷ʧ°Ü£¬ÖØÊÔµÚ " + (i + 1) + " ´Î£º" + error);
  122.             // ¼æÈÝES5µÄsleepµ÷ÓÃ
  123.             es5Sleep(500);
  124.         }
  125.     }
  126.     print.log("µã»÷×ø±ê (" + x + ", " + y + ") ×îÖÕʧ°Ü");
  127.     return false;
  128. }

  129. // ʾÀýÓ÷¨
  130. function safeClickExample() {
  131.     safeClick(500, 500, 3);
  132.     print.log("°²È«µã»÷ʾÀýÑÝʾÍê³É");
  133. }

  134. // ==================== 4. ÕÒ×Öµã»÷ ====================

  135. /**
  136. * ÕÒ×Ö²¢µã»÷¹¦ÄÜ
  137. * @param {string} targetText - Òª²éÕÒ²¢µã»÷µÄÎÄ×Ö
  138. * @param {array} region - ËÑË÷ÇøÓò£¬¿ÉÑ¡²ÎÊý [x1, y1, x2, y2]
  139. * @param {object} ocr - OCRʵÀý
  140. * @returns {boolean} ÊÇ·ñ³É¹¦µã»÷
  141. */
  142. function findTextAndClick(targetText, region, ocr) {
  143.     try {
  144.         var result;
  145.         
  146.         if (region && region.length == 4) {
  147.             // ÇøÓòÕÒ×Ö
  148.             // result = ocr.recognize(region[0], region[1], region[2], region[3]);
  149.             print.log("ÔÚÇøÓò " + region + " ÖвéÕÒÎÄ×Ö: " + targetText);
  150.         } else {
  151.             // È«ÆÁÕÒ×Ö
  152.             // result = ocr.recognize(0, 0, screenWidth, screenHeight);
  153.             print.log("ÔÚÈ«ÆÁÖвéÕÒÎÄ×Ö: " + targetText);
  154.         }
  155.         
  156.         // Ä£ÄâÕÒµ½ÎÄ×ÖµÄÇé¿ö
  157.         var mockResult = {
  158.             text: targetText,
  159.             centerX: 500,
  160.             centerY: 500
  161.         };
  162.         
  163.         if (mockResult) {
  164.             print.log('×¼±¸µã»÷ÎÄ×Ö: ' + mockResult.text);
  165.             print.log('µã»÷×ø±ê: (' + mockResult.centerX + ', ' + mockResult.centerY + ')');
  166.             
  167.             // Ìí¼ÓËæ»úÆ«ÒÆÄ£ÄâÕæÊµµã»÷
  168.             var randomX = mockResult.centerX + (Math.random() - 0.5) * 10;
  169.             var randomY = mockResult.centerY + (Math.random() - 0.5) * 10;
  170.             
  171.             clickScreen(randomX, randomY);
  172.             es5Sleep(500);
  173.             
  174.             return true;
  175.         } else {
  176.             print.log('δÕÒµ½¿Éµã»÷µÄÎÄ×Ö: ' + targetText);
  177.             return false;
  178.         }
  179.     } catch (e) {
  180.         print.log('ÕÒ×Öµã»÷ʧ°Ü: ' + e);
  181.         return false;
  182.     }
  183. }

  184. // ʾÀýÓ÷¨
  185. function findTextClickExample() {
  186.     findTextAndClick("È·¶¨", [0, 0, 1080, 1920]);
  187.     print.log("ÕÒ×Öµã»÷ʾÀýÑÝʾÍê³É");
  188. }

  189. // ==================== 5. ϵͳʼþ¼àÌý ====================

  190. /**
  191. * ÉèÖÃϵͳʼþ¼àÌýÆ÷
  192. */
  193. function setupSystemEventListeners() {
  194.     // ¿ªÊ¼°´Å¥Ê¼þ¼àÌý
  195.     try {
  196.         if (typeof event !== 'undefined' && typeof event.onStartEvent === 'function') {
  197.             event.onStartEvent(function(){
  198.                 print.log('¿ªÊ¼°´Å¥±»µã»÷');
  199.             });
  200.             print.log("¿ªÊ¼°´Å¥Ê¼þ¼àÌýÆ÷ÉèÖóɹ¦");
  201.         }
  202.     } catch (e) {
  203.         print.log("ÉèÖÿªÊ¼°´Å¥Ê¼þ¼àÌýÆ÷ʱ³ö´í: " + e);
  204.     }
  205.    
  206.     // ÔÝÍ£°´Å¥Ê¼þ¼àÌý
  207.     try {
  208.         if (typeof event !== 'undefined' && typeof event.onPauseEvent === 'function') {
  209.             event.onPauseEvent(function(){
  210.                 print.log('ÔÝÍ£°´Å¥±»µã»÷');
  211.             });
  212.             print.log("ÔÝÍ£°´Å¥Ê¼þ¼àÌýÆ÷ÉèÖóɹ¦");
  213.         }
  214.     } catch (e) {
  215.         print.log("ÉèÖÃÔÝÍ£°´Å¥Ê¼þ¼àÌýÆ÷ʱ³ö´í: " + e);
  216.     }
  217.    
  218.     // Í£Ö¹°´Å¥Ê¼þ¼àÌý
  219.     try {
  220.         if (typeof event !== 'undefined' && typeof event.onStopEvent === 'function') {
  221.             event.onStopEvent(function(){
  222.                 print.log('Í£Ö¹°´Å¥±»µã»÷');
  223.             });
  224.             print.log("Í£Ö¹°´Å¥Ê¼þ¼àÌýÆ÷ÉèÖóɹ¦");
  225.         }
  226.     } catch (e) {
  227.         print.log("ÉèÖÃÍ£Ö¹°´Å¥Ê¼þ¼àÌýÆ÷ʱ³ö´í: " + e);
  228.     }
  229. }

  230. // ʾÀýÓ÷¨
  231. function systemEventExample() {
  232.     setupSystemEventListeners();
  233.     print.log("ϵͳʼþ¼àÌýʾÀýÑÝʾÍê³É");
  234. }

  235. // ==================== 6. ÍøÒ³°´Å¥µã»÷ ====================

  236. /**
  237. * ÍøÒ³°´Å¥µã»÷ʾÀý´úÂë
  238. * ×¢Ò⣺´Ë´úÂëÓ¦ÔÚH5Ò³ÃæÖÐʹÓÃ
  239. */
  240. var webButtonClickExample = {
  241.     // HTML²¿·Ö
  242.     html: '<button onclick="showTextValue()">ÏÔʾÎı¾Öµ</button> ' +
  243.           '<button onclick="runStartScript()">Ö´ÐпªÊ¼½Å±¾</button> ' +
  244.           '<button class="danger" onclick="closePage()">¹Ø±ÕÒ³Ãæ</button>',
  245.    
  246.     // JavaScript²¿·Ö
  247.     javascript: '// ÏÔʾÎı¾Öµ\n' +
  248.                 'function showTextValue() {\n' +
  249.                 '    var inputText = document.getElementById("inputText");\n' +
  250.                 '    if (inputText) {\n' +
  251.                 '        printLog("Îı¾Öµ: " + inputText.value);\n' +
  252.                 '    }\n' +
  253.                 '}\n' +
  254.                 '\n' +
  255.                 '// Ö´ÐпªÊ¼½Å±¾\n' +
  256.                 'function runStartScript() {\n' +
  257.                 '    printLog("Ö´ÐпªÊ¼½Å±¾");\n' +
  258.                 '    // ÕâÀï¿ÉÒÔµ÷ÓÃAIWROKµÄAPI\n' +
  259.                 '}\n' +
  260.                 '\n' +
  261.                 '// ¹Ø±ÕÒ³Ãæ\n' +
  262.                 'function closePage() {\n' +
  263.                 '    printLog("¹Ø±ÕÒ³Ãæ");\n' +
  264.                 '    if (typeof dismiss === "function") {\n' +
  265.                 '        dismiss();\n' +
  266.                 '    }\n' +
  267.                 '}\n' +
  268.                 '\n' +
  269.                 '// ʹÓÃaddEventListener·½Ê½\n' +
  270.                 'function setupEventListeners() {\n' +
  271.                 '    var buttons = document.querySelectorAll("button");\n' +
  272.                 '    for (var i = 0; i < buttons.length; i++) {\n' +
  273.                 '        (function(button) {\n' +
  274.                 '            button.addEventListener("click", function() {\n' +
  275.                 '                printLog("°´Å¥±»µã»÷: " + this.textContent);\n' +
  276.                 '            });\n' +
  277.                 '        })(buttons[i]);\n' +
  278.                 '    }\n' +
  279.                 '}'
  280. };

  281. // ==================== 7. HIDµã»÷·½Ê½ ====================

  282. /**
  283. * ʹÓÃHID·½Ê½µã»÷ÆÁÄ»
  284. * @param {number} x - x×ø±ê
  285. * @param {number} y - y×ø±ê
  286. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  287. */
  288. function hidClick(x, y) {
  289.     try {
  290.         if (typeof hid !== 'undefined' && typeof hid.click === 'function') {
  291.             hid.click(x, y);
  292.             print.log("HIDµã»÷×ø±ê (" + x + ", " + y + ") ³É¹¦");
  293.             return true;
  294.         } else {
  295.             print.log("HIDÄ£¿é²»¿ÉÓ㬳¢ÊÔʹÓÃÆäËûµã»÷·½Ê½");
  296.             // »ØÍ˵½Í¨Óõã»÷·½·¨
  297.             return clickScreen(x, y);
  298.         }
  299.     } catch (e) {
  300.         print.log("HIDµã»÷ʧ°Ü: " + e);
  301.         return false;
  302.     }
  303. }

  304. // ʾÀýÓ÷¨
  305. function hidClickExample() {
  306.     hidClick(500, 500);
  307.     print.log("HIDµã»÷ʾÀýÑÝʾÍê³É");
  308. }

  309. // ==================== 8. ×éºÏµã»÷ʾÀý ====================

  310. /**
  311. * ×éºÏµã»÷ʾÀý
  312. * ÑÝʾ¶àÖÖµã»÷·½Ê½µÄ×éºÏʹÓÃ
  313. */
  314. function combinedClickExample() {
  315.     print.log("=== ×éºÏµã»÷ʾÀý¿ªÊ¼ ===");
  316.    
  317.     // 1. Ïȵã»÷ÆÁÄ»ÖÐÑë
  318.     clickScreen(540, 960);
  319.     // ¼æÈÝES5µÄÑÓ³Ù´¦Àí
  320.     es5Sleep(1000);
  321.    
  322.     // 2. ʹÓð²È«µã»÷µã»÷È·¶¨°´Å¥
  323.     safeClick(800, 1600, 3);
  324.     // ¼æÈÝES5µÄÑÓ³Ù´¦Àí
  325.     es5Sleep(1000);
  326.    
  327.     // 3. Ä£ÄâÕÒ×Öµã»÷
  328.     findTextAndClick("ÏÂÒ»²½");
  329.    
  330.     print.log("=== ×éºÏµã»÷ʾÀý½áÊø ===");
  331. }

  332. // ==================== 9. ÕÒͼµã»÷ ====================

  333. /**
  334. * ÕÒͼ²¢µã»÷¹¦ÄÜ
  335. * @param {string} imagePath - ͼƬ·¾¶
  336. * @returns {boolean} ÊÇ·ñ³É¹¦µã»÷
  337. */
  338. function findImageAndClick(imagePath) {
  339.     try {
  340.         print.log("¿ªÊ¼ÕÒͼ: " + imagePath);
  341.         
  342.         // ¼ì²éopencvÊÇ·ñ¿ÉÓÃ
  343.         if (typeof opencv !== 'undefined' && typeof opencv.findImagesEx === 'function') {
  344.             var detects = opencv.findImagesEx(imagePath);
  345.             
  346.             if (detects !== null && detects.length > 0) {
  347.                 print.log("ÕÒµ½Ä¿±ê: " + detects);
  348.                
  349.                 // µã»÷µÚÒ»¸öÕÒµ½µÄÄ¿±ê
  350.                 if (typeof detects[0] !== 'undefined' && typeof detects[0].click === 'function') {
  351.                     detects[0].click();
  352.                     print.log("µã»÷Ä¿±ê³É¹¦");
  353.                     return true;
  354.                 } else if (typeof detects[0] !== 'undefined' && typeof detects[0].x !== 'undefined' && typeof detects[0].y !== 'undefined') {
  355.                     // Èç¹ûûÓÐclick·½·¨£¬³¢ÊÔÖ±½Óµã»÷×ø±ê
  356.                     var x = detects[0].x;
  357.                     var y = detects[0].y;
  358.                     clickScreen(x, y);
  359.                     print.log("µã»÷×ø±ê (" + x + ", " + y + ") ³É¹¦");
  360.                     return true;
  361.                 }
  362.             } else {
  363.                 print.log("δÕÒµ½Ä¿±ê");
  364.                 return false;
  365.             }
  366.         } else {
  367.             print.log("opencvÄ£¿é²»¿ÉÓÃ");
  368.             return false;
  369.         }
  370.     } catch (e) {
  371.         print.log("ÕÒͼµã»÷ʧ°Ü: " + e);
  372.         return false;
  373.     }
  374. }

  375. // ʾÀýÓ÷¨
  376. function findImageClickExample() {
  377.     // ʹÓÃÖ¸¶¨µÄͼƬÃû³Æ
  378.     var result = findImageAndClick('ͼɫ766772.cv');
  379.     print.log("ÕÒͼµã»÷ʾÀýÑÝʾÍê³É£¬½á¹û: " + result);
  380. }

  381. // ==================== 10. ÆäËûµã»÷·½Ê½ ====================

  382. /**
  383. * µã»÷°Ù·Ö±È×ø±ê
  384. * @param {number} percentX - XÖá°Ù·Ö±È (0-100)
  385. * @param {number} percentY - YÖá°Ù·Ö±È (0-100)
  386. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  387. */
  388. function clickPercent(percentX, percentY) {
  389.     try {
  390.         if (typeof auto !== 'undefined' && typeof auto.clickPercent === 'function') {
  391.             auto.clickPercent(percentX, percentY);
  392.             print.log("ʹÓÃauto.clickPercentµã»÷°Ù·Ö±È×ø±ê (" + percentX + ", " + percentY + ")");
  393.             return true;
  394.         } else if (typeof agent !== 'undefined' && typeof agent.clickPercent === 'function') {
  395.             agent.clickPercent(percentX, percentY);
  396.             print.log("ʹÓÃagent.clickPercentµã»÷°Ù·Ö±È×ø±ê (" + percentX + ", " + percentY + ")");
  397.             return true;
  398.         } else if (typeof hid !== 'undefined' && typeof hid.clickPercent === 'function') {
  399.             hid.clickPercent(percentX, percentY);
  400.             print.log("ʹÓÃhid.clickPercentµã»÷°Ù·Ö±È×ø±ê (" + percentX + ", " + percentY + ")");
  401.             return true;
  402.         } else {
  403.             print.log("δÕÒµ½¿ÉÓõİٷֱȵã»÷·½·¨");
  404.             return false;
  405.         }
  406.     } catch (e) {
  407.         print.log("µã»÷°Ù·Ö±È×ø±êʧ°Ü: " + e);
  408.         return false;
  409.     }
  410. }

  411. /**
  412. * Á¬Ðøµã»÷
  413. * @param {number} x - x×ø±ê
  414. * @param {number} y - y×ø±ê
  415. * @param {number} count - µã»÷´ÎÊý
  416. * @param {number} interval - µã»÷¼ä¸ô(ºÁÃë)
  417. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  418. */
  419. function clickMultiple(x, y, count, interval) {
  420.     try {
  421.         if (typeof hid !== 'undefined' && typeof hid.clicks === 'function') {
  422.             hid.clicks(x, y, count, interval);
  423.             print.log("ʹÓÃhid.clicksÁ¬Ðøµã»÷ (" + x + ", " + y + ") " + count + " ´Î");
  424.             return true;
  425.         } else {
  426.             // Ä£ÄâÁ¬Ðøµã»÷
  427.             for (var i = 0; i < count; i++) {
  428.                 clickScreen(x, y);
  429.                 if (i < count - 1) {
  430.                     es5Sleep(interval || 100);
  431.                 }
  432.             }
  433.             print.log("Ä£ÄâÁ¬Ðøµã»÷ (" + x + ", " + y + ") " + count + " ´Î");
  434.             return true;
  435.         }
  436.     } catch (e) {
  437.         print.log("Á¬Ðøµã»÷ʧ°Ü: " + e);
  438.         return false;
  439.     }
  440. }

  441. /**
  442. * ´úÀíģʽµã»÷
  443. * @param {number} x - x×ø±ê
  444. * @param {number} y - y×ø±ê
  445. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  446. */
  447. function agentClick(x, y) {
  448.     try {
  449.         if (typeof agent !== 'undefined' && typeof agent.click === 'function') {
  450.             agent.click(x, y);
  451.             print.log("ʹÓÃagent.clickµã»÷×ø±ê (" + x + ", " + y + ")");
  452.             return true;
  453.         } else {
  454.             print.log("´úÀíÄ£¿é²»¿ÉÓÃ");
  455.             return false;
  456.         }
  457.     } catch (e) {
  458.         print.log("´úÀíµã»÷ʧ°Ü: " + e);
  459.         return false;
  460.     }
  461. }

  462. /**
  463. * ÔªËØµã»÷
  464. * @param {Object} node - ÔªËØ½Úµã
  465. * @returns {boolean} ÊÇ·ñµã»÷³É¹¦
  466. */
  467. function clickElement(node) {
  468.     try {
  469.         if (node && typeof node.click === 'function') {
  470.             node.click();
  471.             print.log("µã»÷ÔªËØ³É¹¦");
  472.             return true;
  473.         } else if (node && typeof node.clickPoint === 'function') {
  474.             node.clickPoint();
  475.             print.log("µã»÷ÔªËØ×ø±ê³É¹¦");
  476.             return true;
  477.         } else {
  478.             print.log("ÎÞЧµÄÔªËØ½Úµã»òÎÞµã»÷·½·¨");
  479.             return false;
  480.         }
  481.     } catch (e) {
  482.         print.log("µã»÷ÔªËØÊ§°Ü: " + e);
  483.         return false;
  484.     }
  485. }

  486. /**
  487. * ¼àÌýµã»÷ʼþ
  488. * @param {Function} callback - µã»÷»Øµ÷º¯Êý
  489. * @returns {boolean} ÊÇ·ñÉèÖóɹ¦
  490. */
  491. function setupClickEventListener(callback) {
  492.     try {
  493.         if (typeof event !== 'undefined' && typeof event.onClickEvent === 'function') {
  494.             event.onClickEvent(callback);
  495.             print.log("µã»÷ʼþ¼àÌýÆ÷ÉèÖóɹ¦");
  496.             return true;
  497.         } else {
  498.             print.log("ʼþÄ£¿é²»¿ÉÓÃ");
  499.             return false;
  500.         }
  501.     } catch (e) {
  502.         print.log("ÉèÖõã»÷ʼþ¼àÌýÆ÷ʧ°Ü: " + e);
  503.         return false;
  504.     }
  505. }

  506. // ʾÀýÓ÷¨
  507. function otherClickMethodsExample() {
  508.     print.log("=== ÆäËûµã»÷·½Ê½Ê¾Àý¿ªÊ¼ ===");
  509.    
  510.     // ²âÊ԰ٷֱȵã»÷
  511.     clickPercent(50, 50);
  512.     es5Sleep(500);
  513.    
  514.     // ²âÊÔÁ¬Ðøµã»÷
  515.     clickMultiple(500, 500, 3, 200);
  516.     es5Sleep(500);
  517.    
  518.     // ²âÊÔ´úÀíµã»÷
  519.     agentClick(600, 600);
  520.     es5Sleep(500);
  521.    
  522.     // ²âÊÔµã»÷ʼþ¼àÌý
  523.     setupClickEventListener(function(x, y) {
  524.         print.log("¼àÌýµ½µã»÷ʼþ: (" + x + ", " + y + ")");
  525.     });
  526.    
  527.     print.log("=== ÆäËûµã»÷·½Ê½Ê¾Àý½áÊø ===");
  528. }

  529. // ==================== ÑÝʾËùÓеã»÷·½Ê½ ====================

  530. /**
  531. * ÑÝʾËùÓеã»÷·½Ê½
  532. */
  533. function demoAllClickMethods() {
  534.     print.log("\n==================== °²×¿AIWROKµã»÷·½Ê½ÑÝʾ ====================");
  535.    
  536.     print.log("\n1. °´Å¥µã»÷ʼþ¼àÌýʾÀý:");
  537.     buttonClickExample();
  538.    
  539.     print.log("\n2. ÆÁÄ»×ø±êµã»÷ʾÀý:");
  540.     screenClickExample();
  541.    
  542.     print.log("\n3. °²È«µã»÷ʾÀý:");
  543.     safeClickExample();
  544.    
  545.     print.log("\n4. ÕÒ×Öµã»÷ʾÀý:");
  546.     findTextClickExample();
  547.    
  548.     print.log("\n5. ϵͳʼþ¼àÌýʾÀý:");
  549.     systemEventExample();
  550.    
  551.     print.log("\n6. HIDµã»÷ʾÀý:");
  552.     hidClickExample();
  553.    
  554.     print.log("\n7. ×éºÏµã»÷ʾÀý:");
  555.     combinedClickExample();
  556.    
  557.     print.log("\n8. ÕÒͼµã»÷ʾÀý:");
  558.     findImageClickExample();
  559.    
  560.     print.log("\n9. ÆäËûµã»÷·½Ê½Ê¾Àý:");
  561.     otherClickMethodsExample();
  562.    
  563.     print.log("\n==================== ÑÝʾÍê³É ====================");
  564.     print.log("\nÍøÒ³°´Å¥µã»÷ʾÀý´úÂë:\n" + webButtonClickExample.html);
  565.     print.log("\nÍøÒ³°´Å¥µã»÷JavaScript´úÂë:\n" + webButtonClickExample.javascript);
  566. }

  567. // ÔËÐÐÑÝʾ
  568. demoAllClickMethods();

  569. // µ¼³ö³£Óú¯Êý
  570. var ClickUtils = {
  571.     click: clickScreen,
  572.     safeClick: safeClick,
  573.     findTextAndClick: findTextAndClick,
  574.     findImageAndClick: findImageAndClick,
  575.     hidClick: hidClick,
  576.     clickPercent: clickPercent,
  577.     clickMultiple: clickMultiple,
  578.     agentClick: agentClick,
  579.     clickElement: clickElement,
  580.     setupClickEventListener: setupClickEventListener,
  581.     setButtonClickListener: setButtonClickListener,
  582.     setupSystemEventListeners: setupSystemEventListeners
  583. };
¸´ÖÆ´úÂë


»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

±¾°æ»ý·Ö¹æÔò

¹Ø±Õ

QQ|»ÓªÏúÈí¼þ×ÛºÏÌÖÂÛ|»ÓªÏúÈí¼þÓÐÎʱشð|»ÓªÏúÈí¼þ½Ì³Ì×¨Çø|»ÓªÏúÈí¼þPOST½Å±¾·ÖÏí|»ÓªÏúÈí¼þÆÕͨ½Å±¾·ÖÏí|»ÓªÏúÈí¼þÈí¼þ×ÊѶ|»ÓªÏúÈí¼þ¾«Æ·Èí¼þ|»ÓªÏúÈí¼þ¸üй«¸æ|ÓªÏúÈí¼þ|B2BÈí¼þ|B2BÍøÂçÈí¼þ ( ¾©ICP±¸09078825ºÅ )±¾ÍøÕ¾¿ª·¢µÄÓªÏúÈí¼þÊÇÒ»¿îеÄÍøÂçÓªÏúÈí¼þ£¬Õâ¿îÓªÏú¿ÉÒÔÈ¥ÍøÕ¾Èí¼þ£¬²©¿ÍÈí¼þ£¬B2BÈí¼þ£¬·ÖÀàÐÅÏ¢Íø·¢Ìù£¬¿ÉÒÔÇÀɳ·¢£¬¿ÉÒÔµ½°Ù¶ÈÎÄ¿âÉÏ´«WORDÎĵµ£¬¿ÉÒÔµ½Ò»Ð©ÊÇÏà²áÍøÕ¾×Ô¶¯ÉÏ´«Í¼Æ¬£¬Õâ¸ö×Ô¶¯·¢ÌûÈí¼þ×Ô´øÔÆÖ©Ö룬¼Ó¿ìÊÕ¼£¬ÓÐ6ÖÖ¶Ô½Ó´òÂë½Ó¿Ú£¬·½±ã£¬Ð§Âʸߣ¬Ëٶȿ죬¶øÇÒ¶ÔÍ϶¯µÄÑéÖ¤ÂëÈ«ÍøµÚÒ»¼Ò¶À¼ÒÖ§³Ö£¬È«²¿Ô­´´¼¼Êõ£¬¶À¼ÒÑз¢£¬Õý°æÔ­´´´ø°æÈ¨Èí¼þ¡£Ñ¡ÔñÍòÄÜÓªÏúÈí¼þ£¬¾ÍÑ¡ÔñÁËÒ»ÖÖ׬ǮµÄЧÂÊ£¬´ÓûÓб»³¬Ô½¹ý£¬Ò»Ö±ÔÚŬÁ¦Ñз¢Ð¼¼Êõ¡£·Å·ÉÃÎÏ룬½â·ÅË«ÊÖ£¬À´µã´´Ò⣬³É¾ÍÄãµÄÃÎÏ룬¾ÍÔÚÍòÄÜÓªÏúÈí¼þ¿ªÊ¼

map2

GMT+8, 2026-2-4 00:36 , Processed in 0.318871 second(s), 36 queries .

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí