Simba Code:
Program BeerBuyer;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ' '; // Player username
Pass := ' '; // Player password
BoxRewards := ['XP', 'ostume', 'mote', 'oins', 'une', 'ssence'];
Active := True;
Pin := ; //Your bank pin
end;
end;
var
x, y, T: Integer;
Procedure Login;
begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SRLKING}
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
DeclarePlayers;
LoginPlayer;
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
end;
procedure Antiban;
begin
if not LoggedIn then LoginPlayer;
Wait(250+random(50));
if not LoggedIn then Exit;
FindNormalRandoms;
case Random(90) of
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
5: ExamineInv;
7: SetAngle(SRL_ANGLE_HIGH);
8: Wait(5000+random(2000));
end;
end;
Procedure WalkToBar;
Var
ToBar:TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['Beer_Map']);
ToBar := [Point(98, 76), Point(98, 86), Point(98, 98), Point(99, 105), Point(117, 106), Point(136, 107), Point(146, 108), Point(156, 108), Point(176, 109), Point(182, 113), Point(194, 120), Point(197, 128), Point(200, 141), Point(204, 151), Point(205, 159), Point(203, 174), Point(204, 186), Point(204, 211), Point(205, 227), Point(205, 245), Point(211, 253), Point(230, 253), Point(258, 246)];
SPS_WalkPath(ToBar);
end;
Procedure WalkToBank;
Var
ToBar:TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['Beer_Map']);
ToBar := [Point(98, 76), Point(98, 86), Point(98, 98), Point(99, 105), Point(117, 106), Point(136, 107), Point(146, 108), Point(156, 108), Point(176, 109), Point(182, 113), Point(194, 120), Point(197, 128), Point(200, 141), Point(204, 151), Point(205, 159), Point(203, 174), Point(204, 186), Point(204, 211), Point(205, 227), Point(205, 245), Point(211, 253), Point(230, 253), Point(258, 246)];
InvertTPA(ToBar);
SPS_WalkPath(ToBar);
end;
Procedure WalkToBankFromLoadstone;
Var
ToBank:TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['11_7','11_6','10_6','10_7','12_7','12_6']);
ToBank := [Point(4681, 3122), Point(4682, 3101), Point(4684, 3081), Point(4683, 3062), Point(4683, 3045), Point(4680, 3026), Point(4680, 3007), Point(4678, 2994), Point(4678, 2974), Point(4674, 2959), Point(4669, 2948), Point(4654, 2937), Point(4640, 2934), Point(4626, 2934), Point(4600, 2933), Point(4588, 2931), Point(4585, 2925), Point(4584, 2917), Point(4584, 2906)];
SPS_WalkPath(ToBank);
end;
//Procedure TeleportToVarrock;
// begin
// end;
Function AtBank:Boolean;
Begin
Wait(250+random(50));
if FindBank('vwb') then
begin
writeln('At the bank');
Result:=True;
end
else
begin
writeln('We are not at the bank Teleporting to varrock and walking there');
Result:=False;
end;
end;
function FindBartender(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.28, 0.11);
if not(FindColorsTolerance(arP, 6776163, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Cannont find bartender');
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
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 8.72) and (X <= 16.40) and (Y >= 9.22) and (Y <= 17.35) and (Z >= 10.53) and (Z <= 19.95) 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;
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('Talk-to')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('Cannot find bartender');
Exit;
end;
GetMousePos(fx, fy);
end;
Procedure ClickBartender;
Begin
if AtBar then
Begin
MarkTime(t);
repeat
if FindBartender(X, Y) then
Begin
Mouse(x, y, 0, 0, False)
wait(250+random(50));
ChooseOption('Talk-to');
end;
until((FindNPCChatText('yer', nothing)) or (TimeFromMark(t) > 5000));
end;
end;
Procedure BuyBeer;
Begin
ClickBartender;
// If FindNPCChatText('yer', nothing) then
begin
SendKeys('SpaceBar', 10, 5);
SendKeys('SpaceBar', 10, 5);
SendKeys('SpaceBar', 10, 5);
SendKeys('1', 10, 5);
SendKeys('1', 10, 5);
SendKeys('1', 10, 5);
SendKeys('1', 10, 5);
SendKeys('SpaceBar', 10, 5);
SendKeys('SpaceBar', 10, 5);
SendKeys('SpaceBar', 10, 5);
SendKeys('SpaceBar', 10, 5);
SendKeys('SpaceBar', 10, 5);
end;
end;
begin
SRL_SixHourFix := True;
SetupSRL;
DeclarePlayers;
// Repeat
Login;
if not LoggedIn then LoginPlayer;
// If not AtBank then TeleportToVarrock;
// WalkToBar;
repeat
BuyBeer;
until(InvFull);
// WalkToBank;
// DepositBeer;
// Until(not LoggedIn);
end.