Jump to content
shadowrecon

need some assistance writing a function..

Recommended Posts

ok, so im making a bot to cut yews, after its done with a yew i want ti to return the center before looking for the next tree, i figure i could get the color of the trees on the mini map and since there in a direct line just divide the y/2 which would put me smack dab in the center, the problem is im using the same color off the tree bit map, and both are always in range, how can i specify find color here then find color here...

 

After writing this i figured it out.. just use the xs,ys,xe,ye to make boxes to search.. now to find the right function!

Link to comment
Share on other sites

ah i was having trouble finding a way to take a color from 2 mini map symbols and click at the point between them, i was over thinking it, i just used find color and set up a search region, on the north part of map and south part of map took the y variables got from each findcolor() and divided by 2 then used that in a mouse click function, i just split the difference between the to and clicked. ( im making a yew cutter for edge ville, and it put the guy somewhere in between the 2 trees ) Heres what i ended up using.

 

Procedure SplitTheDifference;
var
cx,cy,nx,ny,Gy: integer;
begin
 ColorToleranceSpeed(2);
 findcolor(Cx,Cy,494860,601,60,646,100);
 wait(200);
 findcolor(Nx,Ny,494860,599,113,659,152);
 ColorToleranceSpeed(1);
 Gy := ((Cy+Ny) div 2)+10;
 wait(250);
 MoveWindMouse(Nx,Gy,0,0);
 wait(230);
 ClickMouse((Nx-1),Gy,True);
end; 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...