SRL Archive - RS3 Outdated / Broken Scripts

Bad Boy's Ultimate Cooking Script


Bad Boy JH

2009-12-18 02:29:38

After a couple weeks, its ready for release. Its an Al Kharid Cooker

Features Include
- Multiplayer
- Antiban / Antirandom
- Drops Burnt Fish
- Fail-safes
- Works with ANY f2p fish Tuna

zealkctro

2009-12-18 03:47:53

From: Bad Boy JH
After a couple weeks, its ready for release. Its an Al Kharid Cooker

Features Include
- Multiplayer
- Antiban / Antirandom
- Drops Burnt Fish
- Fail-safes
- Works with ANY f2p fish


//start in al karid bank
program FishCooker;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Cooking.scar}

Var
PlayerCount, foodDTM, CFoodDTM, x, y:integer;
Tpoint:TPoint;
issue:boolean;

procedure DeclarePlayers;
begin
NumberOfPlayers(3);
CurrentPlayer:= 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;//Use this player?
Players[0].Pin := '';//Bank pin. Leave blank if you don't have one.
Players[0].BoxRewards := ['Xp', 'mote'];
Players[0].Strings[0] := 'Tuna';//Fish to be cooked
Players[0].Strings[1] := 'Runecrafting';//The skill to boost with lamp
Players[0].integers[0] := 10;//The amount of loads to do.
Players[0].Booleans[0] :=True//Do not touch this, for errors

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := False;
Players[1].Pin := '';
Players[1].BoxRewards := ['Xp', 'mote'];
Players[1].Strings[0] := '';
Players[1].Strings[1] := '';
Players[1].integers[0] := 0;
Players[1].Booleans[0] :=True

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := False;
Players[2].Pin := '';
Players[2].BoxRewards := ['Xp', 'mote'];
Players[2].Strings[0] := '';
Players[2].Strings[1] := '';
Players[2].integers[0] := 0;

end;

{*******************************************************************************
function RadialWalkTol(TheColor, StartRadial, EndRadial, Radius: Integer): Boolean;
Originally Radial Walk By: Nielsie95
Modified by me to add some tolerance.
Description: Walks TheColor from StartRadial to EndRadial for Radius Distance
*******************************************************************************}

function RadialWalkTol(TheColor, StartRadial, EndRadial, Radius: Integer): Boolean;
{I added this function, as i wanted a Radial Walk with Tolerance}
var
tpa: TPointArray;
i: Integer;
begin
Result := False;
if (not LoggedIn) then exit;
if (RoadColorChecker) then
srl_Warn('RadialRoadWalk', 'Updated RoadColor through RoadColorChecker: ' +
IntToStr(RoadColor), warn_Debug);

if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 10, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, 2, 0) then
begin
FlagEx(10, True);
Result := True;
Break;
end;
end;

Procedure LoadrawDTM;
begin
case Players[CurrentPlayer].Strings[0] of
'Tuna' : FoodDTM:=DTMFromString('78DA63E464646028664001FBB76F03D38C503' +
'E230B9055CE8006984857C30B64A51350230364A51150230764E5' +
'E2570300140F053C');

'Crayfish' : FoodDTM := DTMFromString('78DA639CCCC4C050C1C8800C0A1D95C1344C9' +
'47122504D39AA1A0606265435DD407E230135F380FC52026A1602' +
'F97904D44C01F2D3F1AB0100B8DA073A');

'Shrimp' : FoodDTM := DTMFromString('78DA63DCCDC4C050C2C8800C0E74668369982' +
'8E336A09A5C54350C0C4CA86A0E03F90504D41C00F21B09A8D902' +
'E457E05703008B8E07C8');

'Anchovies' : FoodDTM := DTMFromString('78DA63F461626098C4C8800CE2E272C1344C9' +
'4D11CA86602AA1A0606265435F640FE6C026A5C80FC2504D4F801' +
'F9D350D5F0F2F2A2A80100807E05BB');

'Swordfish' : FoodDTM := DTMFromString('78DA63CC66626098CAC8800C56966F06D3305' +
'1C6544C350C0C4CA86A8A80FC7E026AAA80FC9904D49401F97309' +
'A88905F297E25703005F88081F');

'Lobster' : FoodDTM := DTMFromString('78DA639CCEC4C0308B910119943AAB8069982' +
'8E312A09A5E54350C0C4CA86AE600F95D04D4CC02F2971150D301' +
'E4CFC3AF0600056606EC');

'Sardine' : FoodDTM := DTMFromString('78DA63DCCBC4C0308B910119CCD93A074CC34' +
'4197700D5CC4155C3C0C084AAE600116A4E01F95309A8390CE44F' +
'C0AF0600021C08C8');

'Herring' : FoodDTM := DTMFromString('78DA6374616260D8CBC8800CFA3B3BC1344C9' +
'4D112A86637AA1A0606265435E640FE51026A1C89501300E4EF21' +
'A0C61BC8DF845F0D0027DD07CA');

'Pike' : FoodDTM := DTMFromString('78DA63CC666260D8CBC8800CE272E3C0344C9' +
'43107A86633AA1A06062654351540FE56026A0A81FC7D04D4A402' +
'F92708A84900F20FE257030045E60843');

'Salmon' : FoodDTM := DTMFromString('78DA639CCEC4C0B0979101194C890D06D3305' +
'1C66940359B51D530303091AE663190BF95801A907B8E1050D301' +
'E41FC3AF0600D0E20954');

'Trout' : FoodDTM := DTMFromString('78DA63DCC7C4C0B09F910119CC9E3A154CC34' +
'4190F00D56C4655C3C0C084AAE620907F84809AED40FE09026A40' +
'EED94E40CD39207F1B7E3500B30B0ADB');
end;
end;

Procedure LoadCookedDTM;
begin
case Players[CurrentPlayer].Strings[0] of
'Tuna' : CFoodDTM := DTMFromString('78DA63DCC3C4C0B09F910119A445458069982' +
'8E331A09AEDA86A18189850D59C05F2F711507300C83F4140CD16' +
'20FF207E3500CE7508BA');

'Crayfish' : CFoodDTM := DTMFromString('78DA63DCC7C4C050C6C8800CA686898269982' +
'8E321A09A0C54350C0C4CA86ACE00F9F904D4EC06F29B09A8D902' +
'E4D7E0570300265C0729');

'Shrimp' : CFoodDTM := DTMFromString('78DA639CC3C4C090CBC8800C2627888069982' +
'8E32CA09A2C54350C0C4CA86ADA81FC22026ABA80FC0A026A4076' +
'D5E3570300C82B064A');

'Anchovies' : CFoodDTM := DTMFromString('78DA632C636260C86364400666D649601A26C' +
'A980754938DAA86818109554D22909F43404D02905F45404D3190' +
'5F8D5F0D00520B0547');

'Swordfish' : CFoodDTM := DTMFromString('78DA639CCAC4C030859101195485358269982' +
'8E31CA09A7E54350C0C4C986A661050D305E42F22A06612903F01' +
'BF1A0044A90749');

'Lobster' : CFoodDTM := DTMFromString('78DA639CC9C4C0B09B910119AC099500D3305' +
'1C6854035EB51D5303030A1AAE901F27711503311C83F4A40CD7C' +
'20FF007E35006DCB07DA');

'Sardine' : CFoodDTM := DTMFromString('78DA63DCC3C4C0309B9101194C6EAA07D3305' +
'1C6DD40353350D5303030A1AAD90FE4CF21A06617903F8F809AA3' +
'40FE14FC6A00C899086C');

'Herring' : CFoodDTM := DTMFromString('78DA63CC666260D8C7C8800C3262A2C0344C9' +
'4B108A8661BAA1A06062654355540FE1E026A40761D25A02681B0' +
'1A00228B071C');

'Pike' : CFoodDTM := DTMFromString('78DA637464626098C1C8800C82F33CC1344C9' +
'4D109A8A61F550D030313AA1A2F207F3A01359640FE12026ACC80' +
'FCB9F8D500006AAD0567');

'Salmon' : CFoodDTM := DTMFromString('78DA6374666260D8C3C8800CD6984A8069982' +
'82348CD1654350 C0C4CA86A4C80FC6304D480CC394A408D3F90BF' +
'1DBF1A00AB010619');

'Trout' : CFoodDTM := DTMFromString('78DA63CC62626098C5C8800C5222C2C0344C9' +
'4B102A8A607550D030313AA9A3C207F1E01356940FE122AA849C6' +
'7433396A00004B0864');

end;
end;

Function ItemWithdraw:Boolean;
begin
LoadrawDTM
if(FindDTM(FoodDTM, x, y, MBX1, MBY1, MBX2, MBY2)) then
begin
Result := True
Mouse(x, y, 5, 5, false)
wait(200+random(200))
mouse(x, y + 75, 5, 5, true)
FreeDTM(FoodDTM)
end else;
Result := False
end;


procedure AntiBan;
begin
case random(60) of
0: Gametab(21+random(13));
1: RandomMovement;
2: HoverSkill('cooking', false);
3: RandomRClick;
4: PickUpMouse;
5..10: Levelup;
end;
gametab(tab_inv);
FindNormalRandoms;
LampSkill := Players[CurrentPlayer].Strings[1];
end;

Function Bank:Boolean;
begin
Result := False
if(OpenBankNPC) then
begin
wait(625+random(250));
if(depositall) then
begin
wait(625+random(250));
if(ItemWithdraw) then
begin
wait(625+random(250));
Result := True
end;
end;
end;
end;


Function WalkToRange : Boolean;
begin
if(FindSymbol(x, y, 'Kebab Shop')) or FindSymbol(x, y, 'Cook')then
begin
Mouse(x, y, 5, 5, True);
Result := True;
end;
if(RadialWalkTol(195836, 180, 210, 60))then
begin
Wait(2000);
Result := True
end else
begin
Result := False;
Exit;
end;
while(IsMoving)do
Wait(500);
end;

Function Cook:Boolean;
var
counter:integer;

begin
repeat
wait(1000);
inc(counter)
until(FindRange(x, y)) or (counter=90)
If(counter=90) then
begin
result := False;
Exit;
end else;
Counter := 0;
TPoint:=itemcoords(1);
mouse(TPoint.x, TPoint.y, 5, 5, True);
wait(250+random(250));
mouse(x, y, 5, 5, true);
wait(1000+random(1000));
MMouse(233, 408, 5, 5);
while not(isuptext('ook')) do;
wait(500+750);
mouse(236, 408, 5, 5, false);
wait(500+random(750));
mouse(255, 459, 5, 5, True);
loadrawDTM;
repeat
wait(5000);
antiban;
inc(counter);
untiL not(finddtm(FoodDTM, x, y, MIX1, MIY1, MIX2, MIY2)) or (counter=30);
if(counter=30) then
begin
Result := False;
Exit;
end;
freedtm(foodDTM)
Result := True
wait(1000+random(4000))
end;

Procedure Dropburns;
var
i:integer;
Tbox:Tbox;

begin
LoadCookedDTM
for i:=1 to 28 do
begin
Tbox:=invbox(i);
IF not(FindDTM(CFoodDTM, x, y, TBox.x1, TBox.y1, TBox.x2, TBox.y2)) then;
dropitem(i);
end;
FreeDTM(CFoodDTM)
end;


Function WalkToBank:Boolean;
begin
if(findsymbol(x, y, 'Bank')) then
begin
Result := True;
mouse(x, y, 5, 5, true);
end else
If(radialwalktol(16777215, 180, 210, 60)) then
Result:=True else
If(radialwalktol(195836, 180, 210, 60)) then
Result := True else
begin
Result:=False
exit;
end;
repeat
wait(500)
until not(ismoving)
end;

Procedure WriteReport;
Var
Count:integer;
Begin;
repeat
writeln(Players[Count].Name + ' cooked ' + inttostr(28 * Players[Count].Integers[1]) +
'' + Players[CurrentPlayer].Strings[0])
inc(count)
until(count=PlayerCount)
writeln('Thanks for using my fish cooker')
end;

Function Cookaload:boolean;
begin
Result:=False
if(bank) then
if(Walktorange) then
if(cook) then
begin
dropburns;
if(Walktobank) then
begin
antiban;
Result := False;
end;
end;
end;

begin
SetupSRL;
SetupCooking;
DeclarePlayers;
Loginplayer;
repeat
inc(playercount);
walktobank;
gametab(25);
repeat
if(Cookaload) then
begin
Issue := True
inc(players[Currentplayer].Integers[1])
end;
until(players[Currentplayer].Integers[0]=players[Currentplayer].Integers[1]) or Issue
nextplayer(false);
until(allplayersinactive);
writereport;
end.


the mouse keeps hovering around the bankers and bankbooths but did nothing.

benjaa

2009-12-18 04:39:51

From: emuleuser12345
the mouse keeps hovering around the bankers and bankbooths but did nothing.


thats cos UpText is down
once it gets fixed this should be good

Bad Boy JH

2009-12-18 05:01:48

OK… that would be an issue with the SRL procedure OpenBankNPC, Not my script.

Dub

2009-12-18 05:24:26

You could temporarily replace it by making your own banking procedure. Colorfinding the bankbooth/banker color and then making it right click and use a small findbitmap/dtm to find a part of "quickly" and then mouse it? Just a suggestion :).

Bad Boy JH

2009-12-18 05:33:40

Im not patching a solution for a problem that should only exist for a little while not worth my time, I have a life…;)

Dub

2009-12-18 06:12:22

From: Bad Boy JH
Im not patching a solution for a problem that should only exist for a little while not worth my time, I have a life…;)


A solution that would take up about 2 minutes. I doubt your life is that busy.. ;)

Ultra

2009-12-18 15:00:23

Fairly simple, cooked dtms are not needed. Fish dont change shape when they get cooked.
More failasfe and a little more organization will make this script better ;). I wouldn't say you worked on this for 2 weeks, you might have been learning for two weeks, but not making this script for two weeks, cmon :P.

FEAR

2009-12-18 15:21:39

I thought Radial Walk Tolerance was made by Coh3n…

Your function looks exactly the same with some simple things added but the main function looks like its taken from Coh3ns RadialWalkTolerance. Shouldn't you give him the credit?

Kyle Undefined

2009-12-18 15:32:28

You finally released it! Here are some small adjustments:

Your ItemWithdraw function could be

function ItemWithdraw : Boolean;
begin
LoadrawDTM
if(FindDTM(FoodDTM, x, y, MBX1, MBY1, MBX2, MBY2))then
begin
Result := True;
Mouse(x, y, 5, 5, false);
wait(200+random(200))
// Place ChooseOption rather than a mouse click
FreeDTM(FoodDTM);
end else // no semicolon after this
Result := False;
end;

Your Bank function could be:

Function Bank:Boolean;
begin
Result := False
if(OpenBankNPC) then
begin
wait(625+random(250));
if(depositall) then
begin
wait(625+random(250));
Result := ItemWithdraw;
wait(625+random(250));
end;
end;
end;

In your cook function, take the semicolons off after the "else" and "do".

Overall you need standards work. But good job, you're getting the hang of it ;)

~Camo

Bad Boy JH

2009-12-18 20:02:47

From: Dub
A solution that would take up about 2 minutes. I doubt your life is that busy.. ;)


Well, its not just that, I would have to design that and a find range function, and it is getting up to Christmas, which means lots of visiting family.

From: FEAR
I thought Radial Walk Tolerance was made by Coh3n…

Your function looks exactly the same with some simple things added but the main function looks like its taken from Coh3ns RadialWalkTolerance. Shouldn't you give him the credit?


Plain and simple, No. I had made that function a week or so before that was released, I have no doubt that some of the idea to make that function ame from me.

FEAR

2009-12-19 02:30:37

From: Bad Boy JH

lain and simple, No. I had made that function a week or so before that was released, I have no doubt that some of the idea to make that function ame from me.


Are you sure about that? Because that function was released on 11-25-2009 before you even joined SRL…

marpis

2010-01-02 16:01:41

Walking to the kebab shop failed which wasn't totally unexpected.
Symbol clicking isn't the most accurate way to mapwalk.. I suggest you use DTMs.

Bad Boy JH

2010-01-04 07:45:59

From: FEAR
Are you sure about that? Because that function was released on 11-25-2009 before you even joined SRL…


A. I did have a previous account and have done basic scripting before.

B. I must have got an outdated version of SRL, because it wasn't there for me.

From: marpis
Walking to the kebab shop failed which wasn't totally unexpected.
Symbol clicking isn't the most accurate way to mapwalk.. I suggest you use DTMs.

I Looked at DDTM, but with al kharid's differing colors (ie ther aren't enough colors that are the same, without people walking past them, I have got failsafes, and If they don't work, I can't do much else.

marpis

2010-01-04 08:17:03

From: Bad Boy JH

I Looked at DDTM, but with al kharid's differing colors (ie ther aren't enough colors that are the same, without people walking past them, I have got failsafes, and If they don't work, I can't do much else.


The green wall next to the palace? Cactus'? Palm trees? Plenty of DTM point potential.

HyperSecret

2010-01-04 09:51:16

From: benjaa
thats cos UpText is down
once it gets fixed this should be good


Uptext IS fixed. Look in the scar section of the forums or search 'UpText OCR'. The latest pre-release of SCAR in the SVN has a new uptext OCR that works perfectly fine.

Cigue

2010-01-16 16:49:36

First off, good job with this script : It's full of failsafes, probably works very well !

I have tried to modify it to cook seaweed instead of fish, but it doesn't seems to work. I attached it so you could see if I did anything wrong :)

If you want to add me on MSN I'd love to have a chat.

Bad Boy JH

2010-01-25 19:04:24

allright to add you own cooking procedure, to cook anything, in the same way as this, ie select the item, and use on range… and its not a F2P fish…then…

you need a DTM of the cooked and Raw Version of the food…

Go to LoadrawDTM

Add This line

    'newfood' : FoodDTM:=DTMFromString(*DTM number*);

replacing newfood with a name for your food and DTM number with…string you got for your DTM…

then go to…

LoadCookedDTM
add this line

    'newfood' : CFoodDTM:=DTMFromString(*Cooked DTM number*);

the only difference here is the CFoodDTM instead of GooDTM and you use the cooked DTM not the RawDTM

Then when you select the food, put in whatever you set as 'newfood' in the two procedures above…

Bad Boy JH

2010-02-14 05:50:04

LADIES AND GENTLEMEN!
NOW ANNOUNCING THE REVIVAL OF THIS SCRIPT
completely revamped, but not with all fish, currently tuna only, as that is all I had at the time…

HayHay89

2010-02-14 05:59:10

^^^^^Nice
May use in the future when You have included More choices to cook

Bad Boy JH

2010-02-14 08:51:06

Yeah, the DTM's Were broken, Runescape changed the outline ages ago i think, and since it was a while since I did anything with this, I wanted something simple-ish to get the hang of stuff, then I moved onto my chopper, which taught me more advanced stuff, now I decided that I wanted to finish of the whole bank load of stuff I had to cook, so I re-started this thing, almost from scratch, it was VERY basic…

Awkwardsaw

2010-02-17 19:30:25

imma test this out.

also:


rawmonkfish := DTMFromString('78DA638C606460B8C18002F2FDEDC0342394C' +
'FE80764DD6240034CA86AA280AC8704D46400590F08A84903B26E' +
'12A1E6127E350042BB086B');
cookedmonkfish := DTMFromString('78DA634C61666050606440067E6E36601A26C' +
'A580254A382AA86818109554D1A508D360135514498530C54238D' +
'5F0D00B17803B0');

:)

Bad Boy JH

2010-02-17 23:43:02

Hey, I am going to get any f2p fish *soonish* but anyone who wants to give me DTM for p2p fish, I will add them in.