SRL Archive - Archive

han941306 - SRL Member Application


han941306

2009-04-27 10:02:36

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?
ASP, PHP, Pascal, JavaScript, C++


Are you a member of any other communities?
Sythe


Tell us about yourself…
From: han941306
I am a student, I like learning new languages and doing some exiting things.



Please show us one (or multiple) of your scripts.

//Test Miner 0.1 Beta by Han
//Read Before Using :
//Wield Pickaxe First, And Put the Character in the Varrock East Mine.
//This Script is just help players boost Mining Levels.
//The Ores drop instead of banking.
//The failsafe is not doing so well, more failsafes will be added in next version.

Program Miner;
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Mining.scar}

var
Loads, FailAtt, HaltNo : integer;

////////////////////////////Setup///////////////////////////////////
const
CFailAtt = 5; //Fail Attempt Before Switching Characters

Procedure DeclarePlayers;
begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := true;
Players[0].Strings[0] := 'Copper'; //Which Ore?
Players[0].Integers[0] := 20; //Loads to do

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := true;
Players[1].Strings[0] := 'Copper'; //Which Ore?
Players[1].Integers[0] := 1; //Loads to do

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := true;
Players[2].Strings[0] := 'Copper'; //Which Ore?
Players[2].Integers[0] := 1; //Loads to do
end;
/////////////////Script Underneath, Don't Modify////////////////////

Procedure RandomKeyboard;
begin
case Random(6) of
0:MakeCompass('N');
1:MakeCompass('E');
2:MakeCompass('W');
3:MakeCompass('S');
4:SetAngle(True);
5:SetAngle(False);
end;
end;

Procedure AntiBan(RanNum : integer);
begin
case RanNum of
0:RandomRClick;
1:HoverSkill('mining', false);
2:PickUpMouse;
3:RandomMovement;
4:BoredHuman;
5:RandomKeyboard;
end;
end;

Procedure CheckLogin;
begin
if (not loggedIn) then Exit;
end;

Procedure CWait(Times : integer);
begin
wait(Times * (100 + Random(50)));
end;

Procedure ProgressReport;
var
HaltState : String;
begin
case HaltNo of
0:HaltState := 'Done all loads successfully.';
1:HaltState := 'Lost / Ore Not Found.'
end;
WriteLn('...........Progress Report...........');
WriteLn('-------------------------------------');
WriteLn('Player : ' + Players[CurrentPlayer].Nick);
WriteLn('Loads done : ' + IntToStr(Loads));
WriteLn('State : ' + HaltState);
WriteLn('Time Elapsed : ' + TimeRunning);
WriteLn('-------------------------------------');
end;

Procedure MineOre;
var
OreColor : array[0..1] of integer;
x, y: integer;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of

'copper':
begin
OreColor[0] := 4483989;
OreColor[1] := 3824510;
repeat
if (FindObjTPA(x, y, OreColor[0], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (FindObjTPA(x, y, OreColor[1], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (not FindGas(x, y)) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Mine');
Exit;
end;
end;
end else
begin
FailAtt := FailAtt + 1;
WriteLn('Ore Not Found, tried ' + IntToStr(FailAtt) + ' Times.');
MakeCompass('N');
SetAngle(True);
end;
until (FailAtt = CFailAtt);
WriteLn('Ore Not Found, Probably Got Lost.');
HaltNo := 1;
Exit;
end;

'tin':
begin
OreColor[0] := 7566204;
OreColor[1] := 6908273;
repeat
if (FindObjTPA(x, y, OreColor[0], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (FindObjTPA(x, y, OreColor[1], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (not FindGas(x, y)) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Mine');
Exit;
end;
end;
end else
begin
FailAtt := FailAtt + 1;
WriteLn('Ore Not Found, tried ' + IntToStr(FailAtt) + ' Times.');
MakeCompass('N');
SetAngle(True);
end;
until (FailAtt = CFailAtt);
WriteLn('Ore Not Found, Probably Got Lost.');
HaltNo := 1;
Exit;
end;

'iron':
begin
OreColor[0] := 2503251;
OreColor[1] := 1515315;
repeat
if (FindObjTPA(x, y, OreColor[0], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (FindObjTPA(x, y, OreColor[1], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (not FindGas(x, y)) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Mine');
Exit;
end;
end;
end else
begin
FailAtt := FailAtt + 1;
WriteLn('Ore Not Found, tried ' + IntToStr(FailAtt) + ' Times.');
MakeCompass('N');
SetAngle(True);
end;
until (FailAtt = CFailAtt);
WriteLn('Ore Not Found, Probably Got Lost.');
HaltNo := 1;
Exit;
end;

end;
end;

Procedure Init;
begin
Loads := 0;
LampSkill := 'mining';
ClearDebug;
ClearReport;
SmartSetupEx(73, False, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
DeclarePlayers;
SetAudioOff;
LoginPlayer;
end;

Procedure MainLoop;
begin
CheckLogin;
repeat
repeat
CheckLogin;
FailAtt := 0;
ChatsOff;
SetAngle(True);
SetRun(true);
MineOre;
CWait(30);
AntiBan(Random(6));
FindNormalRandoms;
if (InvFull) then
begin
DropAll;
Loads := Loads + 1;
end;
until ((Loads = Players[CurrentPlayer].Integers[0]) or (FailAtt = CFailAtt));
ProgressReport;
Logout;
Cwait(5);
Players[CurrentPlayer].Active := false;
repeat
if(CurrentPlayer = HowManyPlayers - 1) then exit;
Inc(CurrentPlayer);
until(Players[CurrentPlayer].Active = true);
NextPlayer(Players[CurrentPlayer].Active);
Loads := 0;
until(AllPlayersInactive);
writeLn('All Players Finished.');
end;

begin
Init;
MainLoop;
end.

ian.

2009-04-27 10:04:41

Doesn't seem complex enough for me. Sorry. Not voting though.

Floor66

2009-04-27 11:31:04

No.
Sorry, but as 99_ also said, it's not complex enough.

For example, THIS:

Procedure CheckLogin;
begin
if (not loggedIn) then Exit;
end;

Won't work if used like:

procedure Lalala;
begin
CheckLogin;
//stuff.
end;

It will just do this:
Lalala checks CheckLogin, we are logged out so we exit from CheckLogin, but Lalala continues :(

Furthermore, you don't have walking, no DTM's, no BMP's.
The rest of your failsafes and AntiBan/Randoms is better IMO.

ian.

2009-04-27 11:32:51

>.> Why does everyone think my names is _99? Ha ha.

Floor66

2009-04-27 11:34:51

Oh lol it's very confusing ^^.
Back on topic;

Apply again in 1 month with some of the things I said.

BobboHobbo

2009-04-27 11:44:42

Also make a script that banks, makes it more complex and you get a way higher chance of getting SRL Members.

Good try though, keep on scriptin!

NiCbaZ

2009-04-27 12:03:48

Good try, nice script for a begginer!! not not quite good enough for SRL Members, need more advanced methods and some more logic. Try some TPA's there good for many thing!

Da 0wner

2009-04-27 12:29:10

In your MineOre procedure, things could be shortened by a lot.
First, you can set OreColor to a TIntegerArray and set the length to whatever you need it at. Then you can set the length of a TIntegerArray like so:
IntegerArray := [255, 0];
Also, you had a lot of repeated code to mine it. That could get condensed by either using a label, or putting everything except setting the color at the end. I would recommend using the second option I provided as a label is not really needed here. I lowercased the p in procedure because that is one point of standards. You should do that to all of your procedures.
SCAR Script Official Standards
Take a look at a few tutorials about DTMs, DDTMs, TPAs, etc.


The edited procedure:
procedure MineOre;
var
OreColor : TIntegerArray;
x, y: integer;
begin
SetArrayLength(OreColor, 2);
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'copper': OreColor := [4483989, 3824510];
'tin': OreColor := [7566204, 6908273];
'iron': OreColor := [2503251, 1515315];
end;
repeat
if (FindObjTPA(x, y, OreColor[0], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (FindObjTPA(x, y, OreColor[1], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (not FindGas(x, y)) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Mine');
Exit;
end;
end;
end else
begin
FailAtt := FailAtt + 1;
WriteLn('Ore Not Found, tried ' + IntToStr(FailAtt) + ' Times.');
MakeCompass('N');
SetAngle(True);
end;
until (FailAtt = CFailAtt);
WriteLn('Ore Not Found, Probably Got Lost.');
HaltNo := 1;
end;

Floor66

2009-04-27 15:50:18

Who voted yes? C'mon it's not that good. (No offence)

Naike

2009-04-27 16:03:41

I would have voted yes if you would been more active on the forums..

I don't give a shit if the script ain't complex enough.. He shows that he can script and understands it.

For now, i won't vote.

han941306

2009-04-27 16:05:06

Thanks all of your comment.
I just want to get some opinion and see if I have approached the criteria (Probably not), I will do better in the next version of the script :) Thanks anyway..

BobboHobbo

2009-04-27 16:27:54

From: han941306
Thanks all of your comment.
I just want to get some opinion and see if I have approached the criteria (Probably not), I will do better in the next version of the script :) Thanks anyway..


I can see you being a really good scripter anytime soon. Keep it up dude.

Nava2

2009-04-27 16:32:52

Hmm, your logic is good. As others have said, try to avoid the redundant code. If some code looks familiar, you can probably place it in either a loop, or singularly and it will work just fine.

Toss in some walking/banking and I'd vote you a yes. Your logic behind is very good and I think you would work hard even after getting in.

marpis

2009-04-27 18:20:01

I will have to say no. You know what you're doing but you only have one complex procedure, and even that is made unnecessary complex :P

Learn TPAs, their very simple and useful for object finding.
Also add some random crap there that just shows you know how to use DTM's, like finding which pick we are using and calculating time to wait after click.


Procedure CheckLogin;
begin
if (not loggedIn) then Exit;
end;
This doesnt do what you think. 'Exit' command only exits from the _current_ procedure, which is in this case CheckLogin. So you should add if not loggedin then exit; to the beginning of every procedure you want it to be checked.

Also, make your own DropAll, because the on in SRL is broken (it was a month ago?)
Things to learn, and you'll be in next time:
- TPA and ATPA
* ColorToleranceSpeed modifiers (not too exact, just the very basics)
- DTMs
* if you wanna be very leet, then even Dynamic DTMs (DDTM). They are used for walking.

P1nky

2009-04-27 18:47:11

No, I think its too simple, and can be improved in a lot of ways.

Here's 1:
FindObjTPA , is a shortcut for TPA finding… You should use TPA's/DDTMS/RRW and such.

GL next time.

mixster

2009-05-03 14:58:41

Yes.
There are only 2 problems and 1 use of redundant code I found.
One problem was the CheckLogin procedure as said above.
Use of redundant code was as said above.

Other problem is your player switching -


Players[CurrentPlayer].Active := false;
repeat
if(CurrentPlayer = HowManyPlayers - 1) then exit;
Inc(CurrentPlayer);
until(Players[CurrentPlayer].Active = true);
NextPlayer(Players[CurrentPlayer].Active);
This will firstly mean that your script will stop if only the last player is inactive, which would be quite a problem if they were set to inactive in the first place.
Secondly, it can be shortened to:

if (FailAtt = CFailAtt) then
NextPlayer(false)
else
NextPlayer(true);
If you want it to set the player to inactive as they have finished their specified loads, then you could just use "NextPlayer(false);" instead of the above snippit.

Other than this, your script shows promise.
You have made use of the extra player variables, Strings[0] and Integers[0], which are very helpful in the script as you have made use of.
Your script is easy to follow by reading through it.
You double check that you have the right mine.
You have antiban and antirandoms.
You show knowledge of SRL functions and procedures.
CWait is well used - understanding the need for randomness is always good.
You use multiplayer.

For future improvements, adding a banking procedure for popular mines would be a solid addition as would adding failsafes.

footballjds

2009-05-04 20:12:41

From: ~~Joker~~
No, I think its too simple, and can be improved in a lot of ways.

Here's 1:
FindObjTPA , is a shortcut for TPA finding… You should use TPA's/DDTMS/RRW and such.

GL next time.


agreed, but u use findobj in ur script ROFL!!!

No. WAY to simple…:p

Nose Smasher

2009-05-04 23:35:53

Not bad, you understand cases we know… lol ;) I have lots to say bout this script, but I'm only gonna say 2 things for now…

1. Look through, read, and study all of SRL.Scar… I say it to everyone, it really helps! It's what I did :p This way you are familiar and understand all of the cool and powerful Procedures and Functions we have ;)

2. Speaking of Functions, you should try em out! They can be VERY useful :) Instead of just doing what the code says (like in procedures) you can actually return some sort of value or code… like a number, string, true or false, all sorts of things…

Good Luck and keep up the scripting! Hope to see you get membs soon :)

Also, not that it's that big of a deal… but, Join date: Jan 2007 and post count: 14 doesn't look too good :p One of the biggest things that people look for is someone who is active on these forums… ;)

EDIT: sorry, just realized you posted another app on the second :p try waiting at least a month (3 - 5 weeks)

Sir R. M8gic1an

2009-05-05 16:17:06

Bump. It seems like you won't make it this time, however i'll leave it open in case the SRL Members have any extra advice to give you.

~RM

footballjds

2009-05-05 19:03:02

@RM
there isn't really anymore to be said, all his code was already commented on… ;)
i think it can be close now, no?

Tniffoc

2009-05-07 10:35:56

No. Sorry. Not enough complexity.

In the future, try to add some custom object finding instead of FindObjectTPA

MasterKill

2009-05-07 12:44:54

A good start :) AND it's a good thing you used TPA item finding!

Though, I would like to see something more advanced. If you add walking to the bank/mine, and the banking obviously, it will be a yes for sure.

No for now, good luck next time.

lordsaturn

2009-05-08 06:11:40

No from me. Only one part of your script managed to catch my eye, which was your mining procedure. I like your use of TPAs, but your redundant code turned me off. And if you don't understand what I mean by redundant code, here is an example of what your mining procedure could be.
Procedure MineOre;
var
OreColor : array[0..1] of integer;
x, y: integer;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'copper':
begin
OreColor[0] := 4483989;
OreColor[1] := 3824510;
end;
'tin':
begin
OreColor[0] := 7566204;
OreColor[1] := 6908273;
end;
'iron':
begin
OreColor[0] := 2503251;
OreColor[1] := 1515315;
end;
end;
repeat
if (FindObjTPA(x, y, OreColor[0], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (FindObjTPA(x, y, OreColor[1], 10, 2, 15, 25, 10, ['Rock', 'Roc', 'ock'])) then
begin
if (not FindGas(x, y)) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Mine');
Exit;
end;
end;
end else
begin
FailAtt := FailAtt + 1;
WriteLn('Ore Not Found, tried ' + IntToStr(FailAtt) + ' Times.');
MakeCompass('N');
SetAngle(True);
end;
until (FailAtt = CFailAtt);
WriteLn('Ore Not Found, Probably Got Lost.');
HaltNo := 1;
end;


Your CheckLogin won't work :( It exits itself, not the procedure it is placed inside, which I assume is what you were trying to do.

Your standards are near perfect, not much to complain about there.

In your mainloop,
Players[CurrentPlayer].Active := false;
why is the current player always set to false? Shouldn't the player only be set to false if something goes wrong?

Good start, I'd like to see you apply again soon.

marpis

2009-05-10 17:38:02

From: lordsaturn
…here is an example of what your mining procedure could be.
Procedure MineOre;
var
OreColor : array[0..1] of integer;
x, y: integer;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'copper': OreColor:= [4483989, 3824510];
'tin': OreColor:= [7566204, 6908273];
'iron': OreColor:= [2503251, 15153153];
end;



i fixed the first case a bit.

Gu3st...

2009-05-16 11:28:35

Great start and there is logic in you'r scripting, but as stated before; not complex enough and there is some code that could be removed/shortened and/or made in a better way…
Be sure to read tutorials on the things we say that you could improve in, and then try to reapply, I am sure you could get in if you keep on trying (and improving).
I vote no.
EDIT: No I don't, the poll is closed…

Sir R. M8gic1an

2009-05-19 14:29:50

I am sorry, but you didn't make it this time.
You're on the right way, don't give up.
Feel free to try again in a month.

~RM