Hmm, sounds like it still isn't finding the search icon (magnifying lens) then. I'm guessing it is just clicking in the top left corner then?
EndIf
;MouseClick("left",$c1X,$c1Y,2,0)
ClickOffsetOfImage("left",60,$buttonsDir,"searchicon",2)
Send($mapX)
;MouseClick("left",$c2X,$c2Y,2,0)
ClickOffsetOfImage("left",30,$buttonsDir,"searchicon",2)
Send($mapY)
ClickImage($buttonsDir,"searchicon")
Sleep($wait)
MouseClick("left",832,21,2,0)
Send($mapX)
MouseClick("left",868,21,2,0)
Send($mapY)
MouseClick("left",900,21,2,0)
Sleep($wait)
Yes hard coding the mouseclicks is a work around but it won't work for everyone. The original code searches for the searchicon.bmp and then clicks 60 pixels to the left of it, then does the same thing 30 pixels to the left of it. If you are not seeing this result, it is because the image search on the searchicon.bmp is failing. Feel free to edit it however suits you but I want to make sure the everyday user understands what is going on and that changing it to your mouseclicks is not going to necessarily help them if they are having the same issue.Quote:
what i did to get it to work
toCode:EndIf ;MouseClick("left",$c1X,$c1Y,2,0) ClickOffsetOfImage("left",60,$buttonsDir,"searchicon",2) Send($mapX) ;MouseClick("left",$c2X,$c2Y,2,0) ClickOffsetOfImage("left",30,$buttonsDir,"searchicon",2) Send($mapY) ClickImage($buttonsDir,"searchicon") Sleep($wait)
Code:MouseClick("left",832,21,2,0) Send($mapX) MouseClick("left",868,21,2,0) Send($mapY) MouseClick("left",900,21,2,0) Sleep($wait)
The mouse isnt even moving when its looking for searchicon. I tried a different picture but didnt help. The small correction gets it to work.
Until SearchForAttackSword() = False Or ClickImage($buttonsDir,"attack") = True
ElseIf $managogFound = False And SearchForManagogs() Then
ToolTip("Managog found!",0,0)
Sleep(1000)
$managogFound = True
Do
WaitForAttack()
Until SearchForAttackSword() = False Or ClickImage($buttonsDir,"attack") = True
ElseIf $managogFound = True And $success = False Then
$managogFound = False
ChangeCoords()
ElseIf $managogFound = False Then
ChangeCoords()
ClickOffsetOfImage("up",700,$buttonsDir,"searchicon",2)
Func ChangeCoords()
;Changes map coordinates square by square. Moves left to right then moves down one square and goes left to right again.
$wait = 2000 ;sleep (milliseconds) at the end of this function
If $mapX < 585 Then
$mapX += 30
Else
$wait = 2000
$mapX = 15
If $mapY < 591 Then
$mapY += 17
EndIf
EndIf
;MouseClick("left",$c1X,$c1Y,2,0)
ClickOffsetOfImage("up",700,$buttonsDir,"searchicon3",2)
Send($mapX)
;MouseClick("left",$c2X,$c2Y,2,0)
ClickOffsetOfImage("up",700,$buttonsDir,"searchicon2",2)
Send($mapY)
ClickImage($buttonsDir,"searchicon")
Sleep($wait)
EndFunc
;MouseClick("left",$c1X,$c1Y,2,0)
ClickOffsetOfImage("up",700,$buttonsDir,"searchicon3",2)
Send($mapX)
;MouseClick("left",$c2X,$c2Y,2,0)
ClickOffsetOfImage("up",700,$buttonsDir,"searchicon2",2)
Send($mapY)
ClickImage($buttonsDir,"searchicon")
EndIf
MouseClick("left",832,21,2,0) ;<=== change the 832,21 as your x and y coords you found earlyer for the X
Send($mapX)
MouseClick("left",868,21,2,0) ;<=== change the 808,21 as your x and y coords you found earlyer for the Y
Send($mapY)
MouseClick("left",900,21,2,0) <=== change the 900,21 as your x and y coords you found earlyer for the compass location
Sleep($wait)
EndFunc
Just wanted to say thanks for this, I was literally hard-coding all mouse coordinates to do just this because I'm not a wizard with AutoIT in the slightest. I realize you probably have tons of projects, and I've hardcoded this feature in the meantime, but do you think that you could add planting support in the future?Quote:
Initial Post
;Until _ImageSearchArea($string,1,$startX,$startY,$endX,$endY,$gX,$gY,$tolerance) Until _ImageSearchArea($string,1,216,180,1723,1002,$gX,$gY,$tolerance)
Until _ImageSearchArea($string,1,$startX,$startY,$endX,$endY,$gX,$gY,$tolerance) ;Until _ImageSearchArea($string,1,216,180,1723,1002,$gX,$gY,$tolerance)
Thanks for the feedback :) Yes, I plan on having planting support soon. Once I get the .ini file working with all the user defined variables, I will roll out this. I will even allow you to specify how many of each kind of seed you want.Quote:
Just wanted to say thanks for this, I was literally hard-coding all mouse coordinates to do just this because I'm not a wizard with AutoIT in the slightest. I realize you probably have tons of projects, and I've hardcoded this feature in the meantime, but do you think that you could add planting support in the future?
That is, once myFarm is harvested, replant based on inventory position 1 or whatever other variable one would like? Would be nifty. Reached my first "Max Harvested for today" message lol, didn't even know it existed.
Kudos!
----
Yeah later on today for some reason it's not picking up any images whatsoever. I recaptured a few bmps since I'm on 1600x900 and it worked through about one full cycle, and then stopped picking them up again. I don't know what the heck happened. All of my settings are exactly the same. :(