Archaic
2012-03-31 20:30:59
Features:
- ACA TPA object finding
- SPS Walking/Positioning
- Anti-ban, failsafes, random detection
- Download/Copy and paste the script
- Fix the (small) anti-leech
- Fill in the proper log-in information in the script
- MAKE SURE YOUR CHARACTER IS WEARING AN AMULET OF GHOSTSPEAK
- Position your character directly next to a ghost banker in the Port Phasmatys bank
- PUT STEEL BARS IN VERY FIRST SLOT (TOP LEFT CORNER) OF BANK
- Click Run
- Leave feedback/rep/a progress report:D
Author Comments:
Hello everyone! I began work on this little script as soon as the new update increasing the speed of cannonball production while using the new achievement diary reward came out. Done fairly quickly, but I have gone through about 6000 cannonballs with it so it works fairly well–though there may be a few clunky errors here and there. Gets around 15k xp an hour making about 3400-ish cannonballs an hour with the new update and reward. Make sure you are directly next to a ghost banker and are wearing a ghost speak amulet before you click that little green button!
Enjoy!:)
~Archaic
program ArchaicCannonBallCrafter;
var
x, y, BarsInteger: integer;
XPGain, LoadsDone, TimeGone, CannonBalls: Integer;
XPPerHour, LoadsPerHour, CannonballsPerHour, SteelBarsPerHour, CurrentXP, OriginalXP: Integer;
{Begin Player Setup}
const
Bankpin ='1234'; //BankPin here!
BarsToCraft = 300; //Number of bars to craft!
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Players[0].Name := 'Zezima';//username here!
Players[0].Pass := 'asdfasdf'; //Password here!
Players[0].Nick := ''; //three letters of name here!
Players[0].Active:=True;
end;
end;
procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 6; //world
{End Player Setup}
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
MakeCompass('N');
SetAngle(SRL_Angle_High);
end;
Procedure Antiban;
begin;
case random(100) of
0-5: BoredHuman;
6-10: HoverSkill('random', false);
11-15: HoverSkill('Smithing', False);
16-20: PickupMouse;
21-25: RandomRClick;
26-30: PickupMouse;
31-40: ExamineInv;
end;
end;
procedure Proggy;
begin
ClearDebug;
TimeGone := (GetTimeRunning/1000);
CurrentXP := GetXPBar(1);
XPGain := (CurrentXP - OriginalXP);
XPPerhour :=(3600*(XPGain))/((TimeGone));
LoadsPerhour :=(3600*(LoadsDone))/((TimeGone));
CannonballsPerHour := (3600*(Cannonballs))/((TimeGone));
SteelBarsPerHour := (3600*27*(LoadsDone))/((TimeGone));
begin
Writeln('******************************************************************');
Writeln('*/////////---------- Archaic`s Cannonball Crafter ----------\\\\\\\*');
Writeln('*/////////----------*******************************----------\\\\\\\*');
Writeln('******************************************************************');
Writeln('*/////////We have done: ' + IntToStr(LoadsDone) + ' Loads / ' + IntToStr(LoadsPerHour) + ' loads per hour');
Writeln('*/////////We have gained: ' + IntToStr(XPGain) + ' smithing xp /' + IntToStr(XPPerHour) + ' Smithing xp per hour');
Writeln('*/////////We have crafted ' + IntToStr(Cannonballs) + ' Cannonballs /' + IntToStr(CannonballsPerHour) + ' CannonBalls Per Hour');
Writeln('*/////////We have crafted ' + IntToStr(27*(LoadsDone)) + ' Steel Bars /' + IntToStr(SteelBarsPerHour) + ' Steel Bars per Hour');
Writeln('');
end;
end;
function FindDoor(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.08, 0.58);
if not(FindColorsTolerance(arP, 2836291, MSX1, MSY1, MSX2, MSY2, 8)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 46) and (R <= 86) and (G >= 50) and (G <= 91) and (B >= 27) and (B <= 61) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.55) and (X <= 8.24) and (Y >= 3.04) and (Y <= 9.59) and (Z >= 1.53) and (Z <= 5.71) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('pen')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('Door seems to be open! Going through...');
Exit;
end;
GetMousePos(fx, fy);
end;
function FindFurnace(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.40, 0.46);
if not(FindColorsTolerance(arP, 3816256, MSX1, MSY1, MSX2, MSY2, 7)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 44) and (R <= 81) and (G >= 42) and (G <= 78) and (B >= 42) and (B <= 77) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.36) and (X <= 7.29) and (Y >= 2.44) and (Y <= 7.56) and (Z >= 2.61) and (Z <= 7.93) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 40, 40);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('urnace')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
function FindGhostBanker(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.24, 0.55);
if not(FindColorsTolerance(arP, 8497289, MSX1, MSY1, MSX2, MSY2, 21)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToRGB(arC[i], R, G, B);
if (R >= 93) and (R <= 196) and (G >= 105) and (G <= 217) and (B >= 87) and (B <= 186) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 11.51) and (X <= 55.73) and (Y >= 13.37) and (Y <= 64.19) and (Z >= 11.19) and (Z <= 55.28) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (WaitUpTextMulti(['host', 'anker', 'alk-to', 'Ghost', 'host banker'], 1000+random(200))) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('Could not find the ghost banker.');
Exit;
end;
GetMousePos(fx, fy);
end;
Procedure BankItLikeBeckham(var BarsInteger:integer);
begin
if FindGhostBanker(x, y) then
begin
Mouse(x, y, 0, 0, Mouse_Right);
Wait(randomrange(100,400));
ChooseOption('Bank');
Wait(1400+random(400));
if PinScreen then
begin
InPin(BankPin);
Wait(1000+random(1200));
Withdraw(0, 0, 27);
Wait(250+random(300));
CloseBank;
Wait(400+random(800));
end else
begin
Wait(200+random(200));
Withdraw(0, 0, 27);
Wait(250+random(300));
CloseBank;
Wait(400+random(800));
end;
end;
BarsInteger:= BarsInteger + 27
SPS_WalkToPos(point(6575, 2745));
if FindDoor(x, y) then
begin
Case random(2) of
0: Mouse(x, y, 1, 1, Mouse_Left);
1: begin
Mouse(x, y, 1, 1, Mouse_Right);
Wait(300+random(50));
ChooseOption('pen');
end;
end;
SPS_WalkToPos(Point(6585, 2730));
end else
SPS_WalkToPos(Point(6585, 2730));
end;
Procedure MakinBalls;
Var
x, y: integer;
begin
GameTab(Tab_inv);
SteelBar := DTMFromString('mbQAAAHicY2VgYMhlYmAoBeJ0IM4A4jwgfggUfwDEr6D0MyBOSUhgaKmrY1BSVISz+YHi6JgRCwYDAHGsDJw=');
If FindDTM(SteelBar, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Case Random(2) of
0: Mouse(x, y, 1, 1, Mouse_Left);
1: begin
Mouse(x, y, 1, 1, Mouse_Right);
ChooseOption('Use');
end;
end;
if FindFurnace(x, y) then
begin
Case Random(2) of
0: begin
Mouse(x, y, 2, 2, Mouse_Left);
Wait(1500+random(300));
MouseBox(229, 398, 290, 456, Mouse_Left);
end;
1: begin
Mouse(x, y, 2, 2, Mouse_Right);
Wait(600+random(300));
ChooseOption('teel');
Wait(1500+random(50));
MouseBox(229, 398, 290, 456, Mouse_Right);
Wait(500+random(100));
ChooseOption('ake');
end;
end;
repeat
Antiban;
Wait(500+random(40));
until not (FindDTM(SteelBar, x, y, MIX1, MIY1, MIX2, MIY2));
end;
if (not(FindDTM(SteelBar, x, y, MIX1, MIY1, MIX2, MIY2))) then
begin
wait(200+random(700));
SPS_WalkToPos(Point(6575, 2740));
if FindDoor(x, y) then
begin
Case random(2) of
0: Mouse(x, y, 1, 1, Mouse_Left);
1: begin
Mouse(x, y, 1, 1, Mouse_Right);
Wait(300+random(50));
ChooseOption('pen');
end;
end;
SPS_WalkToPos(Point(6590, 2785));
end else
SPS_WalkToPos(Point(6590, 2785));
end;
end else
begin
WriteLn('It looks like we are out of steel bars, logging out to be safe.');
Proggy;
ExitToLobby;
TerminateScript;
end;
end;
Procedure Mainloop;
var
Position:String;
Begin
OriginalXP := GetXPBar(1);
If (loggedin) then
repeat
SPS_GetMyPos;
Position := toStr(SPS_GetMyPos);
If (Position = '(6590, 2785)') or (Position = '(6595, 2785)') or (Position = '(6585, 2785)') or (Position = '(6585, 2780)') or (Position = '(6590, 2780)') or (Position = '(6595, 2780)') or (Position = '(6600, 2780)') then
begin;
FindNormalRandoms;
BankItLikeBeckham(BarsInteger);
end;
If (Position = '(6580, 2725)') or (Position = '(6585, 2730)') or (Position = '(6580, 2730)') or (Position = '(6580, 2735)')then
begin
FindNormalRandoms;
MakinBalls;
IncEx(Cannonballs, 108);
Inc(LoadsDone);
Proggy;
end;
If (Position = '(6575, 2720)') or (Position = '(6580, 2720)') or (Position = '(6585, 2720)') or (Position = '(6590, 2720)') or (Position = '(6595, 2720)') then
begin
SPS_WalkToPos(Point(6590, 2785));
Writeln('woops, the door messed us up a bit, but we are back on track!');
end;
If (Position = '(6575, 2740)') then
begin
Writeln('woops, the door messed us up a bit, but we are back on track!');
if FindDoor(x, y) then
begin
Case random(2) of
0: Mouse(x, y, 1, 1, Mouse_Left);
1: begin
Mouse(x, y, 1, 1, Mouse_Right);
Wait(300+random(50));
ChooseOption('pen');
end;
end;
SPS_WalkToPos(Point(6590, 2785));
end else
SPS_WalkToPos(Point(6590, 2785));
end;
If FindNormalRandoms then
SPS_WalkToPos(Point(6590, 2785));
until((BarsInteger + 27)>= BarsToCraft);
end;
begin
SetupLogin;
LogInPlayer;
SPS_Setup(RUNESCAPE_SURFACE, ['16_6']);
Mainloop;
Proggy;
TerminateScript;