SRL Archive - Archive

Dark Arcana - SRL Member Application


Dark Arcana

2009-04-20 09:49:02

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 know Visual Basic and Scar.


Are you a member of any other communities?
No I am not member of any other community


Tell us about yourself…
From: Dark Arcana
My realy name is Daniel, I am 12 years old, I like playing sport, and love learning new things.



Please give show us one of your scripts.
program Da_Willow_Crusher;

{.Include SRL/SRL/Misc/Smart.Scar}
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Misc/Users.Scar}
{.Include SRL/SRL/Misc/Trade.Scar}


var
x, y, LoadsDone, TotalLoads, Responded, Lvls, Bank,
Trades, i, TotalWillows, AntiBans, NestsFound, Willow: integer;


const
YourSRLID = ''; // Your SRL ID
YourSRLPass = ''; // Your SRL Pass



procedure Sig;
begin
ClearDebug;
Writeln('________ ____ _____ ');
Wait(500);
Writeln('\______ \ _____ _______| | __ / _ \_______ ____ _____ ____ _____');
Wait(500);
Writeln(' | | \\__ \\_ __ \ |/ / / /_\ \_ __ \_/ ___\\__ \ / \\__ \');
Wait(500);
Writeln(' | ` \/ __ \| | \/ < / | \ | \/\ \___ / __ \| | \/ __ \');
wait(500);
Writeln('/_______ (____ /__| |__|_ \ \____|__ /__| \___ >____ /___| (___ /');
Wait(500);
Writeln(' \/ \/ \/ \/ \/ \/ \/ \/ ');
Wait(500);
Writeln(' Dark Arcana ');
Wait(500);
end;


procedure SetUpPlayer;
begin
if not (LoggedIn) then
LogInPlayer;
if LoggedIn then
begin
SetAngle(True);
SetRun(True);
SetChat('On', 1);
SetChat('Off', 2);
Wait(500 + Random(500));
Players[CurrentPlayer].integers[2] := GetSkillInfo('Woodcutting', False);
WriteLn('Players Woodcutting level is ' + IntToStr(Players[CurrentPlayer].integers[2]));
Gametab(4);
end;
end;


function SearchBirdsNest: Boolean; //Credits to Deathscytex for this

var
CTS, I, X, Y: Integer;
NestATPA: T2DPointArray;
NestTPA: TPointArray;
Nest: TPoint;
Timer: LongInt;

begin
if (FindText(x, y, 'nest falls', SmallChars, 0, 400, 495, 460)) then
begin
MarkTime(Timer);
repeat
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
X := MSCX;
Y := MSCY;
FindColorsSpiralTolerance(X, Y, NestTPA, 3952984, MSCX - 100, MSCY - 100, MSCX + 100, MSCY + 100, 15);
NestATPA := TPAtoATPAEx(NestTPA, 5, 5);
for I := 0 to Length(NestATPA) - 1 do
begin
if (TimeFromMark(Timer) >= (10000)) then
Exit;
Nest := MIddleTPA(NestATPA[I]);
X := 0;
Y := 0;
MMouse(Nest.X, Nest.Y, 5, 5);
Wait(250);
if (IsUpText('ird')) then
begin
Mouse(Nest.X, Nest.Y, 5, 5, True);
Result := True;
Inc(NestsFound);
ReportVars[4] := ReportVars[4] + 1;
Wait(250 + Random(150));
Writeln('We Have Found a Bird Nest!');
case (Random(8)) of
0: TypeSend('Found a Birds nest');
1: TypeSend('Cool, I got a bird nest.');
2: TypeSend('Sweet, Found a nest');
3: TypeSend('Yay, a bird nest');
4: TypeSend('Whew, got a nest.');
end;
Exit;
end;
end;
until (TimeFromMark(Timer) >= (10000)) or (Result);
Exit;
end else
Exit;
end;


procedure PlayerForm;
begin
SRLPlayerForm(True, ['Is Axe Wielded?', 'Use Responder?'], ['Pin Number?', 'Loads Each Player?'], [], []);
end;


function LevelUp: Boolean;
begin
Result := FindNPCChatText('gratu', Nothing);
if not Result then
Result := FindNPCChatText('atio', Nothing);
if Result then
begin
while ClickContinue(True, True) do
Wait(500);
Writeln(' We have lvled up!');
Inc(Lvls);
end;
end;


procedure AutoTrader;
begin
if (SomeoneTrades) then
begin
AcceptTrade;
Wait(4000 + random(1000));
Decline;
Inc(Trades);
case Random(4) of
0: Typesend('go away');
1: Typesend('go trade with someone else');
2: TypeSend('leave me alone');
3: TypeSend('No thank you');
end;
end;
end;


function InChatArr(Text: array of string): Boolean;

var
I, H: integer;
s: string;

begin
H := High(Text);
if (not (GetLastChatText(s))) then
LastChatter(s);
for I := 0 to H do
begin
if (Pos(Lowercase(Text[i]), (Lowercase(s))) > 0) then
begin
Result := true;
Exit;
end;
end;
end;


procedure Responder;

var
Question, Thanking: TStringArray;
S: Integer;

begin
if not (Players[CurrentPlayer].Booleans[1]) then
Exit;
Question := ['cut', 'wc', 'lvl', 'cutting lvl', 'wood', 'lvls', 'oodc'];
for I := 0 to 8 do
begin
if InChatArr(Question) then
begin
inc(Responded);
S := GetSkillInfo('Woodcutting', False);
case Random(8) of
0: TypeSend('only ' + IntToStr(S));
1: TypeSend(IntToStr(S));
2: TypeSend((IntToStr(S)) + ' you?');
3: TypeSend(IntToStr(S) + ' lol');
4: TypeSend((IntToStr(S)) + ' here');
5: TypeSend('only ' + IntToStr(S));
8: TypeSend('Nearly ' + IntToStr(S + 1));
7: begin
TypeSend('only ' + IntToStr(S + 1));
Wait(500 + random(500));
TypeSend('I mean ' + IntToStr(S));
end;
end;
Wait(1000 + Random(500));
end;
Thanking := ['nice', 'cool', 'awesome', 'sweet', 'good', 'kool'];
for I := 0 to 8 do
begin
if InChatArr(Thanking) then
begin
inc(Responded);
case Random(4) of
0: TypeSend('thx');
1: TypeSend('thank you');
2: TypeSend('ty');
3: TypeSend('thanks');
end;
end;
for I := 0 to 8 do
begin
if InChatArr([Players[CurrentPlayer].Nick]) then
begin
Inc(Responded);
case Random(4) of
0: Typesend('What do you want');
1: Typesend('im busy');
2: Typesend('Leave me alone...');
3: Typesend('Go away');
end;
end;
end;
end;
end;
end;


procedure FindRandoms;
begin
LampSkill := 'runecrafting';
FindNormalRandoms;
if FindFight then
RunAway('N', True, 1, 15000);
end;


procedure ProgressReport;
begin
ClearDebug;
WriteLn('***************************************************');
WriteLn('* Da Willow Crusher *');
WriteLn('***************************************************');
WriteLn('* Been Crushing for | ' + TimeRunning);
Writeln('* Gained | ' + IntToStr(Lvls) + ' Levels');
WriteLn('* Did | ' + IntToStr(TotalLoads) + ' Loads');
WriteLn('* Crushed | ' + IntToStr(TotalWillows) + ' Willows');
Writeln('* Responded | ' + IntToStr(Responded) + ' Times');
Writeln('* Performed | ' + IntToStr(AntiBans) + ' AntiBans');
Writeln('* Traded | ' + IntToStr(Trades) + ' Times');
Writeln('* Found | ' + IntTOStr(NestsFound) + ' Bird Nests');
WriteLn('* Gained | ' + IntToStr(TotalWillows * 68) + ' Exps');
WriteLn('***************************************************');
Writeln(' Thank you for using my script ^-^ ');
Writeln('***************************************************');
SendSRLReport;
SRLRandomsReport;
end;


procedure AntiBan;
begin
if (not (LoggedIn)) then
Exit;
case Random(10) of
0:
begin
HoverSkill('woodcutting', false);
Wait(100 + Random(200));
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
end;
1:
begin
PickUpMouse;
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
end;
2:
begin
RandomMovement;
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
end;
3:
begin
RandomRClick;
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
end;
4:
begin
BoredHuman;
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
end;
5:
begin
SleepAndMoveMouse(4000 + Random(3000));
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
end;
end;
end;


procedure WhileChopping;
begin
if not loggedin then
Exit;
FindRandoms;
AntiBan;
Responder;
AutoTrader;
SearchBirdsNest;
LevelUp;
end;


procedure CrushWillow;

var
a, Mrk: Integer;

begin
if not LoggedIn then
Exit;
SetRun(True);
WhileChopping;
Writeln('Crushing Willows');
MarkTime(Mrk);
Status('Crushing Willows');
repeat
FindObjCustom(x, y, ['Willow', 'Will', 'illo', 'llow'], [2181686, 6193521, 3755332, 3234376], 7);
if (isuptext('illo')) then
Mouse(x, y, 2, 2, True);
FFlag(7);
wait(500);
if (isuptext('illo')) then
begin
repeat
repeat
Wait(400);
WhileChopping;
until (not IsUpText('ew')) or Invfull or (TimeFromMark(mrk) > 130000 + Random(30000));
Wait(500 + random(500));
if not FindObjCustom(x, y, ['Willow', 'Will', 'illo', 'llow'], [2181686, 6193521, 3755332, 3234376], 7) then
Inc(A);
until FindObjCustom(x, y, ['Willow', 'Will', 'illo', 'llow'], [2181686, 6193521, 3755332, 3234376], 7) or (a = 50);
if (a = 50) then
begin
ProgressReport;
NextPlayer(False);
LoginPlayer;
end;
end;
until (InvFull);
end;


procedure SetUpSmart;
begin
Status('Loading Smart...');
ClearDebug;
Writeln('Please wait...');
Wait(500);
Writeln('Setting Up Smart');
SMARTSetupEx(133, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
Wait(100);
until (SmartGetColor(253, 233) <> 1118604);
end;


procedure WalkToBank;
begin
if not Loggedin then
Exit;
Bank := DTMFromString('78DA63AC636260F0664001E909090CFF81342' +
'310FF0702C62CA01A4F881C0B54CD9F3F4C609A11CA672C22528D' +
'2B116A6CF1AB0100517A11CC');
Writeln('Going To Draynor Bank');
Status('Going to Bank');
SetAngle(True);
SetRun(true);
if FindDTM(Bank, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, True);
Wait(1000 + random(1000));
FreeDTM(Bank);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank!');
Exit;
end else
begin
FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40);
Mouse(x, y, 4, 4, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
end;
if not FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40) then
begin
if (FindColorTolerance(x, y, 60909, 643, 15, 687, 47, 3)) then
Mouse(x, y, 2, 2, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
if not (FindColorTolerance(x, y, 60909, 643, 15, 687, 47, 3)) then
begin
FindSymbol(x, y, 'fishing spot');
Mouse(x + 40, y - 50, 4, 4, true);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank');
end;
end;
end;


function CountDTM(DTM: Integer): Integer;

var
I, X, Y: Integer;
TB: Tbox;

begin
if not loggedin then
Exit;
GameTab(4);
for I := 1 to 28 do
begin
TB := InvBox(I);
if ExistsItem(I) then
if FindDTM(DTM, X, Y, TB.X1, TB.Y1, TB.X2, TB.Y2) then
Inc(Result);
end;
end;


procedure Banking;

var
Exps: Integer;

begin
if not (LoggedIn) then
Exit;
Willow := DTMFromString('78DA6374626660E8606440062EB6920C4C401' +
'A24FA1F08181D816AEA51D54064612490F603AA69465563A0A080' +
'AAC615A8661201356640351308D8650E54D3865F0D00FF630A55');
Status('Banking Willows');
FFlag(7);
MakeCompass('n');
OpenBankQuiet('db');
Wait(500 + random(500));
if (PinScreen) then
begin
Writeln('Entering Pin Number');
InPin(IntToStr(Players[CurrentPlayer].Integers[0]));
end;
if (BankScreen) then
begin
EXPs := CountDTM(Willow);
ReportVars[2] := ReportVars[2] + (EXPs * 68);
ReportVars[1] := ReportVars[1] + EXPs;
TotalWillows := TotalWillows + EXPs;
if (Players[CurrentPlayer].Booleans[0] = False) then
begin
Writeln('Banking Willows');
Deposit(2, 28, True);
Closebank;
end else
Writeln('Banking Willows');
DepositAll;
Closebank;
ReportVars[0] := ReportVars[0] + 1;
Inc(TotalLoads);
Inc(LoadsDone);
FreeDTM(Willow);
Writeln('We Have Banked the Willows');
end;
end;


procedure WalkToWillows;
begin
if not loggedin then
Exit;
Status('Going to Willows');
Writeln('Going to Willows');
SetAngle(True);
SetRun(true);
if (findSymbol(x, y, 'fish')) then
begin
Mouse(x, y - 23, 1, 1, true);
FFlag(4);
Writeln('Arrived at Willows');
end else
begin
if (FindSymbol(x, y, 'Bank')) then
Mouse(x - 35, y + 30, 1, 1, true);
FFlag(4);
Writeln('Arrived at Willows');
end;
end;


procedure Mainloop;
begin
Sig;
PlayerForm;
SetUpSRL;
ScriptID := '1211'; //Do not touch!
SetUpSmart;
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
SetUpPlayer;
repeat
repeat
WalkToWillows;
CrushWillow;
WalkToBank;
Banking;
ProgressReport;
until (LoadsDone >= Players[CurrentPlayer].Integers[1]) or (not (LoggedIn));
NextPlayer(Players[CurrentPlayer].Active);
until (False);
ProgressReport;
end;


begin
Mainloop;
end.

3Garrett3

2009-04-20 14:50:14

Hmm. I'm going to need more time to look at this…

I know you are really helpful, so I'm already leaning to yes. But then your script could be more advanced… Instead of using findobj to find the tree.. you could make a tpa function, and it would really show that you know what you are doing.

Hmmm.

[X]: DTMs
[X]: DDTMs
[X]: Walking - I would like to see radial walking. Not symbols.
[X]: Antiban/Antirandom
[X]: Multiplayer - Nice use of the srl playerform ;)
[X]: TPAs/T2DTPAs

I honestly can't decide. I am so on the line. I would really like to say yes, but at the moment I can't think of which. So. I will let other people analyze it while I am at school. So you should be hearing a decision from me later today. Good luck though :)

Nava2

2009-04-20 15:59:10

I'm going to have to say no. Sorry.

You don't have very much 'advanced' code.

I do really like your massive amount of fail safes etc.

You should toss in some TPAs etc, will improve your code a lot. :)

ZephyrsFury

2009-04-20 16:33:00

I like your script… good use of SRL with Users.scar and Trade.scar, shows you've looked around the include a bit. It might not be great but I like it. Your failsafes are great:


if FindDTM(Bank, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, True);
Wait(1000 + random(1000));
FreeDTM(Bank);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank!');
Exit;
end else
begin
FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40);
Mouse(x, y, 4, 4, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
end;
if not FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40) then
begin
if (FindColorTolerance(x, y, 60909, 643, 15, 687, 47, 3)) then
Mouse(x, y, 2, 2, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
if not (FindColorTolerance(x, y, 60909, 643, 15, 687, 47, 3)) then
begin
FindSymbol(x, y, 'fishing spot');
Mouse(x + 40, y - 50, 4, 4, true);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank');
end;
end;
.. 4 "backups" there. Thats what I like to see. ;)
Good use of multiplayer too.

Here's my suggestion for increasing the efficiency of your script:

if FindDTM(Bank, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, True);
Wait(1000 + random(1000));
FreeDTM(Bank);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank!');
Exit;
end else
if FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40) then
begin
Mouse(x, y, 4, 4, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
end else
if (FindColorTolerance(x, y, 60909, 643, 15, 687, 47, 3)) then
begin
Mouse(x, y, 2, 2, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
end else
begin
FindSymbol(x, y, 'fishing spot');
Mouse(x + 40, y - 50, 4, 4, true);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank');
end;
As you can see that reduces the number of FindColorsTolerances you need to do making it faster and also more reliable. It also looks nicer in my opinion.

I also like you as a person from what I've seen on the forums.. always helping others and participating in a positive manner. This is what influenced me the most. Yes from me.

NCDS

2009-04-20 16:53:56

You should really try and avoid Global Variables, atleast for X and Y.

I remember when I applied I used FindObjCustom(); aswell, but I was heavily criticized for not using a TPA. At the time it was very frustrating but now I am thankful that happened because it is 100% worth the time to learn TPA's. (I would suggest doing that ;))


As Zeph pointed out, you use a good amount of FailSafe's already, which is a very good thing.

I dont know you as a person at all so I cant really judge on that.


Im going to hold my vote, I might end up voting later, or I might not.

Right now I cant decide tho.

GoodLuck!

marpis

2009-04-20 17:44:40

Autotrader is a very nice idea! :) You seem to focus on less important things, like an autoresponder, and not give enough effort on the main things, which are tree finding and walking in this case. I didn't try your script, but i guess it doesnt always wait the willow to be chopped? It seems to check the uptext at the same co-ords after it has walked to the willow, which causes it in most cases not to finish the tree, but to jump around the trees which looks very dubious.
Also, in your AntiBan procedure you could have just added
AntiBans := AntiBans + 1;
ReportVars[3] := ReportVars[3] + AntiBans;
once in the end of the procedure? ^^

This is anyways a good try, and if you don't get in this time i am sure you'll get in next time! Just learn the following things:

Things-to-do list for you:
- TPAs are a must in object finding.
- Walking without relying on symbols (read: DDTMs or RadialWalk, or make a system of your own)

My vote depends on the auto responder: Have you made it yourself more that 90%?

Blumblebee

2009-04-20 19:33:13

From: marpis

My vote depends on the auto responder: Have you made it yourself more that 90%?


his autoresponder looks similiar (not the same, just similiar) to the one i did a few months ago. Aswell, you might want to think about crediting Nava2 and EvilChicken for InChatArr().

Right now, Its a no from me. It is an ok script, but a very common script with common procedures. There is nothing advanced or exemplary that stands out to me. However, Like Zeph had pointed out, I do like your failsafes, most apps these days lack them.

GoodLuck, I'm positive if you dont get in this time it will be the next.

PriSoner

2009-04-20 20:00:58

Sorry it's a no from me.

For me the script is just too simple and has been bulked out in all the unimportant easy places to make it look better.

It shows you have a basic grasp of the way things should be and it is a good start, but you just aint quite there yet.

If you progress at your current rate I would bet that next attempt will get you in.

Nava2

2009-04-20 23:29:39

Aswell, you might want to think about crediting Nava2 and EvilChicken for InChatArr().


Nice memory, but thats not the same. :) Ours was more efficient.

But good luck next time, sorry to go off topic.

Blumblebee

2009-04-21 01:29:16

From: Nava2
Nice memory, but thats not the same. :) Ours was more efficient.

But good luck next time, sorry to go off topic.


ah sorry, name just seemed familiar. :p

Sir R. M8gic1an

2009-04-21 07:36:35


if not (LoggedIn) then
LogInPlayer;

LoginPlayer already does If LoggedIn then exit; so no need to check it again.


case Random(8) of // (in responder)

Random(8) will return a number from 0..7 so where you did case 8 it'll actually never get there; and you actualy left out case 6.



procedure FindRandoms;
begin
LampSkill := 'runecrafting';

first of all, i'd leave LampSkill to what the user wishes to use. However, if you set a default for it, you shouldn't set i the way you did.
everytime you call FindRandoms it'll waste time and memory allocating the string 'runecrafting' to the variable LampSkill. Just do it once in the mainloop.


if not FindObjCustom(x, y, ['Willow', 'Will', 'illo', 'llow'], [2181686, 6193521, 3755332, 3234376], 7) then
Inc(A);
until FindObjCustom(x, y, ['Willow', 'Will', 'illo', 'llow'], [2181686, 6193521, 3755332, 3234376], 7) or (a = 50);

the way you did this it will actually search for it the DOUBLE of the times you expected it.
the If not FindObjCustom will search for it, and then the Until FindObjCustom will also look for it.


//you'd want somethng more or less like this:
//...
var bool: boolean;

begin
//...
if not FindObjCustom(x, y, ['Willow', 'Will', 'illo', 'llow'], [2181686, 6193521, 3755332, 3234376], 7) then
Inc(A)
else
bool := true;
until(bool)or(A > 50)
//...
end;



if (a = 50) then
begin
ProgressReport;
NextPlayer(False);
LoginPlayer;
end;

This is very bad practice!! only change players in the mainloop because otherwise they'll be stuck thinking they're supposed to do what the other player was doing!
eg: player 1 is walking from lumbridge to varrock and at some point can't find the chicken coop. He logs Out. Next player comes in and starts looking for chicken coop ALTHOUGH he's in varrock already!




function CountDTM(DTM: Integer): Integer;


{*******************************************************************************
function CountItemsIn(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
By: masquerader modified by ZephyrsFury
Description: Counts the number of items found within the Area. (Does not count stacks)
Parameters:
Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
ItemType - SRL_DTM, SRL_Bitmap, SRL_BitmapMask, SRL_Color
Item - name/value of your dtm/bmp/color/bmpmask.
Tol - 'dtm' - [] (dtm's can't have tolerance).
'bmp' - [BMPTol].
'color' - [COLOUR Tol, Min Colour Count].
'bmpmask' - [BMPTol, ContourTol].
*******************************************************************************}

from amount.scar, similar function found in inventory.scar



if (FindSymbol(x, y, 'Bank')) then
Mouse(x - 35, y + 30, 1, 1, true);

coord walking based on a symbol o.O! minimap angle changes, symbols change place, that is extremely unreliable! (well, for long walks anyway >.>)


until (LoadsDone >= Players[CurrentPlayer].Integers[1]) or (not (LoggedIn));
NextPlayer(Players[CurrentPlayer].Active);
until (False);

very nice :)



begin
Mainloop;
end.

^ that left me curious.


I had a look at the code as you can see. I'm not sure if it's yet SRL Members quality, buti'd say your attitude speaks higher. I have not voted yet, and most likely won't. But if i do it'll be a yes!

~RM

lordsaturn

2009-04-21 09:22:36

I love your responder, and your standards are great. Nice use of the playerform.

If I'm not mistaken (please correct me if I am), RunAway does not run back to your previous location, so you would be in the wrong position after running away from a fight.

Nice AntiBan, but try to keep statements that are the same across all cases outside of the statement. e.g.
case Random(10) of
0: HoverSkill('woodcutting', false);
1: PickUpMouse;
2: RandomMovement;
//etc
end;
Inc(AntiBans);
IncEx(ReportVars[3], AntiBans);
Its a much neater block of code. Try to use Inc and IncEx too, they are quicker.

Nice failsafes in CrushWillow and walking, though it seems your only object finding in the script are FindObjCustom and FindColorTolerance. Try reading a couple tutorials on TPAs, they're great.

I like CountDTM, though in Banking you don't always free your DTM! Try adding the FreeDTM at the very end of the procedure, so it is freed in all cases.

Overall, it is coded very well. I like your attitude at the forums, you're a great guy. Check out TPAs and I'll love you even more.

Yes. :)

Dark Arcana

2009-04-23 10:05:36

lordsaturn, Runaway runs back. Here is the new version.
program Da_Willow_Crusher;

{.Include SRL/SRL/Misc/Smart.Scar}
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Misc/Users.Scar}
{.Include SRL/SRL/Misc/Trade.Scar}


var
x, y, LoadsDone, TotalLoads, Responded, Lvls, Bank, HomeTeleport,
Trades, i, TotalWillows, AntiBans, NestsFound, Willow, Tries: integer;


const
YourSRLID = '7412'; // Your SRL ID
YourSRLPass = 'omgomg'; // Your SRL Pass



procedure Sig;
begin
ClearDebug;
Writeln('________ ____ _____ ');
Wait(500);
Writeln('\______ \ _____ _______| | __ / _ \_______ ____ _____ ____ _____');
Wait(500);
Writeln(' | | \\__ \\_ __ \ |/ / / /_\ \_ __ \_/ ___\\__ \ / \\__ \');
Wait(500);
Writeln(' | ` \/ __ \| | \/ < / | \ | \/\ \___ / __ \| | \/ __ \');
wait(500);
Writeln('/_______ (____ /__| |__|_ \ \____|__ /__| \___ >____ /___| (___ /');
Wait(500);
Writeln(' \/ \/ \/ \/ \/ \/ \/ \/ ');
Wait(500);
Writeln(' Dark Arcana ');
Wait(500);
end;


procedure SetUpPlayer;
begin
if not (LoggedIn) then
LogInPlayer;
if LoggedIn then
begin
SetAngle(True);
SetRun(True);
SetChat('On', 1);
SetChat('Off', 2);
Wait(500 + Random(500));
Players[CurrentPlayer].integers[2] := GetSkillInfo('Woodcutting', False);
WriteLn('Players Woodcutting level is ' + IntToStr(Players[CurrentPlayer].integers[2]));
Gametab(4);
end;
end;


function SearchBirdsNest: Boolean; //Credits to Deathscytex for this

var
CTS, I, X, Y: Integer;
NestATPA: T2DPointArray;
NestTPA: TPointArray;
Nest: TPoint;
Timer: LongInt;

begin
if (FindText(x, y, 'nest falls', SmallChars, 0, 400, 495, 460)) then
begin
MarkTime(Timer);
repeat
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
X := MSCX;
Y := MSCY;
FindColorsSpiralTolerance(X, Y, NestTPA, 3952984, MSCX - 100, MSCY - 100, MSCX + 100, MSCY + 100, 15);
NestATPA := TPAtoATPAEx(NestTPA, 5, 5);
for I := 0 to Length(NestATPA) - 1 do
begin
if (TimeFromMark(Timer) >= (10000)) then
Exit;
Nest := MIddleTPA(NestATPA[I]);
X := 0;
Y := 0;
MMouse(Nest.X, Nest.Y, 5, 5);
Wait(250);
if (IsUpText('ird')) then
begin
Mouse(Nest.X, Nest.Y, 5, 5, True);
Result := True;
Inc(NestsFound);
ReportVars[4] := ReportVars[4] + 1;
Wait(250 + Random(150));
Writeln('We Have Found a Bird Nest!');
case (Random(8)) of
0: TypeSend('Found a Birds nest');
1: TypeSend('Cool, I got a bird nest.');
2: TypeSend('Sweet, Found a nest');
3: TypeSend('Yay, a bird nest');
4: TypeSend('Whew, got a nest.');
end;
Exit;
end;
end;
until (TimeFromMark(Timer) >= (10000)) or (Result);
Exit;
end else
Exit;
end;


procedure WalkToWillows; forward;

procedure DeathWalk;
begin
if not loggedin then
Exit;
HomeTeleport := BitmapFromString(31, 28, 'beNpjYBgFgxIwYiBq' +
'mtzX+xmOqGQ+urHUswJhsqiQPhqizHx0k6uqfsARxeYjTEY2Fs0KJ' +
'PNJdjaym01N8uAIzf2kOB67yX///YNIARkUmI8eIECjIGbCDQeSyO' +
'aTEjgohkNMxjQcbj61DIcjahlO9WChZYTSNCnSOhPROvvTtOCidZF' +
'L68qCDtXcKKA2AACEMELY');
begin
GameTab(7);
if (FindBitmap(Hometeleport, x, y)) then
begin
Mouse(x + 10, y + 10, 4, 4, true);
Writeln('Teleporting to Lumbridge');
Status('Teleporting to Lumbridge');
Wait(12000 + random(5000));
FreeBitmap(HomeTeleport);
Writeln('Going Back to Draynor!');
Status('Going Back to Draynor!');
Makecompass('n');
SetAngle(True);
Setrun(true);
if not RadialRoadWalk(FindLumbyRoadColor, 54, 80, 74, -2, 1) then
begin
Writeln('Death Walked Failed');
NextPlayer(false);
end;
FFlag(4);
RadialRoadWalk(FindLumbyRoadColor, 290, 337, 70, -2, 1);
FFlag(4);
RadialRoadWalk(FindLumbyRoadColor, 287, 347, 65, -2, 1);
FFlag(4);
RadialRoadWalk(FindLumbyRoadColor, 237, 252, 62, -2, 1);
FFlag(4);
RadialRoadWalk(FindLumbyRoadColor, 240, 330, 40, -2, 1);
FFlag(4);
RadialWalk(FindDirtRoadColor, 200, 300, 60, -2, 1);
FFlag(4);
RadialWalk(FindDirtRoadColor, 238, 302, 59, -2, 1);
FFlag(4);
RadialWalk(FindDirtRoadColor, 243, 300, 60, -2, 1);
FFLag(4);
RadialWalk(FindDirtRoadColor, 238, 300, 65, -2, 1);
FFlag(4);
RadialWalk(FindDirtRoadColor, 220, 270, 65, -2, 1);
FFlag(4);
RadialWalk(FindDirtRoadColor, 213, 288, 65, -2, 1);
FFlag(4);
RadialRoadWalk(FindRoadColor, 350, 274, 74, -2, 1);
FFlag(4);
RadialRoadWalk(FindRoadColor, 350, 274, 65, -2, 1);
FFlag(4);
FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40);
begin
Writeln('Yay We Are Back!');
Mouse(x, y, 4, 4, True);
FFlag(4);
end;
WalkToWillows;
end;
if not FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40) then
begin
Writeln('We are still lost, switching players');
NextPlayer(false);
end;
FreeBitmap(HomeTeleport);
end;
end;


procedure PlayerForm;
begin
SRLPlayerForm(True, ['Is Axe Wielded?', 'Use Responder?'], ['Pin Number?', 'Loads Each Player?'], [], []);
end;


function RockDDTM: Integer;

var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..5] of TDTMPointDef;
TempTDTM: TDTM;

begin
dtmMainPoint.x := 975;
dtmMainPoint.y := 360;
dtmMainPoint.AreaSize := 2;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 4671579;
dtmMainPoint.Tolerance := 100;

dtmSubPoints[0].x := 975;
dtmSubPoints[0].y := 360;
dtmSubPoints[0].AreaSize := 2;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 4671579;
dtmSubPoints[0].Tolerance := 100;

dtmSubPoints[1].x := 953;
dtmSubPoints[1].y := 332;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 195836;
dtmSubPoints[1].Tolerance := 100;

dtmSubPoints[2].x := 955;
dtmSubPoints[2].y := 328;
dtmSubPoints[2].AreaSize := 2;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 195836;
dtmSubPoints[2].Tolerance := 100;

dtmSubPoints[3].x := 956;
dtmSubPoints[3].y := 319;
dtmSubPoints[3].AreaSize := 2;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 100;

dtmSubPoints[4].x := 961;
dtmSubPoints[4].y := 286;
dtmSubPoints[4].AreaSize := 2;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 794717;
dtmSubPoints[4].Tolerance := 100;

dtmSubPoints[5].x := 955;
dtmSubPoints[5].y := 327;
dtmSubPoints[5].AreaSize := 2;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 195836;
dtmSubPoints[5].Tolerance := 100;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


function LevelUp: Boolean;
begin
Result := FindNPCChatText('gratu', Nothing);
if not Result then
Result := FindNPCChatText('atio', Nothing);
if Result then
begin
while ClickContinue(True, True) do
Wait(500);
Writeln(' We have lvled up!');
Inc(Lvls);
end;
end;


procedure AutoTrader;
begin
if (SomeoneTrades) then
begin
AcceptTrade;
Wait(4000 + random(1000));
Decline;
Inc(Trades);
case Random(4) of
0: Typesend('go away');
1: Typesend('go trade with someone else');
2: TypeSend('leave me alone');
3: TypeSend('No thank you');
end;
end;
end;


function InChatArr(Text: array of string): Boolean;

var
I, H: integer;
s: string;

begin
H := High(Text);
if (not (GetLastChatText(s))) then
LastChatter(s);
for I := 0 to H do
begin
if (Pos(Lowercase(Text[i]), (Lowercase(s))) > 0) then
begin
Result := true;
Exit;
end;
end;
end;


procedure Responder;

var
Question, Thanking: TStringArray;
S: Integer;

begin
if not (Players[CurrentPlayer].Booleans[1]) then
Exit;
Question := ['cut', 'wc', 'lvl', 'cutting lvl', 'wood', 'lvls', 'oodc'];
for I := 0 to 8 do
begin
if InChatArr(Question) then
begin
inc(Responded);
S := GetSkillInfo('Woodcutting', False);
case Random(9) of
0: TypeSend('only ' + IntToStr(S));
1: TypeSend(IntToStr(S));
2: TypeSend((IntToStr(S)) + ' you?');
3: TypeSend(IntToStr(S) + ' lol');
4: TypeSend((IntToStr(S)) + ' here');
5: TypeSend('only ' + IntToStr(S));
7: TypeSend('Nearly ' + IntToStr(S + 1));
8: begin
TypeSend('only ' + IntToStr(S + 1));
Wait(500 + random(500));
TypeSend('I mean ' + IntToStr(S));
end;
end;
Wait(1000 + Random(500));
end;
Thanking := ['nice', 'cool', 'awesome', 'sweet', 'good', 'kool'];
for I := 0 to 8 do
begin
if InChatArr(Thanking) then
begin
inc(Responded);
case Random(4) of
0: TypeSend('thx');
1: TypeSend('thank you');
2: TypeSend('ty');
3: TypeSend('thanks');
end;
end;
for I := 0 to 8 do
begin
if InChatArr([Players[CurrentPlayer].Nick]) then
begin
Inc(Responded);
case Random(4) of
0: Typesend('What do you want');
1: Typesend('im busy');
2: Typesend('Leave me alone...');
3: Typesend('Go away');
end;
end;
end;
end;
end;
end;


procedure FindRandoms;
begin
LampSkill := 'runecrafting';
FindNormalRandoms;
if FindFight then
RunAway('E', True, 1, 15000);
end;


procedure ProgressReport;
begin
ClearDebug;
WriteLn('***************************************************'); ;
WriteLn('* Da Willow Crusher *');
WriteLn('***************************************************');
WriteLn('* Been Crushing for | ' + TimeRunning);
Writeln('* Gained | ' + IntToStr(Lvls) + ' Levels');
WriteLn('* Did | ' + IntToStr(TotalLoads) + ' Loads');
WriteLn('* Crushed | ' + IntToStr(TotalWillows) + ' Willows');
Writeln('* Responded | ' + IntToStr(Responded) + ' Times');
Writeln('* Performed | ' + IntToStr(AntiBans) + ' AntiBans');
Writeln('* Traded | ' + IntToStr(Trades) + ' Times');
Writeln('* Found | ' + IntTOStr(NestsFound) + ' Bird Nests');
WriteLn('* Gained | ' + IntToStr(TotalWillows * 68) + ' Exps');
WriteLn('***************************************************');
SendSRLReport;
SRLRandomsReport;
end;


procedure AntiBan;
begin
if (not (LoggedIn)) then
Exit;
case Random(30) of
0: HoverSkill('woodcutting', false);

1: PickUpMouse;

2: RandomMovement;

3: RandomRClick;

4: BoredHuman;

5: SleepAndMoveMouse(4000 + Random(3000));

end;
Inc(AntiBans);
IncEx(ReportVars[3], AntiBans);
end;


procedure WhileChopping;
begin
if not loggedin then
Exit;
FindRandoms;
AntiBan;
Responder;
AutoTrader;
SearchBirdsNest;
LevelUp;
end;


procedure CrushWillow;

var
Mrk, i: Integer;
WillowTree: array[0..5] of Integer;


begin
if not LoggedIn then
Exit;
WillowTree[0] := 2181686;
WillowTree[1] := 6193521;
WillowTree[2] := 3755332;
WillowTree[3] := 3234376;
WillowTree[4] := 3234119;
SetRun(True);
WhileChopping;
Writeln('Crushing Willows');
MarkTime(Mrk);
Status('Crushing Willows');
repeat
if FindObjTPA(x, y, WillowTree[i], 20, -2, 25, 25, 15, ['Willow', 'Will', 'illo', 'llow']) then
if (isuptext('illo')) then
Mouse(x, y, 2, 2, True);
FFlag(7);
wait(500);
if (isuptext('illo')) then
begin
repeat
repeat
Wait(400);
WhileChopping;
until (not IsUpText('ew')) or Invfull or (TimeFromMark(Mrk) >= (30000 + Random(5000)))
Wait(500 + random(500));
if not FindObjTPA(x, y, WillowTree[i], 11, -2, 20, 20, 15, ['Willow', 'Will', 'illo', 'llow']) then
Inc(Tries);
until FindObjTPA(x, y, WillowTree[i], 11, -2, 18, 18, 20, ['Willow', 'Will', 'illo', 'llow']) or (Tries > 20);
if (Tries > 20) then
DeathWalk;
end;
until (InvFull);
end;


procedure SetUpSmart;
begin
Status('Loading Smart...');
ClearDebug;
Writeln('Please wait...');
Wait(500);
Writeln('Setting Up Smart');
SMARTSetupEx(133, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
Wait(100);
until (SmartGetColor(253, 233) <> 1118604);
end;


procedure ScriptTerminate;
begin
ProgressReport;
FreeDTM(Bank);
FreeDTM(Willow);
FreeBitmap(HomeTeleport);
end;


procedure WalkToBank;
begin
if not Loggedin then
Exit;
Bank := DTMFromString('78DA63AC636260F0664001E909090CFF81342' +
'310FF0702C62CA01A4F881C0B54CD9F3F4C609A11CA672C22528D' +
'2B116A6CF1AB0100517A11CC');
Writeln('Going To Draynor Bank');
Status('Going to Bank');
SetAngle(True);
SetRun(true);
if FindDTM(Bank, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 5, 5, True);
Wait(1000 + random(1000));
FFlag(4);
Writeln('We Have Arrived at Draynor Bank!');
Exit;
end else
if FindColorTolerance(x, y, 10089719, MMX1, MMY1, MMX2, MMY2, 40) then
begin
Mouse(x, y, 4, 4, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
end else
if (FindColorTolerance(x, y, 60909, 643, 15, 687, 47, 3)) then
begin
Mouse(x, y, 2, 2, true);
FFlag(7);
Writeln('We Have Arrived at Draynor Bank');
end else
begin
FindSymbol(x, y, 'fishing spot');
Mouse(x + 40, y - 50, 4, 4, true);
FFlag(4);
Writeln('We Have Arrived at Draynor Bank');
end;
if not FindSymbol(x, y, 'fishing spot') then
begin
Writeln('Can not find Bank, doing Death Walk');
Deathwalk;
end;
FreeDTM(Bank);
end;



function CountDTM(DTM: Integer): Integer;

var
I, X, Y: Integer;
TB: Tbox;

begin
if not loggedin then
Exit;
GameTab(4);
for I := 1 to 28 do
begin
TB := InvBox(I);
if ExistsItem(I) then
if FindDTM(DTM, X, Y, TB.X1, TB.Y1, TB.X2, TB.Y2) then
Inc(Result);
end;
end;


procedure Banking;

var
Exps: Integer;

begin
if not (LoggedIn) then
Exit;
Willow := DTMFromString('78DA6374626660E8606440062EB6920C4C401' +
'A24FA1F08181D816AEA51D54064612490F603AA69465563A0A080' +
'AAC615A8661201356640351308D8650E54D3865F0D00FF630A55');
Status('Banking Willows');
FFlag(7);
MakeCompass('n');
repeat
OpenBankQuiet('db');
until (PinScreen) or (BankScreen) or (Tries > 5)
if (PinScreen) then
begin
Writeln('Entering Pin Number');
InPin(IntToStr(Players[CurrentPlayer].Integers[0]));
end;
if (BankScreen) then
begin
EXPs := CountDTM(Willow);
ReportVars[2] := ReportVars[2] + (EXPs * 68);
ReportVars[1] := ReportVars[1] + EXPs;
TotalWillows := TotalWillows + EXPs;
if (Players[CurrentPlayer].Booleans[0] = False) then
begin
Writeln('Banking Willows');
Deposit(2, 28, True);
Closebank;
end else
Writeln('Banking Willows');
DepositAll;
Closebank;
ReportVars[0] := ReportVars[0] + 1;
Inc(TotalLoads);
Inc(LoadsDone);
Writeln('We Have Banked the Willows');
end;
FreeDTM(Willow);
end;


procedure WalkToWillows;
begin
if not loggedin then
Exit;
Status('Going to Willows');
Writeln('Going to Willows');
SetAngle(True);
SetRun(true);
begin
if (FindDTM(RockDDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
Mouse(x - 35, y + 10, 1, 1, true);
FFlag(4);
Writeln('Arrived at Willows');
end else
if (FindSymbol(x, y, 'fish')) then
begin
Mouse(x, y - 23, 1, 1, true);
FFlag(4);
Writeln('Arrived at Willows');
end else
begin
Writeln('Can not find willows, doing Death Walk');
DeathWalk;
end;
end;
end;


begin
Sig;
PlayerForm;
SetUpSRL;
ScriptID := '1211'; //Do not touch!
SetUpSmart;
SRLID := YourSRLID;
SRLPassword := YourSRLPass;
SetUpPlayer;
repeat
repeat
WalkToWillows;
CrushWillow;
WalkToBank;
Banking;
FindRandoms;
ProgressReport;
until (LoadsDone >= Players[CurrentPlayer].Integers[1]) or (not (LoggedIn));
NextPlayer(Players[CurrentPlayer].Active);
until (False);
ProgressReport;
end.

I am not finished with my deathwalk yet, thank you all for your comments :)

ShowerThoughts

2009-04-23 10:19:50

I must say a lot of helpful feedback for the scripter, scripter: good luck with fixing your script up with some TPAs and if you don't do anything nasty I can sort of promise that you will get in if you won't this time.

I sort of promised.

Hobbit

2009-05-05 08:55:55

5 - Yes
10 - No

Sorry but you didn't make it

Please stick around and read some tutorials and apply in one month