SCAR Code:
program AnchoPizza_Reborn;
{.Include SRL/SRL/misc/SMART.Scar}
{.Include SRL/SRL.Scar}
{------------------------------------------------------------------------------}
{DO NOT COPY OR USE ANYTHING FROM THIS SCRIPT WITHOUT MY PERMISSION, SEND ME
A PRIVATE MESSAGE ON SRL-FORUMS TO: U L T R A, IF YOU WANT TO USE SOMETHING
FROM THIS SCRIPT. IF I FIND OUT THAT YOU DO USE/COPY SOMETHING WITHOUT MY
PERMISSION, I WILL REPORT TO A MOD/ADMIN IMMIDIANTLY.
{------------------------------------------------------------------------------}
{The idia of this script has been introduced by me(U L T R A), however the
first-ever versions of this script have been made by Cnr Sport, Shuttleu and
me. THIS PERTICULAR SCRIPT HAS BEEN MADE BY ME (U L T R A) WITH THE
HELP FROM (Shuttleu).}
{------------------------------------------------------------------------------}
{THIS SCRIPT WILL MAKE ANCHOVY PIZZAS IN VARROCK EAST BANK!}
{------------------------------------------------------------------------------}
{---Instructions on buying and selling---
Buy Anchovies For Max Price/Med Price.
Buy Plain Pizzas For Med Price + 1 GP/Med Price.
Sell Anchovy Pizzas For Med-Highest Price.}
{------------------------------------------------------------------------------}
{---Instructions on using script---
Have ingredients in the following order: Anchovies, Plain Pizza's.
Have players in the varrock east bank, near the bank booths.
Setup const & declare players.
Run and enjoy.
POST BUGS/IDIAS/REPORTS ON THE THREAD!!!
{------------------------------------------------------------------------------}
{-----------------------DO NOT TOUCH HERE------------------------------------}
const
Version = '1.8';//Version of the script, DO NOT TOUCH!
{-----------------------DO NOT TOUCH HERE------------------------------------}
{------------------------------------------------------------------------------}
{//////////////////////////////////////////////////////////////////////////////}
{ SET UP HERE /////////////////////////////////////////////////////////////////}
{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
CheckLost = True;//Check if the player is in the bank?
//NOT RECOMMENDED ON A POPULATED WORLD!!!
HaveSleep = True;//Log out every 6-8 mins, wait a little, and log back in?
//Recommended, helps reduce randoms.
ColorFind = True;//Use colors to find the Anchovies/Plain Pizzas, if the
//DTMs fail?
procedure DeclarePlayers;
begin
HowManyPlayers := 1;//How many players are going to auto in total?
NumberOfPlayers(HowManyPlayers);//No Touching.
CurrentPlayer := 0;//Which player will auto first?
Players[0].Name :='';//Username.
Players[0].Pass :='';//Password.
Players[0].Nick :='';//Nickname. If you dont know what this is, press Alt+F4.
Players[0].Active := True;//Is this player going to auto?
end;
{//////////////////////////////////////////////////////////////////////////////}
{ END OF SETUP, NO TOUCHING BELOW THESE LINES. ////////////////////////////////}
{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}
{------------------------------------------------------------------------------}
var
Anchovies, PlainPizza : Integer;//DTMs.
X, Y : Integer;//X, Y Co-ordinates.
AmountMade, ExpEarned, SleepMark, RandomSleepTime, Slept : Integer;//Integer Vars.
Sleeping : Boolean;//Boolean Vars.
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure AntiBan;
begin
case Random(100) of
0..8: RandomRClick;
9..11: PickUpMouse;
12..14: BoredHuman;
15..18:
begin
GameTab(1+Random(13));
Wait(500+Random(200));
if RandomRange(1, 2) = 1 then
GameTab(4);
Wait(200+random(200));
end;
19..25: MMouse(Random(300), Random(300), Random(10), Random(10));
end;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function PlayerIsLost : Boolean;
begin
if CheckLost then
begin
if not FindSymbol(X, Y, 'bank') and not FindColorTolerance(X, Y, 1535151, MSX1, MSY1, MSX2, MSY2, 4) and not FindColorTolerance(X, Y, 3811119, MSX1, MSY1, MSX2, MSY2, 3) then
begin
Result:=True;
end else
Result:=False;
end;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure DeclareDTMs;
begin
Anchovies := DTMFromString('78DA63E4616460C86540019EBE590CFF81345' +
'086E13F1030720059590C6880118904D2FC40560501354C4498A3' +
'0064651250230164151250230264951350C30A64151050C34BD8C' +
'D00F65F0A86');
PlainPizza := DTMFromString('78DA63DCC6C8C02006C44860FB567186FF401' +
'A24FA1F0818770359CAA86A20B23012486F2142CD5A204B81809A' +
'15409638013547812C09026A0E0259B2F8D50000EDD70C69');
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function OpenTheBank : Boolean;
var M : Integer;
begin
if not (BankScreen) then
begin
MarkTime(M);
repeat
Wait(300+random(200));
FindNormalRandoms;
if OpenBank('veb', False, False) then
Result:=True;
until(TimeFromMark(M)>30000)or(Result=True);
if(TimeFromMark(M)>30000)then
LogOut;
Wait(1000+random(500));
if BankScreen then DepositAll;
end else
Result:=True;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function IngredientsExist(Where:String{'bank', 'inv'}) : Boolean;
begin
case Where of
'bank':
begin
Result := FindDTM(Anchovies, x, y, MSX1, MSY1, MSX2, MSY2) and
FindDTM(PlainPizza, x, y, MSX1, MSY1, MSX2, MSY2);
end;
'inv':
begin
Result := FindDTM(Anchovies, x, y, MSX1, MSY1, MSX2, MSY2) or
FindDTM(PlainPizza, x, y, MSX1, MSY1, MSX2, MSY2);
end;
end;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function InViewEnterAmount : Boolean;
begin
Result := FindColorTolerance(X, Y, 8388608, 258, 428, 259, 429, 2);
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure WithrawIngredients;
var WH : Integer;
begin
if not (LoggedIn) then Exit;
if OpenTheBank and not InvFull then
begin
if not IngredientsExist('bank') then
begin
CloseBank;
LogOut;
Exit;
end else
begin
//Withraw Anchovies.
if FindDTM(Anchovies, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 3, 3, False);
Wait(200+Random(100));
if not ChooseOption('14') then
begin
ChooseOption('X');
MarkTime(WH);
while not InViewEnterAmount and not (TimeFromMark(WH)>7000) do Wait(50+random(50));
if (TimeFromMark(WH)>7000) then
begin
LogOut;
Exit;
end;
TypeSend('14');
Wait(1000+random(1000));
end else
Wait(1000+random(1000));
//Withraw Plain Pizzas.
if FindDTM(PlainPizza, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(X, Y, 3, 3, False);
Wait(200+Random(100));
if not ChooseOption('14') then
begin
ChooseOption('X');
MarkTime(WH);
while not InViewEnterAmount and not (TimeFromMark(WH)>7000) do Wait(50+random(50));
if (TimeFromMark(WH)>7000) then
begin
LogOut;
Exit;
end;
TypeSend('14');
Wait(1000+random(1000));
end else
Wait(1000+random(1000));
end;
end;
CloseBank;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function InViewCreatePizza : Boolean;
begin
Result := FindColorTolerance(X, Y, 1619896, 259, 411, 260, 412, 15);
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure CreateAnchoPizzas;
var
M : Integer;
WH : Integer;
begin
MarkTime(M);
if CountItemsIn('inv', 'dtm', PlainPizza, [0])=CountItemsIn('inv', 'dtm', Anchovies, [0]) then AmountMade := AmountMade+CountItemsIn('inv', 'dtm', PlainPizza, [0]);
if CountItemsIn('inv', 'dtm', PlainPizza, [0])>CountItemsIn('inv', 'dtm', Anchovies, [0]) then AmountMade := AmountMade+CountItemsIn('inv', 'dtm', Anchovies, [0]);
if CountItemsIn('inv', 'dtm', PlainPizza, [0])<CountItemsIn('inv', 'dtm', Anchovies, [0]) then AmountMade := AmountMade+CountItemsIn('inv', 'dtm', PlainPizza, [0]);
if FindDTM(Anchovies, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(X, Y, 2, 2, False);
Wait(100+random(50));
ChooseOption('se');
Wait(200+random(100));
end else
if FindColorTolerance(X, Y, 8277575, MIX1, MIY1, MIX2, MIY2, 10) and (ColorFind) then
begin
Mouse(X, Y, 2, 2, False);
Wait(100+random(50));
ChooseOption('se');
Wait(200+random(100));
end else
begin
LogOut;
Exit;
end;
if FindDTM(PlainPizza, X, Y, MIX1, MIY1, MIX2, MIY2) then
Mouse(X, Y, 2, 2, True)
else
begin
if FindColorTolerance(X, Y, 1488310, MIX1, MIY1, MIX2, MIY2, 10) and (ColorFind) then
Mouse(X, Y, 2, 2, True)
else
begin
LogOut;
Exit;
end;
end;
MarkTime(WH);
while not InViewCreatePizza and not (TimeFromMark(WH)>7000) do Wait(100+random(100));
if (TimeFromMark(WH)>7000) then
begin
LogOut;
Exit;
end;
Mouse(259, 413, 5, 5, False);
Wait(50+random(150));
ChooseOption('ll');
repeat
if FindNormalRandoms then Exit;
Wait(300+random(200));
until(not(FindDTM(Anchovies, X, Y, MIX1, MIY1, MIX2, MIY2)))or(not(FindDTM(PlainPizza, X, Y, MIX1, MIY1, MIX2, MIY2)))or(TimeFromMark(M)>35000);
AntiBan;
if PlayerIsLost then LogOut;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure DepositAnchoPizzas;
begin
if not (LoggedIn) then Exit;
if OpenTheBank then
begin
ExpEarned := AmountMade*39;
DepositAll;
end;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function AllPlayersFalse : Boolean;
var ActivePlayers, i : Byte;
begin
for i := 0 to High(Players) do
if Players[i].Active then Inc(ActivePlayers);
if ActivePlayers = 0 then Result := True;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
function ActivePlayersAmount : Integer;
var ActivePlayers, i : Byte;
begin
for i := 0 to High(Players) do
if Players[i].Active then Inc(ActivePlayers);
Result:=ActivePlayers;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure Report;
var
PH : Integer;
begin
PH := 3600000 div (GetTimeRunning);
ClearDebug;
WriteLn('{----------------------------------------------------------}');
WriteLn('{//////////////////////ANCHO-PIZZA\\\\\\\\\\\\\\\\\\\\\\\\\}');
WriteLn('{-------------------MADE BY U L T R A----------------------}');
WriteLn('{Version: ' + Version + '.}');
WriteLn('{----------------------------------------------------------}');
WriteLn('{Ran For: ' + TimeRunning + '.}');
WriteLn('{Total Made: ' + IntToStr(AmountMade) + ' Anchovy Pizza''s.}');
WriteLn('{Total Earned: ' + IntToStr(ExpEarned) + ' Exp.}');
if HaveSleep then WriteLn('{Total Sleeps: ' + IntToStr(Slept) + '.}');
if HaveSleep then Disguise('Sleep In: ' + IntToStr((RandomSleepTime-TimeFromMark(SleepMark))/1000) + ' Secs.');
WriteLn('{Active Players: ' + IntToStr(ActivePlayersAmount) + '.}');
WriteLn('{Current Player: ' + Players[CurrentPlayer].Name + '.}');
WriteLn('{----------------------------------------------------------}');
WriteLn('{P/H Pizza: ' + IntToStr(Round(PH * AmountMade)) + '.}');
WriteLn('{P/H Exp: ' + IntToStr(Round(PH * AmountMade)*39) + '.}');
WriteLn('{----------------------------------------------------------}');
WriteLn('{POST: Bugs/Reports/Idias ON THE THREAD! THANKS FOR USING!!}');
WriteLn('{----------------------------------------------------------}');
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure DoSleep;
begin
if (TimeFromMark(SleepMark)>RandomSleepTime) and HaveSleep then
begin
MarkTime(SleepMark);
RandomSleepTime := 6*1000*60+Random(2*1000*60);
Sleeping := True;
if BankScreen then CloseBank;
repeat
if BankScreen then CloseBank;
LogOut;
until(not(LoggedIn));
Wait(RandomRange(5000, 7000));
LogInPlayer;
Sleeping :=False;
Slept := Slept + 1;
end;
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
procedure MainLoop;
begin
repeat
WithrawIngredients;
CreateAnchoPizzas;
DepositAnchoPizzas;
DoSleep;
Report;
until(not(LoggedIn))and(not(Sleeping));
NextPlayer(False);
end;
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
begin
SetUpSRL;
DeclarePlayers;
DeclareDTMs;
if not loggedin then loginplayer;
repeat
MarkTime(SleepMark);
RandomSleepTime := 6*1000*60+Random(2*1000*60);
MainLoop;
if(AllPlayersFalse)then TerminateScript;
until(AllPLayersFalse);
if(AllPlayersFalse)then TerminateScript;
end.
{------------------------------------------------------------------------------}
{
-Version Log-
---
1.0-
First version of script, yet is not perfected!
---
1.1-
Added sleeping.
Fixed some stuff up.
---
1.2-
Removed sleeping, it wasnt working. Gonna remake it.
Fixed stuff up.
---
1.3-
Remade the DTMs.
---
1.4-
Added a per/hour report.
---
1.5-
Remade sleeping.
Fixed stuff up.
---
1.6-
Added needed tolerances to colors.
Fixed stuff up.
---
1.7-
Made it ChooseOption('14') instead of always typing the amount.
Fixed up the antiban.
Added more failsafes, if dtms dont work, it will use colors to find items.
---
1.8-
Added failsafes, now it wont have infinite waits.
---
}
{(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}{(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}
{(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}{(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}