Sir R. M8gic1an
2009-08-12 14:50:24
This is here for people to give opinions. Do take into account this was for #30 or something.
~RM
program RimmingtonMiner;
{.Include SRL\SRL\Misc\SMART.SCAR}
{.include srl\srl.scar}
{.include SRL\SRL\skill\mining.scar}
var
x,y, OresMined, TotalBanks, LoadsFinished : integer;
OreDTM : integer;
const
LoadsToDo = 2; // Loads To Do Before Switching Players.
Procedure WriteReport;
begin
WriteLn('Total Loads =' + IntToStr(TotalBanks));
WriteLn('Ores Mined =' + IntToStr(OresMined));
end;
Procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 3;
Players[0].Name := '';// Your UserName
Players[0].Pass := '';// Your PassWord
Players[0].Nick := '';// Your Nick (3-4 letters from your username)
Players[0].Active := False;// Use this player ??}
Players[0].integers[0] := 3;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[0].booleans[0] := False;//Is your pick equipped?
Players[0].strings[0] := 'sell'// bank or sell (Case Sensitive)
Players[1].Name := '';// Your UserName
Players[1].Pass := '';// Your PassWord
Players[1].Nick := '';// Your Nick (3-4 letters from your username)
Players[1].Active := True;// Use this player ??}
Players[1].integers[0] := 4;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[1].booleans[0] := False;//Is your pick equipped?
Players[1].strings[0] := 'sell'// bank or sell (Case Sensitive)
Players[2].Name := '';// Your UserName
Players[2].Pass := '';// Your PassWord
Players[2].Nick := '';// Your Nick (3-4 letters from your username)
Players[2].Active := False;// Use this player ??}
Players[2].integers[0] := 2;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[2].booleans[0] := False;//Is your pick equipped?
Players[2].strings[0] := 'bank'// bank or sell (Case Sensitive)
Players[3].Name := '';// Your UserName
Players[3].Pass := '';// Your PassWord
Players[3].Nick := '';// Your Nick (3-4 letters from your username)
Players[3].Active := False;// Use this player ??}
Players[3].integers[0] := 3;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[3].booleans[0] := False;//Is your pick equipped?
Players[3].strings[0] := 'sell'// bank or sell (Case Sensitive)
end;
function SetOreDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 867;
dtmMainPoint.y := 380;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 65536;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 867;
dtmSubPoints[0].y := 380;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 65536;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 851;
dtmSubPoints[1].y := 361;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 65536;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 869;
dtmSubPoints[2].y := 365;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 65536;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 850;
dtmSubPoints[3].y := 387;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 65536;
dtmSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
OreDTM := AddDTM(TempTDTM);
end;
function RadialWalkTwo(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
tpa: TPointArray;
i: Integer;
begin
Result := False;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
wait(5000);
FFlag(10);
Result := True;
Break;
end;
end;
Procedure AntiRandoms;
var
x,y : integer;
begin
if Not(loggedIn) then Exit;
if FindGas(x, y) then
begin
RunTo('W', True);
RunAway ('E', True, 2, (2000+random(2000)));
end;
FindNormalRandoms;
if (FindFight) then
begin
RunTo('E', True);
wait(2000 + random(1000));
RunTo('w', True);
end;
end;
procedure AntiBan;
begin
if Not(loggedIn) then Exit;
case random(130) of
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('Mining', False);
3: GameTab(random(6) + 1);
4: RandomMovement;
5: PickUpMouse;
end;
end;
function FindIron(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2964577, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
Break;
end;
end;
end;
function FindTin(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5); //you do not set them back to defaults!
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10000804, MSX1, MSY1, MSX2, MSY2, 15);
If(IsUpTextMultiCustom(['ine', 'ock'])) then
begin
Result := True;
Mouse(x, y, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
end;
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine', 'ock'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
Break;
end;
end;
end;
function FindShopOwner(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 12568519, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['alk'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, False);
ChooseOption('rade');
wait(random(200));
end else
Result := False;
end;
end;
function FindCopper(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4882382, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 6000+random(2000)));
Break;
end;
end;
end;
function FindGold(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3264507, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
Break;
end;
end;
end;
Procedure WalkToMine;
begin
MakeCompass('n');
SetRun(True);
RadialWalkTwo(FindFallyRoadColor, 225, 180, 70, 2, 2);
RadialWalk(FindFallyRoadColor, 150, 200, 70, 2, 2);
RadialWalk(FindRoadColor, 150, 250, 70, 2, 2);
RadialWalk(FindRoadColor, 150, 250, 70, 2, 2);
RadialWalk(FindRoadColor, 315, 180, 70, 2, 2);
RadialWalk(FindRoadColor, 180, 270, 70, 2, 2);
RadialWalk(FindRoadColor, 270, 160, 45, 2, 2);
if Not(RadialWalk(FindStoneColor, 90, 270, 70, 2, 2)) then
begin
RadialWalk(FindRoadColor, 270, 160, 30, 2, 2);
if Not(RadialWalk(FindStoneColor, 0, 360, 70, 2, 2)) then
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
end else
begin
NextPlayer(False);
LoadsFinished := 0;
end;
end;
end;
end;
Procedure MineIron;
begin
repeat
FFlag(0);
if FindIron(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
FFlag(0);
wait(random(1200));
if FindIron(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
case random(4) of
0 : SetAngle(True);
end;
Mouse(x - 18 + (random(20)), y + random(40), 2, 2, True);
FFlag(0);
end;
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;
Procedure MineTin;
begin
repeat
if FindTin(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
if FindTin(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
Mouse(x + (18 + random(15)), y + (random(20)), 2, 2, True);
FFlag(0);
end;
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;
Procedure MineCopper;
begin
repeat
if FindCopper(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
if FindCopper(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
RadialWalk(FindStoneColor, 310, 370, 55, 2, 2);
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;
Procedure MineGold;
begin
repeat
if FindGold(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
if FindGold(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
Mouse(x + (random(15)), y + (30 + random(30)), 2, 2, True);
FFlag(0);
case random(2) of
0: FindIron(x, y);
end;
end;
wait(5000 + random(2000));
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;
Procedure WalkToShop;
begin
MakeCompass('n');
Setangle(true);
if FindSymbol(x, y, 'mining spot') then
begin
Mouse(x, y, 5, 5, True);
FFlag(0);
end;
case random(1) of
0 : SetRun(True);
end;
if RadialWalk(FindRoadColor, 135, 270, 70, 2, 2) then
begin
RadialWalk(FindRoadColor, 180, 270, 60, 2, 2);
if Not(FindSymbol(x, y, 'pot')) then
begin
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
if FindSymbol(x, y, 'pot') then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindShopOwner(x, y);
end;
end;
end else
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindShopOwner(x, y);
end;
end else
begin
if FindSymbol(x, y, 'mining spot') then
begin
MMouse(x + 10, y, 3, 3);
GetMousePos(x, y);
Mouse(x, y, 2, 2, True);
FFlag(0);
RadialWalk(FindRoadColor, 180, 300, 70, 2, 2);
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 5, 5, True);
FFlag(0);
if FindSymbol(x, y, 'pot') then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindShopOwner(x, y);
end;
end else
begin
RadialWalk(FindRoadColor, 180, 270, 30, 2, 2);
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 6, 6, True);
FFlag(0);
If FindSymbol(x, y, 'pot') then
begin
mouse(x, y, 1, 1, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindSHopOwner(x, y);
end;
end;
end;
end;
end;
wait(2000 + random(500));
end;
Procedure MineRocks;
begin
if Players[CurrentPlayer].integers[0] = 1 then
begin
MineCopper;
end;
if Players[CurrentPlayer].integers[0] = 2 then
begin
MineTin;
end;
if Players[CurrentPlayer].integers[0] = 3 then
begin
MineIron;
end;
if Players[CurrentPlayer].integers[0] = 4 then
begin
MineGold;
end;
end;
Procedure DepositStuff;
begin
if Players[CurrentPlayer].Booleans[0] = True then
begin
wait(random(200));
Deposit(random(20) + 1, 28, True);
if InvCount > 0 then
begin
wait(random(200));
Deposit(1, 28, True);
end;
end;
if Players[CurrentPlayer].Booleans[0] = False then
begin
wait(random(200));
Deposit(random(20) + 2, 28, True);
if InvCount > 1 then
begin
wait(random(200));
Deposit(2, 28, True);
end;
end;
case random(1) of
0 : CloseBank;
end;
Inc(TotalBanks);
Inc(LoadsFinished);
if LoadsFinished >= LoadsToDo then
begin
NextPlayer(True);
LoadsFinished := 0;
end;
end;
Procedure WalkToBank;
begin
MakeCompass('n');
RadialWalk(FindStoneColor, 300, 400, 70, 2, 2);
RadialWalk(FindStoneColor, 0, 90, 70, 2, 2);
RadialWalk(FindRoadColor, 430, 315, 70, 2, 2);
RadialWalk(FindRoadColor, 90, 0, 70, 2, 2);
RadialWalk(FindRoadColor, 135, 0, 30, 2, 2);
RadialWalk(FindRoadColor, 0, 90, 70, 2, 2);
RadialWalk(FindRoadColor, 340, 380, 70, 2, 2);
RadialWalk(FindRoadColor, 340, 380, 70, 2, 2);
RadialWalk(FindRoadColor, 340, 380, 70, 2, 2);
RadialWalk(FindFallyRoadColor, 350, 370, 70, 2, 2);
RadialWalk(FindFallyRoadColor, 350, 370, 70, 2, 2);
SetAngle(True);
FFlag(0);
if FindBank('feb') then
if BankScreen then
begin
DepositStuff;
end else
begin
RadialWalk(FindFallyRoadColor, 430, 350, 40, 3, 3);
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
OpenBankQuiet('feb');
wait(random(1200));
DepositStuff;
end else
begin
RadialWalk(FindFallyRoadColor, 370, 350, 35, 2, 2);
FFlag(0);
FindBank('feb');
DepositStuff;
end;
end;
Inc(TotalBanks);
Inc(LoadsFinished);
if LoadsFinished >= LoadsToDo then
begin
Logout;
NextPlayer(True);
LoadsFinished := 0;
end;
end;
Procedure WalkBackToMine;
begin
MakeCompass('n');
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 2, 2, True);
end;
wait(400 + random(600));
RadialWalk(FindRoadColor, 0, 90, 70, 2, 2);
if Not(RadialWalk(FindStoneColor, 0, 360, 70, 2, 2)) then
begin
if Not(RadialWalk(FindRockColor, 0, 360, 70, 2, 2)) then
begin
RadialWalk(FindRoadColor, 470, 350, 30, 2, 2);
if Not(RadialWalk(FindStoneCOlor, 0, 360, 70, 2, 2)) then
begin
if Not(RadialWalk(FindRockColor, 0, 360, 70, 2, 2)) then
begin
RadialWalk(FindRoadColor, 470, 350, 40, 2, 2);
If Not(RadialWalk(FindStoneColor, 0, 360, 70, 2, 2)) then
begin
If Not(RadialWalk(FindRockColor, 0, 360, 70, 2, 2))then
begin
NextPlayer(False);
end;
end;
end;
end;
end;
end;
SetRun(False);
end;
Procedure SellOre;
begin
FFlag(0);
SetOreDTM;
if FindDTM(oreDTM, x, y, MIx1, Miy1, Mix2, Miy2) then
begin
Mouse(x, y, 2, 2, False);
wait(random(100));
ChooseOption('Sell 50');
wait(200 + random(200));
end;
if Players[CurrentPlayer].booleans[0] = True then
begin
if InvCount > 1 then
begin
if FindDTM(OreDTM, x, y, MIx1, Miy1, MIx2, MIy2) then
begin
Mouse(x, y, 2, 2, False);
wait(random(200));
ChooseOption('Sell 50');
end;
end;
end;
if Players[CurrentPlayer].booleans[0] = False then
begin
if InvCount > 2 then
begin
if FindDTM(OreDTM, x, y, MIx1, MIy1, MIx2, MIy2) then
begin
Mouse(x, y, 2, 2, False);
wait(random(200));
ChooseOption('Sell 50');
end;
end;
end;
FreeDTm(OreDTM);
Inc(TotalBanks);
if TotalBanks >= LoadsToDo then
begin
WalkBackToMine;
NextPlayer(True);
end;
end;
Procedure Mainloop;
begin
SymbolAccuracy := 0.5;
repeat
if(not LoggedIn)then LoginPlayer;
if Players[CurrentPlayer].strings[0] = 'bank' then
begin
WalkToMine;
end;
MineRocks;
if Players[CurrentPlayer].strings[0] = 'bank' then
begin
WalkToBank;
end;
if Players[CurrentPlayer].strings[0] = 'sell' then
begin
WalkToShop;
wait(random(300));
SellOre;
WalkBackToMine;
end;
WriteReport;
Until(AllPlayersInactive);
end;
begin
SMARTSetupEx(8, False, True, False);
Wait(8000);
SetTargetDC(SmartGetDC);
Setupsrl;
DeclarePlayers;
Mainloop;
end.
1. Technique (/100)
2. Individuality (/100)
3. Follow all SRL rules (/100)
4. Creativity (/100)
5. Efficiency (/100)
6. Presentation (/100)
7. Meeting all Requirements (/100)
8. Added Extras (/100)
~RM