B2BÍøÂçÈí¼þ

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

AIWROKÈí¼þÕÒ×ÖÓëOCR·½·¨»ã×ÜʾÀý

[¸´ÖÆÁ´½Ó]

1040

Ö÷Ìâ

1045

Ìû×Ó

7437

»ý·Ö

abc

Rank: 9Rank: 9Rank: 9

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



AIWROKÈí¼þÕÒ×ÖÓëOCR·½·¨»ã×ÜʾÀý


AIWROKÈí¼þÕÒ×ÖÓëOCR·½·¨»ã×ÜʾÀý B2BÍøÂçÈí¼þ
AIWROKÈí¼þÕÒ×ÖÓëOCR·½·¨»ã×ÜʾÀý B2BÍøÂçÈí¼þ

  1. // ÕÒ×ÖÓëOCR·½·¨»ã×ÜʾÀý
  2. // ¼æÈÝES5ºÍRhinoÒýÇæ
  3. // ÊÊÓÃÓÚ°²×¿AIWROK»·¾³
  4. // ¼¼Êõ½»Á÷QQȺ711841924Ⱥһ£¬Æ»¹ûÄÚ²âȺ£¬528816639

  5. /**
  6. * Ä£¿é£º»ù´¡ÕÒ×Ö·½·¨
  7. * ¹¦ÄÜ£ºÌṩ¶àÖÖÎÄ×Ö²éÕÒ·½·¨
  8. */
  9. var FindTextMethods = {
  10.     /**
  11.      * ·½·¨1£º»ù´¡ÕÒ×Ö·½·¨
  12.      * @param {string} text - Òª²éÕÒµÄÎÄ×Ö
  13.      * @param {number} timeout - ³¬Ê±Ê±¼ä£¨ºÁÃ룩
  14.      * @returns {Object} ÕÒµ½µÄÎÄ×ÖλÖÃÐÅÏ¢
  15.      */
  16.     findTextBasic: function(text, timeout) {
  17.         timeout = timeout || 5000;
  18.         var start = new Date().getTime();
  19.         var result;
  20.         
  21.         while (new Date().getTime() - start < timeout) {
  22.             try {
  23.                 if (typeof auto !== 'undefined' && typeof auto.findText === 'function') {
  24.                     result = auto.findText(text, 0.8);
  25.                     if (result) {
  26.                         return result;
  27.                     }
  28.                 }
  29.             } catch (e) {
  30.                 // ºöÂÔ´íÎ󣬼ÌÐø³¢ÊÔ
  31.             }
  32.             sleep.millisecond(100);
  33.         }
  34.         
  35.         return null;
  36.     },
  37.    
  38.     /**
  39.      * ·½·¨2£ºÇøÓòÕÒ×Ö·½·¨
  40.      * @param {string} text - Òª²éÕÒµÄÎÄ×Ö
  41.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  42.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  43.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  44.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  45.      * @returns {Object} ÕÒµ½µÄÎÄ×ÖλÖÃÐÅÏ¢
  46.      */
  47.     findTextInRegion: function(text, x1, y1, x2, y2) {
  48.         try {
  49.             if (typeof auto !== 'undefined' && typeof auto.findText === 'function') {
  50.                 var region = [x1, y1, x2, y2];
  51.                 var result = auto.findText(text, 0.8, region);
  52.                 return result;
  53.             }
  54.         } catch (e) {
  55.             // ºöÂÔ´íÎó
  56.         }
  57.         return null;
  58.     },
  59.    
  60.     /**
  61.      * ·½·¨3£ºÄ£ºýÕÒ×Ö·½·¨
  62.      * @param {string} text - Òª²éÕÒµÄÎÄ×Ö
  63.      * @param {number} similarity - ÏàËÆ¶È£¨0-1£©
  64.      * @returns {Object} ÕÒµ½µÄÎÄ×ÖλÖÃÐÅÏ¢
  65.      */
  66.     findTextFuzzy: function(text, similarity) {
  67.         similarity = similarity || 0.8;
  68.         try {
  69.             if (typeof auto !== 'undefined' && typeof auto.findText === 'function') {
  70.                 var result = auto.findText(text, similarity);
  71.                 return result;
  72.             }
  73.         } catch (e) {
  74.             // ºöÂÔ´íÎó
  75.         }
  76.         return null;
  77.     },
  78.    
  79.     /**
  80.      * ·½·¨4£º¶à´Î³¢ÊÔÕÒ×Ö·½·¨
  81.      * @param {string} text - Òª²éÕÒµÄÎÄ×Ö
  82.      * @param {number} maxAttempts - ×î´ó³¢ÊÔ´ÎÊý
  83.      * @param {number} interval - ³¢ÊÔ¼ä¸ô£¨ºÁÃ룩
  84.      * @returns {Object} ÕÒµ½µÄÎÄ×ÖλÖÃÐÅÏ¢
  85.      */
  86.     findTextWithRetry: function(text, maxAttempts, interval) {
  87.         maxAttempts = maxAttempts || 5;
  88.         interval = interval || 1000;
  89.         
  90.         for (var i = 0; i < maxAttempts; i++) {
  91.             try {
  92.                 if (typeof auto !== 'undefined' && typeof auto.findText === 'function') {
  93.                     var result = auto.findText(text, 0.8);
  94.                     if (result) {
  95.                         return result;
  96.                     }
  97.                 }
  98.             } catch (e) {
  99.                 // ºöÂÔ´íÎ󣬼ÌÐø³¢ÊÔ
  100.             }
  101.             sleep.millisecond(interval);
  102.         }
  103.         
  104.         return null;
  105.     },
  106.    
  107.     /**
  108.      * ·½·¨5£ºÅúÁ¿ÕÒ×Ö·½·¨
  109.      * @param {Array} texts - Òª²éÕÒµÄÎÄ×ÖÊý×é
  110.      * @returns {Object} ÕÒµ½µÄµÚÒ»¸öÎÄ×ÖλÖÃÐÅÏ¢
  111.      */
  112.     findTextBatch: function(texts) {
  113.         for (var i = 0; i < texts.length; i++) {
  114.             try {
  115.                 if (typeof auto !== 'undefined' && typeof auto.findText === 'function') {
  116.                     var result = auto.findText(texts[i], 0.8);
  117.                     if (result) {
  118.                         return {
  119.                             text: texts[i],
  120.                             position: result
  121.                         };
  122.                     }
  123.                 }
  124.             } catch (e) {
  125.                 // ºöÂÔ´íÎ󣬼ÌÐø³¢ÊÔÏÂÒ»¸öÎÄ×Ö
  126.             }
  127.         }
  128.         
  129.         return null;
  130.     },
  131.    
  132.     /**
  133.      * ·½·¨6£ºÕÒ×Ö²¢µã»÷·½·¨
  134.      * @param {string} text - Òª²éÕÒ²¢µã»÷µÄÎÄ×Ö
  135.      * @param {number} timeout - ³¬Ê±Ê±¼ä£¨ºÁÃ룩
  136.      * @returns {boolean} ÊÇ·ñ³É¹¦µã»÷
  137.      */
  138.     findTextAndClick: function(text, timeout) {
  139.         var result = this.findTextBasic(text, timeout);
  140.         if (result) {
  141.             var x = result.x + result.width / 2;
  142.             var y = result.y + result.height / 2;
  143.             // Ìí¼ÓËæ»úÆ«ÒÆÄ£ÄâÕæÊµµã»÷
  144.             var randomX = x + (Math.random() - 0.5) * 10;
  145.             var randomY = y + (Math.random() - 0.5) * 10;
  146.             try {
  147.                 if (typeof touch !== 'undefined' && typeof touch.tap === 'function') {
  148.                     touch.tap(randomX, randomY);
  149.                     return true;
  150.                 }
  151.             } catch (e) {
  152.                 // ºöÂÔ´íÎó
  153.             }
  154.         }
  155.         return false;
  156.     },
  157.    
  158.     /**
  159.      * ·½·¨7£ºµÈ´ýÎÄ×Ö³öÏÖ·½·¨
  160.      * @param {string} text - ÒªµÈ´ýµÄÎÄ×Ö
  161.      * @param {number} timeout - ³¬Ê±Ê±¼ä£¨Ã룩
  162.      * @returns {boolean} ÊÇ·ñÔÚ³¬Ê±Ç°ÕÒµ½ÎÄ×Ö
  163.      */
  164.     waitForText: function(text, timeout) {
  165.         timeout = timeout || 30;
  166.         var startTime = Date.now();
  167.         var timeoutMs = timeout * 1000;
  168.         
  169.         while (Date.now() - startTime < timeoutMs) {
  170.             try {
  171.                 if (typeof auto !== 'undefined' && typeof auto.findText === 'function') {
  172.                     var result = auto.findText(text, 0.8);
  173.                     if (result) {
  174.                         return true;
  175.                     }
  176.                 }
  177.             } catch (e) {
  178.                 // ºöÂÔ´íÎ󣬼ÌÐø³¢ÊÔ
  179.             }
  180.             sleep.millisecond(1000);
  181.         }
  182.         
  183.         return false;
  184.     }
  185. };

  186. /**
  187. * Ä£¿é£ºOCR·½·¨
  188. * ¹¦ÄÜ£ºÌṩ¶àÖÖOCRÎÄ×Öʶ±ð·½·¨
  189. */
  190. var OCRMethods = {
  191.     /**
  192.      * ·½·¨1£º»ù´¡OCRʶ±ð
  193.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  194.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  195.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  196.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  197.      * @returns {string} ʶ±ðµ½µÄÎÄ×Ö
  198.      */
  199.     ocrBasic: function(x1, y1, x2, y2) {
  200.         try {
  201.             if (typeof ocr === 'function') {
  202.                 var result = ocr(x1, y1, x2, y2);
  203.                 return result;
  204.             }
  205.         } catch (e) {
  206.             // ºöÂÔ´íÎ󣬷µ»Ø¿Õ×Ö·û´®
  207.         }
  208.         return "";
  209.     },
  210.    
  211.     /**
  212.      * ·½·¨2£º´øÓïÑÔÉèÖõÄOCRʶ±ð
  213.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  214.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  215.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  216.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  217.      * @param {string} lang - ÓïÑÔÉèÖÃ
  218.      * @returns {string} ʶ±ðµ½µÄÎÄ×Ö
  219.      */
  220.     ocrWithLanguage: function(x1, y1, x2, y2, lang) {
  221.         try {
  222.             if (typeof ocr === 'function') {
  223.                 lang = lang || "chi_sim";
  224.                 var result = ocr(x1, y1, x2, y2, lang);
  225.                 return result;
  226.             }
  227.         } catch (e) {
  228.             // ºöÂÔ´íÎ󣬷µ»Ø¿Õ×Ö·û´®
  229.         }
  230.         return "";
  231.     },
  232.    
  233.     /**
  234.      * ·½·¨3£ºÈ«ÆÁOCRʶ±ð
  235.      * @returns {string} ʶ±ðµ½µÄÎÄ×Ö
  236.      */
  237.     ocrFullScreen: function() {
  238.         try {
  239.             if (typeof ocr === 'function') {
  240.                 var screenWidth = 0;
  241.                 var screenHeight = 0;
  242.                 try {
  243.                     if (typeof screen !== 'undefined' && typeof screen.getScreenWidth === 'function') {
  244.                         screenWidth = screen.getScreenWidth();
  245.                         screenHeight = screen.getScreenHeight();
  246.                     }
  247.                 } catch (e) {
  248.                     // ºöÂÔ´íÎó£¬Ê¹ÓÃĬÈÏÖµ
  249.                 }
  250.                 var result = ocr(0, 0, screenWidth, screenHeight);
  251.                 return result;
  252.             }
  253.         } catch (e) {
  254.             // ºöÂÔ´íÎ󣬷µ»Ø¿Õ×Ö·û´®
  255.         }
  256.         return "";
  257.     },
  258.    
  259.     /**
  260.      * ·½·¨4£ºOCRʶ±ð²¢²éÕÒÌØ¶¨ÎÄ×Ö
  261.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  262.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  263.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  264.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  265.      * @param {string} keyword - Òª²éÕҵĹؼü×Ö
  266.      * @returns {boolean} ÊÇ·ñÕÒµ½¹Ø¼ü×Ö
  267.      */
  268.     ocrAndFindKeyword: function(x1, y1, x2, y2, keyword) {
  269.         try {
  270.             var text = this.ocrBasic(x1, y1, x2, y2);
  271.             return text.indexOf(keyword) !== -1;
  272.         } catch (e) {
  273.             // ºöÂÔ´íÎ󣬷µ»Øfalse
  274.         }
  275.         return false;
  276.     },
  277.    
  278.     /**
  279.      * ·½·¨5£ºOCRʶ±ð²¢ÌáÈ¡Êý×Ö
  280.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  281.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  282.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  283.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  284.      * @returns {Array} ÌáÈ¡µ½µÄÊý×ÖÊý×é
  285.      */
  286.     ocrExtractNumbers: function(x1, y1, x2, y2) {
  287.         try {
  288.             var text = this.ocrBasic(x1, y1, x2, y2);
  289.             var numbers = text.match(/\d+/g) || [];
  290.             return numbers;
  291.         } catch (e) {
  292.             // ºöÂÔ´íÎ󣬷µ»Ø¿ÕÊý×é
  293.         }
  294.         return [];
  295.     },
  296.    
  297.     /**
  298.      * ·½·¨6£ºOCRʶ±ð²¢½âÎö×ø±ê
  299.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  300.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  301.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  302.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  303.      * @returns {Array} ½âÎöµ½µÄ×ø±êÊý×é
  304.      */
  305.     ocrExtractCoordinates: function(x1, y1, x2, y2) {
  306.         try {
  307.             var text = this.ocrBasic(x1, y1, x2, y2);
  308.             var coords = [];
  309.             var regex = /(\d+),(\d+)/g;
  310.             var match;
  311.             
  312.             while ((match = regex.exec(text)) !== null) {
  313.                 coords.push({
  314.                     x: parseInt(match[1], 10),
  315.                     y: parseInt(match[2], 10)
  316.                 });
  317.             }
  318.             
  319.             return coords;
  320.         } catch (e) {
  321.             // ºöÂÔ´íÎ󣬷µ»Ø¿ÕÊý×é
  322.         }
  323.         return [];
  324.     },
  325.    
  326.     /**
  327.      * ·½·¨7£ºOCRʶ±ð²¢ÌáÈ¡ÓÊÏä
  328.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  329.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  330.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  331.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  332.      * @returns {Array} ÌáÈ¡µ½µÄÓÊÏäÊý×é
  333.      */
  334.     ocrExtractEmails: function(x1, y1, x2, y2) {
  335.         try {
  336.             var text = this.ocrBasic(x1, y1, x2, y2);
  337.             var emails = text.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g) || [];
  338.             return emails;
  339.         } catch (e) {
  340.             // ºöÂÔ´íÎ󣬷µ»Ø¿ÕÊý×é
  341.         }
  342.         return [];
  343.     },
  344.    
  345.     /**
  346.      * ·½·¨8£ºOCRʶ±ð²¢ÌáÈ¡URL
  347.      * @param {number} x1 - ÇøÓò×óÉϽÇX×ø±ê
  348.      * @param {number} y1 - ÇøÓò×óÉϽÇY×ø±ê
  349.      * @param {number} x2 - ÇøÓòÓÒϽÇX×ø±ê
  350.      * @param {number} y2 - ÇøÓòÓÒϽÇY×ø±ê
  351.      * @returns {Array} ÌáÈ¡µ½µÄURLÊý×é
  352.      */
  353.     ocrExtractURLs: function(x1, y1, x2, y2) {
  354.         try {
  355.             var text = this.ocrBasic(x1, y1, x2, y2);
  356.             var urls = text.match(/https?:\/\/[\w\-]+(\.[\w\-]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/g) || [];
  357.             return urls;
  358.         } catch (e) {
  359.             // ºöÂÔ´íÎ󣬷µ»Ø¿ÕÊý×é
  360.         }
  361.         return [];
  362.     },
  363.    
  364.     /**
  365.      * ·½·¨9£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - ²éѯ°üº¬ÎÄ×Ö
  366.      * @param {string} text - Òª²éѯµÄÎÄ×Ö
  367.      * @returns {object|null} ʶ±ðµ½µÄÄ¿±ê¶ÔÏó»ònull
  368.      */
  369.     findIncludeText: function(text) {
  370.         try {
  371.             var result = new ocrResult().findIncludeText(text);
  372.             return result;
  373.         } catch (e) {
  374.             // ºöÂÔ´íÎ󣬷µ»Ønull
  375.         }
  376.         return null;
  377.     },
  378.    
  379.     /**
  380.      * ·½·¨10£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - ²éѯ°üº¬ÎÄ×Ö£¨¶àÄ¿±ê£©
  381.      * @param {string} text - Òª²éѯµÄÎÄ×Ö
  382.      * @returns {Array} ʶ±ðµ½µÄÄ¿±ê¶ÔÏóÊý×é
  383.      */
  384.     findIncludeTexts: function(text) {
  385.         try {
  386.             var result = new ocrResult().findIncludeTexts(text);
  387.             return result;
  388.         } catch (e) {
  389.             // ºöÂÔ´íÎ󣬷µ»Ø¿ÕÊý×é
  390.         }
  391.         return [];
  392.     },
  393.    
  394.     /**
  395.      * ·½·¨11£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - Ä£ºý²éѯ£¨½üËÆÆ¥Å䣩
  396.      * @param {string} text - Òª²éѯµÄÎÄ×Ö
  397.      * @returns {object|null} ʶ±ðµ½µÄÄ£ºýÆ¥ÅäÄ¿±ê»ònull
  398.      */
  399.     findSimText: function(text) {
  400.         try {
  401.             var img = screen.screenShotFull();
  402.             var ocrres = img.MLKitOcr('zh');
  403.             var result = ocrres.findSimText(text);
  404.             img.recycle();
  405.             return result;
  406.         } catch (e) {
  407.             // ºöÂÔ´íÎ󣬷µ»Ønull
  408.         }
  409.         return null;
  410.     },
  411.    
  412.     /**
  413.      * ·½·¨12£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - ¾«È·²éѯÎÄ×Ö
  414.      * @param {string} text - Òª²éѯµÄÎÄ×Ö
  415.      * @returns {object|null} ʶ±ðµ½µÄ¾«È·Ä¿±ê»ònull
  416.      */
  417.     findText: function(text) {
  418.         try {
  419.             var img = screen.screenShotFull();
  420.             var ocrres = img.MLKitOcr('zh');
  421.             var result = ocrres.findText(text);
  422.             img.recycle();
  423.             return result;
  424.         } catch (e) {
  425.             // ºöÂÔ´íÎ󣬷µ»Ønull
  426.         }
  427.         return null;
  428.     },
  429.    
  430.     /**
  431.      * ·½·¨13£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - »ñÈ¡ËùÓÐʶ±ðÄ¿±ê
  432.      * @returns {Array} ËùÓÐʶ±ðÄ¿±êµÄÊý×é
  433.      */
  434.     getAllDetect: function() {
  435.         try {
  436.             var result = new ocrResult().getAllDetect();
  437.             return result;
  438.         } catch (e) {
  439.             // ºöÂÔ´íÎ󣬷µ»Ø¿ÕÊý×é
  440.         }
  441.         return [];
  442.     },
  443.    
  444.     /**
  445.      * ·½·¨14£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - »ñÈ¡ËùÓÐʶ±ðÎÄ×Ö
  446.      * @returns {string} ËùÓÐʶ±ðÎÄ×ֵį´½Ó½á¹û
  447.      */
  448.     getAllString: function() {
  449.         try {
  450.             var result = new ocrResult().getAllString();
  451.             return result;
  452.         } catch (e) {
  453.             // ºöÂÔ´íÎ󣬷µ»Ø¿Õ×Ö·û´®
  454.         }
  455.         return "";
  456.     },
  457.    
  458.     /**
  459.      * ·½·¨15£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - »ñÈ¡JSON¸ñʽ½á¹û
  460.      * @returns {string} OCRʶ±ð½á¹ûµÄJSON×Ö·û´®
  461.      */
  462.     getJson: function() {
  463.         try {
  464.             var result = new ocrResult().getJson();
  465.             return result;
  466.         } catch (e) {
  467.             // ºöÂÔ´íÎ󣬷µ»Ø¿Õ×Ö·û´®
  468.         }
  469.         return "";
  470.     },
  471.    
  472.     /**
  473.      * ·½·¨16£º»ù´¡ÎÄ×Ö²éѯ·½·¨ - »ñÈ¡JSON×Ö·û´®
  474.      * @returns {string} OCRʶ±ð½á¹ûµÄJSON×Ö·û´®
  475.      */
  476.     getJsonString: function() {
  477.         try {
  478.             var result = new ocrResult().getJsonString();
  479.             return result;
  480.         } catch (e) {
  481.             // ºöÂÔ´íÎ󣬷µ»Ø¿Õ×Ö·û´®
  482.         }
  483.         return "";
  484.     },
  485.    
  486.     /**
  487.      * ·½·¨17£ººËÐÄʶ±ð·½·¨ - MLKitOcrÎÄ×Öʶ±ð£¨Google MLKitÒýÇæ£©
  488.      * @param {string} lang - ʶ±ðÓïÑÔ£¬Ä¬ÈÏ"zh"
  489.      * @returns {object|null} OCRʶ±ð½á¹û¶ÔÏó»ònull
  490.      */
  491.     MLKitOcr: function(lang) {
  492.         try {
  493.             lang = lang || "zh";
  494.             var img = screen.screenShotFull();
  495.             var result = img.MLKitOcr(lang);
  496.             img.recycle();
  497.             return result;
  498.         } catch (e) {
  499.             console.log("MLKitOcr error:", e.message);
  500.             return null;
  501.         }
  502.     },
  503.    
  504.     /**
  505.      * ·½·¨18£ººËÐÄʶ±ð·½·¨ - MLKitOcrRectÎÄ×ÖÇøÓòʶ±ð
  506.      * @param {string} lang - ʶ±ðÓïÑÔ£¬Ä¬ÈÏ"zh"
  507.      * @param {Array} region - ʶ±ðÇøÓòµÄ°Ù·Ö±È×ø±ê [x1, y1, x2, y2]
  508.      * @returns {object|null} OCRʶ±ð½á¹û¶ÔÏó»ònull
  509.      */
  510.     MLKitOcrRect: function(lang, region) {
  511.         try {
  512.             lang = lang || "zh";
  513.             region = region || [0, 0, 1, 1];
  514.             var img = screen.screenShotFull();
  515.             var result = img.MLKitOcrRect(lang, region);
  516.             img.recycle();
  517.             return result;
  518.         } catch (e) {
  519.             console.log("MLKitOcrRect error:", e.message);
  520.             return null;
  521.         }
  522.     },
  523.    
  524.     /**
  525.      * ·½·¨19£ººËÐÄʶ±ð·½·¨ - aiworkOCRÎÄ×Öʶ±ð
  526.      * @param {number} size - ʶ±ð³ß´ç£¬ÍƼöÖµ£º640¡¢320
  527.      * @param {Array} region - ʶ±ðÇøÓòµÄ°Ù·Ö±È×ø±ê [x1, y1, x2, y2]
  528.      * @returns {object|null} OCRʶ±ð½á¹û¶ÔÏó»ònull
  529.      */
  530.     aiworkOCR: function(size, region) {
  531.         try {
  532.             size = size || 640;
  533.             region = region || [0, 0, 1, 1];
  534.             var img = screen.screenShotFull();
  535.             var result = img.aiworkOCR(size, region);
  536.             img.recycle();
  537.             return result;
  538.         } catch (e) {
  539.             console.log("aiworkOCR error:", e.message);
  540.             return null;
  541.         }
  542.     },
  543.    
  544.     /**
  545.      * ·½·¨20£ººËÐÄʶ±ð·½·¨ - paddleOCRÎÄ×Öʶ±ð
  546.      * @param {number} size - ʶ±ð³ß´ç£¬ÍƼöÖµ£º640¡¢320
  547.      * @param {Array} region - ʶ±ðÇøÓòµÄ°Ù·Ö±È×ø±ê [x1, y1, x2, y2]
  548.      * @returns {object|null} OCRʶ±ð½á¹û¶ÔÏó»ònull
  549.      */
  550.     paddleOCR: function(size, region) {
  551.         try {
  552.             size = size || 640;
  553.             region = region || [0, 0, 1, 1];
  554.             var img = screen.screenShotFull();
  555.             var result = img.paddleOCR(size, region);
  556.             img.recycle();
  557.             return result;
  558.         } catch (e) {
  559.             console.log("paddleOCR error:", e.message);
  560.             return null;
  561.         }
  562.     },
  563.    
  564.     /**
  565.      * ·½·¨21£ºOpenCVÏà¹Ø·½·¨ - ͨ¹ýѵÁ·×Ö¿âʶ±ð
  566.      * @param {object} matImg - ÊäÈëµÄͼƬ¶ÔÏó£¨MatÀàÐÍ£©
  567.      * @param {string} dictPath - ×Ö¿âÎļþ·¾¶/Ãû³Æ
  568.      * @param {number} threshold - ÏàËÆ¶ÈãÐÖµ£¨0~1£©
  569.      * @param {number} expectedCount - Ô¤ÆÚʶ±ðµÄÎÄ×ÖÊýÁ¿
  570.      * @param {Array} region - ʶ±ðÇøÓòµÄ°Ù·Ö±È×ø±ê [x1,y1,x2,y2]
  571.      * @returns {object|null} OCRʶ±ð½á¹û¶ÔÏó»ònull
  572.      */
  573.     opencvOCR: function(matImg, dictPath, threshold, expectedCount, region) {
  574.         try {
  575.             if (typeof opencv !== 'undefined' && typeof opencv.OCR === 'function') {
  576.                 dictPath = dictPath || "";
  577.                 threshold = threshold || 0;
  578.                 expectedCount = expectedCount || 0;
  579.                 region = region || [];
  580.                 var result = opencv.OCR(matImg, dictPath, threshold, expectedCount, region);
  581.                 return result;
  582.             }
  583.         } catch (e) {
  584.             // ºöÂÔ´íÎ󣬷µ»Ønull
  585.         }
  586.         return null;
  587.     },
  588.    
  589.     /**
  590.      * ·½·¨22£ºOpenCVÏà¹Ø·½·¨ - »ùÓÚCVÎļþµÄOCRʶ±ð
  591.      * @param {string} cvFileName - CVÎļþÃû
  592.      * @returns {object|null} OCRʶ±ð½á¹û¶ÔÏó»ònull
  593.      */
  594.     opencvOCREx: function(cvFileName) {
  595.         try {
  596.             if (typeof opencv !== 'undefined' && typeof opencv.OCREx === 'function') {
  597.                 cvFileName = cvFileName || "";
  598.                 var result = opencv.OCREx(cvFileName);
  599.                 return result;
  600.             }
  601.         } catch (e) {
  602.             console.log("opencvOCREx error:", e.message);
  603.             return null;
  604.         }
  605.         return null;
  606.     }
  607. };



  608. /**
  609. * Ä£¿é£ºOCRÒýÇæ¹ÜÀí
  610. * ¹¦ÄÜ£º¹ÜÀíOCRÒýÇæµÄ¼ÓÔØºÍÐ¶ÔØ
  611. */
  612. var OCREngineManager = {
  613.     /**
  614.      * ¼ÓÔØOCRÒýÇæ
  615.      * @param {string} lang - ÓïÑÔÄ£ÐÍ
  616.      * @returns {boolean} ÊÇ·ñ¼ÓÔØ³É¹¦
  617.      */
  618.     loadOCREngine: function(lang) {
  619.         lang = lang || "chi_sim";
  620.         try {
  621.             if (typeof loadOCR === 'function') {
  622.                 var result = loadOCR(lang);
  623.                 return result;
  624.             } else {
  625.                 console.log("loadOCR function not available");
  626.                 return false;
  627.             }
  628.         } catch (e) {
  629.             console.log("Error loading OCR engine:", e.message);
  630.             return false;
  631.         }
  632.     },
  633.    
  634.     /**
  635.      * Ð¶ÔØOCRÒýÇæ
  636.      * @returns {boolean} ÊÇ·ñÐ¶ÔØ³É¹¦
  637.      */
  638.     unloadOCREngine: function() {
  639.         try {
  640.             if (typeof unloadOCR === 'function') {
  641.                 var result = unloadOCR();
  642.                 return result;
  643.             } else {
  644.                 console.log("unloadOCR function not available");
  645.                 return false;
  646.             }
  647.         } catch (e) {
  648.             console.log("Error unloading OCR engine:", e.message);
  649.             return false;
  650.         }
  651.     },
  652.    
  653.     /**
  654.      * ¼ì²éOCRÒýÇæ×´Ì¬
  655.      * @returns {boolean} OCRÒýÇæÊÇ·ñÒѼÓÔØ
  656.      */
  657.     isOCREngineLoaded: function() {
  658.         try {
  659.             if (typeof isOCRLoaded === 'function') {
  660.                 var result = isOCRLoaded();
  661.                 return result;
  662.             } else {
  663.                 console.log("isOCRLoaded function not available");
  664.                 return false;
  665.             }
  666.         } catch (e) {
  667.             console.log("Error checking OCR engine status:", e.message);
  668.             return false;
  669.         }
  670.     }
  671. };

  672. /**
  673. * Ä£¿é£º¹¤¾ßº¯Êý
  674. * ¹¦ÄÜ£ºÌṩ¸÷ÖÖ¹¤¾ßº¯Êý
  675. */
  676. var Utils = {
  677.     /**
  678.      * ÑÓ³ÙÖ´ÐÐ
  679.      * @param {number} ms - ÑÓ³ÙºÁÃëÊý
  680.      */
  681.     sleep: function(ms) {
  682.         java.lang.Thread.sleep(ms);
  683.     },
  684.    
  685.     /**
  686.      * »ñÈ¡É豸ÐÅÏ¢
  687.      * @returns {Object} É豸ÐÅÏ¢
  688.      */
  689.     getDeviceInfo: function() {
  690.         var screenWidth = 0;
  691.         var screenHeight = 0;
  692.         
  693.         try {
  694.             if (typeof screen !== 'undefined' && typeof screen.getScreenWidth === 'function') {
  695.                 screenWidth = screen.getScreenWidth();
  696.                 screenHeight = screen.getScreenHeight();
  697.             }
  698.         } catch (e) {
  699.             // ºöÂÔ´íÎó£¬Ê¹ÓÃĬÈÏÖµ
  700.         }
  701.         
  702.         return {
  703.             width: screenWidth,
  704.             height: screenHeight,
  705.             model: "δ֪",
  706.             brand: "δ֪",
  707.             sdk: "δ֪",
  708.             androidVersion: "δ֪"
  709.         };
  710.     },
  711.    
  712.     /**
  713.      * ´´½¨Í¼Ïñ¶ÔÏó
  714.      * @param {string} path - ͼÏñ·¾¶
  715.      * @returns {Object} ͼÏñ¶ÔÏó
  716.      */
  717.     createImage: function(path) {
  718.         try {
  719.             var img = new image();
  720.             img.read(path);
  721.             return img;
  722.         } catch (e) {
  723.             console.log("Error creating image object:", e.message);
  724.             return null;
  725.         }
  726.     },
  727.    
  728.     /**
  729.      * ´òÓ¡ÈÕÖ¾
  730.      * @param {string} message - ÈÕÖ¾ÏûÏ¢
  731.      */
  732.     log: function(message) {
  733.         console.log(message);
  734.     },
  735.    
  736.     /**
  737.      * Ëæ»úÊýÉú³É
  738.      * @param {number} min - ×îСֵ
  739.      * @param {number} max - ×î´óÖµ
  740.      * @returns {number} Ëæ»úÊý
  741.      */
  742.     random: function(min, max) {
  743.         return Math.floor(Math.random() * (max - min + 1)) + min;
  744.     }
  745. };

  746. /**
  747. * ×ÛºÏʾÀý£ºÊ¹ÓÃÕÒ×ÖºÍOCR·½·¨
  748. */
  749. function runComprehensiveDemo() {
  750.     console.log("=== AIWROK ÕÒ×ÖÓëOCR·½·¨ÖÕ¼«»ã×ÜʾÀý ===");
  751.    
  752.     // 1. ´òÓ¡É豸ÐÅÏ¢
  753.     console.log("\n1. É豸ÐÅÏ¢:");
  754.     var deviceInfo = Utils.getDeviceInfo();
  755.     console.log("É豸ÐͺÅ: " + deviceInfo.model);
  756.     console.log("ÆÁÄ»³ß´ç: " + deviceInfo.width + "x" + deviceInfo.height);
  757.     console.log("Android°æ±¾: " + deviceInfo.androidVersion);
  758.    
  759.     // 2. ³¢ÊÔʹÓûù´¡ÕÒ×Ö·½·¨
  760.     console.log("\n2. »ù´¡ÕÒ×ÖʾÀý:");
  761.     var textResult = FindTextMethods.findTextBasic("È·¶¨", 3000);
  762.     if (textResult) {
  763.         console.log("ÕÒµ½ÎÄ×Ö'È·¶¨'£¬Î»ÖÃ: x=" + textResult.x + ", y=" + textResult.y);
  764.     } else {
  765.         console.log("δÕÒµ½ÎÄ×Ö'È·¶¨'");
  766.     }
  767.    
  768.     // 3. ³¢ÊÔʹÓÃOCRʶ±ð²¢µã»÷
  769.     console.log("\n3. OCRʶ±ðÓëµã»÷ʾÀý:");
  770.     var targetText = "À×µç"; // Òª²éÕÒ²¢µã»÷µÄÎÄ×Ö
  771.     var clicked = false;
  772.    
  773.     // ³¢ÊÔʹÓÃÄÚÖõÄMLKitOcr½øÐÐʶ±ð
  774.     console.log("\n1. ³¢ÊÔʹÓÃMLKitOcr½øÐÐʶ±ð:");
  775.     var mlkitResult = OCRMethods.MLKitOcr('zh');
  776.     if (mlkitResult) {
  777.         console.log("MLKitOcrʶ±ð³É¹¦");
  778.         console.log("MLKitOcrʶ±ð½á¹û:");
  779.         console.log(mlkitResult);
  780.         
  781.         // ³¢ÊÔ²éÕÒ²¢µã»÷Ä¿±êÎÄ×Ö
  782.         try {
  783.             var target = mlkitResult.findIncludeText(targetText);
  784.             if (target) {
  785.                 console.log("ʹÓÃMLKitOcrÕÒµ½ÎÄ×Ö'" + targetText + "'£¬ÕýÔÚµã»÷...");
  786.                 target.hidClick();
  787.                 clicked = true;
  788.                 console.log("µã»÷³É¹¦£¡");
  789.             } else {
  790.                 console.log("MLKitOcrδÕÒµ½ÎÄ×Ö'" + targetText + "'");
  791.             }
  792.         } catch (e) {
  793.             console.log("MLKitOcrµã»÷ʧ°Ü:", e.message);
  794.         }
  795.     } else {
  796.         console.log("MLKitOcrʶ±ðʧ°Ü");
  797.     }
  798.    
  799.     // ³¢ÊÔʹÓÃMLKitOcrRect½øÐÐʶ±ð
  800.     console.log("\n2. ³¢ÊÔʹÓÃMLKitOcrRect½øÐÐʶ±ð:");
  801.     var mlkitRectResult = OCRMethods.MLKitOcrRect('zh', [0, 0, 1, 1]);
  802.     if (mlkitRectResult) {
  803.         console.log("MLKitOcrRectʶ±ð³É¹¦");
  804.         console.log("MLKitOcrRectʶ±ð½á¹û:");
  805.         console.log(mlkitRectResult);
  806.         
  807.         // ³¢ÊÔ²éÕÒ²¢µã»÷Ä¿±êÎÄ×Ö
  808.         try {
  809.             var target = mlkitRectResult.findIncludeText(targetText);
  810.             if (target) {
  811.                 console.log("ʹÓÃMLKitOcrRectÕÒµ½ÎÄ×Ö'" + targetText + "'£¬ÕýÔÚµã»÷...");
  812.                 target.hidClick();
  813.                 clicked = true;
  814.                 console.log("µã»÷³É¹¦£¡");
  815.             } else {
  816.                 console.log("MLKitOcrRectδÕÒµ½ÎÄ×Ö'" + targetText + "'");
  817.             }
  818.         } catch (e) {
  819.             console.log("MLKitOcrRectµã»÷ʧ°Ü:", e.message);
  820.         }
  821.     } else {
  822.         console.log("MLKitOcrRectʶ±ðʧ°Ü");
  823.     }
  824.    
  825.     // ³¢ÊÔʹÓÃaiworkOCR½øÐÐʶ±ð
  826.     console.log("\n3. ³¢ÊÔʹÓÃaiworkOCR½øÐÐʶ±ð:");
  827.     var aiworkResult = OCRMethods.aiworkOCR(640, [0, 0, 1, 1]);
  828.     if (aiworkResult) {
  829.         console.log("aiworkOCRʶ±ð³É¹¦");
  830.         console.log("aiworkOCRʶ±ð½á¹û:");
  831.         console.log(aiworkResult);
  832.         
  833.         // ³¢ÊÔ²éÕÒ²¢µã»÷Ä¿±êÎÄ×Ö
  834.         try {
  835.             var target = aiworkResult.findIncludeText(targetText);
  836.             if (target) {
  837.                 console.log("ʹÓÃaiworkOCRÕÒµ½ÎÄ×Ö'" + targetText + "'£¬ÕýÔÚµã»÷...");
  838.                 target.hidClick();
  839.                 clicked = true;
  840.                 console.log("µã»÷³É¹¦£¡");
  841.             } else {
  842.                 console.log("aiworkOCRδÕÒµ½ÎÄ×Ö'" + targetText + "'");
  843.             }
  844.         } catch (e) {
  845.             console.log("aiworkOCRµã»÷ʧ°Ü:", e.message);
  846.         }
  847.     } else {
  848.         console.log("aiworkOCRʶ±ðʧ°Ü");
  849.     }
  850.    
  851.     // ³¢ÊÔʹÓÃpaddleOCR½øÐÐʶ±ð
  852.     console.log("\n4. ³¢ÊÔʹÓÃpaddleOCR½øÐÐʶ±ð:");
  853.     var paddleResult = OCRMethods.paddleOCR(640, [0, 0, 1, 1]);
  854.     if (paddleResult) {
  855.         console.log("paddleOCRʶ±ð³É¹¦");
  856.         console.log("paddleOCRʶ±ð½á¹û:");
  857.         console.log(paddleResult);
  858.         
  859.         // ³¢ÊÔ²éÕÒ²¢µã»÷Ä¿±êÎÄ×Ö
  860.         try {
  861.             var target = paddleResult.findIncludeText(targetText);
  862.             if (target) {
  863.                 console.log("ʹÓÃpaddleOCRÕÒµ½ÎÄ×Ö'" + targetText + "'£¬ÕýÔÚµã»÷...");
  864.                 target.hidClick();
  865.                 clicked = true;
  866.                 console.log("µã»÷³É¹¦£¡");
  867.             } else {
  868.                 console.log("paddleOCRδÕÒµ½ÎÄ×Ö'" + targetText + "'");
  869.             }
  870.         } catch (e) {
  871.             console.log("paddleOCRµã»÷ʧ°Ü:", e.message);
  872.         }
  873.     } else {
  874.         console.log("paddleOCRʶ±ðʧ°Ü");
  875.     }
  876.    
  877.     // ³¢ÊÔʹÓÃopencv.OCREx½øÐÐʶ±ð
  878.     console.log("\n5. ³¢ÊÔʹÓÃopencv.OCREx½øÐÐʶ±ð:");
  879.     var opencvResult = OCRMethods.opencvOCREx('ͼɫ473670.cv');
  880.     if (opencvResult) {
  881.         console.log("opencv.OCRExʶ±ð³É¹¦");
  882.         try {
  883.             console.log("opencv.OCRExʶ±ð½á¹û:");
  884.             console.log(opencvResult.getAllString());
  885.             
  886.             // ³¢ÊÔ²éÕÒ²¢µã»÷Ä¿±êÎÄ×Ö
  887.             var target = opencvResult.findIncludeText(targetText);
  888.             if (target) {
  889.                 console.log("ʹÓÃopencv.OCRExÕÒµ½ÎÄ×Ö'" + targetText + "'£¬ÕýÔÚµã»÷...");
  890.                 target.hidClick();
  891.                 clicked = true;
  892.                 console.log("µã»÷³É¹¦£¡");
  893.             } else {
  894.                 console.log("opencv.OCRExδÕÒµ½ÎÄ×Ö'" + targetText + "'");
  895.             }
  896.         } catch (e) {
  897.             console.log("opencv.OCREx²Ù×÷ʧ°Ü:", e.message);
  898.         }
  899.     } else {
  900.         console.log("opencv.OCRExʶ±ðʧ°Ü");
  901.     }
  902.    
  903.     // ËùÓÐOCR·½·¨¶¼³¢ÊÔÍê±Ï
  904.     if (!clicked) {
  905.         console.log("\nËùÓÐOCR·½·¨¶¼Î´ÕÒµ½ÎÄ×Ö'" + targetText + "'");
  906.     }
  907.    
  908.     // 7. ÅúÁ¿ÕÒ×ÖʾÀý
  909.     console.log("\n4. ÅúÁ¿ÕÒ×ÖʾÀý:");
  910.     var texts = ["È·¶¨", "È¡Ïû", "ÉèÖÃ", "¿ªÊ¼"];
  911.     var batchResult = FindTextMethods.findTextBatch(texts);
  912.     if (batchResult) {
  913.         console.log("ÕÒµ½ÎÄ×Ö: " + batchResult.text + "£¬Î»ÖÃ: x=" + batchResult.position.x + ", y=" + batchResult.position.y);
  914.     } else {
  915.         console.log("δÕÒµ½ÈκÎÎÄ×Ö");
  916.     }
  917.    
  918.     console.log("\n=== ʾÀýÖ´ÐÐÍê³É ===");
  919. }

  920. /**
  921. * ¸ß¼¶Ê¾Àý£º×Ô¶¯»¯ÈÎÎñÁ÷³Ì
  922. */
  923. function runAutomationTask() {
  924.     console.log("=== AIWROK ×Ô¶¯»¯ÈÎÎñÁ÷³ÌʾÀý ===");
  925.    
  926.     console.log("✅ ¿ªÊ¼Ö´ÐÐ×Ô¶¯»¯ÈÎÎñ");
  927.    
  928.     // 1. µÈ´ýÓ¦ÓÃÆô¶¯
  929.     console.log("\n1. µÈ´ýÓ¦ÓÃÆô¶¯...");
  930.     // ÕâÀï¿ÉÒÔʹÓûù´¡ÕÒ×Ö·½·¨µÈ´ýÓ¦ÓÃÆô¶¯
  931.     var appStarted = false;
  932.     var startTime = Date.now();
  933.     var timeoutMs = 30 * 1000;
  934.    
  935.     while (Date.now() - startTime < timeoutMs) {
  936.         var result = FindTextMethods.findTextBasic("Ê×Ò³", 1000);
  937.         if (result) {
  938.             appStarted = true;
  939.             break;
  940.         }
  941.         sleep.millisecond(1000);
  942.     }
  943.    
  944.     if (!appStarted) {
  945.         console.log("❌ Ó¦ÓÃÆô¶¯³¬Ê±");
  946.         return;
  947.     }
  948.     console.log("✅ Ó¦ÓÃÆô¶¯³É¹¦");
  949.    
  950.     // 2. µã»÷µÇ¼°´Å¥
  951.     console.log("\n2. µã»÷µÇ¼°´Å¥...");
  952.     var loginResult = FindTextMethods.findTextBasic("µÇ¼", 3000);
  953.     if (loginResult) {
  954.         auto.clickPoint(loginResult.x, loginResult.y);
  955.         sleep.millisecond(1000);
  956.         console.log("✅ µÇ¼°´Å¥µã»÷³É¹¦");
  957.     } else {
  958.         console.log("❌ δÕÒµ½µÇ¼°´Å¥");
  959.         return;
  960.     }
  961.    
  962.     // 3. µÈ´ýµÇÂ¼Ò³Ãæ
  963.     console.log("\n3. µÈ´ýµÇÂ¼Ò³Ãæ...");
  964.     var loginPageLoaded = false;
  965.     startTime = Date.now();
  966.     timeoutMs = 10 * 1000;
  967.    
  968.     while (Date.now() - startTime < timeoutMs) {
  969.         var result = FindTextMethods.findTextBasic("Óû§Ãû", 1000);
  970.         if (result) {
  971.             loginPageLoaded = true;
  972.             break;
  973.         }
  974.         sleep.millisecond(1000);
  975.     }
  976.    
  977.     if (!loginPageLoaded) {
  978.         console.log("❌ µÇÂ¼Ò³Ãæ¼ÓÔØ³¬Ê±");
  979.         return;
  980.     }
  981.     console.log("✅ µÇÂ¼Ò³Ãæ¼ÓÔØ³É¹¦");
  982.    
  983.     // 4. Ö´ÐеǼ²Ù×÷£¨ÕâÀïÖ»ÊÇʾÀý£¬Êµ¼ÊÐèÒªÊäÈëÓû§ÃûÃÜÂ룩
  984.     console.log("\n4. Ö´ÐеǼ²Ù×÷...");
  985.     // Ä£ÄâÊäÈëÓû§ÃûÃÜÂë
  986.     // input.setText("username", "test");
  987.     // input.setText("password", "123456");
  988.    
  989.     // 5. µã»÷µÇ¼°´Å¥
  990.     var loginSubmitResult = FindTextMethods.findTextBasic("µÇ¼", 3000);
  991.     if (loginSubmitResult) {
  992.         auto.clickPoint(loginSubmitResult.x, loginSubmitResult.y);
  993.         sleep.millisecond(1000);
  994.         console.log("✅ µÇ¼²Ù×÷Ìá½»³É¹¦");
  995.     } else {
  996.         console.log("❌ δÕÒµ½µÇ¼Ìá½»°´Å¥");
  997.         return;
  998.     }
  999.    
  1000.     // 6. µÈ´ýµÇ¼³É¹¦
  1001.     console.log("\n5. µÈ´ýµÇ¼³É¹¦...");
  1002.     var loginSuccess = false;
  1003.     startTime = Date.now();
  1004.     timeoutMs = 15 * 1000;
  1005.    
  1006.     while (Date.now() - startTime < timeoutMs) {
  1007.         var result = FindTextMethods.findTextBasic("»¶Ó­", 1000);
  1008.         if (result) {
  1009.             loginSuccess = true;
  1010.             break;
  1011.         }
  1012.         sleep.millisecond(1000);
  1013.     }
  1014.    
  1015.     if (!loginSuccess) {
  1016.         console.log("❌ µÇ¼ʧ°Ü»ò³¬Ê±");
  1017.         return;
  1018.     }
  1019.     console.log("✅ µÇ¼³É¹¦");
  1020.    
  1021.     console.log("\n=== ×Ô¶¯»¯ÈÎÎñÖ´ÐÐÍê³É ===");
  1022. }



  1023. // ÔËÐÐʾÀý£¨Èç¹ûÖ±½ÓÖ´ÐдËÎļþ£©
  1024. if (typeof console !== 'undefined' && console.log) {
  1025.     // ÑÓ³Ù1ÃëºóÔËÐÐʾÀý£¬ÒÔ±ãÓÐʱ¼ä×¼±¸²âÊÔ»·¾³
  1026.     setTimeout(function() {
  1027.         runComprehensiveDemo();
  1028.         // ¿ÉÒÔÑ¡ÔñÔËÐÐ×Ô¶¯»¯ÈÎÎñʾÀý
  1029.         // runAutomationTask();
  1030.     }, 1000);
  1031. }



¸´ÖÆ´úÂë


»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

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

¹Ø±Õ

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

map2

GMT+8, 2026-2-6 16:28 , Processed in 0.200327 second(s), 34 queries .

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