
Originally Posted by
Greomareh
When you step below the 1st of the two bottom rocks, the script thinks it is lost and not at the mine.
Then it failed to find the well. I don't know what to suggest, because I'm a noob, but the script gets lost a little too easily.
Okay, I addressed the Well finding problem by adding a backup method. Some of my functions are getting a little dated most were written in September 2011 before the bot nuke and subsequent updates. My location detection functions are custom built the mine detection is done in the function AtMine:
Simba Code:
function AtMine (UseBackup: Boolean):Boolean;
//Locates mining rocks and dead trees to see if at clay mine
var
RockColor,TreeColor,i,Len,match,dist: integer;
RockTPA,TreeTPA: TPointArray;
RockATPA,TreeATPA: T2DPointArray;
RockTP,TreeTP: TPoint;
begin
Result := false;
RockColor := 5341329;
TreeColor := 2238252;
match := 0;
//Find all the Rock colors and Tree colors
if (FindColorsTolerance(RockTPA,RockColor,MSX1,MSY1,MSX2,MSY2,5)) and
(FindColorsTolerance(TreeTPA,TreeColor,MSX1,MSY1,MSX2,MSY2,5))then
begin
//Found some colors, group them
RockATPA := SplitTPAEx(RockTPA,13,13);
SortATPASize(RockATPA,true);
TreeATPA := SplitTPAEx(TreeTPA,40,40);
SortATPASize(TreeATPA,true);
//Cutt off ones that are too small
Len := length(RockATPA);
writeln('Groups of Rocks: '+tostr(Len));
writeln('Number of tree points: '+tostr(length(TreeATPA[0])));
if (Len >= 4)and(length(TreeATPA[0])>700)and(Len <=6) then
begin
//go from largest tree
TreeTP := MiddleTPA(TreeATPA[0]);
//MMouse(TreeTP.x,TreeTP.y,0,0);
//Now Look at the rock to tree distance relation
for i := 0 to (Len-1) do
begin
RockTP := MiddleTPA(RockATPA[i]);
dist := Distance(TreeTP.x,TreeTP.y,RockTP.x,RockTP.y);
writeln(tostr(i)+' dist = '+tostr(dist));
if (dist >100) and(dist<320) then
Inc(match);
end;
if (match >= 4) then
Result := true;
end;
end;
if not(Result) and(UseBackup) then
begin
RockColor := 7844821;
if (FindObj(RockTP.x,RockTP.y,'ine Rock',RockColor,10)) then
Result := true;
end;
if (Result) then
begin
writeln('Found mine');
end else
writeln('Failed to find mine');
end;
This counts the rocks and measures the distance between the dead trees and the rocks. Since it uses the main screen it could fail due to NPC's and other characters clothing colors so be sure to dress appropriately. It works for me; I will post a progress report for Rev16 in a few hours when it either stops or I force quit it.
Test run: making bowls, level goal 60, and banking the bowls.
Progress Report:
=========== THE Pot Maker =============
Time Running 1:27:21
Current action: Lost
Level Goal: 51 / 60
Mining xp: 1350
Crafting xp: 8910
=======================================
Got lost next to mine field; I'll need to figure out what caused it to fail
Remember you can always see how many people are using this script successfully at the SRL stats page