Simba Code:
program new;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i srl/srl/misc/paintsmart.scar}
var boxLeft,boxRight,boxMe:TBox;
procedure setVars;
begin
SetColorspeed2Modifiers(0.01,0.40);
with boxMe do
begin
X1 := 232;
X2 := 286;
Y1 := 118;
Y2 := 163;
end;
with boxLeft do
begin
X1 := 138;
X2 := 165;
Y1 := 114;
Y2 := 149;
end;
with boxRight do
begin
X1 := 353;
X2 := 374;
Y1 := 123;
Y2 := 158;
end;
end;
procedure drawBoxes;
begin
SMART_DrawBoxex(true,boxLeft,clBlue);
SMART_DrawBoxex(false,boxMe,clOlive);
SMART_DrawBoxex(false,boxRight,clBlue);
end;
procedure mouseLeftBox;
begin
MMouse(boxLeft.X1+(boxLeft.X2-boxLeft.X1)/2,boxLeft.Y1+(boxLeft.Y2-boxLeft.Y1)/2,10,10);
end;
procedure mouseRightBox;
begin
MMouse(boxRight.X1+(boxRight.X2-boxRight.X1)/2,boxRight.Y1+(boxRight.Y2-boxRight.Y1)/2,10,10);
end;
function clickBoxMe:boolean;
var mid:tpoint;tpa:TPointArray;x,y,I:integer;
begin
result := FindColorsSpiralTolerance(x,y,tpa,1607850,boxme.x1,boxme.y1,boxme.x2,boxme.y2,13);
mid:= MiddleTPA(tpa);
if (result) then
begin
for I := 0 to 10 do
begin
mmouse(mid.x,mid.y,10,10);
if WaitUptext('ine',725+random(225)) then
begin
clickmouse2(true);
break;
end;
end;
end;
end;
function checkLeft:boolean;
begin
result := CountColorTolerance(1414075,BoxLeft.X1,BoxLeft.Y1,BoxLeft.X2,BoxLeft.Y2,8) > 0;
writeln('Ore on left side: ' + BoolToStr(result));
end;
function checkRight:boolean;
begin
result := CountColorTolerance(1414075,boxRight.X1,boxRight.Y1,boxRight.X2,boxRight.Y2,8) > 0;
writeln('Ore on right side: ' + BoolToStr(result));
end;
procedure waitTillMined;
var time:longint;
begin
wait(4000);
markTime(time);
while (CountColorTolerance(1414075 ,BoxMe.X1,BoxMe.Y1,BoxMe.x2,BoxMe.y2,13)) >0 do
begin
writeln('in waittill mined');
wait(1000+random(10));
if timefrommark(time) > 25000 then
begin
clickBoxMe;
markTime(time);
if checkLeft then mouseLeftBox else if checkRight then mouseRightBox;
end;
end;
writeln('done waiting to finish mining');
end;
var x,y:integer;
begin
Smart_Members := true;
Smart_Server := 100;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
ActivateClient;
setVars;
drawBoxes;
clickboxme;
if(checkLeft) then mouseLeftBox else if checkRight then mouseRightBox;
waitTillMined;
repeat
if checkLeft then
begin
GetMousePos(x,y);
if (pointinbox(Point(x,y),boxLeft)) then
begin
ClickMouse2(true);
mouseRightBox;
end else
begin
mouseLeftBox;
ClickMouse2(true);
mouseRightBox;
end;
end;
if checkRight then
begin
GetMousePos(x,y);
if (pointinbox(Point(x,y),boxRight)) then
begin
ClickMouse2(true);
mouseLeftBox;
end else
begin
mouseRightBox;
ClickMouse2(true);
mouseLeftBox;
end;
end;
waitTillMined;
until IsKeyDown(VK_CONTROL) AND IsKeyDown(VK_S); {}
end.