Simba Code:
Program ShowOres;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
{$I SRL/SRL/misc/SmartGraphics.simba}
Const
COLORROCK = 5988191;
COLORORE = 1910337;
TOL = 15;
var
box1count,box2count,box3count,box4count,box5count,box6count:Integer;
box1countI,box2countI,box3countI,box4countI,box5countI,box6countI:Integer;
box1countR,box2CountR,box3CountR,box4CountR,box5CountR,box6CountR:String;
Procedure GetPositions;
Begin
Begin
if box1count >= 70 and box1countI >= 10 then
//box1countI >= 10 then
Begin
box1countR := 'Iron'
End;
if box1Count >= 70 and box1countI <= 10 then
Begin
box1countR := 'Rock'
End;
if box1Count =< 70 and box1countI =< 10 then
Begin
box1countR := 'Nothing'
End;
End;
End;
Procedure GetRocks;
Begin
box1count := CountColorTolerance(COLORROCK, 215, 182-50, 247, 213-50, TOL);
box2count := CountColorTolerance(COLORROCK, 247, 182-50, 279, 213-50, TOL);
box3count := CountColorTolerance(COLORROCK, 279, 182-50, 309, 213-50, TOL);
box4count := CountColorTolerance(COLORROCK, 215, 213-50, 247, 244-50, TOL);
box5count := CountColorTolerance(COLORROCK, 247, 213-50, 279, 244-50, TOL);
box6count := CountColorTolerance(COLORROCK, 279, 213-50, 309, 244-50, TOL);
box1countI := CountColorTolerance(COLORORE, 215, 182-50, 247, 213-50, TOL);
box2countI := CountColorTolerance(COLORORE, 247, 182-50, 279, 213-50, TOL);
box3countI := CountColorTolerance(COLORORE, 279, 182-50, 309, 213-50, TOL);
box4countI := CountColorTolerance(COLORORE, 215, 213-50, 247, 244-50, TOL);
box5countI := CountColorTolerance(COLORORE, 247, 213-50, 279, 244-50, TOL);
box6countI := CountColorTolerance(COLORORE, 279, 213-50, 309, 244-50, TOL);
{Writeln('BOX1:' + IntToStr(box1count) + '');
Writeln('BOX2:' + IntToStr(box2count) + '');
Writeln('BOX3:' + IntToStr(box3count) + '');
Writeln('BOX4:' + IntToStr(box4count) + '');
Writeln('BOX5:' + IntToStr(box5count) + '');
Writeln('BOX6:' + IntToStr(box6count) + '');
Writeln('BOX1:' + IntToStr(box1countI) + '');
Writeln('BOX2:' + IntToStr(box2countI) + '');
Writeln('BOX3:' + IntToStr(box3countI) + '');
Writeln('BOX4:' + IntToStr(box4countI) + '');
Writeln('BOX5:' + IntToStr(box5countI) + '');
Writeln('BOX6:' + IntToStr(box6countI) + ''); }
End;
Begin
SetupSRL;
ActivateClient;
GetRocks;
End.