SRL Archive - First Scripts

Simple Willow Power Choper (MY FIRST);


poopy2177

2009-06-19 09:36:46

Hey guys so I made my first script!!!!!!!:eek: I know I finally learned a little.

Ok so basicly what is does is chops the willows and drops then then repeats forever……. Its my first script.

Anyways I like getting flamed it makes me better.

Best place to run this is here where I am:

enjoy….if you can lol

Dark Arcana

2009-06-19 09:47:04

From: poopy2177
Hey guys so I made my first script!!!!!!!:eek: I know I finally learned a little.

Ok so basicly what is does is chops the willows and drops then then repeats forever……. Its my first script.

Anyways I like getting flamed it makes me better.

Best place to run this is here where I am:

enjoy….if you can lol


You left your password in the script, I changed it and I will PM you.

poopy2177

2009-06-19 09:53:59

Dang thanks dude I checked to make sure then made changes started again and forgot lol

ty but hes so crapy anyways lol

Macro_FTW

2009-06-19 17:56:33

Looks pretty good. A few suggestions/errors you may not have noticed though:

Your 'repeat…until' loop has nothing in it in the main loop. I suggest you do something more like…

begin
SetupSRL
cleardebug;
DeclarePlayers;
repeat
LoginPlayer;
ChopWillow;
AntiRandoms;
AntiBan;
DropLogs;
Proggy;
NextPlayer(False); //Goes to the next player
until(AllPlayersInactive); //Keeps going until all the players are inactive.
end.

Aside from that, it looks like you did a good job for a first script. Keep it up, and you'll be an expert scripter in no time. :)
~Macro_FTW

poopy2177

2009-06-19 21:35:41

Oh thanks dude that seems way more obvious You rock at helping me lol

Macro_FTW

2009-06-19 22:12:51

Any time; I'm more than happy to help. :)

~Macro_FTW

Kyle Undefined

2009-06-20 10:11:58

Looks good. Just one thing, don't use "repeat…until(false);" I would suggest using "repeat…until(AllPlayersInactive);" That way it won't be an infinite loop if something were to go haywire. Keep it up.

[OFFTOPIC]Macro, you're not a member yet?[/OFFTOPIC]

~Camo

ian.

2009-06-20 10:18:36

He applied :p Go vote on his app ^^

Macro_FTW

2009-06-21 03:51:34

From: Camo Developer
Looks good. Just one thing, don't use "repeat…until(false);" I would suggest using "repeat…until(AllPlayersInactive);" That way it won't be an infinite loop if something were to go haywire. Keep it up.

[OFFTOPIC]Macro, you're not a member yet?[/OFFTOPIC]

~Camo


[ONTOPIC] I agree with Camo. :P[/ONTOPIC]

Nope. 99_ summed it up for me; I applied for members yesterday with a Varrock East miner+banker. Take a quick look if you don't mind+ you have the time.

Thanks! :)
~Macro_FTW

Coh3n

2009-06-23 06:41:28

procedure DropLogs;
var
a: integer;
begin
if(InvFull)then
begin
Wait(80 + Random(100));
for a := 2 to 28 do
DropItem(a);
NumOfLogs := NumOfLogs + 27;
if(NumOfLogs >= Players[CurrentPlayer].Integers[0])then
begin
Writeln('Cut desired number of logs, logging out.');
Wait(80 + Random(100));
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
AntiRandoms;
end;

^ Did you get that procedure from my script? It looks identical, in fact, it is identical - here's my original:

procedure Cut_DropLogs;
var
a : Integer;
begin
if(InvFull)then
begin
Wait(80 + Random(100));
for a := 2 to 28 do
DropItem(a);
NumOfLogs := NumOfLogs + 27;
if(NumOfLogs >= Players[CurrentPlayer].Integers[0])then
begin
Writeln('Cut desired number of logs, logging out.');
Wait(80 + Random(100));
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
S_FindRandoms;
end;

^ I don't mind if you use my procedure, just credit. :) I know it's not advanced, but plagiarism is plagiarism. :) It's not a good thing if you take someone else's work without crediting, it won't get you far around here. ;)

I know for sure it is from my script because this line:

if(NumOfLogs >= Players[CurrentPlayer].Integers[0])then

… wouldn't work in your script because there is no Players[CurrentPlayer].Integer[0] in you DeclarePlayers. The point of that line was so that the script would know when the amount of logs specified in DeclarePlayers has been exceeded, and would therefore move on to the next player.

As for the rest of your script:

procedure AntiRandoms;
begin
if (FindFight) then
RunAway('N', True, 1, 1500);
FindNormalRandoms;
FindLamp('');
end;

^ There's no need for FindFight as there aren't fighting randoms in RS anymore. :)

In your ChopWillow procedure, you use ColorToleranceSpeed(3). As far as I know, CTS(2) is the most accurate. Correct me if I'm wrong.

While (IsUpText('illo')) Do
Begin
If (Not(Loggedin)) Then exit;

^ Part of your standards - try not to capitalize the first letter of bolded words, it looks better, and most people here are used to reading it that way. :)

If(Players[CurrentPlayer].Booleans[0]) Then
Begin
Logs:= Logs+ 28;
Logxp := Round(Logs * 67.5);
End Else
Begin
Logs:= Logs+ 27;
Logxp := Round(Logs * 67.5);
end;

^ That little part there is also similar to what I did in my updated script in the Free For All Script section. In mine, the idea of that was to say that if the hatchet was in the inventory then NumOfLogs would increase by 27 each load, and it it were equipped, by 28 each load. In your case, it wouldn't do anything as there is no Players[CurrentPlayer].Booleans[0] in your DeclarePlayers.

I would also suggest adding a hatchet checker (making a DTM would be the easiest IMO).

Anyway, that was just quickly skimming over it, I'm sure I missed a few things. Overall, for a first script, it's not too bad. I'm far from an expert, but I think there are a lot of things you can improve and expand on, but I've seen you around and I'm sure you're up to the task. :)

I hope I helped, if you have any questions don't be afraid to ask and I'll do the best I can.

Cheers. :)