Simba Code:
program IronMinerV2;
{$I SRL/SRL.Simba}
{$I P07Include.Simba}
{$i sps/sps.simba}
Const
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
Version= '1.00'; //Version
{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: SRL's Player Setup
*******************************************************************************}
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;
end;
{*******************************************************************************
Procedure Antiban;
By: YoHoJo/SRL
Description: Multiple antiban procedures from SRL
*******************************************************************************}
Procedure Antiban;
Begin
Case Random(192) Of
0: P07_HoverSkill('Mining',RandomRange(2500,3500));
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: P07_HoverSkill('random',RandomRange(2500,3500));
End;
End;
function RockColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.99);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 1384248, MSX1, MSY1, MSX2, MSY2, 9);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 0.59) and (X <= 5.12) and (Y >= 0.51) and (Y <= 4.37) and (Z >= 0.28) and (Z <= 2.42) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
if P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock', 'Mine Rocks'], [RockColor], 10) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);
Case Random (2) Of
0: Begin
MMouse(x, y, 0, 0);
ClickMouse2(False);
end;
1: Begin
MMouse(x, y, 0, 0);
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks', 'Mine Rocks']);
End;
End;
Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;
End;
begin
SetupSRL;
MineIron;
end.