SRL Archive - Archive

Coh3n - SRL Member Application


Coh3n

2009-06-19 01:11:33

How Long have You Played Runescape?
4 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
Nava2


What is your general programming knowledge?
SCAR


Are you a member of any other communities?
No


Tell us about yourself…
From: Coh3n
My name is Cohen Adair. I'm from Stratford, Ontario. My interests are hockey :), scripting (it's addicting :p), video games, learning new things, and getting mono.. apparently XD.



Please show us one (or multiple) of your scripts.
//Special thanks to Nava2, ZephyrsFury and everyone who helped me on the forums/IRC Chat. :)

program DraynorChopNBank;
{.Include SRL\SRL\Misc\SMART.SCAR}
{.include SRL\SRL.scar}
//{.include SRL\SRL\Misc\Debug.scar}

var
HatchetDTM : Array of Integer;
NumOfLogs, TotalProggies : Integer;
XpGain : TExtendedArray;
TP : TPoint;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nickname';
Players[0].Active := True;//Use this player?
Players[0].Pin := '';//Bank pin. Leave blank if you don't have one.
Players[0].Integers[0] := 000;//How many logs to cut?
Players[0].Booleans[0] := True;//Is hatchet equiped?
Players[0].BoxRewards := ['Xp', 'mote', 'ostume'];

{Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].Integers[0] := 000;
Players[0].Booleans[0] := True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume'];}
end;

procedure S_TurnRunOn;
var
s : String;
begin
if GetMMLevels('energy', s) > 60 then
begin
SetRun(True);
Exit;
end;
end;

procedure S_FindRandoms;
begin
if FindFight then
RunAway('N', True, 1, 5000);
LampSkill := 'woodcutting';
FindNormalRandoms;
end;

function S_LevelUp: Boolean;
var
x, y : Integer;
begin
if FindNPCChatText('ongrat', Nothing)then
begin
ClickContinue(True, True);
Wait(80 + Random(100));
GetSkillLevel('woodcutting');
Mouse(x, y, 4, 4, True);
Wait(80 + Random(100));
CloseWindow;
Writeln('Congratulations, you have gained a Woodcutting level!');
Result := True;
end;
end;

procedure S_MyAntiBan;
begin
case Random(70) of
0: RandomMovement;
1: BoredHuman;
2: HoverSkill('random', false);
3: RandomRClick;
4: begin
case Random(2) of
0: begin
KeyDown(VK_RIGHT);
Wait(50 + Random(1300));
KeyUp(VK_RIGHT);
Wait(60 + Random(2000));
KeyDown(VK_LEFT);
Wait(70 + Random(1100));
KeyUp(VK_LEFT);
end;
1: begin
KeyDown(VK_LEFT);
Wait(50 + Random(1300));
KeyUp(VK_LEFT);
Wait(60 + Random(2000));
KeyDown(VK_RIGHT);
Wait(70 + Random(1100));
KeyUp(VK_RIGHT);
end;
end;
end;
5: begin
KeyDown(VK_LEFT);
Wait(100 + Random(1200));
KeyUp(VK_LEFT);
end;
6: begin
KeyDown(VK_RIGHT);
Wait(150 + Random(1100));
KeyUp(VK_RIGHT);
end;
end;
end;

procedure S_HatchetDTMs;
begin
SetArrayLength(HatchetDTM, 7);//[0]:= Bronze, [6]:= Rune
HatchetDTM[0] := DTMFromString('78DA630C646260D8C4C8800C7CAC9519F8813' +
'44C94D113A86617AA1A982C5C8D1B50CD36026ABC816AD6125013' +
'0C54B38E809A504C3763A80921EC1E00949107EF');
HatchetDTM[1] := DTMFromString('78DA630C626260D8C4C8800C02BDBD19F8813' +
'448F43F1030BA03D5EC47550391859140DA0DA8662B01355E4035' +
'6B09A80906AA5947404D2850CD06026A42806AB6E157030033F30' +
'C28');
HatchetDTM[2] := DTMFromString('78DA630C626260D8C8C8800CCAF3F318F8813' +
'448F43F10307A02D5EC40550391859140DA0DA8660B01355E4035' +
'6B09A80904AA5947404D28A69BB1AAD98A5F0D0090050C8D');
HatchetDTM[3] := DTMFromString('78DA63F4676260D8C0C8800C44454418F8813' +
'448F43F1030BA03D5EC43550391859140DA05A8661701351E4035' +
'EB09A80900AA5947404D28A69BB1AAD98A5F0D0095870B78');
HatchetDTM[4] := DTMFromString('78DA630C646260D8C8C8800C1C1CE319F8813' +
'44C94D10DA8E600AA1A982C5C8D2B50CD0E026A3C806A36105013' +
'0054B38E809A504C3763A80901AAD9865F0D00C5940824');
HatchetDTM[5] := DTMFromString('78DA63EC64626038C0C8800C9C829D18F8813' +
'44C94B101A8E614AA1A982C8A9A7D04D4F402D5EC2742CD21026A' +
'6A816AAEE05703006FA208C7');
HatchetDTM[6] := DTMFromString('78DA638C676060E8614001AE31690CFC409A1' +
'188FF0301633090B180010D302291403A1048CC22A0260448F413' +
'501309243A08A84902129D04D42403895EFC6A00F1EB0B8F');
end;

procedure W_WalkToWillows;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
S_TurnRunOn;
MakeCompass('n');
if RadialWalk(FindWaterColor, 180, 220, 60, 2, 1)then
begin
Wait(80 + Random(100));
Writeln('Walking to Willows.');
FFlag(2);
end else
begin
if FindSymbol(x, y, 'fish')then
begin
Wait(80 + Random(100));
Writeln('Walking to Willows.');
Mouse(x, y - 20 - Random(15), 4, 4, True);
FFlag(2);
end else
begin
Writeln('Couldn''t walk to Willows.');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
end;

function W_BankFloorColor: Integer;
var
BankFloor, x, y : Integer;
begin
BankFloor := DTMFromString('78DA63AC606260D066400179E969609A11CA6' +
'7AC05AA514555F3E70F13A61A3D22D418E1570300B1E409D9');
if DTMRotated(BankFloor, x, y, MMX1, MMY1, MMX2, MMY2)then
begin
Result := GetColor(x + 15, y);
Writeln('Bank floor color = ' + IntToStr(Result));
end else
Writeln('Didn''t find bank color.');
FreeDTM(BankFloor);
end;

procedure W_WalkToBank;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
S_TurnRunOn;
MakeCompass('n');
if RadialWalk(W_BankFloorColor, 0, 77, 68, -2, 1)then
begin
Wait(80 + Random(100));
Writeln('Inventory full, walking to bank.');
FFlag(2);
end else
begin
if FindSymbol(x, y, 'bank')then
begin
Wait(80 + Random(100));
Mouse(x, y, 4, 4, True);
Writeln('Inventory full, walking to bank.');
FFlag(2);
end else
begin
Writeln('Couldn''t walk to bank.');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
end;

procedure Cut_FindHatchet;
var
b : Boolean;
i, x, y : Integer;
begin
if Players[CurrentPlayer].Booleans[0] = True then
GameTab(5)
else
GameTab(4);
for i := 0 to 6 do
begin
b := FindDTM(HatchetDTM[i], x, y, MIX1, MIY1, MIX2, MIY2);
if b then Break;
end;
if b then Writeln('Found hatchet.')else
begin
Writeln('Didn''t find hatchet, logging out.');
Wait(80 + Random(100));
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
for i := 0 to 6 do
FreeDTM(HatchetDTM[i]);
end;

procedure Cut_WhileChopping;
var
ClickTree, NCTime, LastCount : Integer;
begin
MarkTime(ClickTree);
NCTime := 15000 + Random(10000);
LastCount := InvCount;
while(InvCount < 28)and LoggedIn do
begin
if TimeFromMark(ClickTree) > NCTime then
if InvCount = LastCount then Break;
S_MyAntiBan;
Wait(80 + Random(5000));
if S_LevelUp then Continue;
S_FindRandoms;
end;
end;

function Cut_TreeCutDown: Boolean;
var
TrCols : TPointArray;
begin
FindColorsTolerance(TrCols, 5667697, TP.x - 20, TP.y - 20, TP.x + 20, TP.y + 20, 18);
if(Length(TrCols) < 10)then
begin
//Writeln('Tree has been cut down.');
Result := True;
end;
end;

procedure Cut_ChopTrees;
var
fx, fy, k, x, y : Integer;
s : String;
TPA : TPointArray;
T2D : T2DPointArray;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
repeat
FindColorsSpiralTolerance(fx, fy, TPA, 5667697, MSX1, MSY1, MSX2, MSY2, 18);
T2D := SplitTPAEx(TPA, 5, 5);
//DebugATPA(T2D, '');
if Length(T2D) = 0 then Exit;
SortATPAFromFirstPoint(T2D, Point(MSCX, MSCY));

for k := 0 to High(T2D) do
begin
//Writeln('Length:' + IntToStr(Length(T2D[k])));
if(Length(T2D[k]) < 50)then Continue;
MiddleTPAEx(T2D[k], fx, fy);
Wait(30 + Random(20));
MMouse(fx, fy, 4, 4);
s := RS_GetUpText;
if((Pos('hop', s) > 0) and (Pos('illow', s) > 0))then
begin
GetMousePos(x, y);
Wait(80 + Random(100));
Mouse(x, y, 4, 4, True);
TP := IntToPoint(x, y);
repeat
Cut_WhileChopping;
until(Cut_TreeCutDown or InvFull);
end;
end;
until(InvFull or not LoggedIn);
ColorToleranceSpeed(1);
end;

procedure B_BankItems;
var
DepositAllTab : Integer;
begin
if OpenBank('db', True, True)then
begin
if Players[CurrentPlayer].Booleans[0] = True then
begin
DepositAll;
CloseBank;
NumOfLogs := NumOfLogs + 28;
end else
begin
Deposit(2, 28, True);
CloseBank;
NumOfLogs := NumOfLogs + 27;
end;

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 else
begin
Wait(80 + Random(100));
Writeln('Couldn''t find bank booth, logging out.');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;

{*******************************************************************************
function Prg_PlayerActivity(i: integer): string;
By: Drags111
Description: Determines whether the player is active or not.
*******************************************************************************}

function F_PlayerActive(i : Integer): String;
begin
if Players[i].Active then Result := 'T' else Result := 'F';
end;

procedure F_ProgReport;
var
i : Integer;
begin
Players[i].Integers[9] := NumOfLogs / 28;
Players[i].Integers[10] := NumOfLogs;
Inc(TotalProggies);
Writeln(' _______________________________________________');
Writeln(PadR('| Coh3n''s Power Chopper', 48) + '|');
Writeln('|_________________First Script__________________|');
Writeln('| |');
Writeln(PadR('| Time run: ' + TimeRunning, 48) + '|');
Writeln(PadR('| Loads: ' + IntToStr(NumOfLogs / 28), 48) + '|');
Writeln(PadR('| Logs: ' + IntToStr(NumOfLogs), 48) + '|');
Writeln(PadR('| Exp Gained: ' + FloatToStr(NumOfLogs * 67.5), 48) + '|');
Writeln('|_______________________________________________|');
Writeln('|________________Player''s Stats_________________|');
Writeln('| Nick T/F Loads Logs |');
Writeln('| ¯¯¯¯ ¯¯¯ ¯¯¯¯¯ ¯¯¯¯ |');
for i := 0 to High(Players)do
Writeln('| ' + PadR(Players[i].Nick, 10) + PadR(F_PlayerActive(i), 9)
+ PadR(IntToStr(Players[i].Integers[9]), 11)
+ PadR(IntToStr(Players[i].Integers[10]), 11) + '|');
Writeln('|_______________________________________________|');
end;

procedure F_Setup;
begin
ClearDebug;
SMARTSetupEx(152, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
SetAngle(True);
S_HatchetDTMs;
end;

begin
F_Setup;
repeat
repeat
Cut_FindHatchet;
begin
W_WalkToWillows;
Cut_ChopTrees;
W_WalkToBank;
B_BankItems;
F_ProgReport;
end;
until(NumOfLogs >= Players[CurrentPlayer].Integers[0])or(not LoggedIn);
NextPlayer(LoggedIn);
until AllPlayersInactive;
end.

Nava2

2009-06-19 01:12:09

Ninja'd

procedure S_TurnRunOn;
var
s : String;
begin
if GetMMLevels('energy', s) > 60 then
begin
SetRun(True);
Exit;
end;
end;

Replaced with:
SRL/Core/GameTab.scar:
{*******************************************************************************

function RunEnergy(Min: Integer): Boolean;

By: lordsaturn

Description: Toggles run if energy is greater or equal to MinEnergy. Results

true if energy is greater or equal to minimum.

*******************************************************************************}



function RunEnergy(Min: Integer): Boolean;

var

t: String;

begin

Result := (GetMMLevels('run', t) >= Min);

if (Result) then SetRun(True);

end;

function S_LevelUp: Boolean;
var
x, y : Integer;
begin
if FindNPCChatText('ongrat', Nothing)then
begin
ClickContinue(True, True);
Wait(80 + Random(100));
GetSkillLevel('woodcutting');
Mouse(x, y, 4, 4, True);
Wait(80 + Random(100));
CloseWindow;
Writeln('Congratulations, you have gained a Woodcutting level!');
Result := True;
end;
end;

You never set the GetSkillLevel to anything, whats the point in calling it?

function W_BankFloorColor: Integer;
var
BankFloor, x, y : Integer;
begin
BankFloor := DTMFromString('78DA63AC606260D066400179E969609A11CA6' +
'7AC05AA514555F3E70F13A61A3D22D418E1570300B1E409D9');
if DTMRotated(BankFloor, x, y, MMX1, MMY1, MMX2, MMY2)then
begin
Result := GetColor(x + 15, y);
Writeln('Bank floor color = ' + IntToStr(Result));
end else
Writeln('Didn''t find bank color.');
FreeDTM(BankFloor);
end;

procedure W_WalkToBank;
var
x, y : Integer;
begin
if not LoggedIn then Exit;
S_TurnRunOn;
MakeCompass('n');
if RadialWalk(W_BankFloorColor, 0, 77, 68, -2, 1)then
begin
Wait(80 + Random(100));
Writeln('Inventory full, walking to bank.');
FFlag(2);
end else
begin
if FindSymbol(x, y, 'bank')then
begin
Wait(80 + Random(100));
Mouse(x, y, 4, 4, True);
Writeln('Inventory full, walking to bank.');
FFlag(2);
end else
begin
Writeln('Couldn''t walk to bank.');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
end;

Maybe set the bankfloor colour to a variable? This way, you don't have to keep calling it over and over again.

        repeat
Cut_WhileChopping;
until(Cut_TreeCutDown or InvFull);
Antiban?

Add some breaks, remove some globals. Learn to pass parameters. :)

Decent script, nothing bad was major.

Yes.

Dynamite

2009-06-19 01:21:09

if FindFight then
No fighting randoms anymore.
procedure W_WalkToWillows;
Use DTMs for walking then radialwalk as failsafe.

Apart from that so far, looks good.
Will look more in morning.
But you seem like a really nice guy.
AND you Nava's mate so…
Good luck…
Yes ;)

T~M

Frt

2009-06-19 01:21:28

Good walking with failsafes.
Knowledge of TPA's.
Nice attitude.

However, I'm not so sure your Cut_TreeCutDown is working as it might detect another close tree, since two of the trees are placed pretty close.

I'm voting yes.

From: Nava2
Ninja'd

You never set the GetSkillLevel to anything, whats the point in calling it?



Might be antiban as I personally always go to look at my level when I level up.

Coh3n

2009-06-19 01:32:27

From: Nava2

Antiban?

Add some breaks, remove some globals. Learn to pass parameters. :)

Decent script, nothing bad was major.

Yes.


There's Antiban in the Cut_WhileChopping procedure. ;)


From: Frt
I'm not so sure your Cut_TreeCutDown is working as it might detect another close tree, since two of the trees are placed pretty close.


From what I've tested, it works fine, but I know what you mean. :)

Thanks guys a lot for your compliments, and voting yes. :)

NCDS

2009-06-19 01:46:24

in your AnitBan you dont have to write out all this:

0: begin
KeyDown(VK_RIGHT);
Wait(50 + Random(1300));
KeyUp(VK_RIGHT);
Wait(60 + Random(2000));
KeyDown(VK_LEFT);
Wait(70 + Random(1100));
KeyUp(VK_LEFT);
end;

Instead you can use MakeCompass:

0: begin
MakeCompass(30 + Random(10));
end;
I believe that's what you were basically going for? You can move it back to whatever angle it need's to be at also.

Nice use of Array's with your DTM's.

I really like your failsafe's as it is the same basic method I use, try something twice and if it still doesn't work then NextPlayer/terminatescript :) Good deal there.

I don't have time to really go through the whole thing right now but from a quick skim everything look's pretty good.

I want to look closer before I actually vote but it's looking like a yes :)

Coh3n

2009-06-19 01:52:08

From: NCDS
I want to look closer before I actually vote but it's looking like a yes :)


Awesome, can't wait. :) Thanks for the suggestions and compliments. :)

Naike

2009-06-19 02:26:09

I keep it short, as always ;)

Nice guy, willing to learn and script is ok.
Yes.

Coh3n

2009-06-19 02:28:31

From: N1ke!
I keep it short, as always ;)

Nice guy, willing to learn and script is ok.
Yes.


Thanks N1ke! :)

Tags
monoboy, poo.., script


Monoboy? Thanks Nava, I'm assuming it was you. XD

Cazax

2009-06-19 02:33:06

Yes.
One thing:

NumOfLogs := NumOfLogs + 28;
I'd recommend you to use ItemAmount because you sometimes get an inventory random and you don't have 28 logs in your inventory :)

Coh3n

2009-06-19 02:34:42

From: Cazax
Yes.
One thing:

NumOfLogs := NumOfLogs + 28;
I'd recommend you to use ItemAmount because you sometimes get an inventory random and you don't have 28 logs in your inventory :)


Ah yes, good idea, thanks. :) And thanks for the yes. :D

Rubix

2009-06-19 03:59:04

To combat N1kes vote, I'll keep my reason shorter.

Yes.

Coh3n

2009-06-19 04:00:13

From: Rubix
To combat N1kes vote, I'll keep my reason shorter.

Yes.


Thanks! :D

And btw, I Loled hard at your sig, caught me off guard. :p

ZephyrsFury

2009-06-19 05:13:02

Yes. Good luck ;D

Coh3n

2009-06-19 05:18:03

From: ZephyrsFury
Yes. Good luck ;D


Thanks, Zeph! :D

ian.

2009-06-19 05:32:44

Yes. :] I'd like to see some more advanced stuff coming from you, though! :D I know you can do it ^^

Coh3n

2009-06-19 05:36:17

From: 99_
Yes. :] I'd like to see some more advanced stuff coming from you, though! :D I know you can do it ^^


Count on it. ;) Scripting is addicting, I'm not gonna lie. I already have ideas for a couple more scripts, so I'll start working on those soon enough. I also want to learn reflection to make the scripts better. :)

Thanks for the yes! :)

Nava2

2009-06-19 05:48:27

From: Coh3n
Count on it. ;) Scripting is addicting, I'm not gonna lie. I already have ideas for a couple more scripts, so I'll start working on those soon enough. I also want to learn reflection to make the scripts better. :)

Thanks for the yes! :)


Blasphemy!

Naike

2009-06-19 22:30:23

Nava2: Keep your weird words for yourself, either that or the alcohol has to go.

Just finished reading the whole script, can't find anything to nag on which already has..
So, grats ;)

Coh3n

2009-06-19 22:31:19

From: N1ke!
Nava2: Keep your weird words for yourself, either that or the alcohol has to go. Don't count on it. :p

Just finished reading the whole script, can't find anything to nag on which already has..
So, grats ;)


Thanks N1ke! :D

NCDS

2009-06-19 23:18:07

You have a such a great attitude, I really don't see how anyone could vote 'no'. :p


Although, as 99_ said, I would also like to see some more advanced code coming from you, but for now, Congrats :)

Yes

Dynamite

2009-06-19 23:24:12

l0l
[tags]benhjkhkeegan, monoboy, poo.., poop[tags]
I agree, one of THE best attitudes on the forums.
But as said above. Moar advanced stuff please :)

T~M

ian.

2009-06-19 23:28:16

</3 I don't have the best attitude? :[ And I know you're not in yet, but I have a hunch that you'll get in :p Congratulations ^^

Dynamite

2009-06-19 23:31:32

Yes you do 99_. But you my babe <3 :p
I was gonna say you might get in quicker than me but…. nah :p
Good luck ;)

T~M

Coh3n

2009-06-19 23:32:18

From: NCDS
You have a such a great attitude, I really don't see how anyone could vote 'no'. :p

Although, as 99_ said, I would also like to see some more advanced code coming from you, but for now, Congrats :)

Yes


Thanks, and I plan on it. :)

From: 99_
</3 I don't have the best attitude? :[ And I know you're not in yet, but I have a hunch that you'll get in :p Congratulations ^^


Thanks. :)

Rubix

2009-06-20 03:31:58

[tags]99_ wins at life, benhjkhkeegan, monoboy, poo.., poop[/tags]
i lol'd at them, good luck.

ian.

2009-06-20 03:47:46

:o I wonder who said I win at life!??! ^^

Coh3n

2009-06-20 07:19:50

From: Rubix
[tags]99_ wins at life, benhjkhkeegan, monoboy, poo.., poop[/tags]
i lol'd at them, good luck.


Thanks. :D

From: 99_
:o I wonder who said I win at life!??! ^^


I wonder. :rolleyes:

ian.

2009-06-20 07:38:27

I don't loses at life D:

And YAY! You're gonna be a member :p

Coh3n

2009-06-20 07:40:17

From: 99_
I don't loses at life D:

And YAY! You're gonna be a member :p


No, no you don't … as far as I know. o_O

And YAY! :D

Nava2

2009-06-20 07:47:47

try and keep it on topic…

Daniel

2009-06-20 07:59:55

No, i've never met you and i can tell i will immediately dislike you. But from what i can see, you're attitude is horrible (offence) and some of your scripting abilities are not advanced at all. Bad luck though :(

Reverse everything from what i had previously said in the last paragraph for the truth

—

Coh3n

2009-06-20 19:26:32

[QUOTE=Dan's The Man;588697]No, i've never met you and i can tell i will immediately dislike you. But from what i can see, you're attitude is horrible (offence) and some of your scripting abilities are not advanced at all. Bad luck though :(

Reverse everything from what i had previously said in the last paragraph for the truth

—

Lol wow, I was like… hmm well that's different. :o TBH I didn't really know what to say. :p Then I went to quote it and loled pretty hard. :p

So does that mean you voted yes? Cause one person voted no, and I'd just like to know why, so I can improve on it later? :)

Wizzup?

2009-06-20 19:41:57

The script is extremely short. (400 lines)
It shows some knowledge of SRL, and the use of Wizzyplugin is nice.

Standards like this:

for i := 0 to 6 do
begin
b := FindDTM(HatchetDTM[i], x, y, MIX1, MIY1, MIX2, MIY2);
if b then Break;
end;
if b then Writeln('Found hatchet.')else
begin

Aren't very clear, especially not using a new line for each if statement.
In a loop, a small if statement can be put on 1 line, but the writeln on the same line makes the code unreadable. (Heck, there isn't even a space between the writeln and the else…)

I'd prefer a statement like this:


if b then
Writeln('Found hatchet.')
else
begin

I really have my doubt about who wrote most of this script though. (Nava or you.)

Coh3n

2009-06-20 19:45:17

From: Wizzup?
The script is extremely short. (400 lines)
It shows some knowledge of SRL, and the use of Wizzyplugin is nice.

Standards like this:

for i := 0 to 6 do
begin
b := FindDTM(HatchetDTM[i], x, y, MIX1, MIY1, MIX2, MIY2);
if b then Break;
end;
if b then Writeln('Found hatchet.')else
begin

Aren't very clear, especially not using a new line for each if statement.
In a loop, a small if statement can be put on 1 line, but the writeln on the same line makes the code unreadable. (Heck, there isn't even a space between the writeln and the else…)

I'd prefer a statement like this:


if b then
Writeln('Found hatchet.')
else
begin

I really have my doubt about who wrote most of this script though. (Nava or you.)


Thanks, I'll work on my standards. :) As for who wrote it, I could say I wrote the whole thing, but I could very easily be lying, you have no reason to trust me. Just as Nava about it. :)

And for the length, I know it's short, and that's why I was hesitant about applying. But people kept saying it could hurt, and Nava was right about all the feedback I get. :)

Dynamite

2009-06-21 00:03:46

Wait so you didnt write it!?
-.-

T~M

Coh3n

2009-06-21 00:18:49

From: The Man
Wait so you didnt write it!?
-.-

T~M


Yes, I did write it.

Dynamite

2009-06-21 00:19:31

OK good.
I got confused :P

T~M

Hobbit

2009-06-21 07:24:31

Yes


I'm confident he wrote it himself

Coh3n

2009-06-21 07:25:31

From: Hobbit
Yes


I'm confident he wrote it himself


Thanks you very much Hobbit! :D

Daniel

2009-06-21 10:37:35

From: Coh3n
So does that mean you voted yes?


What's the opposite of no?

Coh3n

2009-06-21 19:34:42

[QUOTE=Dan's The Man;589309]What's the opposite of no?

Lol yeah alright just making sure. Now apparently there's 3 people that voted no. I just want feedback that's all. So far no one who voted no posted, except Wizzup? may have voted no, I'm not sure.

If you vote no, I'd like to know why, so that way I can improve on it in the future.

Thanks.

Wizzup?

2009-06-21 19:35:36

I didn't vote.

Coh3n

2009-06-21 19:38:31

From: Wizzup?
I didn't vote.


Okay, thanks for letting me know. Then there's 3 people that voted no, and I don't know why. I don't care that they voted no, that doesn't upset me. I just want to know why.

Thanks.

mixster

2009-06-21 23:12:23

If it isn't too much to ask, could you tell me where you picked up the naming habit? I haven't seen anyone else use it, so it sticks out a bit. Not important though.

S_TurnRunOn
exit unneeded, therefore begin and end; can also be removed

S_LevelUp
Could just change the if to an if not and make it exit, meaning the rest doesn't have to indented. Also, you don't get any info from checking the woodcutting level, so it's a bad antiban, due to repeating it every time. Get info from it or make it random. Moreover, x, y are unset, yet you use Mouse with them, so you end up clicking in the top left of the screen within a 4 x 4 box.


S_MyAntiBan
Would say using MakeCompass instead of half of your random left/right holding down would make more sense.

S_HatchetDTMs
A DTM outline of the hatchets with high tolerance middle makes more sense. All except a couple of the high level axes have the same outline if I recall, so this way you can have a one-DTM-fits-all, making it much more compact. If you need to then see which type it is, you can get the colour where you find the DTM and compare it to colours of the different types or you could have a DDTM and set the main point colour based on which axe they choose.

W_WalkToWillows / W_WalkToBank
Should be using
else if

instead of

else
begin
if
end;

Also, you exit pointlessly at the end if it fails.

W_BankFloorColor
Should return an invalid number if it couldn't find the right colour, ie -1, as standard practice so when it is used, it can easily check if it failed or not. Alternatively, set a var type parameter and make it return a boolean relating to whether or not it succeeded.

Cut_FindHatchet
Flaw in that you free the axe DTM's as the end. If you reload them elsewhere, then it's a memory leak as you only free them if the axe was found. If they aren't reloaded, then it will cause access violation next loop through.

Cut_WhileChopping
Don't see the need for the if S_LevelUp then continue;

Cut_ChopTrees
After checking the up text, you get the position of the mouse. You then click, but you use 4, 4 for randomness for Mouse, which means it'll move over after already stopping to check the up text, while it should be 0, 0.

B_BankItems
More pointless exit's.


Overall, not a bad script.
However, take out the DeclarePlayers, hatchet DTM declarations and progress report bits and the script is under 300 lines. It's short. I don't think it shows any real skill - it all seems like it could of just come out of a tutorial. Also, I don't think it was actually ever run except to check for compiling as the hatchet DTM problem should've become apparent. It shouldn't be enough that it is good, it should be able to show every trick the scripter knows. If this is the extent of skill and knowledge, then it's trailing behind.

Coh3n

2009-06-21 23:40:01

From: mixster
If it isn't too much to ask, could you tell me where you picked up the naming habit? I haven't seen anyone else use it, so it sticks out a bit. Not important though. Oh I just separated each section to make it easier for me to navigate around the different procedures. TBH it didn't really make a difference with such a short script. It's so I know which procedures have to do with what. i.e. B_ has something to do with banking, and W_ has something to do with walking.

S_TurnRunOn
exit unneeded, therefore begin and end; can also be removed Yes, that procedure is no longer there, I used RunEnergy(); in my walking procedures.

S_LevelUp
Could just change the if to an if not and make it exit, meaning the rest doesn't have to indented. Also, you don't get any info from checking the woodcutting level, so it's a bad antiban, due to repeating it every time. Get info from it or make it random. Moreover, x, y are unset, yet you use Mouse with them, so you end up clicking in the top left of the screen within a 4 x 4 box. Yeah, the idea was just to get it to click the skill when the character leveled up. Pretty sure I removed that part from the script.


S_MyAntiBan
Would say using MakeCompass instead of half of your random left/right holding down would make more sense. Yes, this has been changed.

S_HatchetDTMs
A DTM outline of the hatchets with high tolerance middle makes more sense. All except a couple of the high level axes have the same outline if I recall, so this way you can have a one-DTM-fits-all, making it much more compact. If you need to then see which type it is, you can get the colour where you find the DTM and compare it to colours of the different types or you could have a DDTM and set the main point colour based on which axe they choose. Thanks, I'll look into improving this.

W_WalkToWillows / W_WalkToBank
Should be using
else if

instead of

else
begin
if
end;

Also, you exit pointlessly at the end if it fails. Okay thanks, I'll improve on this.

W_BankFloorColor
Should return an invalid number if it couldn't find the right colour, ie -1, as standard practice so when it is used, it can easily check if it failed or not. Alternatively, set a var type parameter and make it return a boolean relating to whether or not it succeeded. Hmm, I already have thought of a few ways of improving the WalkToBank procedure. Thanks. :)

Cut_FindHatchet
Flaw in that you free the axe DTM's as the end. If you reload them elsewhere, then it's a memory leak as you only free them if the axe was found. If they aren't reloaded, then it will cause access violation next loop through. Yes, I've already fixed this.

Cut_WhileChopping
Don't see the need for the if S_LevelUp then continue; The idea of that was the check if the character gained a level, and if so, then continue cutting.

Cut_ChopTrees
After checking the up text, you get the position of the mouse. You then click, but you use 4, 4 for randomness for Mouse, which means it'll move over after already stopping to check the up text, while it should be 0, 0. Okay, that actually explains a little. Thanks. :)

B_BankItems
More pointless exit's. I'll work on that.


Overall, not a bad script.
However, take out the DeclarePlayers, hatchet DTM declarations and progress report bits and the script is under 300 lines. It's short. I know, when Wizzup said that I replied and said that's why I was hesitant to apply in the first place… it's further up in the page if you want to know the whole thing. I don't think it shows any real skill - it all seems like it could of just come out of a tutorial. Also, I don't think it was actually ever run except to check for compiling as the hatchet DTM problem should've become apparent. What problem? And I've tested it many times and it finds the axe without any trouble, not matter which kind it is. Do you think I would apply with a script that I didn't test to see if worked? Sorry if that seems bitter, but I find that kind of insulting. It shouldn't be enough that it is good, it should be able to show every trick the scripter knows. If this is the extent of skill and knowledge, then it's trailing behind. I already have a lot of different things I've thought of to improve this. When Wizzup said he doubted I wrote this, I didn't really like that so I started reading a bunch of TUTs, and I've picked up a few new things.


Comments are all in red. :)

Thanks a lot for your input mix, I'll work on improving the little things asap. Thanks. :D

EDIT: On the note that this script is pretty short - I would like to know why it needs to be longer? It's only a Draynor Willow Cutter and Banker. I mean I could add in Autoresponders and a Deathwalk and things like that, but IMO it is not needed.

EDIT2: Scratch the first EDIT, I just realized the length is not about the needless additions to the script, it's to show a broader knowledge of SCAR. :o

mixster

2009-06-22 00:09:16

Like I said - it needs to be long enough to show what skills and knowledge you have. If the whole of what you know in regards to scripting can fit into such a small space, then it puts doubts in my mind.

I also find it insulting that you doubt what I say. You free the DTM's if you find the DTM in Cut_FindHatchet, but you only set it on startup, in F_Setup. Unless you have posted an old version, I am sure that it will give an error. If it doesn't, then it's because the DTM's don't work and so don't find the axe and so doesn't chop anything.

Coh3n

2009-06-22 00:30:18

From: mixster
I also find it insulting that you doubt what I say. You free the DTM's if you find the DTM in Cut_FindHatchet, but you only set it on startup, in F_Setup. Unless you have posted an old version, I am sure that it will give an error. If it doesn't, then it's because the DTM's don't work and so don't find the axe and so doesn't chop anything.


I'm don't want to doubt what you're saying, and I don't want to say you're wrong, but let me explain what I just did.

I copied and pasted the exact script that is in my application, and ran it. It found the hatched without problems and ran to the trees and started cutting. Now, unless there's something wrong in my code that makes it say that it found the hatchet every time no matter what, then it seems to be working fine.

Sorry to argue with you, but it's working for me. :o

mixster

2009-06-22 00:37:20

So you didn't test for multiple loops (2 players)?
Error would occur on second run through since it unloads them after searching, so would have to wait until next axe check, which would be when the next player comes up.

Nava2

2009-06-22 00:42:02

From: mixster
So you didn't test for multiple loops (2 players)?
Error would occur on second run through since it unloads them after searching, so would have to wait until next axe check, which would be when the next player comes up.


To end the bickering..

Coh3n this is the issue I told you about before.. :D

mixster is definitely right. You need to reload the hatchets if you are going to use another player.

Coh3n

2009-06-22 00:42:10

From: mixster
So you didn't test for multiple loops (2 players)?
Error would occur on second run through since it unloads them after searching, so would have to wait until next axe check, which would be when the next player comes up.


Ohh, no I didn't as I only have one account to test on. That's all you had to say. :p

Now I get what your saying. I was just really confused cause it was working for me, and I know that you know what your talking about, but that clears it up. I'll work on it right away. Thanks. :)

From: Nava2
To end the bickering..

Coh3n this is the issue I told you about before.. :D


Lol definitely don't remember you telling me that. :p But I'm sure you did. XD

From: Nava2
mixster is definitely right. You need to reload the hatchets if you are going to use another player.


That is a much simpler way of saying that, thanks. :)

Goobs

2009-06-22 07:09:55

I'm not gonna vote on this, since I've only recently become a Member myself. But, I would like to say congratulations! 21-3 at the time of posting. Not bad =D. I would have liked to see something new and unusual (which is probably going to be the bulk of the scripts that I write), but I suppose a Chopper isn't that bad.

Your script shows a decent concept of SCAR scripting. You have a good attitude, and accepted most criticism without question. IMO, if you practice, and stay focused, you could greatly assist in the furthering of SRL. Once again, Congratulation on your Membership. :D

Coh3n

2009-06-22 07:15:18

From: ProphesyOfWolf
I'm not gonna vote on this, since I've only recently become a Member myself. But, I would like to say congratulations! 21-3 at the time of posting. Not bad =D. I would have liked to see something new and unusual (which is probably going to be the bulk of the scripts that I write), but I suppose a Chopper isn't that bad.

Your script shows a decent concept of SCAR scripting. You have a good attitude, and accepted most criticism without question. IMO, if you practice, and stay focused, you could greatly assist in the furthering of SRL. Once again, Congratulation on your Membership. :D


Thank you very much! :) I agree 100% on your new and unusual part. To be honest, this was the first script that came to mind that I thought I would actually be able to use myself, so I just started away.

Before I work on another script I want to make this one really, really good (I've already started making tweaks and improving it). For my next script, I want to try and make one that isn't very popular, or one that hasn't been made at all (I have one good idea IMO, however, it is members and I don't have a members account at the moment to test). I'm pretty sure the idea I have has never been done before, so I'm hoping I'll be able to do that one with great success.

Thanks a lot for for compliments, I look forward to being an SRL Member. :)

Home

2009-06-23 12:25:14

From: N1ke!
I keep it short, as always ;)

Nice guy, willing to learn and script is ok.
Yes.

Yes!

Macro_FTW

2009-06-23 19:42:56

Looking at what others have posted, they've covered everything I wanted to say.

Yes. :D

Nava2

2009-06-23 19:52:42

From: Macro_FTW
Looking at what others have posted, they've covered everything I wanted to say.

Yes. :D


You should read the stickies in this section ;)

Technically, you shouldn't vote.. but I guess it can slide this time…

Macro_FTW

2009-06-23 20:00:38

XD. I see. Sorry about that.

I'll stalk the applications for a few weeks then, to see how people rate scripts.

…and ensure to read the stickies more often.

Coh3n

2009-06-23 20:02:11

From: Home
Yes!


Thanks! :D

From: Macro_FTW
XD. I see. Sorry about that.

I'll stalk the applications for a few weeks then, to see how people rate scripts.

…and ensure to read the stickies more often.


Haha who cares, you voted yes! :p I'm fine with it. :p Thanks. :)

Coh3n

2009-06-25 05:18:43

Sorry for the double post, but I was just wondering how long I have to wait before I actually get/not get in?

JPHamlett

2009-06-25 07:01:48

From: Coh3n
Sorry for the double post, but I was just wondering how long I have to wait before I actually get/not get in?


This poll will close on 07-03-2009 at 12:11 AM

Coh3n

2009-06-25 07:43:27

From: J_Pizzle
This poll will close on 07-03-2009 at 12:11 AM


Wow, that long? Alrighty then, guess I'll have to wait. :(

Thanks, J_Pizzle. :)

Brain

2009-06-25 07:47:15

depends on when a mod/admin comes along and deems that you have a big enough vote margin to get in.

Coh3n

2009-06-25 07:48:15

From: Brain
depends on when a mod/admin comes along and deems that you have a big enough vote margin to get in.


Ohh, okay, thanks a lot. :)

Macro_FTW

2009-06-25 08:25:59

From: Coh3n
Ohh, okay, thanks a lot. :)


*hint* 27-3 is nowhere near big enough of a vote margin. ;) */hint*

[ontopic] Good luck getting in! :D[/ontopic]

Coh3n

2009-06-25 18:29:39

From: Macro_FTW
*hint* 27-3 is nowhere near big enough of a vote margin. ;) */hint*

[ontopic] Good luck getting in! :D[/ontopic]


Thanks, and it's not? :o But I guess I've never seen other applications so I wouldn't know.

Dynamite

2009-06-26 20:50:42

He was joking.. I hope.
I think you will get in.
But just wait till a Admin comes along ;)

T~M

Coh3n

2009-06-26 22:26:16

From: The Man
He was joking.. I hope.
I think you will get in.
But just wait till a Admin comes along ;)

T~M


Yeah, lol, that's what Nava said too. >.>

Hopefully one comes around soon. :p

Coh3n

2009-06-27 05:48:31

From: Trevor3443
Voted yes because. I rarely come on here. and to further solidify, now 30 to 3.


Lol, well thank you very much! :D

Hobbit

2009-06-27 09:50:31

IN!

Welcome :)

Nava2

2009-06-27 09:50:42

gratz in b4 lock

Macro_FTW

2009-06-27 09:51:43

Congrats inb4lock

R0b0t1

2009-06-27 09:52:52

No.

ZephyrsFury

2009-06-27 09:54:24

From: nava2
gratz in b4 lock


From: macro_ftw
congrats inb4lock


From: r0b0t1
no.


fail.