SRL Archive - Archive

[JS] - SRL Member Application *


[JS]

2009-08-09 02:02:22

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
HTML.


Are you a member of any other communities?
None.


Tell us about yourself…
[quote=[JS]]My name is Joe, I am 17 years of age. My planned future would consist of majoring in graphic design. Other than graphic design I would like to learn various types of coding. I see SRL/Villavu as a gateway into learning different types of coding which is why I chose to learn to script. Thanks for looking at application. :)


Note: Didn't include a progress report, if comes as an issue I will gladly add one.


Please show us one (or multiple) of your scripts.
program VarrockEastMiner;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}

Type
TRadial = Record
Col, MinR, MaxR, Rad: Integer;
end;

var
RockColor: Array [0..2] Of Integer;

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

Players[0].Name := 'name';
Players[0].Pass := 'pass';
Players[0].Nick := 'nick';
Players[0].Strings[0] := ''; //Rock you want to mine
Players[0].Booleans[0] := False; //PowerMine?
Players[0].Booleans[1] := False; //Pickaxe equpied?
Players[0].Active := True;
end;

Function BuildTRadial(Col, MinR, MaxR, Rad: Integer): TRadial;
begin
Result.Col := Col;
Result.MinR := MinR;
Result.MaxR := MaxR;
Result.Rad := Rad;
end;

Function LoadTRadial(Index: Integer): TRadial;
begin
Case Index of
0: Result := BuildTRadial(FindVarrockRoadColor, 70, 80, 70); // From bank
1: Result := BuildTRadial(FindVarrockRoadColor, 85, 95, 70);
2,3: Result := BuildTRadial(FindVarrockRoadColor, 87, 95, 70);
4..7: Result := BuildTRadial(FindVarrockRoadColor, 120, 200, 70);

8..10: Result := BuildTRadial(FindVarrockRoadColor, 0, 80, 70);
11: Result := BuildTRadial(FindVarrockRoadColor, 310, 360, 70);
12..15: Result := BuildTRadial(FindVarrockRoadColor, 260, 330, 70);
end;
end;

procedure AntiBan;
begin
Case Random(300) of
7: HoverSkill('random', False);
8: BoredHuman;
9: MouseBox(59, 31, 647, 264, 3);
10..14: MakeCompass(IntToStr(Random(361)));
15: RandomMovement;
16: SleepAndMoveMouse(1000+Random(2000));
17..20: GameTab(RandomRange(1, 13));
end;
end;


Procedure DeclareRockColors;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'copper' :
begin
RockColor[0] := 4417680
RockColor[1] := 5011106
RockColor[2] := 5340588
end;
'tin' :
begin
RockColor[0] := 9671839
RockColor[1] := 6579308
RockColor[2] := 10855857
end;
'iron' :
begin
RockColor[0] := 2635094
RockColor[1] := 2964577
RockColor[2] := 2371662
end;
end;
end;


Function FindRock: Boolean;
var
x, y: Integer;
TPA, tTPA: TPointArray;
ATPA: T2DPointArray;
I, H: Integer;
begin
Result := False;
if not LoggedIn then Exit;

ColorToleranceSpeed(2);
SetColorspeed3Modifiers(1);

For I:=0 to 2 do
begin
FindColorsTolerance(tTPA, RockColor[i], MSX1, MSY1, MSX2, MSY2, 7);
TPA := CombineTPA(TPA, tTPA);
end;

ATPA := SplitTPA(TPA, 10);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
H := High(ATPA);
For i:=0 to H do
begin
MiddleTPAEx(ATPA[i], x, y);
Mouse(x, y, 4, 4, False);
Result := WaitOption('ine', 300);
If Result then
begin
Flag;
Exit;
end;
end;
end;

Procedure DropOre;
var
I: Integer;
begin
if not (LoggedIn) then
Exit;
FindNormalRandoms;
GameTab(tab_inv);
If Players[CurrentPlayer].Booleans[1] then
Inc(I) else
I := 2;

For I:=I to 28 do
DropItem(I);
end;

Function RWalk(Rec: TRadial): Boolean;
begin
Result := RadialRoadWalk(Rec.Col, Rec.MinR, Rec.MaxR, Rec.Rad, 0, 0);
end;

Function GetInsideMine: Boolean;
Var
X, Y: Integer;
TPA: TPointArray;
begin
If FindColors(TPA, FindStoneColor, MMX1, MMCY, MMCX, MMY2)then
begin
MiddleTPAEx(TPA, X, Y);
Mouse(X, Y, 3, 3, True);
Wait(100+Random(100));
Flag;
Result := True;
Exit;
end else
If FindSymbol(X, Y, 'mining shop')then
begin
Mouse(X, Y, 3, 3, True);
Wait(100+Random(100));
Flag;
Result := True;
Exit;
end;
end;

function WalkToMine: Boolean;
var
I: Integer;
begin
Result := False;
If Players[CurrentPlayer].Booleans[0] then
Exit;

For I:=0 to 7 do
Begin
Result := RWalk(LoadTRadial(I));
If Not Result then
Begin
Writeln('Walking #' + IntToStr(I) + ' Failed.');
Logout;
Exit;
end;
end;

If Not GetInsideMine then
begin
Writeln('Getting Inside the mine failed');
Logout;
end;
end;

function WalkToBank: Boolean;
var
I: Integer;
begin
For I:=8 to 16 do
Begin
Result := RWalk(LoadTRadial(I));
If Not Result then
Begin
Writeln('Walking #' + IntToStr(I) + ' Failed.');
Logout;
Exit;
end;
end;

Result := FindBank('veb');
end;

Procedure BackToBank;
var
I: Integer;
begin
If Not WalkToBank then
begin
Writeln('Walking to bank failed, NextPlayer.');
Logout;
Exit;
end;
If Not OpenBankFast('veb')then
begin
Writeln('Failed opening bank, NextPlayer.');
Logout;
Exit;
end;
If Players[CurrentPlayer].Booleans[1] then
Inc(I)
else
I := 2;

Deposit(I, 28, True);

Case Random(4) of
0: CloseBank;
end;
end;

Procedure WaitMining;
var
Time, C: Integer;
begin
C := InvCount;
Time := GetSystemTime;
While C = InvCount do
begin
AntiBan;
FindNormalRandoms;
If (GetSystemTime-Time) > 5000 then
Exit;
end;
end;

Procedure NewPlayer;
begin
DeclareRockColors;
SetAngle(True);
RunEnergy(40+Random(40));
end;

begin
{$IFDEF SRL_SMART}
Smart_Server := 65;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ENDIF}

SetupSRL;
DeclarePlayers;
LoginPlayer;
NewPlayer;
repeat
If Not LoggedIn then
begin
NextPlayer(False);
NewPlayer;
end;

If Not WalkToMine then
begin
Writeln('Walking to mine failed, NextPlayer.');
Logout;
end;

Repeat
If FindRock then
WaitMining
else
AntiBan;
Until(InvFull);

If Players[CurrentPlayer].Booleans[0] then
DropOre
else
BackToBank;

Until(AllPlayersInactive);
end.

Naike

2009-08-09 02:09:18

Looking good [JS]..

Seems like you understand this way better then when you first came asking questions haha..

You got a good attitude when it comes to learning, and got that little spark..

Even tho the script is a bit short, It's a clear yes, from me.

EvilChicken!

2009-08-09 02:25:11

One thing you could to to improve readability, especially for longer pieces of code,
is to use WITH statements.


Function BuildTRadial(Col, MinR, MaxR, Rad: Integer): TRadial;
begin
Result.Col := Col;
Result.MinR := MinR;
Result.MaxR := MaxR;
Result.Rad := Rad;
end;

This could be turned into this:


Function BuildTRadial(Col, MinR, MaxR, Rad: Integer): TRadial;
begin
with Result do
begin
Col := Col;
MinR := MinR;
MaxR := MaxR;
Rad := Rad;
end;
end;

The elements in the cases in DeclareRockColors; needs semicolons after each of them.

In findRock, why do you set the modifier for CTS 3 if you set the current CTS to 2?

You also have absolutely no backups for your walking procedures.
Instead of logging out and/or exiting, try repeating the last walking function that was called, or the one before that.

In your WalkToBank, you have a case for a single procedure instance.

In stead of
  Case Random(4) of
0: CloseBank;
end;

you should rather go for a simple IF.

if (Random(4) = 0) then
CloseBank;

Other than those small issues, I can't find too much to pick on, "sadly enough". :p I have to tell you this; you've done a great job, you've made one of the best applications I've seen in quite a while. You've got most advanced stuff, like TPAs, RRW, ect. You even show good usage of Defines. A definete yes from me – but please tell me this; exactly how much did N1ke help you with this?

Macro_FTW

2009-08-09 02:25:56

You capitalized bold words. You will never get in to SRL. EVER.

Kidding. The script is a bit short, but you clearly know what you're doing. Yes. ;)

[JS]

2009-08-09 02:34:40

From: EvilChicken!

Other than those small issues, I can't find too much to pick on, "sadly enough". :p I have to tell you this; you've done a great job, you've made one of the best applications I've seen in quite a while. You've got most advanced stuff, like TPAs, RRW, ect. You even show good usage of Defines. A definete yes from me – but please tell me this; exactly how much did N1ke help you with this?


N1ke answered a lot of questions i had and suggested certain things, though he has helped me since day 1, and has made me do everything myself so that i could get to this point.

EvilChicken!

2009-08-09 02:41:15

From: [JS]
N1ke answered a lot of questions i had and suggested certain things, though he has helped me since day 1, and has made me do everything myself so that i could get to this point.


That's what I wanted to hear ^__^

By the way, as Macro_FTW said, try not to capitalize bold words.

Coh3n

2009-08-09 02:58:16

I had a quick look through it and there is nothing that I can see wrong with it, great job. :)

Although I do have a few suggestions:
  • You need to add a lot more failsafes if you want the script to last a long time. For example, use DDTMs for walking, and RRW for a failsafe, or even repeat the RRW like EC! said.
  • Add a progress report. ;) It's not an issue, but it's always nice to have one.
  • You should think about adding small features such as level checks, or pickaxe checks. This just shows us that you have some creativity. :)

You seem to have a good knowledge of SCAR and SRL, and some of the more advanced techniques. It's a yes from me, good job. :)

Richard

2009-08-09 03:26:09

Nice job, I was wondering when you would apply. Its a definite yes from me. Just a couple of things:

As EC! said, use with statements for types, it just makes the script look neater and more readable.

RunEnergy(40+random(40)); When I ctrl + space this, nothing is displayed, anyone care to explain what it is/does?

 If Players[CurrentPlayer].Booleans[1] then
Inc(I)
else
I := 2;

Deposit(I, 28, True);

Case Random(4) of
0: CloseBank;
end;

What if the players pickaxe isn't in the first inventory slot? It will drop the pickaxe. And nowhere else in the script is there a place that checks if the pickaxe is there, it will just continue clicking the rock without a pickaxe, creating a very bot like look.

 {$IFDEF SRL_SMART}
Smart_Server := 65;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ENDIF}

You don't really need the $IFDEF/$ENDIF, it won't error if you don't have SMART included at the top.

In the FindRock function, you have Result := False; at the start, all booleans default to False.


Very good job, you'll easily get in, unless all SRL Members have a sudden turn and decide you have to be BenLand100 standard to get in.

noidea

2009-08-09 03:30:38

Nice job!
You have improved from day one, and you WANT to learn. You dont just want the scripts, but the knowledge.

I say yes :)

Home

2009-08-09 03:50:58

Simple and effective ( My next word i mean ) Yes.

And keep going man!


~Home

cycrosism

2009-08-09 04:19:44

Looks very good. I like how you have used the Type at the start of the script (Not many people know them) and how all your consts are included in the DeclarePlayers;

I am not very fond of symbol clicking it looks a bit botty, but since you only do it once that is fine by me.


Mouse(X, Y, 3, 3, True);
Wait(100+Random(100));
Flag;

This can be changed to MouseFlag(X, Y, 3, 3, 0);
Just shorter and simpler.

I do not see many fail safes, most of the time you just logout. The problem is when you log out and switch players, you don't switch the player to false so he will just log back in next time. Not good.

301 lines IS a bit short, but the code looks good.

Voted Yes. Good luck.

ian.

2009-08-09 04:22:27

Very understanding, and super nice/easy to talk to. :) Keep it up. ^^

Naike

2009-08-09 04:31:15

From: cycrosism
The problem is when you log out and switch players, you don't switch the player to false so he will just log back in next time. Not good.


No?, He did it by the mainloop..

Simtoon

2009-08-09 05:04:20

From: N1ke!
Looking good [JS]..

Seems like you understand this way better then when you first came asking questions haha..

You got a good attitude when it comes to learning, and got that little spark..

Even tho the script is a bit short, It's a clear yes, from me.


^^

Yes

ZaSz

2009-08-09 07:21:21

No. You never told me you were going to apply on msn. That shows bad friendship…

Yo listen up here's a story
About a little guy that lives in a blue world
And all day and all night and everything he sees
Is just blue like him inside and outside
Blue his house with a blue little window
And a blue corvette
And everything is blue for him and himself


Jk, yes lols

BobboHobbo

2009-08-09 07:30:04

Looks nice, packed with looks of sweet stuff. Good job, yes from meh.

TRiLeZ

2009-08-09 07:58:21

Looks good.
I see its multiplayer, antiban but only a 6% chance of doing anything, some TPAs, radial walking, and DTMs.

You need some more failsafes. You should increase the chance of the antiban doing something. Instead of making the user enter if the pickaxe is equipted, you could make the script check for the pickaxe.

Learn DDTMs if you dont know them already.Theyre the best color walking way to me.

You have a good attitude and are a good learner.

Its a yes from me.

Griff

2009-08-09 10:41:29

Don't listen to them! Keep capatilazing the bold words! Anyway, great script, and even better attitude. Yes.

bugger0001

2009-08-09 15:14:00

That's some wicked stuff :p
I like your techniques, but it still seems to me that you only scripted as much as necessary yet as less as possible(it's a negative saying)…That's the way to go! :D
YES

Naum

2009-08-09 16:11:05

[JS] your invited to my exclusive group, OMG Griff join now!!: http://www.villavu.com/forum/group.php?groupid=35

We, have day-outs and trips to local safaris. :)

Anyway, the app:

1) As EC said, 'with' and 'do' statements to make code look more 'good'


2) Well your Declare RockColors; procedure is good, however, it could be shortened:

Procedure DeclareRockColors;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'copper' : RockColor := [4417680, 5011106, 5340588];
'tin' : RockColor := [9671839, 6579308, 10855857];
'iron' : RockColor := [2635094, 2964577, 2371662];
end;
end;

:)

3) In your FindRock function the result is, as default, set to false. So you don't need to do Result := False; unless you change it, of course.


4) Sometimes Case statements do not need to be used:

  Case Random(4) of
0: CloseBank;
end;

to

  If Random(4) = 0 Then CloseBank;


5) You could also set I, as a global variable as you always set it to a number.


Other than that, Good Job! I can see that your a deserving candidate. I didn't really find much to scrutinize.

Yes, Rep++

[JS]

2009-08-09 19:07:36

From: NaumanAkhlaQ
[JS] your invited to my exclusive group, OMG Griff join now!!: http://www.villavu.com/forum/group.php?groupid=35

We, have day-outs and trips to local safaris. :)



I lol'd at that and gladly accepted you invitation :D.

and thanks to everyone that has voted and made suggestions on script. Feedback is key to making things better. ;)

Again, thank you all so much, greatly appreciated.

Awkwardsaw

2009-08-09 19:14:31

:pfrom looking at past feed back, its really good and from what i can tell you have a real good attitude, its a yes from me :)

Sir R. M8gic1an

2009-08-13 05:37:37

Welcome to Jah People!

~RM