初来贵地,求帮改代码,不胜感激
#include <Sound.au3>HotKeySet("{F4}", "Terminate")HotKeySet("{F2}", "pause")Opt("WinTitleMatchMode", 2) WinMove("百度","",0,0,740,895)WinMove("Microsoft Office Picture Manager","",740,0,431,410)Opt("MouseClickDownDelay", 0) $sourcepos=MouseGetPos()$sourcepos[0]=759$sourcepos[1]=92
sleep(1000)$colorpos=find0();MouseClick("",$colorpos[0]+21,$colorpos[1]+48,1,0)sleep(1000)dim $destPos[2]$destPos[0]=$colorpos[0]-411$destPos[1]=$colorpos[1]MouseClick("",$colorpos[0],$colorpos[1],1,0)MouseMove($destPos[0],$destPos[1],0)Global $paintcolor[5][3]for $colori=0 to 4 for $colorj=0 to 2 $paintcolor[$colori][$colorj]=PixelGetColor($colorpos[0]+$colori*14,$colorpos[1]+$colorj*14) NextNext
dim $painted[391][291]
$begin=TimerInit()for $replace=1 to 2 for $colori=4 to 0 step -1 for $colorj=2 to 0 step -1 ;MouseMove($destPos[0],$destPos[1]) ;sleep(1000) $destcolor=PixelGetColor($colorpos[0]+$colori*14,$colorpos[1]+$colorj*14) MouseClick("",$colorpos[0]+$colori*14,$colorpos[1]+$colorj*14,1,0) sleep(1000) if $colori=0 and $colorj=1 Then;MouseClick("",$colorpos[0]+21+17,$colorpos[1]+48,1,0) ElseMouseClick("",$colorpos[0]+21,$colorpos[1]+48,1,0) EndIf for $i=0 to 390 step 1 $jrecord=0for $j=0 to 280 step 1 if $painted[$i][$j]=0 Then if PixelGetColor($sourcepos[0]+$i,$sourcepos[1]+$j)=16777215 Then $painted[$i][$j]=1 EndIf if PixelGetColor($sourcepos[0]+$i,$sourcepos[1]+$j)=15526360 Then $painted[$i][$j]=1 EndIf if $colori+$colorj<>0 Then if PaintTest(PixelGetColor($sourcepos[0]+$i,$sourcepos[1]+$j),$destcolor)=1 ThenMouseClick("",$destPos[0]+$i,$destPos[1]+$j,1,0)$painted[$i][$j]=1 EndIf EndIf EndIfNext Next Next Next for $deletearrayi=1 to 390 for $deletearrayj=1 to 290 $painted[$deletearrayi][$deletearrayj]=0 Next NextNext
SoundPlay("c:\windows\media\Windows XP 硬体失败.wav",1)
MouseClick("",$colorpos[0]+36,$colorpos[1]+309,1,0)sleep(10*1000)Send("^{enter}")FileWriteLine("log.txt",int(TimerDiff($begin)/60/1000)&"min")if msgbox(0,"取消关机",int(TimerDiff($begin)/60/1000)&"min",60*10)=-1 Then shutdown(64)
Func Terminate()ExitEndFunc Func pause()sleep(60*1000)EndFunc func PaintTest($pixel,$destcolor) $return=0 $colorii=0 $colorjj=0 $zhireturntemp=999 if $destcolor<>16777215 Then for $colori=0 to 4 for $colorj=0 to 2if color_dis($pixel,$paintcolor[$colori][$colorj])<color_dis($pixel,$paintcolor[$colorii][$colorjj]) Then $colorii=$colori $colorjj=$colorjEndIf Next Next EndIf if $paintcolor[$colorii][$colorjj]=$destcolor then $return=1 Return $returnEndFunc
Func color_mohu($color, $dui_bi_color,$zhi)
$red = BitAND(BitShift($color, 16), 0xFF)
$green = BitAND(BitShift($color, 8), 0xFF)
$blue = BitAND($color, 0xFF)
$redb = BitAND(BitShift($dui_bi_color, 16), 0xFF)
$greenb = BitAND(BitShift($dui_bi_color, 8), 0xFF)
$blueb = BitAND($dui_bi_color, 0xFF)
If ($red > $redb - $zhi) And ($red < $redb+ $zhi) And ($green > $greenb - $zhi) And ($green < $greenb + $zhi) And ($blue > $blueb - $zhi) And ($blue < $blueb + $zhi) Then
Return True
EndIf
Return False
EndFunc
func color_dis($color, $dui_bi_color) $red = BitAND(BitShift($color, 16), 0xFF)
$green = BitAND(BitShift($color, 8), 0xFF)
$blue = BitAND($color, 0xFF)
$redb = BitAND(BitShift($dui_bi_color, 16), 0xFF)
$greenb = BitAND(BitShift($dui_bi_color, 8), 0xFF)
$blueb = BitAND($dui_bi_color, 0xFF)
Return abs($red-$redb)+abs($green-$greenb)+abs($blue-$blueb)EndFunc func detchooseChecksum($i,$j)return PixelChecksum($i-5,$j-5,$i+5,$j+5)endFunc
func find0() for $x=1 to 100 for $y=1 to 300 $xx=int(((-1)^$x)*0.5*$x) $yy=int(((-1)^$y)*0.5*$y) if detchooseChecksum(648+$xx,488+$yy)=818156483 Then$x=100$y=100$returnX=648+$xx$returnY=488+$yy EndIf Next Next dim $returnmax[2] $returnmax[0]=$returnX-65 $returnmax[1]=$returnY+20 return $returnmaxEndFunc
帮忙看看哪里错了 谢谢