SRL Archive - First Scripts

Dg's PowerChopper


Dgby714

2010-02-23 22:30:56

Dgby714's Powerchopper


Description:
[indent]This is my first Working-ish script! I've been working on it for awhile and would like some advice. You prob wont get over 5min with this at the moment it needs lots of work still[/indent]

Features:(noone said features had to be good >.>)
[indent] - Good - [/indent]
  • Works in Simba and Scar =)
  • Cuts Normal, Oak, Willow, Maple, Yew, and Magic (idk who would powercut magic but its there)
  • Script will check for Updates
  • SRL stats
  • Accounts are loaded from a ini file. (if you want)
[indent] - Bad -[/indent]
  • Script is Bloaty
  • Script has a hard time finding Trees
  • Script has a hard time detecting if your Chopping >.>
ChangeLog:
  • [v0.1] - Initial Release =)
  • [v0.2] - Deleted Warning() and Error() and replaced with srl_Warning
  • [v0.2] - Fixed GetTreeInfo(), Deleted Center()
  • [v0.3] - Using SRLPlayerReport as Proggie Report now!
  • [v0.3] - Deleted GetTreeXP, Using FindXP instead, Added running from fights!
  • [v0.4] - Changed Implode to use srl_implode, added a few SMART options to const's
  • [v0.5] - Added Ivy Support!

Latest Files: v0.5
  • Simba - [attach]9311[/attach]
  • Scar - [attach]9312[/attach]

accounts.ini Structure
[Accounts]
Ammount=2
Usernames=Username1:Username2

[username1]
Password=password1
Nick=nick1
Tree=normal
LampSkill=Woodcutting
RunDir=N
Loads=1
Active=True

[username2]
Password=password2
Nick=nick2
Tree=normal
LampSkill=Woodcutting
RunDir=N
Loads=1
Active=True

Mr. Doctor

2010-02-23 22:36:39

Reserved for notes.
SCAR version.
==
SRL has a warn feature called

srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);

So no need for the warning procedure.
==

procedure AntiRandoms;
begin
FindNormalRandoms;
LampSkill := Players[CurrentPlayer].Strings[2];
end;

FindNormalRandoms shouldn't be used alone in a procedure. There are many other randoms, E.X. Fights, Trade ect.
==

procedure Center(var x, y: integer);
begin
x := MSCX;
y := MSCY;
end;

The point of that?
==

function GetTreeInfo(str: string): DGObject;
var
Tree: DGObject;
begin
case str of
'normal':begin
with Tree do
begin
Uptext := ['ree', 'hop', 'down tree', 'own ree', 'own tree'];
Color := 1329468;
Hue := 0.14;
Sat := 2.44;
Tol := 5;
end;
end;
'oak':begin
with Tree do
begin
Uptext := ['ak', 'Oak', 'own Oak', 'own oak'];
Color := 2649439;
Hue := 0.02;
Sat := 0.88;
Tol := 17;
end;
end;
'willow':begin
with Tree do
begin
Uptext := ['wil', 'low', 'own willow'];
Color := 3562314;
Hue := 0.10;
Sat := 0.55;
Tol := 15;
end;
end;
'maple':begin
with Tree do
begin
Uptext := ['aple', 'maple', 'own maple'];
Color := 2243938;
Hue := 0.26;
Sat := 0.52;
Tol := 8;
end;
end;
'yew':begin
with Tree do
begin
Uptext := ['yew', 'ew', 'own yew'];
Color := 3506545;
Hue := 0.04;
Sat := 1.08;
Tol := 12;
end;
end;
'magic':begin
with Tree do
begin
Uptext := ['agic', 'magic', 'own magic'];
Color := 9755617;
Hue := 0.03;
Sat := 1.81;
Tol := 20;
end;
end else
begin
with Tree do
begin
Uptext := [''];
Color := 0;
Hue := 0;
Sat := 0;
Tol := 0;
end;
end;
end;
Result := Tree;
end;

Fixed procedure. You need an extra end; (Except for the last) in each X:
===

That's all I feel like doing. Not bad overall. What you need to work on is Antiban/randoms. They are decent, but it's always nice to make your own.

Dgby714

2010-02-23 23:03:20

Updated =) v0.2, Working on AntiRandoms.

Sex

2010-02-23 23:24:30

FindNormalRandoms shouldn't be used alone in a procedure. There are many other randoms, E.X. Fights, Trade ect.

There are no fights or anything I thought anymore.

Dgby714

2010-02-24 00:12:35

From: Sex
There are no fights or anything I thought anymore.


I think he means what if something aggressive attacks me like a highwayman that's neer the trees.

Updated v0.3!

void_hatred

2010-02-24 02:10:34

hey the script looks nice; I'll have to run it later on :)

one thing, though I doubt that you created the implode feature,
function implode(const glue: string; const pieces: array of string): string;

could be.. (not that it really matters)

function Implode(const blue: string; const pieces: TStringArray): String;

nice job! :)

void_hatred

Dgby714

2010-02-24 04:08:07

From: void_hatred
hey the script looks nice; I'll have to run it later on :)

one thing, though I doubt that you created the implode feature,
function implode(const glue: string; const pieces: array of string): string;

could be.. (not that it really matters)

function Implode(const blue: string; const pieces: TStringArray): String;

nice job! :)

void_hatred


I didnt (found it on the internet as a delphi implode alternative), it says
By: ???

thanks for the tip though.

whats the diffrence between TStringArray and array of string?

Sex

2010-02-24 10:00:09

They are exactly the same thing TStringArray is a type declared as TStringArray = array of string; :p.
Also, you don't need const in front of it so you could just put
function Implode(Glue : string; Pieces : TStringArray) : string;
Anyways SRL has implode and explode in it already (SRL_Implode/SRL_Explode), so I'd just use them :).

Dgby714

2010-02-24 15:41:38

yeah i know, i got that because srl_implode is pieces then glue and i didnt wanna switch all of the implodes in the stats thing….

Updated v0.4