SRL Archive - Archive

The Man - SRL Member Application


Dynamite

2009-05-16 15:33:26

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


Are you affilated in anyway with Jagex LTD?
no

Were you Referred to SRL?



What is your general programming knowledge?
I only know SRL


Are you a member of any other communities?
I go on RsBot a tiny bit. Just to go and help people


Tell us about yourself…
From: The Man
Hi my name is Senna, I was born in London but moved to Southampton (UK).
I used to ride motorbikes but gave up to play full time football, 6 days a week. I am 14, I love SRL because of the community and ease of script and editing.
Also i love helping people any way i can and i love people asking me :)



Please show us one (or multiple) of your scripts.
{==============================================================================]
[ [SRL]4 ]
[ ]
[ ]
[ NAME : Destiful Woodcutter ]
[ WRITER : The Man ]
[ CATEGORY : Woodcutting ]
[ DESCRIPTION : ]
[ ]
[==============================================================================]
[ Instructions: Be at Draynor bank. Fill out form, then run. ]
[==============================================================================}

{=========================Records & Vars DONT TOUCH!===========================}
program DestifulCutter;
{$DEFINE SMART} //Comment out to remove SMART

{$IFDEF SMART}
{.include srl/srl/misc/smart.scar}
{$ENDIF}

{.include SRL/SRL.scar}
{.include srl/srl/misc/debug.scar}
{.include SRL/SRL/Misc/Users.scar}

const
Rockcolour = 379494;
StartPlayer = 0;



var
x, y, RockDTM, LevelUps, WillowsDTM:integer;




procedure DeclarePlayers;
begin
SRLPlayerForm(True, [], [], ['Pin'], []);
end;

procedure SetLoc(s: String);
begin
Players[CurrentPlayer].Loc := s;
end;

function PlayerLoc: String;
begin
Result := Players[CurrentPlayer].Loc;
end;


function CountNPCs(var NPA: T2DPointArray): Integer;
var
NPC: array of TPoint;
begin
FindColorsSpiralTolerance(MMCX, MMY2, NPC, 62965, MMX1, MMY1, MMX2, MMY2, 5);
NPA := TPAtoATPA(NPC, 2);
Result := Length(NPA);
end;


function LevelUp : Boolean; //Thanks Wizzup?
var
Lev : Integer;
begin
Result := FindNPCChatText('gratu', Nothing) or
FindNPCChatText('atio', Nothing);
if Result then
begin
while ClickContinue(True, True) do
Wait(500 + Random(250));
WriteLn(Players[CurrentPlayer].Name + ' leveled up');
Lev:= GetSkillInfo('woodcutting', False);
WriteLn(Players[CurrentPlayer].Name + '''s woodcutting level is now ' + IntToStr(Lev));
LevelUps:= LevelUps + 1;
end;
end;

procedure LoadDTMs(Load : TStringArray);
var I : Integer;
begin
for I:= 0 to High(Load) do
case Load[i] of
Axe : AxeDTM := DTMFromString('78DA63AC616160F8C480023AD38518FE03694' +
'620FE0F048C9D40356F19D000231209A46B816A5E1050530A54F3' +
'9F809A2AA09ADF04D43402D5BCC4AF06008D550EC3');
Rock : RockDTM := DTMFromString('78DA636467606060614001DE41DE609A11CA6' +
'7E40212ACA86A748D7550D5F00009765435663616986A38099803' +
'92E726A086950873406AD8F0AB0100821404CC');
Willows : WillowsDTM := DTMFromString('78DA63B461666098C2C8800C023D65C1344C9' +
'4D108A8A617558DB38D04AA1A17A09A2E22D44C465563612C82AA' +
'C603A86616AA1A3B73315435A640350B50D514653A62BA790EAA9' +
'A8820235435BA4035B351D524475BA0AAD1C30C1F0F0729143500' +
'EE1C0DF9');
Bank : DB := DTMFromString('78DA636C67626008644001FFFFFD63F80FA41' +
'9416C2060AC01AAF182C8B140D5FCF9C304A619A17CB09A204C35' +
'22E86AC2F09B0300F8811153');
end;
end;

procedure FreeDTMs(Free : TStringArray);
var I : Integer;
begin for I:= 0 to High(Free) do
case Free[i] of
Axe : FreeDTM(AxeDTM);
Rock : FreeDTM(RockDTM);
Willows : FreeDTM(WillowsDTM);
Bank : DB := FreeDTM(DB);
end;
end;
procedure GRockDTM
var
MaxTol, i, T, D, C: Integer;

begin
MaxTol := 55;
C := FindRockColor;
LoadDTMs([Rock]);
repeat
IncEx(T, 10);
Writeln(IntToStr(T));
if DTMRotated(D, Result.x, Result.y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln('Found');
Break;
end;
FreeDTMs([Rock]);
until(T >= MaxTol);
end;

function DepositWillows: Boolean;
var
AxeDTM, x, y, i: Integer;
InvItems: boolean;
T: TBox;
begin
LoadDTMs([Axe])
if InvCount > 0 then
OpenBank('db', True, True)
else Exit;
if PinScreen then InPin(Players[CurrentPlayer].Strings[0]);
if BankScreen then
begin
for i := 1 to 28 do
begin
T := InvBox(i);
if not FindDTM(AxeDTM, x, y, T.x1, T.y1, T.x2, T.y2) and ExistsItem(i) then
begin
MouseItem(i, False);
Wait(RandomRange(500, 1000));
case Random(3) of
0..1: ChooseOption('eposit-All');
2: begin
ChooseOption('eposit-X');
Wait(RandomRange(500, 1000));
TypeSend(IntToStr(RandomRange(30, 100)));
end;
end;
Wait(2000+random(2000));
Result := not(InvFull);
if Result then SetLoc('WalkToWillows');
end;
end;
Result := True;
SetLoc('WalkToWillows');
end;
CloseBank;
finally
FreeDTMs([Axe]);
end;
end;

function WalkWillowRadial(XOffSet, YOffSet: Integer): TPoint;
var
TPA: TPointArray;
i, CTS: Integer;
ATPA: T2DPointArray;
TB: TBox;

begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
RadialWalkEx(TPA, MMCX, MMCY + 20, 1455939, 50, 200, 250, 50);
if Length(TPA) = 0 then Exit;
ATPA := SplitTPAEx(TPA, 20, 20);
SortATPAFrom(ATPA, Point(MMCX, MMCY));
TB := GetATPABounds(ATPA);
for i := 0 to High(TPA) do
if (PointInBox(TPA[i], TB)) then
begin
Result.x := ((TB.x1 + TB.x2) / 2) - XOffSet;
Result.y := ((TB.y1 + TB.y2) / 2) - YOffSet;
Break;
end;
ColorToleranceSpeed(CTS);
end;

procedure SetupScript;
var
s: String;

begin
MakeCompass('n');
SetAngle(True);
SetRun(GetMMLevels('run', s) > 0);
DepositWillows;
MakeCompass('n');
SetLoc('WalkToWillows');
end;

procedure AntiRandom;
begin
FindNormalRandoms;
end;

procedure Proggy;
var
i: Integer;
begin
writeln('Destiful Woodcutter');
writeln('Ran For: '+TimeRunning+'!');
for I := 0 to High(Players) do
begin
Writeln(IntToStr(Players[I].Integers[99]));
end;
end;

function PointSet(P: TPoint): Boolean;
begin
if (P.x <> 0) or (P.y <> 0) then Result := True;
end;

procedure ScriptTerminate;
begin
Proggy;
end;

function ToWillows: boolean;
var
u,x,y,m: Integer;
P: TPoint;

begin
if (not(loggedin)) then exit;
U := findwatercolor;
P := WalkWillowRadial(3, 3);
if (PointSet(P)) then
begin
Result := True;
Mouse(P.x, P.y, 3, 3, True);
AntiRandom;
Flag;
SetLoc('Chopping');
Exit;
end;
if (DTMRotated(RockDDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then // Found DDTM
begin
Result := True;
Mouse(x, y, 5, 5, True);
AntiRandom;
Flag;
SetLoc('Chopping');
Wait(RandomRange(100, 500));
Exit;
end;
if RadialWalk(FindRockColor, 160, 200, 60, -10, -10) then
Result := True
else
Result := RadialWalk(FindWaterColor, 260, 280, 40, 70, 5);
if Result then
begin
SetLoc('Chopping');
AntiRandom;
Exit;
end;
if Findsymbol(x,y,'fish') then
begin
M := GetColor(x - 20, y);
if M = U Then
begin
Mouse(x,y,5,5, true);
wait(250+random(250));
FFlag(10);
If Distance(mmcx,mmcy,x,y) < 7 then
begin
result := true;
SetLoc('Chopping');
AntiRandom;
Exit;
end;
end;
end;
end;

function Reposition: TPoint;
var
i, CTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
TB: TBox;

begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, 1455939, MMX1, MMY1, MMX2, MMY2, 50);
if Length(TPA) = 0 then Exit;
SortATPAFrom(ATPA, Point(MMCX, MMCY));
TB := GetATPABounds(ATPA);
for i := 0 to High(TPA) do
if (PointInBox(TPA[i], TB)) then
begin
Result.x := ((TB.x1 + TB.x2) / 2) - 2;
Result.y := ((TB.y1 + TB.y2) / 2) - 2;
Break;
end;
ColorToleranceSpeed(CTS);
end;

Procedure CountTheLogs;
var
Log: Byte;
LogDTM: Integer;
begin
if not LoggedIn then Exit;
GameTab(4);
LoadDTMs([Willows])
Log := CountItemsIn('inv', 'dtm', WillowsDTM, []);
Writeln('Got ' + IntToStr(Log) + ' logs this time.');
Players[currentplayer].integers[99] := Players[currentplayer].integers[99] + Log;
FreeDTMs([Willows])
end;

function Bank: Boolean;
var
DB, x, y, i, ii, Failsaves: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;

begin
Failsaves := 1;
for i := 0 to Failsaves do
begin
case i of
0:
begin
LoadDTMs([Bank])
if DTMRotated(DB, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Result := True;
Mouse(x, y, 3, 3, True);
Flag;
AntiRandom;
SetLoc('Bank');
Exit;
end;
finally
FreeDTMs([Bank]);
end;
end;
1:
begin
RadialWalkEx(TPA, MMCX, MMCY, 195836, 3, 360, 30, 30);
if Length(TPA) = 0 then Exit;
SortTPAFrom(TPA, Point(MMCX, MMCY));
ATPA := SplitTPAEx(TPA, 10, 10);
SortATPASize(ATPA, True);
MiddleTPAEx(ATPA[0], x, y);
Mouse(x, y, 3, 3, True);
Result := True;
AntiRandom;
Flag;
AntiRandom;
SetLoc('Bank');
Exit;
end;
end;
end;
end;


Procedure SetVar;
Begin
Players[CurrentPlayer].Strings[0] := Lowercase(Players[CurrentPlayer].Strings[0]);
End;

function FindWillow(var x, y: Integer): Boolean;
var
Colors: TIntegerArray;
I, A, M, curCTS, MX, MY: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;

begin
Result := False;
if (not(LoggedIn)) then exit;
curCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(3);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3233608, MSX1, MSY1, MSX2, MSY2, 2);
if Length(TPA) = 0 then Exit;
ColorToleranceSpeed(1);
ATPA := TPAtoATPAEx(TPA, 10, 10);
M := High(ATPA);
for A := 0 to M do
if MiddleTPAEx(ATPA[A], MX, MY) then
begin
MMouse(MX, MY, 6, 6);
Wait(100 + Random(50));
if IsUpText('illow') then
begin
Result := True;
GetMousePos(X, Y);
ColorToleranceSpeed(curCTS);
Exit;
end;
end;
ColorToleranceSpeed(curCTS);
end;

procedure AntiBanage;
begin
case Random(100) of
0: HoverSkill('woodcutting', false);
1: MakeCompass('random');
2: Wait(1000 + Random(200));
3: RandomMovement;
4: RandomRClick;
5: HoverSkill('random', false);
6: GameTab(RandomRange(1, 12));
else SleepAndMoveMouse(250+random(100));
end;
end;

function ChoppingLoop: Boolean;
var
T, x, y: Integer;
P: TPoint;
Colour: Integer;
begin
repeat
begin
AntiRandom;
MarkTime(T);
if FindWillow(x, y) then
begin
Mouse(x, y, 3, 3, False);
Wait(100+random(200));
if ChooseOption('hop') then
begin
Colour := GetColor(x, y - 5);
Wait(1000+random(2000));
while (SimilarColors(Colour, GetColor(x, y - 5), 4) and not(InvFull)) do
begin
MakeCompass('N');
Result := True;
AntiBanage;
Wait(100)
AntiRandom;
SleepAndMoveMouse(2500+random(100));
if TimeFromMark(T) >= 20000 then Break;
end;
end;
end;
end;
until(InvFull = True);
end;

procedure Responder; // Cheers R1ch great guy :D
var
HiChats, NoobChats, AutoChats, HiChatR, NoobChatR, AutoChatR, UpChats,
UpChatR, LevelChats, YesChats : TStringArray;
I, RL, R : Integer;

begin
if (not(LoggedIn)) then
begin
Players[CurrentPlayer].Active:= False;
Exit;
end;
HiChats:= ['hi', 'yo', 'sup', 'ello', 'wassup', 'll right', 'hey', 'hai'];
HiChatR:= ['hi', 'hello there', 'sup', 'yo', 'hello', 'hey', 'howdy', 'hai'];
NoobChats:= ['noob', 'froob', 'neeb', 'choob', 'loser', 'you are a'];
NoobChatR:= ['u are', 'you r', 'u r', 'i aint', 'how am i??', 'looked in the mirror lately?'];
AutoChats:= ['autoer', 'bot', 'auto', 'cheater', 'autoing', 'cheat'];
AutoChatR:= ['no im not', 'im not a bot', 'i dont cheat!', 'me?!', 'r u serious?!', 'bots can talk??'];
UpChats:= ['gratz', 'well done', 'congratulations', 'grats', 'congratz'];
UpChatR:= ['thanks', 'ty', 'thank you', 'thx', 'thanx'];
LevelChats:= ['wc lv', 'wcing lv', 'woodcutting lev', 'wc lev'];
YesChats:= ['Yes', 'Ye', 'Yeah', 'Yea', 'Yup', 'Uh huh', 'Yep'];

for I:= 0 to High(HiChats) do
begin
if InChat(HiChats[i]) then
TypeSend(HiChatR[i]);
R:= R + 1;
end;
for I:= 0 to High(NoobChats) do
begin
if InChat(NoobChats[i]) then
TypeSend(NoobChatR[i]);
R:= R + 1;
end;
for I:= 0 to High(AutoChats) do
begin
if InChat(AutoChats[i]) then
TypeSend(AutoChatR[i]);
R:= R + 1;
end;
if LevelUp then
begin
for I:= 0 to High(UpChats) do
begin
if InChat(UpChats[i]) then
TypeSend(UpChatR[i]);
R:= R + 1;
end;
end;
for I:= 0 to High(LevelChats) do
begin
if InChat(LevelChats[i]) then
begin
R:= R + 1;
RL:= GetSkillInfo('fishing', False);
case Random(10) of
0: TypeSend(IntToStr(RL));
1: TypeSend('lvl '+IntToStr(RL));
2: TypeSend(IntToStr(RL) + ' over here');
3: TypeSend('level '+IntToStr(RL));
4: TypeSend('I''m ' + IntToStr(RL) + 'fishing');
5: TypeSend('only ' + IntToStr(RL));
6: TypeSend('meh, only ' + IntToStr(RL));
7: begin
case Random(5) of
0: TypeSend('onky ' + IntToStr(RL));
1: TypeSend('omly ' + IntToStr(RL));
2: TypeSend('inly ' + IntToStr(RL));
3: TypeSend('onlu ' + IntToStr(RL));
4: TypeSend('om;y ' + IntToStr(RL));
end;
case Random(5) of
0: TypeSend('only*');
1: TypeSend('*only');
2: TypeSend('Sorry, *only');
3: TypeSend('I meant "only"');
4: TypeSend('*only ' + IntToStr(RL));
end;
end;
8: case Random(3) of
0: TypeSend('My wcing is ' + IntToStr(RL));
1: TypeSend('My woodcutting is ' + IntToStr(RL) + '...8-)');
2: TypeSend('It''s ' + IntToStr(RL));
end;
9: begin
TypeSend('Me?');
Wait(2500 + Random(1500));
for I:= 0 to High(YesChats) do
if InChat(YesChats[i]) then
TypeSend(IntToStr(RL));
end;
end;
end;
end;
end;

procedure SetupMain;
begin
cleardebug;
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
setupsrl;
ScriptID := '1058';
mousespeed := 13; // to fast. 13 is better
declareplayers;
activateclient;
wait(500);
end;

begin
SetupMain;
{$IFDEF SMART}
smartsetupex(16, false, true, false);
settargetdc(smartgetdc);
{$ENDIF}
if (not (LoggedIn)) then
begin
Loginplayer;
setangle(true);
Wait(500 + random(30))
SetChat('on', 1);
SetChat('friends', 2);
SetChat('off', 3);
end;
SetupScript;
repeat
if not (loggedIn) then
begin
nextplayer(false);
SetupScript;
end;
if PlayerLoc = 'WalkToWillows' then
if ToWillows then Continue;

if PlayerLoc = 'Chopping' then
ChoppingLoop;

if PlayerLoc = 'LoadDone' then
if Bank then Continue;

if PlayerLoc = 'Bank' then
if DepositWillows then Continue;

Until(AllPlayersInactive = True);
Proggy;
end.

jakeyboy29

2009-05-16 15:37:31

YES. the script isent great, but shows some advanced scripting. also you have a great atitude and help lots of ppl. good luck

Dynamite

2009-05-16 15:39:21

Thank you, what can i improve :) ?

T~M

Sir R. M8gic1an

2009-05-16 15:39:36

Before anyone says anything abouthis proggy, Destiful = The Man.

~RM

Floor66

2009-05-16 15:41:49

Yes.
Script is OK, but your personality makes up for it. You are a really nice guy, not pushy, not whiny, your attitude is excellent.

Dynamite

2009-05-16 15:42:37

From: Floor66
Yes.
Script is OK, but your personality makes up for it. You are a really nice guy, not pushy, not whiny, your attitude is excellent.


:) thank you, i really try to help and be as nice as possible to people :)

T~M

Rich

2009-05-16 16:36:23

I'm not going to vote on this, as I'm just going to watch how the process works.

senrath

2009-05-16 16:40:13

From just glancing over it, it seems to be a decent enough script. The only real problem I see is that you use a DDTM (RockDDTM) when you could be using a DTM. DDTMs are only useful if you are using either an autocolor or are adjusting the tolerance mid-run. It's not a big deal, but it does use up more resources to do it with a DDTM than a DTM.

Also, out of curiosity, do you know any other languages? Because a lot of your procedures smack of a more object oriented language, such as Java or C++.

Edit: Oh, yeah, I voted yes. Good luck to you.

Dynamite

2009-05-16 16:41:34

I do know a bit of java, not loads though.

T~M

EDIT: Thank you Senrath :)

Laur€ns

2009-05-16 16:58:03

{$DEFINE} and stuff.. Could be easier with a const UseSmart = True; but that's all. 6 times a T2DPointArray. Gah, I don't even know how to use it.. So it should be good.
Yes.

Sir R. M8gic1an

2009-05-16 17:18:00

i voted no, because although you are a great guy, and know your way around wizzypluggin, you obviously don't know your basics.


procedure DeclarePlayers;
begin
SRLPlayerForm(True, [], [], ['Pin'], []);
end;

procedure SetLoc(s: String);
begin
Players[CurrentPlayer].Loc := s;
end;

function PlayerLoc: String;
begin
Result := Players[CurrentPlayer].Loc;
end;

procedure AntiRandom;
begin
FindNormalRandoms; //no fighting antirandoms?
end;

Procedure SetVar;
Begin
Players[CurrentPlayer].Strings[0] := Lowercase(Players[CurrentPlayer].Strings[0]);
End;

One line functions? No use for them. just call that very same line.

Procedure CountTheLogs, Function Bank: don't free your DTMs? and you load them everytime you call the function?! memory leak !

repeat
begin

no begin after repeat…

procedure SetupMain;
begin
cleardebug;
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');


you already cleared the debug. why all those spaces? Also, loop?


if PlayerLoc = 'WalkToWillows' then
if ToWillows then Continue;

if PlayerLoc = 'Chopping' then
ChoppingLoop;

if PlayerLoc = 'LoadDone' then
if Bank then Continue;

if PlayerLoc = 'Bank' then
if DepositWillows then Continue;

case?


As i said, you seem to know your way around wizzypluggin, which can be impressive, but i think that some absolutely basic things you just don't know :s

~RM

Dynamite

2009-05-16 17:20:25

From: Rasta Magician
i voted no, because although you are a great guy, and know your way around wizzypluggin, you obviously don't know your basics.


procedure DeclarePlayers;
begin
SRLPlayerForm(True, [], [], ['Pin'], []);
end;

procedure SetLoc(s: String);
begin
Players[CurrentPlayer].Loc := s;
end;

function PlayerLoc: String;
begin
Result := Players[CurrentPlayer].Loc;
end;

procedure AntiRandom;
begin
FindNormalRandoms; //no fighting antirandoms?
end;

Procedure SetVar;
Begin
Players[CurrentPlayer].Strings[0] := Lowercase(Players[CurrentPlayer].Strings[0]);
End;

One line functions? No use for them. just call that very same line.

Procedure CountTheLogs, Function Bank: don't free your DTMs? and you load them everytime you call the function?! memory leak !

repeat
begin

no begin after repeat…

procedure SetupMain;
begin
cleardebug;
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');


you already cleared the debug. why all those spaces? Also, loop?


if PlayerLoc = 'WalkToWillows' then
if ToWillows then Continue;

if PlayerLoc = 'Chopping' then
ChoppingLoop;

if PlayerLoc = 'LoadDone' then
if Bank then Continue;

if PlayerLoc = 'Bank' then
if DepositWillows then Continue;

case?


As i said, you seem to know your way around wizzypluggin, which can be impressive, but i think that some absolutely basic things you just don't know :s

~RM


Ok thank you, i will work on improving basics :)
Thank you very much on feedback

T~M

marpis

2009-05-16 17:32:11

I say yes :)
you have nice ideas there on your walking!
but i think your responder can answer multiple times to one question?

Dynamite

2009-05-16 17:32:49

oh ok. Thank you for feedback, will update now :)

T~M

NiCbaZ

2009-05-16 17:40:17

Why do you have DDTM, afaik you don't use dynamicly?

Dynamite

2009-05-16 18:28:45

I edited the DDTM, would it be better with just a simple DTM then?

T~M

senrath

2009-05-16 18:32:05

Yes. Since you're using a static color with tolerance, and you're never changing the tolerance, it's better to use a regular DTM.

Dynamite

2009-05-16 18:32:58

Oh ok, should i do that now? or does it not matter?

T~M

senrath

2009-05-16 18:34:42

I would, since I can't make heads nor tails of what you were trying to do with your edit to RockDDTM.

Dynamite

2009-05-16 18:35:48

Ok, i will do later on, i have to sleep and eat.

T~M

noidea

2009-05-16 19:06:04

It would be simpolist to RadialWalk to the Rock ;)
I vote yes.

Dervish

2009-05-16 19:09:51

I forgot alot about SRL and scripting, but you seem to be a nice guy and to have knowledge.

So I'm voting yes.

And for the Red and Green messages ToF is missing :

Yes NoYes NoYes No

NCDS

2009-05-16 20:06:27

This is not a bad App at all but like RM said, your lacking some basic's.

Just as everyone else has already said, You do have an excellent attitude from what I can tell..

Don't be afraid to update your members app script with what people tell you. It can only help.

I'm going to hold my vote for now.

Good Luck!

Quickmarch

2009-05-16 20:14:31

Yes from me. We've had some good chats on msn and your attitude is great, DDTMs (although you could of used a static one :p), TPAs, etc. :)

Dynamite

2009-05-16 20:39:46

Ok i put a DTM in instead of DDTM, I also got rid of some stuff that i didnt need to make script go faster

T~M

EDIT: RM for freeing and loading the DTMs should i have a function that loads the DTMs then in the actual function (bank) have at the end freeDTM(blahDTM)

XcanadamanX

2009-05-16 21:41:49

function GRockDTM :TPoint;
var
MaxTol, i, T, D, C: Integer;

begin
MaxTol := 55;
C := FindRockColor;
repeat
IncEx(T, 10);
Writeln(IntToStr(T));
RockDTM := DTMFromString('78DA636467606060614001DE41DE609A11CA6' +
'7E40212ACA86A748D7550D5F00009765435663616986A38099803' +
'92E726A086950873406AD8F0AB0100821404CC');
if DTMRotated(D, Result.x, Result.y, MMX1, MMY1, MMX2, MMY2) then
begin
FreeDTM(D);
Writeln('Found');
Break;
end;
FreeDTM(D);
until(T >= MaxTol);
end;

Move the DTM out of the repeat (before) and only have one FreeDTM at the very end of the function.

Edit: why is it a function….there is no result?!?!

Rich

2009-05-16 21:47:04

Use cases for loading and freeing your DTMs. Like this:
procedure LoadDTMs(Load : TStringArray);
var
I : Integer;

begin
for I:= 0 to High(Load) do
case Load[I] of
Axe : AxeDTM := DTMFromString('bla!');
Rock : RockDTM := DTMFromString('bla!');
Willows : WillowsDTM := DTMFromString('bla!');
Bank : DB := DTMFromString('bla!');
end;
end;

procedure FreeDTMs(Free : TStringArray);
var
I : Integer;

begin
for I:= 0 to High(Free) do
case Free[I] of
Axe : FreeDTM(AxeDTM);
Rock : FreeDTM(RockDTM);
Willows : FreeDTM(WillowsDTM);
Bank : DB := FreeDTM(DB);
end;
end;


Richard

Dynamite

2009-05-16 21:47:15

From: XcanadamanX
function GRockDTM :TPoint;
var
MaxTol, i, T, D, C: Integer;

begin
MaxTol := 55;
C := FindRockColor;
repeat
IncEx(T, 10);
Writeln(IntToStr(T));
RockDTM := DTMFromString('78DA636467606060614001DE41DE609A11CA6' +
'7E40212ACA86A748D7550D5F00009765435663616986A38099803' +
'92E726A086950873406AD8F0AB0100821404CC');
if DTMRotated(D, Result.x, Result.y, MMX1, MMY1, MMX2, MMY2) then
begin
FreeDTM(D);
Writeln('Found');
Break;
end;
FreeDTM(D);
until(T >= MaxTol);
end;

Move the DTM out of the repeat (before) and only have one FreeDTM at the very end of the function.

Edit: why is it a function….there is no result?!?!


Ok thank you, i have edited now, thank you for feedback :)

T~M

EDIT: OK thank you R1ch, they are procedures right?

XcanadamanX

2009-05-16 21:50:11

you have to take the :Tpoint; away from the function for the script to compile

Dynamite

2009-05-16 21:51:54

From: XcanadamanX
you have to take the :Tpoint; away from the function for the script to compile


oh yeh sorry :(

T~M

Rich

2009-05-16 21:53:05

From: The Man
EDIT: OK thank you R1ch, they are procedures right?


Yep, the are the procedures which you would place somewhere in your script. To use them, they would be used something like
LoadDTMs([Axe, Willows]);
FreeDTMs([Axe, Willows]);

I think you get it. Oh yeah, and you must only free DTMs that are currently loaded, or you will get an access violation error.

Richard

Nadeem

2009-05-16 22:09:08

Yay you finally applied! :) YES from me! Your very active + know how to use SRL OK. Thought what RM said is true, that may need a bit of tweaking, although I guess it can be considered somewhat of a personal choice ;)



~NS

Dynamite

2009-05-16 22:17:18

Ok i updated again, i understand it all, and it seems a lot better :)

T~M

Thank you Nadeem ;)

footballjds

2009-05-16 22:30:36

From: Rasta Magician
i voted no, because although you are a great guy, and know your way around wizzypluggin, you obviously don't know your basics.


procedure DeclarePlayers;
begin
SRLPlayerForm(True, [], [], ['Pin'], []);
end;

procedure SetLoc(s: String);
begin
Players[CurrentPlayer].Loc := s;
end;

function PlayerLoc: String;
begin
Result := Players[CurrentPlayer].Loc;
end;

procedure AntiRandom;
begin
FindNormalRandoms; //no fighting antirandoms?
end;

Procedure SetVar;
Begin
Players[CurrentPlayer].Strings[0] := Lowercase(Players[CurrentPlayer].Strings[0]);
End;

One line functions? No use for them. just call that very same line.

Procedure CountTheLogs, Function Bank: don't free your DTMs? and you load them everytime you call the function?! memory leak !

repeat
begin

no begin after repeat…

procedure SetupMain;
begin
cleardebug;
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');
writeln('');


you already cleared the debug. why all those spaces? Also, loop?


if PlayerLoc = 'WalkToWillows' then
if ToWillows then Continue;

if PlayerLoc = 'Chopping' then
ChoppingLoop;

if PlayerLoc = 'LoadDone' then
if Bank then Continue;

if PlayerLoc = 'Bank' then
if DepositWillows then Continue;

case?


As i said, you seem to know your way around wizzypluggin, which can be impressive, but i think that some absolutely basic things you just don't know :s

~RM


even though ur a great guy, we can't vote solely based on ur attitude though :rolleyes: , i had to vote no for the same reasons at RM

d/w though, ull still get in cause everyone loves u :D:eek:

Dynamite

2009-05-16 22:33:52

From: footballjds
even though ur a great guy, we can't vote solely based on ur attitude though :rolleyes: , i had to vote no for the same reasons at RM

d/w though, ull still get in cause everyone loves u :D:eek:


ok thank you :)

T~M

Naum

2009-05-16 22:35:02

Yes! Try using AddMistakes. It makes it seems more human-like.

Rich

2009-05-16 22:36:57

Hehe, that was my fault. He "borrowed" the responder from me, and I had completely forgotten about AddMistakes when I was making it. I'll take the blame for that. :)

Richard

Dynamite

2009-05-16 22:40:05

no completely my fault, i should have looked through before i use someone elses, sorry :(

T~M

WT-Fakawi

2009-05-17 00:36:02

In.