SRL Archive - RS3 Outdated / Broken Scripts

Akward Power Cutter - 100% color


Awkwardsaw

2009-10-13 16:29:55

yes, i used to have an other chopper, but it was old, sucked, and used reflection. this is new, better, and 100% color :)

i am still calling this version 3, since its using the same "outline" as the old one.

features:
  • 100% color
  • Good Antiban
  • Multi Player
  • Can cut almost any tree, at any place!
  • New SRL Animation. :D

Instructions:
  1. Download script
  2. Fill out the variables, if needed
  3. fill out Declare Players
  4. if not using SMART, comment out the include line, and follow the next step :)
  5. make sure to drag the cross hairs over to the RS screen
  6. make sure the player is in veiw of the tree
  7. try to be as desolate from other players as possible

Example of filling out the variables:
procedure LoadVars;
begin
//debug setup
SetArrayLength(debug, 4);
debug[0]:= true;//if want to debug
debug[1]:= false;//if want to writeln debug
debug[2]:= false;//if want to alert debug
debug[3]:= true;//if want to status debug
end;

procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

writeln('Declaring Players');

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Integers[0] := 10; //loads to do
Booleans[0] := true; //false = hatchet is weilded!!!!!!
Strings[0] := 'willow'; //name of the tree
BoxRewards := ['XP'];
end;
end;

Bugs:
  • EXP rates

Changes
  • Removed E-mail, version checked, ect, since this was a hassle for me. if you want it back tell me :p
  • Added the new Animation.scar. you need the latest SRL dev-rev for it to work :)

my only reason for updating it is because i noticed i still got e-mails from the script, and animation.scar was released, so i said why not make a little update. :)

getslotownlost

2009-10-14 21:55:31

Looks good, going to test now

Awkwardsaw

2009-10-14 22:26:16

From: getslotownlost
Looks good, going to test now


lol, suspended? thanks for the bump i guess.

Runaway

2009-10-14 22:46:03

Looks beautiful! And I like how you included magic log powerchopping :p I do hope no one actually uses that feature…

Anyhoo, I shall be using this quite a bit on mah new guy.

I'll update this post with all the proggies I get :)

Awkwardsaw

2009-10-14 22:48:22

From: Runaway Cop
Looks beautiful! And I like how you included magic log powerchopping :p I do hope no one actually uses that feature…

Anyhoo, I shall be using this quite a bit on mah new guy.

I'll update this post with all the proggies I get :)


:)

if not proggies, at least advise on how to make it better :D

JAD

2009-10-14 23:29:16

In AGetVersion:


if Ver = Version then result := true;

Could save length, and true lines (since code after an if/then should be on a new line):

Result := Ver = version;

Also, it's better to do that because then the function will always result something.



while not FindThis do
begin
for i:= 1 to tol do
begin
if FindColorsSpiralTolerance(MSCX, MSCY, T, color, MSX1, MSY1, MSX2, MSY2, tol) then
break;
end;
k := length(t);
FindThis := k > 0; //thanks to noidea :)
if timefrommark(time) > 5000 then break;
end;

Change to:


while not FindThis and TimeFromMark(time) < 5000+random(1500) do
begin
for i := 1 to tol do
if FindColorsSpiralTolerance(MSCX, MSCY, T, color, MSX1, MSY1, MSX2, MSY2, i) then
break;
end;
k := length(t);
FindThis := k > 0; //thanks to noidea :)
end;

Added randomness to your marktime + put in the while statement. Took out unnecessary begin/end in for loop. Most importantly, your tolerance incrementer was using tol instead of I in the FindColorsSpiralTolerance. I'm assuming you wanted to keep incrementing the tolerance until found, right? In that case, you would want to use i as the tolerance as I changed it to above.


So now we have this:

result:= true;
d:= 0;
if not loggedin then loginplayer;
ColorToleranceSpeed(3);
time := 0;
marktime(time);
while not FindThis and TimeFromMark(time) < 5000+random(1500) do
begin
for i := 1 to tol do
if FindColorsSpiralTolerance(MSCX, MSCY, T, color, MSX1, MSY1, MSX2, MSY2, i) then
break;
end;
k := length(t);
FindThis := k > 0; //thanks to noidea :)
end;
ColorToleranceSpeed(1);
if Length(T) = 0 then
begin
A_Debug('color not found');
result:= false;
exit;
end;

Which could get rid of a few lines by doing a few things with the Result:


d:= 0;
if not loggedin then loginplayer;
ColorToleranceSpeed(3);
time := 0;
marktime(time);
while not FindThis and TimeFromMark(time) < 5000+random(1500) do
begin
for i := 1 to tol do
if FindColorsSpiralTolerance(MSCX, MSCY, T, color, MSX1, MSY1, MSX2, MSY2, i) then
break;
end;
k := length(t);
FindThis := k > 0; //thanks to noidea :)
end;
ColorToleranceSpeed(1);
Result := not Length(T) = 0;
if not Result then
begin
A_Debug('color not found');
exit;
end;

Only 1 line, but looks cleaner to me.


Not sure, but at this part:
if not result then
begin
A_Debug('Something has gone wrong');
players[currentplayer].active := false;
end;

Wouldn't you just want to Logout when things go wrong, have if not loggedin then Exit;'s at the beginning of (almost) all procedures/functions, and then at the end of the main loop have if not loggedin then NextPlayer(false)? That's the way I do it at least.



In Stats Check Output:

for i := 0 to High(sa) do
if (Trim(sa[i]) <> '') then
if StartsWith('ERROR(1)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
end
else if StartsWith('ERROR(2)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_ScriptID := '5';
end
else
WriteLn('STATS: "' + sa[i] + '"');

That looks messy:


for i := 0 to High(sa) do
if (Trim(sa[i]) <> '') and StartsWith('ERROR(1)', sa[i]) then
WriteLn('STATS: "' + sa[i] + '"')
else if StartsWith('ERROR(2)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_ScriptID := '5';
end else
WriteLn('STATS: "' + sa[i] + '"');

Saves some lines and looks cleaner.


On line 221:

var
Stats_GlobalVars: array[1..24] of Integer;

Shouldn't that be up top with the other global variables? Would be easier to keep track of everything/change stuff, and is standard.


On line 278-280 get rid of unnecessary begin/end.


In NextPlayerP:

NextPlayer(Players[(CurrentPlayer + 1)].Active);

I don't understand why you do that? NextPlayer switches players, leaving the current players .active to whatever you put in there. Why would you want to set it to what the next players .active is? It would always be true anyways.



In LoadTrees:


case lowercase(players[currentplayer].strings[0]) of
'normal': with TA do
begin
name := 'normal';
uptext := 'ree';
color := 4094573;
tol := 4;
end;

'oak': with TA do
begin
name := 'oak';
uptext := 'Oak';
color := 5739656;
tol := 4;
end;

'willow': with TA do
begin
name := 'willow';
uptext := 'illow';
color := 4282446;
tol := 4;
end;

'maple': with TA do
begin
name := 'maple';
uptext := 'aple';
color := 3956883;
tol := 4;
end;
'teak': with TA do
begin
name := 'teak';
uptext := 'eak';
color := 5410940;
tol := 4;
end;
'mahogany': with TA do
begin
name := 'mahogany';
uptext := 'ahogany';
color := 1525307;
tol := 4;
end;
'yew': with TA do
begin
name := 'yew';
uptext := 'ew';
color := 1259054;
tol := 4;
end;
'magic':with TA do
begin
name := 'magic';
uptext := 'agic';
color := 12836577;
tol := 4;
end;
end;

Could be shortened a fair amount:


TA.name := lowercase(players[currentplayer].strings[0]);
TA.tol := 4;
case lowercase(players[currentplayer].strings[0]) of
'normal': with TA do
begin
uptext := 'ree';
color := 4094573;
end;

'oak': with TA do
begin
uptext := 'Oak';
color := 5739656;
end;

'willow': with TA do
begin
uptext := 'illow';
color := 4282446;
end;

'maple': with TA do
begin
uptext := 'aple';
color := 3956883;
end;
'teak': with TA do
begin
uptext := 'eak';
color := 5410940;
end;
'mahogany': with TA do
begin
uptext := 'ahogany';
color := 1525307;
end;
'yew': with TA do
begin
uptext := 'ew';
color := 1259054;
end;
'magic':with TA do
begin
uptext := 'agic';
color := 12836577;
end;
end;



function findax:boolean;
var
i, a: integer;
tpa: TPointArray;
c: TIntegerArray;
begin
colortolerancespeed(3);
c := [5064763, 593214, 5261885, 869985];
for i:= 0 to high(c) do
if findcolorstolerance(tpa, c[i], mscx - 40, mscy - 40, mscx + 40, mscy + 40, 5) then
inc(a);
result := (a > 0);
colortolerancespeed(1);
end;

Could just be:


function findax:boolean;
var
i: integer;
tpa: TPointArray;
c: TIntegerArray;
begin
colortolerancespeed(3);
c := [5064763, 593214, 5261885, 869985];
for i:= 0 to high(c) do
if findcolorstolerance(tpa, c[i], mscx - 40, mscy - 40, mscx + 40, mscy + 40, 5) then
Result := true;
colortolerancespeed(1);
end;

No need for an incrementing variable.


In ChopTree:

while findax do
begin
antiban;
if invfull then break;
end;

Possible infinite loop. Add a (marktime?) Fail safe.

Also in ChopTree:

if invfull then break;
until invfull or not result;

You can delete that first line there, because it will already break if inv is full because of the until.


In DropLogs:

if not loggedin then exit;
if not invfull then exit;

Could just be:

if not loggedin or not invfull then exit;


In AwkSetup:

if l then
if not loggedin then loginplayer;

Could just be:

if l then and not loggedin then loginplayer;





Very nice Awkward!

Hopefully you were not offended by how much I pointed out, I was really bored.. Most of that stuff was just code shortenings/nothing that matters to anybody else except me :p There were just a possibly problematic things such as the switching players (which maybe you were doing right and I misread), the tolerance changer, an infinite loop or 2, and maybe a couple other small things.

~JAD

Awkwardsaw

2009-10-15 09:02:13

JAD, i love you :D

this is exactly what i wanted, and i'm fixing ASAP

Orrealis

2009-11-06 08:28:25

Yay dude! it works awsome for me, this is the first script that i get started, so im realy thanksfull :D

Awkwardsaw

2009-11-06 08:38:14

From: Orrealis
Yay dude! it works awsome for me, this is the first script that i get started, so im realy thanksfull :D


lol thanks :p remember to post feedback and proggy

Orrealis

2009-11-06 15:11:09

i doesn't realy understand why my progg doesn't work, it doesn't show how long i worked or how many logs i cut :/ you got any problems with that?

Awkwardsaw

2009-11-06 16:57:11

From: Orrealis
i doesn't realy understand why my progg doesn't work, it doesn't show how long i worked or how many logs i cut :/ you got any problems with that?


if your talking about the E-Mail, idk why that is, =\

although i do know that timing is mest up(or was, last time i checked) with the scrip proggys

what about the script itself?

Awkwardsaw

2009-12-08 08:35:40

its been a while, but i updated this a small bit :)

my only reason for updating it is because i noticed i still got e-mails from the script, and animation.scar was released, so i said why not make a little update

Matsetst

2009-12-08 09:03:57

is reflection already working then ?? :surprised:

I am curious how it runs ^^

Coh3n

2009-12-08 12:20:43

From: Matsetst
is reflection already working then ?? :surprised:

I am curious how it runs ^^

He said the script is 100% color…

Awkwardsaw

2009-12-08 16:49:38

From: Coh3n
He said the script is 100% color…


that it is.. :)

kevinconklin

2009-12-09 11:44:11

it opens up smart and then it bring me to the login screen and then doesn't move? am i doing something wrong?

Awkwardsaw

2009-12-09 16:56:24

its SRL, :p

the fonts are probobly messed up still

DrWu

2010-03-21 21:58:10

I keep getting this error message when I try to run it. It's probably just me :duh: But do you have any idea why this might be coming up?


Line 847: [Error] (20669:4): Unknown identifier 'Respond' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\AntiRandoms\AntiRandoms.scar

i luffs yeww

2010-03-21 22:01:51

That's a problem in SRL, not the script. :)

And you're using SCAR 3.22, I think (according to that file path you are).

Use Coh3n's guide. :)

http://villavu.com/forum/showthread.php?t=47714

But this script is over three months old, so it might not work either way. :p

YoHoJo

2010-03-21 22:02:35

@DrWu
This script was made A LONG TIME AGO:
If you look near the top of the first post:
10-13-2009, 02:29 PM


Please make sure scripts you are using are current, active, and working. This thread has not been posted on in quite a while.

i luffs yeww

2010-03-21 22:05:05

YoHoJo, it's actually not five months old.. :p It's only threeeeeee! :D (probably.. I got that from "Last edited by Awkwardsaw; 12-08-2009 at 06:34 AM.")

DrWu

2010-03-21 22:06:49

Oh. Cool, again thanks and sorry :D