lolp1 Posted October 5, 2006 Posted October 5, 2006 I belive this is based of larrys code, but I have ran into a compile error: When I run this it runs fine: expandcollapse popupGlobal Const $SM_VIRTUALWIDTH = 78 Global Const $SM_VIRTUALHEIGHT = 79 Global $pixel = Int(IniRead(".\PixelSearch.ini","Main","PixelColor","-1")) Global $chksum = Int(IniRead(".\PixelSearch.ini","Main","PixelCheckSum","-1")) If $pixel = -1 Or $chksum = -1 Then MsgBox(4096,"Error","Could not read INI") Exit EndIf $VIRTUALDESKTOPWIDTH = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_VIRTUALWIDTH) $VIRTUALDESKTOPWIDTH = $VIRTUALDESKTOPWIDTH[0] $VIRTUALDESKTOPHEIGHT = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_VIRTUALHEIGHT) $VIRTUALDESKTOPHEIGHT = $VIRTUALDESKTOPHEIGHT[0] HotKeySet("`","find") While 1 ToolTip("Press ` (Tilda key) to" & @LF & "find the area in PixelSearch.ini.") Sleep(100) WEnd Func find() $x = 0 $y = 0 $ypixel = $VIRTUALDESKTOPHEIGHT - 1 While 1 $xy = PixelSearch($x,$y,$VIRTUALDESKTOPWIDTH - 1,$ypixel,$pixel) If @error And $ypixel = ($VIRTUALDESKTOPHEIGHT - 1)Then MsgBox(4096,"Error","Could not find area.") Exit ElseIf @error Then $y = $ypixel + 1 $ypixel = ($VIRTUALDESKTOPHEIGHT - 1) $x = 0 ElseIf $chksum = PixelCheckSum($xy[0]-5,$xy[1]-5,$xy[0]+5,$xy[1]+5) Then Mousemove($xy[0],$xy[1]) ToolTip("There it is.") Sleep(3000) Exit Else $y = $xy[1] $ypixel = $y $x = $xy[0] + 1 EndIf WEnd EndFunc How ever when I run this: expandcollapse popupGlobal Const $SM_VIRTUALWIDTH = 78 Global Const $SM_VIRTUALHEIGHT = 79 Global $pixel = Int(IniRead(".\PixelSearch.ini","Main","PixelColor","-1")) Global $chksum = Int(IniRead(".\PixelSearch.ini","Main","PixelCheckSum","-1")) If $pixel = -1 Or $chksum = -1 Then MsgBox(4096,"Error","Could not read INI") Exit EndIf $VIRTUALDESKTOPWIDTH = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_VIRTUALWIDTH) $VIRTUALDESKTOPWIDTH = $VIRTUALDESKTOPWIDTH[0] $VIRTUALDESKTOPHEIGHT = DLLCall("user32.dll","int","GetSystemMetrics","int",$SM_VIRTUALHEIGHT) $VIRTUALDESKTOPHEIGHT = $VIRTUALDESKTOPHEIGHT[0] HotKeySet("`","find") While 1 ToolTip("Press ` (Tilda key) to" & @LF & "find the area in PixelSearch.ini.") Sleep(100) WEnd Func find() $x = 0 $y = 0 $ypixel = $VIRTUALDESKTOPHEIGHT - 1 While 1 $xy = PixelSearch($x,$y,$VIRTUALDESKTOPWIDTH - 1,$ypixel,$pixel) If @error And $ypixel = ($VIRTUALDESKTOPHEIGHT - 1)Then MsgBox(4096,"Error","Could not find area.") Exit ElseIf @error Then $y = $ypixel + 1 $ypixel = ($VIRTUALDESKTOPHEIGHT - 1) $x = 0 ElseIf $chksum = PixelCheckSum($xy[0]-5,$xy[1]-5,$xy[0]+5,$xy[1]+5) Then Mouseclick($xy[0],$xy[1]) ToolTip("There it is.") Sleep(3000) Exit Else $y = $xy[1] $ypixel = $y $x = $xy[0] + 1 EndIf WEnd EndFunc Note: The thing that changed was Mousemove($xy[0],$xy[1]) To: Mouseclick($xy[0],$xy[1]) When I run it I get this error: Error: Incorrect number of parameters in function call. Any advice?
Moderators SmOke_N Posted October 5, 2006 Moderators Posted October 5, 2006 You forgot "left" Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
lolp1 Posted October 5, 2006 Author Posted October 5, 2006 I tryed: [Mouseclick("left")($xy[0],$xy[1]) I get error: Error: Illegal text at the ed if the statement[/code[ Any help apperciatedk
BigDod Posted October 5, 2006 Posted October 5, 2006 Try Mouseclick("left",$xy[0],$xy[1]) Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now