Simba Code:
Program BeerBuyer;
{$DEFINE SMART8}
{$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 pin
end;
end;
const
LoadsToDo = 999999; //Number of loads of beer to buy
var
x, y, T, B, loads: 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
ToBar := [Point(128, 122), Point(126, 131), Point(124, 153), Point(131, 163), Point(142, 164), Point(159, 165), Point(175, 165), Point(195, 169), Point(209, 169), Point(222, 176), Point(226, 189), Point(233, 206), Point(234, 236), Point(238, 266), Point(237, 290), Point(238, 311), Point(287, 299)];
SPS_WalkPath(ToBar);
repeat
wait(50);
until(not IsMoving);
end;
Procedure WalkToBank;
Var
ToBank:TPointArray;
begin
writeln('Walking to the bank');
ToBank := [Point(128, 122), Point(126, 131), Point(124, 153), Point(131, 163), Point(142, 164), Point(159, 165), Point(175, 165), Point(195, 169), Point(209, 169), Point(222, 176), Point(226, 189), Point(233, 206), Point(234, 236), Point(238, 266), Point(237, 290), Point(238, 311), Point(287, 299)];
InvertTPA(ToBank);
SPS_WalkPath(ToBank);
wait(RandomRange(250,500));
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 FindBanker:Boolean;
var
tmpCTS, i, l, r, counter: integer;
BankerTPA:TPointArray;
begin tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.85, 1.15);
FindColorsTolerance(BankerTPA, 4140331, MSX1, MSY1, MSX2, MSY2, 10);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(BankerTPA)
marktime(counter);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
mmouse(BankerTPA[r].x, BankerTPA[r].y, 2, 2);
if waituptext('Talk-to', 300) then
Break;
if timefrommark(counter) > 20000 then
begin
writeln('Failed to find the banker');
end;
end;
writeln('Found the banker');
clickmouse2(mouse_right);
wait(RandomRange(250,300));
ChooseOption('Bank Banker');
MarkTime(b);
repeat
wait(50+random(5));
until(BankScreen or (TimeFromMark(t)>20000)or PinScreen);
end;
Function FindBartender:Boolean;
var
tmpCTS, i, l, r, counter: integer;
BTTPA:TPointArray;
begin tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.06, 0.34);
FindColorsTolerance(BTTPA, 6973285, MSX1, MSY1, MSX2, MSY2, 10);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(BTTPA)
marktime(counter);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
mmouse(BTTPA[r].x, BTTPA[r].y, 2, 2);
if waituptext('tender', 300) then
Break;
if timefrommark(counter) > 3000 then
begin
writeln('Failed to find the bartender');
end;
end;
writeln('Found the bartender');
clickmouse2(mouse_right);
WaitOption('Talk-to', 500);
MarkTime(b);
repeat
wait(50+random(5));
until((FindNPCChatText('yer', nothing)) or (TimeFromMark(b) > 2000));
end;
Procedure ClickBartender;
Begin
if InvFull then WalkToBank else
if PinScreen then InPin(Players[0].Pin);
Begin
MarkTime(t);
repeat
if FindBartender then
Begin
MarkTime(b)
repeat
wait(100+random(5));
until((FindNPCChatText('yer', nothing)) or (TimeFromMark(b) > 2000));
end;
until((FindNPCChatText('yer', nothing)) or (TimeFromMark(t) > 15000) or FindBlackChatMessage('You cant reach that'));
if FindBlackChatMessage('You cant reach that') then WalkToBar;
end;
end;
Procedure OpenBanker;
Begin
MarkTime(t);
repeat
wait(randomrange(100,200));
if FindBanker then
Begin
MarkTime(b)
repeat
wait(100+random(5));
until(BankScreen or (TimeFromMark(t)>20000)or PinScreen);
end;
until(BankScreen or (TimeFromMark(t)>20000)or PinScreen );
end;
Procedure BuyBeer;
Begin
if InvFull then WalkToBank else
ClearDebug;
if PinScreen then InPin(Players[0].Pin);
ClickBartender;
wait(300+random(50));
begin
MarkTime(b);
repeat
wait(50)
until((FindNPCChatText('yer', nothing)) or (TimeFromMark(b) > 15000))
Mouse(259, 469, 5, 5, True);
wait(950+random(50));
Mouse(260, 395, 5, 5, True);
wait(950+random(50));
Mouse(259, 469, 5, 5, True);
wait(950+random(50));
Mouse(259, 469, 5, 5, True);
MarkTime(t);
repeat
wait(10);
until(PinScreen or (TimeFromMark(t)>1000));
if PinScreen then InPin(players[0].pin)
end;
end;
Function DepositBeer:Boolean;
begin
MarkTime(T);
OpenBanker;
if PinScreen then InPin(players[0].Pin);
if BankScreen then
begin
DepositAll;
wait(250+random(50));
CloseBank;
wait(500+random(50));
Result:= True;
writeln('Depositied beer, returning to tavern');
WalkToBar;
end else
Begin
Result:=False;
writeln('Failed to Deposit');
end
end;
begin
SRL_SixHourFix := True;
SetupSRL;
DeclarePlayers;
Login;
SPS_Setup(RUNESCAPE_SURFACE,['Beer_Map']);
Repeat
if not LoggedIn then LoginPlayer;
if InvFull then
begin
WalkToBank;
DepositBeer;
end else
WalkToBar;
repeat
if InvFull then WalkToBank else
BuyBeer;
until(InvFull);
WalkToBank;
DepositBeer;
Until(false);
end.