SCAR Code:
{=========================================================================]<--Credit to WT-Fakawi For this layout.
[ NAME : (unf) Potion Maker ]
[ WRITER : Mikevskater ]
[ CATEGORY : Herblore ]
[ DESCRIPTION : Makes any (unf) potion that involves a herb ]
[ USAGE : To Raise Your Herblore Level ]
[ CONTACT : Pm Mikevskater On Srl ]
[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ 1. USE Runescape With Low Detail, Very Bright. ]
[ 2. Set your Screen To 32 bit TRUE color. ]
[ 3. Position Players In Bank ]
[ 4. Set Playernames And Passwords / SRL Id And Pass in Player Setup ]
[ 5. Start with either 14 herbs and vials of water in inv or it will bank ]
[ 6. Have Herbs in first bank spot and vials of water in secound ]
[ 7. Please Post Proggies/Bugs ]
[=========================================================================]
[Valid banks are: ]
[ 'akb': 'al kharid'/\ 'lb': 'lumbridge'/\ 'veb': 'varrock east' ]
[ 'vwb': 'varrock west'/\ 'feb': 'falador east'/\ 'fwb': 'falador west']
[ 'db': 'draynor' /\ 'eb': 'edgeville bank' ]
[=========================================================================}
program Mikevskaters_unf_Pot_Maker;
{.include srl/srl.scar}
var
x, y, Herbs, Vials, NumofHerbs, NumofVials, NumofPots :integer;
Potting :Boolean;
const
Bank = 'veb'; //What Bank To Use (look at "Valid Banks" above for letters)
Dir = 'N'; //Run Away Direction (N, S, W, E)
////////////////////////////////////////////////////////////////////////////////
procedure PlayerSetup;
begin
SRLID := '';
SRLPassword := '';
CurrentPlayer := 0;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := ''; //UserName
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //NickName
Players[0].Strings[0] := ''; //BankPin, Leave blank if you don't have one.
Players[0].Active := True;
end;
////////////////////////////////////////////////////////////////////////////////
procedure Dtms(which :string);
begin
case which of
'herb': Herbs := DTMFromString('78DA637461626078CA800242CAF9C1342394C' +
'F680554F392010D30A2AA0199F38E801A5FA09AE704D4F803D5DC' +
'C1AF0600EFCC06D0');
'vial': Vials := DTMFromString('78DA6374646260A860644006ABD61E01D3305' +
'1462B4C353059B81A0BA09A1A026ABC816A6A09A8F100AA2923A0' +
'C609A8A619BF1A00BF1C06A9');
'both': begin
Herbs := DTMFromString('78DA637461626078CA800242CAF9C1342394C' +
'F680554F392010D30A2AA0199F38E801A5FA09AE704D4F803D5DC' +
'C1AF0600EFCC06D0');
Vials := DTMFromString('78DA6374646260A860644006ABD61E01D3305' +
'1462B4C353059B81A0BA09A1A026ABC816A6A09A8F100AA2923A0' +
'C609A8A619BF1A00BF1C06A9');
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
procedure Free(which :string);
begin
case which of
'herb': freedtm(herbs);
'vial': freedtm(vials);
'both': begin
freedtm(herbs);
freedtm(vials);
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
procedure BankError;
begin
Writeln('We have had an error in the bank, might not have any more herbs...');
Writeln('Post Proggy');
Status('ERROR! Post Proggy');
TerminateScript;
end;
////////////////////////////////////////////////////////////////////////////////
procedure RandomFind;
begin
FindNormalRandoms;
if FindFight then
RunAway(Dir, true, 1, 1000);
end;
////////////////////////////////////////////////////////////////////////////////
procedure Bankopen;
begin
OpenBankFast(Lowercase(bank));
InPin(Players[Currentplayer].Strings[0]);
end;
////////////////////////////////////////////////////////////////////////////////
procedure Firstthing;
begin
ClearDebug;
Writeln('Unfinished Potion Maker By MikeVSkater');
end;
////////////////////////////////////////////////////////////////////////////////
procedure FirstBank;
begin
Bankopen;
Depositall;
FixBank;
wait(750);
if FindDtm(Herbs, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x,y,0,0);
if IsUpText('lean') then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('X');
wait(1000);
typesend('14');
end;
end else
BankError;
if FindDtm(Vials, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x,y,0,0);
if IsUpText('ial of water') then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('All');
end;
end else
begin
BankError;
end;
CloseBank;
end;
////////////////////////////////////////////////////////////////////////////////
function Count(which : string) : integer;
var
Thedtm, i :integer;
Points :TBox;
begin
Dtms(which);
case which of
'vial': Thedtm := Vials;
'herb': Thedtm := Herbs;
end;
for i := 1 to 28 do
begin
if ExistsItem(i) then
begin
Points := InvBox(i);
if FindDTM(Thedtm, x, y, Points.x1, Points.y1, Points.x2, Points.y2) then
Result := Result + 1;
end;
end;
end;
////////////////////////////////////////////////////////////////////////////////
procedure UseFirst;
begin
Dtms('herb');
if FindDtm(Herbs, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 0, 0);
wait(250 + random(250));
if IsUpText('Clean') then
begin
wait(250 + random(250));
Mouse(x, y, 0, 0, false);
repeat
wait(250 + random(250));
until(ChooseOption('Use'));
end;
end;
Free('herb');
end;
////////////////////////////////////////////////////////////////////////////////
procedure UseSecound;
begin
Dtms('vial');
if FindDtm(Vials, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 0, 0);
wait(250 + random(250));
if IsUpText('Vial of water') then
begin
wait(250 + random(250));
Mouse(x, y, 0, 0, false);
repeat
wait(250 + random(250));
until(ChooseOption('Use'));
end;
end;
Free('vial');
end;
////////////////////////////////////////////////////////////////////////////////
procedure Clickonpot;
begin
MMouse(240, 400, 20, 20);
wait(200+random(100));
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
if not(ClickOption('All', 3)) then Exit;
Potting := true
end;
////////////////////////////////////////////////////////////////////////////////
procedure WaitWhilstPotting;
begin
if Potting = true then
begin
Dtms('herb');
repeat
wait(250);
RandomFind;
until(not(FindDtm(Herbs, x, y, MIX1, MIY1, MIX2, MIY2)));
Free('herb');
Potting := False;
end;
end;
////////////////////////////////////////////////////////////////////////////////
Function Randoms :Boolean;
begin
if FindBox then
begin
CloseBank;
SolveBox;
FirstBank;
Result := true;
end;
if not(InvCount = 14) then
begin
FirstBank;
Result := true;
end;
end;
////////////////////////////////////////////////////////////////////////////////
procedure BankNormal;
begin
Dtms('both');
NumofHerbs := Count('herb');
NumofVials := Count('vial');
if (NumofHerbs = 14) and (NumofVials = 14)then
begin
exit;
end;
if FindDtm(Herbs, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x,y,0,0);
if IsUpText('lean') then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('All');
end;
end else
begin
BankError;
end;
MouseItem(1, False);
ChooseOption('All');
if FindDtm(Vials, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x,y,0,0);
if IsUpText('ial of water') then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('All');
end;
end else
begin
BankError;
end;
NumofPots := NumofPots + 14;
ReportVars[0] := ReportVars[0] + 14;
CloseBank;
end;
////////////////////////////////////////////////////////////////////////////////
procedure Proggy;
begin
ClearDebug;
Writeln('/-----------------------------------\');
Writeln('| (unf) Pot Maker by MikeVSkater |');
Writeln('\-----------------------------------/');
Writeln('/-----------------------------------\');
Writeln('Pots Made: ' + inttostr(NumofPots));
Writeln('Time: ' + TimeRunning);
Writeln('\-----------------------------------/');
end;
////////////////////////////////////////////////////////////////////////////////
procedure mainloop;
begin
if not LoggedIn then
begin
LoginPlayer;
MakeCompass('N');
SetAngle(True);
end;
Dtms('both');
NumofHerbs := Count('herb');
NumofVials := Count('vial');
if not(NumofHerbs = 14) and not(NumofVials = 14)then
begin
firstbank;
free('both');
end;
repeat
UseFirst;
UseSecound;
RandomFind;
ClickOnPot;
WaitWhilstPotting;
BankOpen;
if (not(randoms)) then
begin
BankNormal;
end;
RandomFind;
Proggy;
until(false)
end;
////////////////////////////////////////////////////////////////////////////////
begin
FirstThing
Playersetup;
setupsrl;
ScriptId := '701';
activateclient;
wait(1000);
mainloop;
end.