2015-02-23 88 views
0

我正在使用Imagesearch.au3在outlook上搜索日曆圖片。以下是代碼。通過搜索日曆來點擊Outlook日曆圖片(_ImageSearch)

創建新文件夾 - > ImageSearch.au3,ImageSearchDLL.dll,和日曆的屏幕截圖被放置

#include <ImageSearch.au3> 
$x=0 
$y=0 
start() 
while 1 
    sleep(1000) 
WEnd 
Func Start() 
    while 1 
     $result = _ImageSearch("cal.png",1,$x,$y,0) 
     if $result=1 Then 
      ConsoleWrite("Sucesfull") 
      MouseMove($x,$y,10) 
     Else 
      ConsoleWrite("Img not found") 
     EndIf 
    WEnd 
EndFunc 

問題:拋出的錯誤消息 「C:\用戶... \ Desktop \ AutoIT \ New folder \ img \ ImageSearch.au3「(44):==>在不可訪問的變量上使用下標: if $ result [0] =」0「則返回0 如果$ result^ERROR

+0

64位的圖片搜索測試PLZ幫我 – Maheshwari 2015-02-25 07:34:10

回答

0

作爲腳本運行時,dll不會加載。我不確定爲什麼,但似乎其他人也有同樣的問題。我能夠將腳本編譯爲64位應用程序,然後應用程序加載該DLL。改變寬容後,我能夠找到圖像。

另外,我會重寫你的代碼。無緣無故你有兩個無限循環。我在while循環中添加了一個睡眠。我會增加容忍度。

#include <ImageSearch.au3> 

start() 
Func Start() 
    while 1 
    $x=0 
    $y=0 
    $result = _ImageSearch("cal.png",1,$x,$y,20) 
     if $result=1 Then 
      MsgBox(0,"Found Image","moving mouse") 
      MouseMove($x,$y,10) 
     Else 
      MsgBox(0,"Img not found","not found") 
     EndIf 
     sleep(10000) 
    WEnd 
EndFunc 

我與位於http://www.autoitscript.com/forum/topic/148005-imagesearch-usage-explanation/page-2

+0

HI, 從上面提到的鏈接,如果我點擊URL鏈接:(您請求不存在頁) 32位:圖片搜索32bit.rar 64:圖片搜索64 bit.rar https://www.autoitscript.com/forum/index.php?app=core&module=attach§ion=attach&attach_rel_module=post&attach_id=39525。 您能否給我發送正確的鏈接,在哪裏下載。 – Maheshwari 2015-07-06 08:18:23

+0

請讓我知道從哪裏可以下載Windows 64位圖像的DLL – Maheshwari 2015-07-07 10:13:55