SRL Archive - RS3 Outdated / Broken Scripts

PowerChopper


FuruChan

2009-05-09 00:02:22

Simple Power Cutter
By FuruChan

Although this script isn't well written, it can be somewhat effect for leveling up a little. I will not be updating this script. I only released it as more of a learning process. I would like as much feed back on Procedures/Functions I can change/add to make future scripts with the same type work better.

Thanks for the feedback. :)

Setup:
1. Start anywhere there are some trees.
2. Fill out the setup.
3. Press play.
4. Further instructions inside the script.


[ATTACH]7068[/ATTACH]

Dark Arcana

2009-05-09 06:12:44

Instead of this:

MyTimer:= MyTimer+1;

Change it to this:

Inc(MyTimes)

Because it looks better and it's quicker to type, and if you want to add more than one, do this.

IncEx(MyTimer, 28);

I fixed your standards, you can use it if you want.

Blumblebee

2009-05-09 06:19:57

ummm you could shorten your code by almost half. I dont think you really understand cases (it kinda reminds me of my first powerchopper).

Instead of doing the case tree of
willow: same code with color change
normal: same code with color change
oak: same as above;

have a variable called tree color and a variable uptext then do:

Function ChopTree: Boolean;
var TreeColor: Integer; UpText: String;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'normal':
begin
TreeColor := 1234567;
UpText := 'ree';
end;
'oak':
begin
TreeColor := 9876654321;
UpText := 'ak';
end;
'willow':
begin
TreeColor := 1234598876;
UpText := 'illow';
end;
// Now do the chopping procedure but instead of the static numbers input your Variables so like
FindColorsSpiralTolerance(x, y, tpa, TreeColor {Get it?}, msx1, msy1, msx2, msy2);
if tpa > 0 then
begin
TpaShitdownhere;
if IsUpText(UpText) then
Mousethatshit;
end;
end;

I hope you kinda understood that, im kinda in a hurry sorry, pm me if you want more help/ want me to elaborate.

FuruChan

2009-05-09 06:59:00

From: Blumblebee
ummm you could shorten your code by almost half. I dont think you really understand cases (it kinda reminds me of my first powerchopper).

Instead of doing the case tree of
willow: same code with color change
normal: same code with color change
oak: same as above;

have a variable called tree color and a variable uptext then do:

Function ChopTree: Boolean;
var TreeColor: Integer; UpText: String;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'normal':
begin
TreeColor := 1234567;
UpText := 'ree';
end;
'oak':
begin
TreeColor := 9876654321;
UpText := 'ak';
end;
'willow':
begin
TreeColor := 1234598876;
UpText := 'illow';
end;
// Now do the chopping procedure but instead of the static numbers input your Variables so like
FindColorsSpiralTolerance(x, y, tpa, TreeColor {Get it?}, msx1, msy1, msx2, msy2);
if tpa > 0 then
begin
TpaShitdownhere;
if IsUpText(UpText) then
Mousethatshit;
end;
end;

I hope you kinda understood that, im kinda in a hurry sorry, pm me if you want more help/ want me to elaborate.


Ha that does make a lot more sense. Thank you for explaining it. I didn't even think about that. Basically your saying you use one typed function after stating what each case is?

Blumblebee

2009-05-10 02:27:06

From: FuruChan
Ha that does make a lot more sense. Thank you for explaining it. I didn't even think about that. Basically your saying you use one typed function after stating what each case is?


yes :) and to make the code look better you can have the variables just globals, and have the function that sets the variables called everytime a new player is logged in. this will cut down your coding by a large amount, making it faster and more effiecient (it doesnt have to read through all that code that it doesnt use).