SRL Archive - First Scripts

First Willow Power Cutter ++ Drop


BlueFire15

2009-09-08 08:17:34

Hey guys!

This is my first power cutter made specifically for willow trees.

Features:
Cuts Willow Trees
Drops
Prog Report

Please post comments and suggestions! Thanks goes to SandStorm as he helped me out a bit.

BlueFire15

Craig`

2009-09-08 10:33:34

Your standards a bit off, but readable don't get me wrong :)
I just looked through your code, and it looks a promising first script;

I would recommend some syntax changes though, one example being:


ColorArray[0] := 3100223;
ColorArray[1] := 5142122;
ColorArray[2] := 3364164;
ColorArray[3] := 1651495;
ColorArray[4] := 1977640;

// change that to:

ColorArray := [3100223, 5142122, 3364164, 1651495, 1977640];

Oh and about your standards, You're indenting everything inside of a conditional statement, even the begin and end; I wouldn't do so.

For example:


If CheckUpText then
begin

// I would do:
if CheckUpText then
begin
// code - notice no indent on the block start/end

And lastly my recommendation would be not to capitalize keywords, that is "Begin", "End", "Function", in my opinion they are easier read when in lowercase, and surely capitalizing them will take longer, no?

~ Craig` :)

Sandstorm

2009-09-08 16:19:08

Lol, I did those for him. The array wasn't compiling correctly when called like that. We tried it.

Indenting everything is how I do it, he knows that it's not the "accepted" standards. Same with bolded words. It's just become habit to hit shift for me, doesn't take any more time for me.

~Sandstorm

BlueFire15

2009-09-08 20:23:41

Thanks Craig

the array wasn't compiling so SandStorm told me to do that and my standards are as good as my teachers I guess :P.

Thanks for the advice

Bionicle

2009-09-09 01:58:36

pretty good for a first script!

if i were you id add a DeclarePlayer section, aswell as this in your mainloop RIGHT after the SetupSRL;

declareplayers;
GraphicsSet := True;
if not loggedin then loginplayer;
makecompass('n');
SetAngle(True);


for the declare players section, you can use mine if you wish ;) just credit it to me please if you decide you want to;

procedure DeclarePlayers;
begin
NumberOfPlayers(1);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].BoxRewards := ['XP', 'ostume', 'mote'];
Players[0].Active := True;
end;

Sandstorm

2009-09-09 02:46:38

Why would he credit for DeclarePlayers? It's part of SRL. If anything, he should credit SRL for 95% of the script o.o.

But yea, it's a good idea. It'll let you use multiple accounts with one script.

~Sandstorm

Bionicle

2009-09-12 01:41:20

From: Sandstorm
Why would he credit for DeclarePlayers? It's part of SRL. If anything, he should credit SRL for 95% of the script o.o.

But yea, it's a good idea. It'll let you use multiple accounts with one script.

~Sandstorm
yea true enough lol :p