If you need to enter place, just as a boat or a cave etc. and u need your script to find the color of the entrance, but there are other exact/similar colors in the area how would you get it to only select the door/cave/entrance?
If you need to enter place, just as a boat or a cave etc. and u need your script to find the color of the entrance, but there are other exact/similar colors in the area how would you get it to only select the door/cave/entrance?
Use FindObjCustom.
For the theory, you would need to create a loop, then loop through the points of the color.
Im trying to figure out how to fix it to click a bridge to enter a boat but the dock is the same color as the bridge and it cant find the bridge so it just gets lostCode:Function FindBoatColor: integer; var i,tc,tc2: integer; bpts: Tpointarray; begin colortolerancespeed(1); findcolorstolerance(bpts,1325637,mmx1,mmy1,mmx2,mmy2,50); for i := 0 to high(bpts) do begin tc := Getcolor(bpts[i].x,bpts[i].y); if similarcolors(tc,1325637,45) then begin tc2 := Getcolor(bpts[i].x + 1,bpts[i].y); //if (abs(tc2 - tc) = 396557) or (abs(tc2 - tc) = 3341) or (abs(tc2 - tc) = 331021) or (abs(tc2 - tc) = 461324) then if (abs(tc2 - tc) = 396557) or (abs(tc2 - tc) = 3341) or (abs(tc2 - tc) = 331021) or (abs(tc2 - tc) = 461324) or (abs(tc2 - tc) = 2572) then begin Result := tc; if Debug then Writeln('BoatColor := ' + inttostr(result)); exit; end; end; end; end;
EDIT: this is just finding the color of the plank
Last edited by kylerperson; 09-14-2009 at 11:44 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)