SRL Archive - First Scripts

Ricky Rombo's Combo Platter!


RickyRombo

2009-04-02 22:50:49

Needs constant parenting.
Follow instructions.
Remember, no matter how bad it is, it's my first script!

:P The bank walk doesn't always work, I stopped working on this last month or so, so there's some stuff I just didn't fix. And probably won't fix. Runescapes done as far as I'm concerned. :)

{                 Ricky Rombo's Combo Platter!
/=----=---=---=---=---=---=---=---=---=---=---=---=---=---=---=---=\
|+~<Also Helped by 99_, Twisted, Widget, Cutem2it, and Smithssps>~+|
|.-~*´¨¯¨`*·~-.-(_Helped And Edited By: Camo¤Kyle_)-,.-~*´¨¯¨`*·~-.|
\Setup~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
|-Start next to dead tree just north of Varrock East mining spot. |
|-Have your weapon equipped with the fight mode selected. |
|-Bring an axe and a tinderbox and put in the first two slots |
|-Fill out the Declare Players |
|-Start logged out or in. |
\End~of~Instructions~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
}
program ComboPlatter;
//{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}

var
x, y, a, b, s, h, Bones, BonesBuried, TreesCut, MeatEaten, BurntMeat, Fires,
LogsColor, Tinderbox, Meat, CookingLvl, MeatCooked, CookingXPStart, Trips, CookingDif, Cooked
: integer;
MeatTPA : TPointArray;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'ilvshardae';
Players[0].Pass := 'walsh';
Players[0].Nick := 'sha';
Players[0].Pin := '';
Players[0].Active:= True;
Players[0].Strings[0]:= 'bank'; //What do you want to the meat after
//you cook it? ( 'bank', 'eat', or 'drop' )
Players[0].Integers[0]:= 3; //How many times do you want to do the loop?
Players[0].Booleans[0]:= True; //Do you want to eat some meat every so often?
Players[0].Integers[1]:= 6;// How much meat do you want to save? Only for bank
Players[0].Integers[2]:= 3;//How much meat do you want to eat at a time?
{
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active:= True;
Players[1].Strings:='eat'

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active:= True;
}
end;

procedure SetupDTMS;
begin
Cooked:= DTMFromString('78DA639CCAC4C0F09C0105F4473A33B000694' +
'620FE0F048CF3806A6EA3AAA9F51500D38C503EE30CA09AD704D4' +
'F401D5BC20A0663650CD33026A2613611748CD234C7F21AB01005' +
'DE91517');

Meat := DTMFromString('78DA63746462603060644006FBB76D65E007D' +
'220D1FF40C0E80554A382AA6681B228988689323A03D598A1AAD9' +
'B16E2DAA1A6BA01A7D02E6B803D5E81250630F54A389AAE6D4A14' +
'3A86A1C806AB408986345845DB640354644B8192D0C776FDC80A9' +
'86907B40E12C87AA06260B57E30654A341C01C4722FC6585E9660' +
'C353640358604D480C2D904BF1A005EBA1E7E');

Tinderbox := DTMFromString('78DA632C636260B8C18006189148201D0F547' +
'39F0835AF08A84905AAF940404D1650CD47026ACA89B0AB02A8E6' +
'25013520BF3F22A0A610A8E61D7E350044880C2C');

LogsColor := DTMFromString('78DA633CC9C4C07093010D302291407A3B50C' +
'D1D026AB602D53C26A06633116A3602D5BC26A0661750CD47026A' +
'CE01D5BC22A0E62C50CD13026A8E02D5BCC5AF060031730EF3');

Bones := DTMFromString('78DA63CC626260B8CD8006189148201D0F54F' +
'390809A44A09AC704D4A401D5BC22A0269B0835A540352F08A8A9' +
'00AA7942404D3150CD03026A8A806AEE1150930B54F30CBF1A000' +
'1390D50');
end;

procedure AntiRandoms;
begin
FindTalk;
FindNormalRandoms;
if(FindFight = true) then
begin
RunAway('n', True, 1, (7748 + Random(5098)));
end;
end;

procedure FightRats;
begin
Status('Fighting Rat...');
repeat
if (FindObjCustom(x, y, ['iant', 'tack'], [9606045, 9279640, 8950675, 8621453], 10)) then
begin
Mouse(x, y, 1, 1, True);
Wait(1000 + Random(1000));
end;
Wait(5000 + Random(1500));
until (not (FindObjCustom(x, y, ['iant', 'tack'], [9606045, 9279640, 8950675, 8621453], 10)));
end;



procedure RetryPickUp;
begin
Status('Picking up meat...');
if FindObjCustom(x, y, ['eat', 'at', 'aw'], [1385376], 7) then
begin
Mouse(x, y, 2, 2, False);
Wait(100 + Random(50));
ChooseOption('ones');
Wait(1000 + Random(100));
end else if(FindObjCustom(x, y, ['ones', 'one', 'ake'], [9606045], 7)) then
begin
Mouse(x, y, 2, 2, False);
Wait(100 + Random(50));
ChooseOption('ones');
Wait(1000 + Random(100));
end;
wait(500+1000);
//if FindObjCustom(x, y, ['ones', 'one', 'ake'], [9606045], 7) then
if FindObjCustom(x, y, ['eat', 'at', 'aw'], [1385376], 7) then
begin
Mouse(x, y, 1, 1, False);
wait(100 + Random(50));
ChooseOption('ake');
end;
end;

procedure PickUp;
begin
Status('Picking up meat...');
if FindObjCustom(x, y, ['eat', 'at', 'aw'], [1385376], 7) then
begin
Mouse(x, y, 2, 2, False);
Wait(100 + Random(50));
ChooseOption('ones');
Wait(1000 + Random(100));
end else if(FindObjCustom(x, y, ['ones', 'one', 'ake'], [9606045], 7)) then
begin
Mouse(x, y, 2, 2, False);
Wait(100 + Random(50));
ChooseOption('ones');
Wait(1000 + Random(100));
end;
wait(500+1000);
//if FindObjCustom(x, y, ['ones', 'one', 'ake'], [9606045], 7) then
if FindObjCustom(x, y, ['eat', 'at', 'aw'], [1385376], 7) then
begin
Mouse(x, y, 1, 1, False);
wait(100 + Random(50));
ChooseOption('ake');
end else
begin
MakeCompass('80'+inttostr(Random(20)));
RetryPickUp;
MakeCompass('n');
end;
MakeCompass('n');
end;

procedure BuryBones;
var
I : Integer;
begin
Status('Burying Bones...');
Wait(1000 + Random(100));
for I := 0 to 27 do
if (FindDTM(Bones, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x, y, 1, 1, True);
wait(1741+Random(140));
Inc(BonesBuried);
AntiRandoms;
end;
FreeDTM(Bones);
end;

procedure CutDeadTree;
begin
Wait(1000 + Random(500));
Status('Cutting Tree');
if FindObjCustom(x, y, ['ead'], [2173489], 10) and (IsUpTextMultiCustom(['hop', 'ree']))then
begin
Mouse(x, y, 2, 2, True);
repeat
Wait(5000 + Random(10000));
Until(not(FindObjCustom(x, y, ['ead'], [2173489], 10)));
Inc(TreesCut);
end else
begin
if FindObjCustom(x, y, ['ree'], [2119499], 10) then
begin
Mouse(x, y, 4, 4, True);
Wait(2821 + Random(200));
FindObjCustom(x, y, ['ree'], [2119499], 10);
MMouse(x, y, 4, 4);
repeat
wait(5000 + Random(10000));
until(not(IsUpTextMultiCustom(['hop', 'ree'])));
Inc(TreesCut);
end;
end;
AntiRandoms;
end;



procedure LightandCook;
var
q: Integer;
found: boolean;
begin
SetupDTMS;
CookingLvl := GetSkillLevel('cooking');
GameTab(4);
repeat
if (FindDTM(LogsColor, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 1, 1, True);
FreeDTM(LogsColor);
found := True;
end else
Wait(500 + Random(500));
until found = True;
if (FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 1, 1, True);
AntiRandoms;
wait(13000+Random(6440));
Status('Lighted Fire');
Inc(Fires);
FreeDTM(Tinderbox);
end;
if (FindDTM(Meat, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 2, 2, True);
end else
begin
writeln('Meat Not Found!');
FindDTM(Meat, x, y, MIX1, MIY1, MIX2, MIY2);
end;
if FindObjCustom(x, y, ['ire'], [2522047], 10) then
begin
Mouse(x, y, 1, 1, True);
Wait(1000 + Random(500));
MouseBox(226, 385, 303, 450, 2); //Will click in the box where the meat is then right click
Wait(250 + Random(500));
ChooseOption('ook All'); //Will cook all the meat :)
Status('Cooking Meat...');
Wait(13000 + Random(5000));
end;
end;

procedure CheckMeat;
begin
if (GetSkillLevel('cooking') > CookingLvl) then LightandCook;
GameTab(4);
if (FindDTM(Meat, x, y, MIX1, MIY1, MIX2, MIY2)) then LightandCook;
end;



procedure Drop;
var
q, I : Integer;
MeatTPA : TPointArray;
MeatPoint : TPoint;
begin
For I:= 1 to 3 do
If FindColorsTolerance(MeatTPA, 3618619, MIX1, MIY1, MIX2, MIY2, 4) then
begin
For Q:= 0 to High(MeatTPA) do
begin
MeatPoint:= MeatTPA[Q];
MMouse(MeatPoint.X, MeatPoint.Y, 5, 5);
If IsUpText('urnt') then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
Wait(100 +random(500));
ChooseOption('rop');
Inc(BurntMeat);
Wait(100 +random(500));
end;
end;
end else
Writeln('Couldn''t find color');
AntiRandoms;
end;

procedure Eat;
var
z, q : integer;
MeatTPA2 : TPointArray;
MeatPoint : TPoint;
begin
status('Eating');
For Z := 0 to 27 do
If(Players[CurrentPlayer].Booleans[0] = False)then
begin
FindColorsTolerance(MeatTPA2, 1002363, MIX1, MIY1, MIX2, MIY2, 10)
end else If(Players[CurrentPlayer].Booleans[0] = True)then
begin
FindColorsTolerance(MeatTPA2, 1002363, MIX1, MIY1+45, MIX2, MIY2, 10)
end;
begin
For Q:= 0 to High(MeatTPA2) do
begin
MeatPoint:= MeatTPA2[Q];
MMouse(MeatPoint.X, MeatPoint.Y, 5, 5);
If IsUpText('ooked') then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, True);
Inc(MeatEaten);
Wait(100 +random(500));
end;
AntiRandoms;
end;
end;
end;

procedure RandomEat;
var
q, t : integer;
MeatTPA2: TPointArray;
MeatPoint: TPoint;
begin
status('Random Eat');
If((Players[CurrentPlayer].Booleans[0] = True) and (HpPercent < 50))then
begin
GameTab(4);
If FindColorsTolerance(MeatTPA2, 1002363, MIX1, MIY1, MIX2, MIY2, 5) then
begin
For Q:= 0 to High(MeatTPA2) do
begin
MeatPoint:= MeatTPA2[Q];
MMouse(MeatPoint.X, MeatPoint.Y, 5, 5);
If IsUpText('ooked') then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, True);
Wait(100 +random(500));
Inc(t);
end;
if (t = Players[CurrentPlayer].Integers[2]) then break;
end;
end else
Writeln('Couldn''t find color');
end;
end;

procedure bankwalk;
var
p, j : integer;
TheBox : TBox;

begin
ArrangeInv;
RadialRoadWalk(FindVarrockRoadColor, 320, 370, 70, 0, 0);
RadialRoadWalk(FindVarrockRoadColor, 320, 370, 70, 0, 0);
repeat
Wait(1000 + Random(500));
RadialRoadWalk(FindVarrockRoadColor, 260, 370, 70, 0, 0);
until (FindSymbol(x, y, 'water')) or (FindSymbol(x, y, 'bank'));
repeat
if (not(FindSymbol(x, y, 'bank'))) then
RadialRoadWalk(FindVarrockRoadColor, 60, 120, 25, 0, 0);
Inc (p);
until (FindSymbol(x, y, 'bank')) or (p >= 4);
Writeln('Found Bank Symbol');
Mouse(x, y, 4, 4, True);
Wait(7770 + Random(6000));
OpenBankFast('veb');
Writeln('Banking...');
If(BankScreen)then
begin
If(Players[CurrentPlayer].Booleans[0] = False)then
Deposit(3, 28, True);
If(Players[CurrentPlayer].Booleans[0] = True)then
Deposit(3, 28, True);
SearchBank('cooked');
FindDTM(Cooked, x, y, TheBox.x1, TheBox.y1, TheBox.x2, TheBox.y2);
repeat
Mouse(x, y, 3, 3, False);
Inc(j);
until j >= Players[CurrentPlayer].Integers[1]
end;
CloseBank;
RadialRoadWalk(FindVarrockRoadColor, 20, 40, 50, 0, 0);
Wait(1000 + Random(500));
RadialRoadWalk(FindVarrockRoadColor, 80, 100, 72, 0, 0);
Wait(1000 + Random(500));
RadialRoadWalk(FindVarrockRoadColor, 180, 140, 70, 0, 0);
if(not(radialroadwalk(findvarrockroadcolor, 180, 150, 50, 0, 0))) then
RadialRoadWalk(FindVarrockRoadColor, 80, 100, 30, 0, 0);
Wait(1000 + Random(500));
repeat
RadialRoadWalk(FindVarrockRoadColor, 190, 150, 50, 0, 0);
Wait(600 + Random(600));
until (FindSymbol(x, y, 'mining spot'));
if (not(FindObjCustom(x, y, ['iant', 'tack'], [9606045, 9279640, 8950675, 8621453], 10))) then
begin
RadialRoadWalk(FindVarrockRoadColor, 340, 400, 20, 0, 0);
if (not(FindObjCustom(x, y, ['iant', 'tack'], [9606045, 9279640, 8950675, 8621453], 10))) then
RadialRoadWalk(FindVarrockRoadColor, 180, 150, 50, 0, 0);
end;
Inc(Trips);
end;

procedure ComboPlatter;
begin
ClearReport;
AddToReport(' ^ ^ ^ ________ /| ');
AddToReport('(-| |---/ ______ \----| |-)');
AddToReport('(-\ /--/ / \ \---| |-)');
AddToReport('(--| |--| / \ |--| |-)');
AddToReport('(- | |--| \ / |--|-|-)');
AddToReport('(--| |---\ \______/ /---|.|-)');
AddToReport('(--|_|----\________/----[_]-)');
AddToReport('(----Rickys-Combo-Platter!--)');
end;


procedure Signature;
begin
ClearDebug;
WriteLn('RickyRombos Combo Platter!');
repeat
ReplaceDebugLine(1,(GetDebugLine(1)+'/'));
wait(100)
ReplaceDebugLine(1,(GetDebugLine(1)+'\'));
Inc(b);
until (b = 16);
Wait(500);
Writeln(' ____ _ ');
Wait(500);
Writeln(' / __ \ _ | | ____ __');
Wait(500);
Writeln('| [__) |(*) ___ | |/ /\ \ / /');
Wait(500);
Writeln('| / _ / _|| ( \ \/ / ');
Wait(500);
Writeln('| |\ \ | | |_ | |\ \ \ / ');
Wait(500);
Writeln('|__| \__\|_|\___||_| \_\ /_/ ');
Wait(500);
Writeln('*');
repeat
ReplaceDebugLine(8,(GetDebugLine(8)+'*'));
Inc(a);
wait(50);
until (a = 31);
end;

procedure Proggy;
begin
ClearDebug;
Writeln(' /<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>\');
Writeln(' /RICKY ROMBO"S COMBO PLATTER PROGGY\');
Writeln('/>^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*<\');
Writeln('|Bones Buried: ' + inttostr(BonesBuried) + '|Meat Eaten: ' +
inttostr(MeatEaten) + '|');
Writeln('|Meat Cooked: ' + inttostr(MeatCooked) + '|Fires Made: '+
inttostr(Fires) + '|')
Writeln('|Trees Cut: ' + inttostr(TreesCut) + '|Burnt Meat: ' +
inttostr(BurntMeat) + '|')
Writeln('|Cooking Lvls Gained: ' + inttostr(CookingDif) + '|Bank Trips: ' +
inttostr(Trips) + '|');
Writeln('\<^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*>/');
end;

procedure MainLoop;
begin
CookingXPStart := GetXP('cooking');
repeat
SetupDTMS;
GetAllLevels;
//bankwalk;
repeat
FightRats;
RandomEat;
Pickup;
until InvCount >= 27;
Pickup;
BuryBones;
CutDeadTree;
LightandCook;
CheckMeat;
FreeDTM(Meat);
if (Players[CurrentPlayer].Strings[0] = 'bank') then
begin
writeln('Start process: '+Players[CurrentPlayer].Strings[0]);
Drop;
Status('Bank Walk Commencing...');
bankwalk;
end;
if (Players[CurrentPlayer].Strings[0] = 'eat') then
begin
Drop;
Writeln('Dropped Burnt');
Eat;
Writeln('Ate');
end;
MeatCooked := ((GetXP('cooked') - CookingXPStart) / 30)
Proggy;
Writeln(inttostr(CookingXPStart));
Inc (s);
until (s = Players[CurrentPlayer].Integers[0])
LogOut;
end;
begin
SetupSRL;
//SmartSetupEx(19, false, false, false);
//SetTargetDC(SmartGetDC);
ComboPlatter;
Signature;
ActivateClient;
DeclarePlayers;
If not(LoggedIn) then
LoginPlayer;
MainLoop;
end.

All that is man

2009-04-02 22:55:26

uhhh, wheres the script?

EDIT:sorry lagg or something just appeared…

Sandstorm

2009-04-02 23:15:13

You left your password in there!

Changed and PMed.

~Sandstorm

cycrosism

2009-04-03 06:31:09

lol Sandstorm i looked at the script like an hour ago but didn't even notice he left them in there

RickyRombo

2009-04-03 09:47:33

oops! :o

thanks Sandstorm :D

oh yeah the first time I forgot to even put the script lol, it's there obviously now.

ian.

2009-04-03 21:22:50

^^

I remember helping you with this..

lookin good ;)

(I would read through it all but I just fixed 3 scripts and I'm bored :p)

Griff

2009-04-04 13:17:28

This actually looks amazing for your first script. You need to work on failsafes a little. If you get logged out in a different part of the script, you will still be trying to do the next procedure, which is why it is super important to have
if not logged in then exit;

Also, try making some functions, so you can have
Result = true;

So that's all I have for now, if I see anything else, I'll edit, and, again, amazing first script!

RickyRombo

2009-04-12 21:09:39

I have no experience with functions in SCAR (only in C++) but if you want you can make some or whatever.

Thanks! I had a LOT of help from people, like 99_ (^^), Camo, and Twisted. But I kept it my own, learning and writing most myself.

I like the idea with the snippet there, I'd implement it but I'm taking a break from Srl/Scar for a while (I'm working on my website ^^).

Fix anything you feel needs fixing! Oh, and by the way, I don't play Runescape anymore anyway (major waste of time making this script! Well not really, learned a lot)