Well i've done it but i don't think it works very well :P (USE FAWKI'S!!)
program LumbyMiner;
{.include SRL/SRL.scar}
var
i,StairTopColor,StairBottomColor,FountainColor,MMLadderColor,Temp:integer;
const
DebugMessage = true;
function FindDoorMM(DirectionDoor:string):boolean;
begin
case Trim(LowerCase(DirectionDoor)) of
'n':if findcolor(x,y,231,642,75,657,83) then Result := true
'e':if findcolor(x,y,231,647,74,655,89) then Result := true
's':if findcolor(x,y,231,638,84,658,94) then Result := true
'w':if findcolor(x,y,231,636,75,648,92) then Result := true
end;
end;
function Moving:boolean;
var Temp:integer;
begin
Temp := getcolor(146,269)
wait(500)
if not(findcolor(x,y,Temp,145,268,147,270)) then Result := true
end;
procedure DebugAll(messagesend:string);
begin
If DebugMessage = true then writeln(messagesend)
end;
function StrContains(Str, Substr: String): Boolean; //Thanks bullzeye95!}
begin
Result:= (Pos(Substr, Str) <> 0);
end;
procedure FindStairBottomColor;
begin
i := 0
DebugAll('Starting FindStairBottomColor')
repeat
if findcolortolerance(x,y,603213,MSX1,MSY1,MSX2,MSY2,i) then
begin
MMouse(x,y,0,0)
if StrContains(GetUpText,'Stair') then
begin
StairBottomColor := GetColor(x,y)
DebugAll('Found at: ' + inttostr(x) + ', ' + inttostr(y))
DebugAll('Color: ' + inttostr(StairBottomColor))
Break;
end;
end;
i := i + 1
until(i > 14)
DebugAll('Finished FindStairBottomColor')
end;
procedure FindStairTopColor;
begin
i := 0
DebugAll('Starting FindStairTopColor')
repeat
if findcolortolerance(x,y,7724,MSX1,MSY1,MSX2,MSY2,i) then
begin
MMouse(x,y,0,0)
if StrContains(GetUpText,'Stair') then
begin
StairTopColor := GetColor(x,y)
DebugAll('Found at: ' + inttostr(x) + ', ' + inttostr(y))
DebugAll('Color: ' + inttostr(StairTopColor))
Break;
end;
end;
i := i + 1
until(i > 14)
DebugAll('Finished FindStairTopColor')
end;
procedure FindMMLadderColor;
begin
i := 0
DebugAll('Starting FindMMLadderColor')
repeat
if findcolortolerance(x,y,7750,MMX1,MMY1,MMX2,MMY2,i) then
begin
MMLadderColor := GetColor(x,y)
DebugAll('Found at: ' + inttostr(x) + ', ' + inttostr(y))
DebugAll('Color: ' + inttostr(MMLadderColor))
Mouse(x,y,0,0,true)
FFlag(10)
Break;
end;
i := i + 1
until(i > 14)
DebugAll('Finished FindMMLadderColor')
end;
procedure FindFountainColor;
begin
i := 0
DebugAll('Starting FindFountainColor')
repeat
watercolor := 0
DebugAll('Looking')
if findcolortolerance(x,y,11163985,MMX1,MMY1,MMX2,MMY2,i) then
begin
WaterColor := GetColor(x,y)
DebugAll('Found at: ' + inttostr(x) + ', ' + inttostr(y))
DebugAll('Color: ' + inttostr(WaterColor))
Mouse(x,y,0,0,true)
FFlag(10)
Break;
end;
i := i + 1
until(i > 14)
DebugAll('Finished FindFountainColor')
end;
procedure WalkToMine;
begin
MakeCompass('n')
Mouse(623,140,0,0,true)
Flag;
MakeCompass('w')
LowestAngle;
LowestAngle;
if StairTopColor = 0 then FindStairTopColor
Mouse(x,y,0,0,false)
ChooseOption(x,y,'down')
wait(1000 + random(500))
HighestAngle;
if StairBottomColor = 0 then FindStairBottomColor
Mouse(x,y,0,0,false)
ChooseOption(x,y,'down')
wait(1000 + random(500))
MakeCompass('n')
if FountainColor = 0 then FindFountainColor
if FindColorTolerance(x,y,FountainColor,MMX1,MMY1,MMX2,MMY2,15) then
begin
Mouse(x,y,0,0,true)
end;
RadialWalk(FindRoadColor,82,114,60,0,0);
repeat
RadialWalk(FindRoadColor,143,220,60,0,0);
until(FindSymbol(x,y,'tree'))
RadialWalk(FindRoadColor,143,220,60,0,0);
repeat
RadialWalk(FindWaterColor,143,198,60,0,0);
until(FindSymbol(x,y,'fish'))
Mouse(x,y,0,0,true)
FFlag(10);
repeat
Mouse(620,95,0,0,true)
FFlag(10);
until(FindSymbol(x,y,'mining spot'))
Mouse(x,y,0,0,true)
FFlag(5)
end;
procedure WalkToBank;
begin
MakeCompass('n')
if FindSymbol(x,y,'fish') then
begin
Mouse(x,y,0,0,true)
end else
begin
repeat
Mouse(679,68,0,0,true)
FFlag(10)
until(FindSymbol(x,y,'fish'))
Mouse(x,y,0,0,true)
FFlag(10)
end;
repeat
RadialWalk(FindWaterColor,403,458,60,0,0);
until(FindSymbol(x,y,'tree'))
repeat
RadialWalk(FindRoadColor,307,332,60,0,0);
until(FindSymbol(x,y,'water'))
Mouse(x,y,0,0,true)
FFlag(10)
Mouse(632,82,0,0,true)
FFlag(3)
if MMLadderColor = 0 then FindMMLadderColor
Mouse(x,y,0,0,true)
FFlag(3)
if StairBottomColor = 0 then FindStairBottomColor
wait(1000)
if FindObj(x,y,'Stair',StairBottomColor,15) then
begin
Mouse(x,y,0,0,false)
ChooseOption(x,y,'up')
end;
wait(1000 + random(1000))
if FindObj(x,y,'Stair',StairBottomColor,15) then
begin
Mouse(x,y,0,0,false)
ChooseOption(x,y,'up')
end;
wait(1000 + random(1000))
if findcolortolerance(x,y,195836,MMX1,MMY1,MMX2,MMY2,10) then
begin
Mouse(x + 5,y + 5,0,0,true)
FFlag(3)
MakeCompass('n')
OpenBank3;
Mouse(580,265,0,0,false)
wait(100 + random(500))
chooseoption(x,y,'All')
CloseBank;
end;
end;
begin
ClearDebug;
SetupSRL;
FindWindowBySize(766,504)
WalkToMine;
WalkToBank;
end.