rj
2013-02-08 22:08:59
Hello, I have taken it upon myself to make a ultra fast iron powerminer with good antiban similair to the RiD one (75k xp an hour proggy's):

Now this won't be any ordinary power miner, it is going to be using a similar method to RiD. what RiD does it, before you start the bot you hit 'scan'. the bot now defines iron rocks in the area, and when it mines it hovers over the rock even when there no ore in it then mines it as soon as the ore appears. This is the goal I want to acheive. Here is how I plan on doing it:
First, at the start of the script the bot will analize these regions of the main screen:

It will then sort out what is nothing and what is a rock and what is a iron ore. It will use Writeln to display the results:
Source code so far:
Credits to @SRLKing for the => working properly
PROGRESS:
Added rock detector that detects iron ores + normal rocks. It is 100% accurate so far.

Now this won't be any ordinary power miner, it is going to be using a similar method to RiD. what RiD does it, before you start the bot you hit 'scan'. the bot now defines iron rocks in the area, and when it mines it hovers over the rock even when there no ore in it then mines it as soon as the ore appears. This is the goal I want to acheive. Here is how I plan on doing it:
First, at the start of the script the bot will analize these regions of the main screen:

It will then sort out what is nothing and what is a rock and what is a iron ore. It will use Writeln to display the results:
|Nothing|Iron|Nothing|
|Iron|Nothing|Iron|Source code so far:
Program ShowOres;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
{$I SRL/SRL/misc/SmartGraphics.simba}
Const
COLORROCK = 5988191;
COLORORE = 2635354;
ROCKTOL = 17;
ORETOL = 9;
PSX1 = 251;
PSY1 = 206;
PSX2 = 273;
PSY2 = 236;
var
box1count,box2count,box3count,box4count,box5count,box6count:Integer;
box1countI,box2countI,box3countI,box4countI,box5countI,box6countI:Integer;
box1countR,box2CountR,box3CountR,box4CountR,box5CountR,box6CountR:String;
box1countA,box2countA,box3countA,box4countA,box5countA,box6countA:boolean;
ContainsOreA,ContainsOreB,ContainsOreC,ContainsOreD,ContainsOreE,ContainsOreF:Boolean;
RockAOre,RockBOre,RockCOre,RockDOre,RockEOre,RockFOre:Boolean;
RockAOreM,RockBOreM,RockCOreM,RockDOreM,RockEOreM,RockFOreM:Boolean;
BOUNDSX,BOUNDSY,BOUNDSX2,BOUNDSY2:Integer;
ContainsOre:Boolean;
RockState:Integer;
function IsMining: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(PSX1, PSY1 - 50, PSX2, PSY2 - 50);
Result := (AveragePixelShift(PBox, 250, 350) > 110);
end;
function StartMine: Boolean;
var
tmpCTS, i, L, Counter: Integer;
ObjTPA: TPointArray;
ObjATPA: T2DPointArray;
X, Y, DMCount, Moves: Integer;
begin
Moves := 0;
DMCount := 0;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.00, 0.16);
FindColorsTolerance(ObjTPA, 6383206, BOUNDSX, BOUNDSY, BOUNDSX2, BOUNDSY2, 3);
SplitTPAWrap(ObjTPA, 10, ObjATPA);
SortATPASize(ObjATPA, True);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
DMCount := RandomRange(3, 5);
L := High(ObjATPA) MarkTime(Counter);
for i := 0 to L do
begin
MiddleTPAEx(ObjATPA[i], X, Y);
repeat
begin
Moves := Moves + 1;
Wait(RandomRange(100, 200));
MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
if (IsUpTextMultiCustom(['Mine Ir', 'ine Iro', 'ine Iron'])) then
While IsMining do
Wait(RandomRange(100, 400));
begin
clickmouse2(mouse_Left);
Wait(RandomRange(100, 500));
Exit;
end;
end;
until (Moves > DMCount) if (TimeFromMark(Counter) > 5000) then
begin
MakeCompass(180 - Random(15));
Wait(RandomRange(7000, 12000));
Break;
end;
end;
Result := False;
end;
Procedure WriteRocks;
Begin
Writeln('|' + box1countR +'|' + box2countR + '|' + box3countR + '|');
Writeln('|' + box4countR +'|' + box5countR + '|' + box6countR + '|');
End;
Procedure DoMine;
Begin
If RockAOre = True then
Begin
StartMine;
RockAOreM = True;
Exit;
End;
If RockBOre = True then
Begin
StartMine;
RockBOreM = True;
Exit;
End;
If RockCOre = True then
Begin
StartMine;
RockCOreM = True;
Exit;
End;
If RockDOre = True then
Begin
StartMine;
RockDOreM = True;
Exit;
End;
If RockEOre = True then
Begin
StartMine;
RockDOreM = True;
Exit;
End;
If RockFOre = True then
Begin
StartMine;
RockFOreM = True;
Exit;
End;
End;
Procedure DefineRocks;
Begin
{
Box 1 Counts
}
ContainsOre := False;
Begin
if (box1count >= 65) and (box1countI >= 10) then
Begin
BOUNDSX :=279;
BOUNDSY :=213-50;
BOUNDSX2 :=309;
BOUNDSY2 :=244-50;
box1countR := 'Iron'
box1countA := True;
RockAOre := True;
//ContainsOre := True;
//StartMine;
End;
if (box1Count >= 65) and (box1countI <= 10) then
Begin
box1countR := 'Rock'
End;
if (box1Count <= 65) and (box1countI <= 10) Then
Begin
box1countR := 'Nothing'
End;
End;
{
Box 2 Counts
}
Begin
if (box2count >= 65) and (box2countI >= 4) then
Begin
BOUNDSX :=247;
BOUNDSY :=182-50;
BOUNDSX2 :=279;
BOUNDSY2 :=213-50;
box2countR := 'Iron'
box2countA := True;
RockBOre := True;
//ContainsOre := True;
// StartMine;
End;
if (box2Count >= 65) and (box2countI <= 4) then
Begin
box2countR := 'Rock'
End;
if (box2Count <= 65) and (box2countI <= 4) then
Begin
box2countR := 'Nothing'
End;
End;
{
Box 3 Counts
}
Begin
if (box3count >= 65) and (box3countI >= 20) then
Begin
BOUNDSX :=279;
BOUNDSY :=182-50;
BOUNDSX2 :=309;
BOUNDSY2 :=213-50;
box3countR := 'Iron'
box3countA := True;
RockCOre := True;
//ContainsOre := True;
//StartMine;
End;
if (box3Count >= 65) and (box3countI <= 20) then
Begin
ContainsOre := False;
box3countR := 'Rock'
End;
if (box3Count <= 65) and (box3countI <= 20) then
Begin
ContainsOre := False;
box3countR := 'Nothing'
End;
End;
{
Box 4 Counts
}
Begin
if (box4count >= 65) and (box4countI >= 5) then
Begin
BOUNDSX :=215;
BOUNDSY :=213-50;
BOUNDSX2 :=247;
BOUNDSY2 :=244-50;
box4countR := 'Iron'
box4countA := True;
RockDOre := True;
//ContainsOre := True;
//StartMine;
End;
if (box4Count >= 65) and (box4countI <= 5) then
Begin
ContainsOre := False;
box4countR := 'Rock'
End;
if (box4Count <= 65) and (box4countI <= 5) then
Begin
ContainsOre := False;
box4countR := 'Nothing'
End;
End;
{
Box 5 Counts
}
Begin
if (box5count >= 65) and (box5countI >= 20) then
Begin
BOUNDSX :=247;
BOUNDSY :=213-50;
BOUNDSX2 :=279;
BOUNDSY2 :=244-50;
box5countR := 'Iron'
box5countA := True;
RockEOre := True;
//ContainsOre := True;
// StartMine;
End;
if (box5Count >= 65) and (box5countI <= 20) then
Begin
ContainsOre := False;
box5countR := 'Rock'
End;
if (box5Count <= 65) and (box5countI <= 20) then
Begin
ContainsOre := False;
box5countR := 'Nothing'
End;
End;
{
Box 6 Counts
}
Begin
if (box6count >= 65) and (box6countI >= 5) then
Begin
BOUNDSX :=279;
BOUNDSY :=213-50;
BOUNDSX2 :=309;
BOUNDSY2 :=244-50;
box6countR := 'Iron'
box6countA := True;
RockFOre := True;
//ContainsOre := True;
//StartMine;
End;
if (box6Count >= 65) and (box6countI <= 5) then
Begin
ContainsOre := False;
box6countR := 'Rock'
End;
if (box6Count <= 65) and (box6countI <= 5) then
Begin
ContainsOre := False;
box6countR := 'Nothing'
End;
End;
End;
Procedure GetRocks;
Begin
box1count := CountColorTolerance(COLORROCK, 215, 182-50, 247, 213-50, ROCKTOL);
box2count := CountColorTolerance(COLORROCK, 247, 182-50, 279, 213-50, ROCKTOL);
box3count := CountColorTolerance(COLORROCK, 279, 182-50, 309, 213-50, ROCKTOL);
box4count := CountColorTolerance(COLORROCK, 215, 213-50, 247, 244-50, ROCKTOL);
box5count := CountColorTolerance(COLORROCK, 247, 213-50, 279, 244-50, ROCKTOL);
box6count := CountColorTolerance(COLORROCK, 279, 213-50, 309, 244-50, ROCKTOL);
box1countI := CountColorTolerance(COLORORE, 215, 182-50, 247, 213-50, ORETOL );
box2countI := CountColorTolerance(COLORORE, 247, 182-50, 279, 213-50, ORETOL );
box3countI := CountColorTolerance(COLORORE, 279, 182-50, 309, 213-50, ORETOL );
box4countI := CountColorTolerance(COLORORE, 215, 213-50, 247, 244-50, ORETOL );
box5countI := CountColorTolerance(COLORORE, 247, 213-50, 279, 244-50, ORETOL );
box6countI := CountColorTolerance(COLORORE, 279, 213-50, 309, 244-50, ORETOL );
Writeln('*******Rock results*******')
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('*******Iron Results*******');
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;
ContainsOre := False;
box1countR := 'Nothing';
box2countR := 'Nothing';
box3countR := 'Nothing';
box4countR := 'Nothing';
box5countR := 'Nothing';
box6countR := 'Nothing';
GetRocks;
DefineRocks;
DoMine;
WriteRocks;
StartMine;
repeat
ClearDebug;
ContainsOre := False;
GetRocks;
DefineRocks;
DoMine;
WriteRocks;
//GetPositions;
until False;
End. Credits to @SRLKing for the => working properly
PROGRESS:
Added rock detector that detects iron ores + normal rocks. It is 100% accurate so far.