Simba Code:
program UnfPotMakerByErke;
{$DEFINE SMART}
{$i srl/srl.simba}
Const
HerbRow = 0; //Herbs in the first bankslot
HerbCol = 0;
VialRow = 0; //Vials in second bankslot
VialCol = 1;
Unf = True; //True if you want to make Unfs
Pot = False; //True if you want to make Pots
AntiBanChance = 20;
var
StartingXP, PotsOrUnfsMade, AntiBans: integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Active:=True;
end;
function Open_Banks(Location: Integer): Boolean;
var
bo, i, l, c, z: Integer;
Info: TVariantArray;
Chests: TPointArray;
AChests: T2DPointArray;
UpText: TStringArray;
B: TBox;
begin
result := false;
if (not LoggedIn) then
Exit;
if BankScreen or PinScreen then
begin
Result := True;
Exit;
end;
UpText := ['Bank', 'chest', 'nk che'];
{ 0 1 2 3 4 5 6 7 8 9 10 }
case Location of { Sort X Sort Y Color Tol Hue Sat Count SplitTPA? W H Compass}
SRL_BANK_SW : Info := [MSCX , MSCY, 10198185, 21, 0.08, 0.25, 50, True , 10, 10, 's'];
SRL_BANK_CW : Info := [MSCX , MSCY, 10198185, 21, 0.08, 0.25, 50, True , 10, 10, 'n'];
SRL_BANK_B : Info := [MSCX , MSCY, 10198185, 21, 0.08, 0.25, 50, True , 10, 10, 'n'];
SRL_BANK_GG : Info := [MSCX , MSCY, 5921630, 9 , 0.47, 0.08, 50, True , 10, 10, 'n'];
else
begin
srl_Warn('OpenBankChestEdge', 'Unknown bank: '+IntToStr(Location), warn_AllVersions); //will output loc as int (no longer string)
Exit;
end;
end;
MakeCompass(Info[10]);
//SetAngle(SRL_ANGLE_HIGH); //??
z := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Info[4], Info[5]);
FindColorsSpiralTolerance(Info[0], Info[1], Chests, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
ColorToleranceSpeed(z);
SetColorSpeed2Modifiers(0.2, 0.2);
{ Split to ATPA. }
if Info[7] then
AChests := SplitTPA(Chests, 3)
else
AChests := TPAtoATPA(Chests, 10);
Chests := [];
{ Go through ATPA. }
l := GetArrayLength(AChests) -1;
for i := 0 to l do
begin
{ Too few pixels. }
if (Length(AChests[i]) < Info[6]) then
Continue;
{ Too small TPA bounds. }
B := GetTPABounds(AChests[i]);
If ((B.X2 - B.X1) < Info[8]) Or ((B.Y2 - B.Y1) < Info[9]) Then
Continue;
Inc(bo);
SetArrayLength(Chests, bo);
Chests[bo-1] := MiddleBox(GetTPABounds(AChests[i]));
end;
SortTPAFrom(Chests, Point(Info[0], Info[1]));
l := GetArrayLength(Chests) -1;
for i := 0 to l do
begin
MMouse(Chests[i].X, Chests[i].Y, 3, 3);
if WaitUpTextMulti(UpText, 1000) Then
begin
GetMousePos(Chests[i].X, Chests[i].Y);
Case Random(9) of
0..7: Mouse(Chests[i].X, Chests[i].Y, 0, 0, mouse_left);
8: begin
Mouse(Chests[i].X, Chests[i].Y, 0, 0, mouse_right);
if not WaitOptionMulti(['Use', 'se'], 1000) then Exit;
end;
end;
FFLag(0);
MarkTime(c);
repeat
Wait(100);
until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 10000);
Wait(Random(300));
if (HowManyPlayers > 0) then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
if (Result) then Exit;
end;
end;
end;
procedure SetupPlayer;
begin
SetAngle(0);
MakeCompass('S');
GameTab(tab_inv)
end;
Function XPPerHour(runtime,gained:integer):String; //Fwd Motion
begin
result:=inttostr(Round((gained * 3600) / (runtime / 1000)));
end;
Function GainedXP:integer; //Fwd Motion
begin
result:= GetXPBarTotal - startingxp;
end;
procedure Antiban; //Based on Shut's AntiBan
var
Chance: Integer;
begin
Chance:= Random(100)+1;
if Chance<=AntibanChance then
case Random(100)+1 of
1..20: begin
HoverSkill('Herblore', false);
Wait(1000+Random(500));
GameTab(tab_Inv);
antibans := antibans + 1;
end;
21..40:
begin
PickUpMouse;
antibans := antibans + 1;
end;
41..60:
begin
RandomMovement;
antibans := antibans + 1;
end;
61..80:
begin
BoredHuman;
antibans := antibans + 1;
end;
81..100:
begin
ExamineInv;
antibans := antibans + 1;
end;
end;
ChooseOption('ancel');
end;
function Open_Bank: boolean;
begin
if Open_Banks(SRL_BANK_SW) then
Result:= true;
end;
procedure WithDrawStuff;
begin
if BankScreen then
begin
Withdraw(HerbCol, HerbRow, 14);
Wait(100 + random(50));
Withdraw(VialCol, VialRow, 14);
Wait(100 + random(50));
CloseBank;
end else
Open_Bank;
end;
procedure DepositStuff;
begin
if BankScreen then
begin
DepositAll;
PotsOrUnfsMade := PotsOrUnfsMade + 14
end else
Open_Bank;
end;
procedure MakeStuff;
begin
case random(3) of
0 : begin
InvMouse(13, 1);
Wait(200 + random(50));
InvMouse(17, 1);
end;
1 : begin
InvMouse(14, 1);
Wait(200 + random(50));
InvMouse(15, 1);
end;
2 : begin
InvMouse(14, 1);
Wait(200 + random(50));
InvMouse(18, 1);
end;
end;
Wait(900 + random(100));
MMouse(257, 430, 13, 13);
if WaitUptext('ake', 1000) then
begin
ClickMouse2(true);
if Unf then
begin
Wait(8200 + random(500));
end;
if Pot then
begin
Wait(16000 + random(500));
end;
end else
begin
WriteLn('Something went wrong!');
TerminateScript;
end;
end;
Procedure Proggy; //Based on Fwd Motion's Proggy
begin
ClearDebug;
Writeln('***************Unf/Pot Maker***************');
Writeln('*****************By Erke*******************');
Writeln('Running for: ' + TimeRunning);
Writeln('Unfs/Pots made: ' + inttostr(PotsOrUnfsMade));
Writeln('Unf/Pots Made/Hour: ' + XPPerHour(GetTimeRunning, PotsOrUnfsMade));
Writeln('Experience Gained: ' + inttostr(GainedXP));
Writeln('Experience/Hour: ' + XPPerHour(GetTimeRunning, GainedXP));
Writeln('Antibans: ' + inttostr(AntiBans));
Writeln('*******************************************');
end;
begin
Smart_Server := 117;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetUpSRL;
ActivateClient;
DeclarePlayers;
Wait(1000);
LoginPlayer;
SetupPlayer;
if not(IsXPBarOpen) then
ToggleXPBar(True);
startingxp:= GetXPBarTotal;
writeln(GetXPBarTotal);
Open_Bank;
DepositAll;
repeat
WithDrawStuff;
MakeStuff;
AntiBan;
Open_Bank;
DepositStuff;
Proggy;
until (not LoggedIn)
end.