SRL Archive - RS3 Outdated / Broken Scripts

Lj's Cooker


Le Jingle

2012-11-21 10:14:07

*Moved old outdated public script to members+

Thought I'd share my Varrock Cooks Guild cooking script; it was after all my script I applied with for SRL members.

*Script is up to date with EoC.

When I get free time I try to update it as much I can, there's still numerous things I'll do with this script.

In the mean time, feel free to critique if you wish, as I'm always looking for improvements!

I can add in a short example on how to use too.

Special Thanks:
  • Zmon
  • Narcle
  • CynicRus
  • RunAway (with prior version(s))
  • Lazarus IDE
  • and the SRL Community
Couldn't have made this without ya'll teaching me a thing or two!

Comes with some decent debugging too:

Time Ran: 14 Minutes and 53 Seconds
Raw Shark Cooked: 283 [cooked/Hr = 1,140]
Gained Cook Xp: 71,814 [Xp/Hr = 289,507]
Urns Teleported: 8 [Urns Used/Hr = 32]
Teleported a Urn from Slot 1.
didnt even see it???
Cleared Player TPA, Length is now = 158.
Loop 1, Index 0 : Possible # of TPA Points = 158.
Entered 2nd loop, ATPA. ATPA Length = 3.
Result = FOUND!
Attempting Restock: 1 of 5.
[(404, 112)]
found only 1 urn match, withdrew 1 urn.
Have: ---000 raw Shark left in the bank.
Found Item at Bank Slot 10.
9, 0
We withdrew, closing bank
Cleared Player TPA, Length is now = 49.
Loop 1, Index 0 : Possible # of TPA Points = 49.
Entered 2nd loop, ATPA. ATPA Length = 1.
Result = FOUND!
didn't find the first check, error/cannot cook this food.
didn't find the first check, error/cannot cook this food.
didn't find the first check, error/cannot cook this food.

Notes:

Generally easier to start with an inventory ready to go / one that's already done

Form:
TCheckBoxes + TComboBox to update after clicking 'Load Settings' (help needed)

If using URNS --> Have the stack appear in an earlier bank index than the single-urn that is in use/x percent full.

Change Log:

11-21-2012 - Initial Release
11-25-2012 - Revision 1

Cheers,
Lj

(note: no bitmap-beefing-up the file size going on ;P)

CynicRus

2012-11-21 10:54:11

Hi. Allow yourself a few comment on your code.
Line 187-199
1)


var i: Integer;
var b: Integer;
var w: Integer;
var h: Integer;
var p: string;
var ckBoxHints: TStringArray;
var ckBoxCaps: TStringArray;
var ComboBox1Strings: TStringArray;
var EditArrHints: TStringArray;
var EditArrText: TStringArray;
var ButtonHints: TStringArray;
var ButtonCaps: TStringArray;
var EditArrMaxL: TIntegerArray;

Why do you add to each variable "var"? The service is enough to write the word once. This is not BASIC, Pascal or Java script.

line 212-222
2)


for i := 0 to 2 do
begin
Buttons[i] := TButton.Create(TForm1);
Buttons[i].Parent := TForm1;
Buttons[i].Hint := ButtonHints[i];
Buttons[i].Caption := ButtonCaps[i];
Buttons[i].OnClick := @OnSend;
Buttons[i].ParentShowHint := False;
Buttons[i].ShowHint := True;
end;

I think, will be more readable this way:



for i := 0 to 2 do
begin
Buttons[i] := TButton.Create(TForm1);
with Buttons[i] do
begin
Hint := ButtonHints[i];
Caption := ButtonCaps[i];
OnClick := @OnSend;
ParentShowHint := False;
ShowHint := True;
end;
end;
Well, with the other components I think should do the same.

line 328-335
3)

procedure CancelEx(s:string; Log, Term: boolean);
begin
writeln(s);
if Log then
LogOut;
if Term then
TerminateScript;
end;

Why do it? Why 2 different a boolean flags? Just use 1 flag, like as if myflag then logout else terminatescript or something like this.

line 365-366;
4)

ExitSquealOfFortune();
ExitSquealOfFortune();

This is bug or this is feature?-))))

line 777-781
5)

if (Length(__ONE) <= ADJOffsetOne) then Exit;
if (Length(__TWO) <= ADJOffsetTwo) then Exit;
if (Length(__ONE) - ADJOffsetOne < DeadStop) then Exit;
if (Length(__TWO) - ADJOffsetTwo < DeadStop) then Exit;

I think this way is more compact code:


if (Length(__ONE) <= ADJOffsetOne) or (Length(__TWO) <= ADJOffsetTwo) or (Length(__ONE) - ADJOffsetOne < DeadStop) or (Length(__TWO) - ADJOffsetTwo < DeadStop) then Exit;


It is the fact that caught my eye.

Thank you for the your hard work.

Cheers, Cynic.

Le Jingle

2012-11-21 11:07:03

Ah nice points;
- for the var's x100000, I wanted to test if it made a difference, which it didn't make too big difference - but never got around to changing back to single var instead of current x10000 vars
- I forgot about the with do (you even have this format in FormDesigner iirc, thanks for the help on that –> does indeed read easier
- Didnt bring into question about having 2 bools, but now that you put it into question, it would overall be better to change to one or the other because I can't think of why to object as it's not crucial to have one or other in any means
- haha didn't even see 2 exitSqueal calls thanks
- didn't edit Zmon's code :p [much]


Thanks very much for feedback, will change soon
Cheers,
Lj

Edit:
- Updated to revision 1, works good with EoC, however tends to time out after 50 minutes… :confused: Suppose I'll debug with Cynic's memory debugger if/when I get around to it, that is if a new simba version isn't out and somehow fixes it by that time

* Stinks that quantity of raw shark I bought is now ~ 300 gp or half of what I bought at -.-

Le Jingle

2013-02-11 14:30:11

Remastered.

New features:
  • faster range/bank finding,
  • more complete code,
  • on-end running.

New Thanks to:
  • Ashaman88 (script skeleton from bonfire script, for a durable script!)
  • Flight (Mouse movement fun!)
  • Zmon (fuzzy uptext/waitoption for life!)
  • SRL Community for the awesome lessons / includes / code support
  • And CynicRus + Runaway from prior versions! :]

Setup :
  • Same as before, set player inside the cooking guild range area.
  • Fill out the details
  • —–> 0. setup your raw/cooked/urn DTM's in the InitializeData; procedure (default is tuna because I'm on a new/poor account) —–> 1. Username —–> 2. Password (declare players procedure) —–> 3. Breaks (constant to set as true/false) —–> 4. Time out failsafe (constant to set as true/false) —–> 5. Xp counter (constant to be set as 1/2/3)
  • have the raw food in the top right corner
  • if using urns:
  • —–> 0. have any started urn already in the inventory* —–> 1. have them in the top row in bank, in the top right corner but shifted 1 to the left.

Test Run: (tuna) + (forgot a few things & forgot to implement antiban this run)

Time Running: 10 Hours, 5 Minutes and 37 Seconds
Food Cooked: 12818 [cooked per hr = 1270]
Experience Earned: 1583329 [exp per hr = 156831]
Urns Used: 230 [urns per hr = 23]

Notes:
Will add more locations when I get the time, feel free to post remastered versions/edits if you want to. Always appreciate developments of the script.
Will possibly make public after 200m xp goal or ban :>

Cheers, happy scripting/'scaping
-Lj

Ashaman88

2013-02-11 15:19:35

Nice job jingle :) How many more fish/hr do you get from here as opposed to roguesden?

Le Jingle

2013-02-11 17:05:45

From: Ashaman88
Nice job jingle :) How many more fish/hr do you get from here as opposed to roguesden?


Thanks! :) couldn't have done it without your script skeleton, amazing how long it runs now ;)

I skimmed through your rouges cooker thread, and it looked like you had somebody post a proggy after about 2 hours @ 1240 fish/hr (w/o urns).

So, if not using urns with this script, it's about/approx. +130 fish cooked per hour* or +30 fish even though this script is using urns and the proggy from the thread was with out urns.

* = (I've come to realize that even using strong urns doesn't seem to get me more xp per hour, but saves me fish to be cooked? kinda don't want to use them any more due to that - could be wrong though.)

Overall, I think it's a noticeable but small difference, plus the guild requires you to have some varrock diary done (luckily my acc had the stats, but oh my I dreaded the quests -.-)

Edit:
another proggy, slightly increased fish/hr , shorter time ran however, but still using urns:

Time Running: 3 Hours, 51 Minutes and 0 Seconds
Food Cooked: 5,018 [cooked per hr = 1299]
Experience Earned: 629,025 [exp per hr = 162861]
Urns Used: 97 [urns per hr = 25]
Antibans preformed: 16

a new proggy (had it up to 2 days, but forgot to implement a SMART crash failsafe (for when the RS game updates), plus it was somewhat nice to stop, because I also had a good deal of small tweaks/changes to make too :)

Time Running: 1 Days, 12 Hours, 41 Minutes and 38 Seconds
Food Cooked: 43,349 [cooked per hr = 1181]
Experience Earned: 5,492,081 [exp per hr = 149618]
Urns Used: 902 [urns per hr = 25]
Antibans preformed: 256
Time until break: 3 Hours, 17 Minutes and 34 Seconds