Bixby Sayz Posted May 28, 2012 Share Posted May 28, 2012 Got my flax picker/spinner working pretty flawlessly now (except for a huge wrinkle with trial members, but that is a story for another day). But it could be better. When it finds a flax plant it continues to pick that plant until it is gone (to avoid the slowdown of searching for every pick). Which works fine except when the act of picking that plant for the first time causes the character to move to the plant. In this case my coords to click are now off by however many pixels the character moved. Not a big deal. The script will realize this and simply search again once it fails to pick. But it would be nice to figure out if/how much exactly the character has moved to adjust the mouse coords. Quote Link to comment Share on other sites More sharing options...
Velvet Glam Posted May 28, 2012 Share Posted May 28, 2012 function follow(var x, y: Integer): Boolean; var TPA: TPointArray; bounds: TBox; t: Integer; begin result := False; SetColorToleranceSpeed(2); SetToleranceSpeed2Modifiers(HUE, SAT); t := GetSystemTime; while GetSystemTime - t < 1000 do begin if GetSystemTime - t > 500 then //IF DETECT PIXEL CHANGE AROUND THE CHAR MINIMAP t := GetSystemTime; bounds := constrainBounds(IntToBox(x - 15, y - 15, x + 15, y + 15)); with bounds do FindColorsSpiralTolerance(x, y, TPA, COLOR, x1, y1, x2, y2, 0); if Length(TPA) > 0 then MiddleTPAEx(TPA, x, y) else begin SetColorToleranceSpeed(1); Exit; end; end; result := Distance(x, y, MSCX, MSCY) < 60; SetColorToleranceSpeed(1); end; Something like this may work if your search box is small enough...will have to test it out Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted May 28, 2012 Share Posted May 28, 2012 Have you tried using SPS in the GMRL include? It can determine your char position within a few pixels. When I ported all the functions over, I did alot of testing and was pretty amazed how accurate it was 98% of the time. Give it a whirl Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted May 28, 2012 Author Share Posted May 28, 2012 Something like this may work if your search box is small enough...will have to test it outI'll give it a go. Was thinking along the lines of something like this. The tricky part is figuring out what to track. The nearby flax plants can disappear if others are picking, the npcs move around, the fence can be obscured by others walking by, and your character itself can be obscured by those damn npcs bopping around. Have you tried using SPS in the GMRL include? It can determine your char position within a few pixels. When I ported all the functions over, I did alot of testing and was pretty amazed how accurate it was 98% of the time. Give it a whirl I was thinking of adding SPS later as an optional walking method. Quote Link to comment Share on other sites More sharing options...