此次测试代码:#include<af_search_pic.au3>
;~ Opt("TrayIconDebug", 1)
Sleep(6000)
search_pic (0,0, @DesktopWidth, @DesktopHeight,@ScriptDir & "\1.bmp")
If $aPosMsg<>"" Then
$array=StringSplit ($aPosMsg,",",2)
ConsoleWrite(@CRLF & "1.bmp array0 is " & $array[0] & @CRLF & @CRLF)
ConsoleWrite(@CRLF & "1.bmp array1 is " & $array[1] & @CRLF & @CRLF)
;MouseClick("left",$array[0]+20,$array[1]+10,"2") ;点击配置属性
EndIf
search_pic (0,0, @DesktopWidth, @DesktopHeight,@ScriptDir & "\4.bmp")
If $aPosMsg<>"" Then
$array=StringSplit ($aPosMsg,",",2)
ConsoleWrite(@CRLF & "4.bmp array0 is " & $array[0] & @CRLF & @CRLF)
ConsoleWrite(@CRLF & "4.bmp array1 is " & $array[1] & @CRLF & @CRLF)
MouseClick("left",$array[0]+20,$array[1]+10,"2") ;点击配置,选择Debug还是Release
EndIf
我分了2个步骤继续去调试:
1、先把第九行注释了,运行的结果是只有1.bmp的调试输出:
1.bmp array0 is 198
1.bmp array1 is 159
输出窗口内容后面,就没有显示有4.bmp的0和1的输出了。
2、我把整个第一步骤都注释了:#include<af_search_pic.au3>
;~ Opt("TrayIconDebug", 1)
Sleep(6000)
;~ search_pic (0,0, @DesktopWidth, @DesktopHeight,@ScriptDir & "\1.bmp")
;~ If $aPosMsg<>"" Then
;~ $array=StringSplit ($aPosMsg,",",2)
;~ ConsoleWrite(@CRLF & "1.bmp array0 is " & $array[0] & @CRLF & @CRLF)
;~ ConsoleWrite(@CRLF & "1.bmp array1 is " & $array[1] & @CRLF & @CRLF)
;~ MouseClick("left",$array[0]+20,$array[1]+10,"2") ;点击配置属性
;~ EndIf
search_pic (0,0, @DesktopWidth, @DesktopHeight,@ScriptDir & "\4.bmp")
If $aPosMsg<>"" Then
$array=StringSplit ($aPosMsg,",",2)
ConsoleWrite(@CRLF & "4.bmp array0 is " & $array[0] & @CRLF & @CRLF)
ConsoleWrite(@CRLF & "4.bmp array1 is " & $array[1] & @CRLF & @CRLF)
MouseClick("left",$array[0]+20,$array[1]+10,"2") ;点击配置,选择Debug还是Release
EndIf
运行输出非常妖异:>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\lwk\Desktop\autit\MakeProject\configproject.au3" /UserParams
+>14:38:27 启动 AutoIt3Wrapper v15.920.938.0 SciTE v3.6.0.0 键盘:00000804 操作系统:WIN_7/Service Pack 1 CPU:X64 系统架构:X64 语言环境:0804
+> SciTE 目录 => C:\Program Files (x86)\AutoIt3\SciTE AutoIt3Wrapper 用户目录 => C:\Users\lwk\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE 用户目录 => C:\Users\lwk\AppData\Local\AutoIt v3\SciTE
>运行 AU3Check (3.3.14.2) 检查代码. 参数: C:\Program Files (x86)\AutoIt3 au3 文件: C:\Users\lwk\Desktop\autit\MakeProject\configproject.au3
+>14:38:27 AU3Check 语法检查结束.rc: 0
>运行:C:\Program Files (x86)\AutoIt3\autoit3_x64.exe(3.3.14.2), 脚本: C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\lwk\Desktop\autit\MakeProject\configproject.au3"
--> 点击 Ctrl+Alt+Break 重新启动, 或 Ctrl+Break 停止脚本执行
+>14:38:33 AutoIt3.exe 结束.rc: 0
+>14:38:33 AutoIt3Wrapper 完成脚本处理.
>Exit code: 0 Time: 6.787
似乎什么事情都没有发生过,我反复确认过4.bmp是很正常的截图,没有变化过的24位图,肯定界面上是会有的。
脚本目录下面的Source.bmp也是截图成功的
以前也在其它平台上写过很简单的代码的,见到编译器这样无视代码也是不得其解。。。。。 |