SRL Archive - Archive

yargo - SRL Member Application Form


yargo

2008-08-26 17:01:26

<!– BEGIN TEMPLATE: formanswers –>
yargo - SRL Member Application Form
yargo

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
In order most to least skill: Java(know a lot), assembly, delphi, php, c++(can work with it)

Other Communitys
nothing to do with runescape, although i ran a private server for a while there

How Long have You Played Runescape
i was one of the first 500 people to start

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

I've played runescape off and on since it first came out. At the time jagex had mainly online chess and a couple arcade games. I've autoed for a long time, not with scar though. Before rs2 I used an autominer written by nicholas sherlock. It was a simple autoclicker with basic color finding features. It's obsolete now that the camera turns randomly and colors change. Thats really a shame, as it was a great little program. Still useful though. Then for a while I used AutoHotKey, which is a scripting language with a lot of features. Its still useful but mainly with other games. Its not terribly useful for runescape because its not meant for it. Anyhow, I have a lot programming experience and feel I could contribute a lot to this community.

A bit about the script I'm submitting:

Some features haven't been fully thought out yet, but I'm working on it. I was too lazy to have a reflection failsafe because this script does a whole lot of walking. I'd really love to release this in the Members section instead of jr members or ffa section because I don't want 1000 people suddenly running around runescape in exactly the same loop that I'm doing. Anyhow, it still could use a little work but I thought this was a fair sample of my work.

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

//-----------------------------------------------------------------//
//-- A SCAR+SRL Script by Yargo --//
//-- The Soft Clay Assembler and Banker --//
//-- » S.C.A.B. « --//
//-- --//
//-- Directions: --//
//-- Fill out the DeclarePlayers procedure --//
//-- --//
//-- Valid Players[#].Integers[1] values are: --//
//-- 1 - The south door of West Varrock Bank --//
//-- 2 - The West Varrock Mine --//
//-- 3 - The Fountain in Varrock Square --//
//-- --//
//-- Unless you know what the script wants at each location --//
//-- please leave your player at the south door of the bank --//
//-- with 9 empty buckets and an unequipped pickaxe. --//
//-- --//
//-- --//
//-- --//
//-- Please post progress on the forums. --//
//-- --//
//-- Post errors or send directly to [email]jmp.00534558@gmail.com[/email] --//
//-- for speedier replies. --//
//-----------------------------------------------------------------//


program ClayTester;
{.include SRL/SRL/Misc/Smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/mining.scar}
{.include srl/srl/reflection/reflection.scar}
var
WorldNumber: Integer;

procedure declarePlayers;
begin
WorldNumber := 57;
LampSkill := 'Magic'; //Which skill to increase if there is a magic lamp
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
{
PLEASE REMEMBER TO START EACH PLAYER WITH 9 EMPTY BUCKETS AND 1 PICKAXE AT THE
SOUTH DOOR TO THE VARROCK WEST BANK FOR MAXIMUM SCRIPT EFFECTIVENESS
}
Players[0].Name := ''; //username
Players[0].Pass := ''; //password
Players[0].Nick := ''; //3-4 letters from your username
Players[0].Integers[1] := 1; // 1 for bank, 2 for mine, 3 for fountain
Players[0].Booleans[2] := false; //is player broken? (don't touch this!)
Players[0].Active := True;

Players[1].Name := ''; //username
Players[1].Pass := ''; //password
Players[1].Nick := ''; //3-4 letters from your username
Players[1].Integers[1] := 1; // 1 for bank, 2 for mine, 3 for fountain
Players[1].Booleans[2] := false; //is player broken? (don't touch this!)
Players[1].Active := True;
end;

var
EmptyBucket,FullBucket,HardClay,SoftClay,AnyPickaxe: Integer;

procedure ItemMapSetup;
begin
EmptyBucket := DTMFromString('78DA63AC6161606866624006493E520C46409' +
'A1188FF03016325504D15AA1A882C8C04D2D540359309A86906AA' +
'9940404D2B504D1D0135254035FDF8D5000097050B45');
FullBucket := DTMFromString('78DA63CC6762606060644006B57573198CA0A' +
'2FF8180B102A88603550D4C0F4C943103A88697809A34A09ADF0C' +
'F8D5E401D57C26A0A612A8E6177E350057930B80');
HardClay := DTMFromString('78DA6394676160086164400613AA821864803' +
'448F43F1030CA01D504A1AA81C8C24820AD01541340408D0C504D' +
'14013562403561F8D500002B2107D9');
SoftClay := DTMFromString('78DA6354666160B0666440065531FC0C72401' +
'A24FA1F081815806A7451D540646124909603AAD127A04612D32E' +
'0C3546403546F8D50000A65B06D7');
AnyPickaxe := DTMFromString('78DA63546461601066644006068A6C0C22401' +
'A24FA1F0818B5816A3850D540646124909606AA9125A04609A886' +
'8B801A35A01A3EFC6A00044D058E');
end;

var
BankToMinePath,MineToFountainPath,FountainToBankPath: TPointArray;
procedure SetPaths;

begin
SetLength(BankToMinePath,8);
BankToMinePath[0] := Point(3186, 3429);
BankToMinePath[1] := Point(3175, 3427);
BankToMinePath[2] := Point(3171, 3419);
BankToMinePath[3] := Point(3171, 3408);
BankToMinePath[4] := Point(3171, 3400);
BankToMinePath[5] := Point(3173, 3393);
BankToMinePath[6] := Point(3177, 3383);
BankToMinePath[7] := Point(3183, 3376);

SetLength(MineToFountainPath, 9);
MineToFountainPath[0] := Point(3187, 3376);
MineToFountainPath[1] := Point(3198, 3376);
MineToFountainPath[2] := Point(3206, 3374);
MineToFountainPath[3] := Point(3211, 3384);
MineToFountainPath[4] := Point(3211, 3392);
MineToFountainPath[5] := Point(3212, 3401);
MineToFountainPath[6] := Point(3211, 3411);
MineToFountainPath[7] := Point(3211, 3420);
MineToFountainPath[8] := Point(3209, 3428);

SetLength(FountainToBankPath, 4);
FountainToBankPath[0] := Point(3204, 3428);
FountainToBankPath[1] := Point(3196, 3429);
FountainToBankPath[2] := Point(3187, 3429);
FountainToBankPath[3] := Point(3186, 3433);
end;

procedure WriteName;
begin
WriteLn('SSSSSS SSSSSS');
WriteLn(' SS SS');
WriteLn(' SS SS CCCCCC AAAAAAAAAA BBBBBBBBBB !!!!!! ');
WriteLn(' SSSSSS CC AA AA BB BB !! !!');
WriteLn(' SS CCCCCCCC AA BB BB !! !!');
WriteLn(' SS CC CC AA BB BB !! !!');
WriteLn(' SS CC CC AA BB BB !! !!');
WriteLn(' SSSSSS CCCCCCCCCC AAAAAA BBBBBBBB !!!!!!');
WriteLn(' BB BB');
WriteLn(' BBBBBB ');
end;

function BrokenPlayers: boolean;
var
i:Integer;
begin
for i:=0 to HowManyPlayers-1 do
if Players[i].booleans[2] = true then Result := true;
end;

{*******************************************************************************
Randoms procedure stolen from MasterKill's VEIM
Description: Detects randoms and runs away if it finds a fight. It also
will run back when it's done.
I modified it slighly to make it more useful
********************************************************************************}
function Randoms: boolean;
begin
result := FindNormalRandoms;
if FindFight then
begin
MakeCompass('n');
mouse(630, 154, 5, 5, True);
fflag(0);
SleepAndMoveMouse(15000+random(5000));
Mouse(630, 15, 5, 5, True);
SleepAndMoveMouse(2000 + random(2000));
fflag(0);
result := true
end;
end;

procedure Fail;
begin
logout;
Players[CurrentPlayer].booleans[2] := true;
NextPlayer(false);
end;

var
scount,time,total,avg:integer;
function Bank:Boolean;
var
x,y:Integer;
begin
Players[CurrentPlayer].Integers[1] := 1;
scount := scount + CountItems(SoftClay,'dtm',[10]);
OpenBankFast('vwb');
SleepAndMoveMouse(800+Random(400));
FindDTM(SoftClay,x,y,MIx1,MIy1,MIx2,MIy2);
Mouse(x,y,5,5,false);
Wait(Random(300)+285);
if not ChooseOption('All') then
begin
WriteLn('Could not Bank any Softened Clay');
Exit;
end;
WriteLn(IntToStr(scount) + ' soft clays banked so far');
SleepAndMoveMouse(800+Random(400));
FindDTM(HardClay,x,y,MIx1,MIy1,MIx2,MIy2); //Bank hard clay if any failed
Mouse(x,y,5,5,false);
Wait(Random(300)+285);
if not ChooseOption('All') then
begin
WriteLn('No hard clays to bank');
Exit;
end;
result := true;
Randoms;
end;

function CheckBuckets: boolean;
var
ea,x,y: Integer;
begin
if not LoggedIn then Exit;
GameTab(4);
ea := CountItems(EmptyBucket,'dtm',[10]);
ea := ea + CountItems(FullBucket,'dtm',[10]);
if (ea < 1) then
begin
WriteLn('Please place between 1 and 9 buckets in inventory');
Fail;
end;
if (ea > 9) then
repeat
FindDTM(EmptyBucket,x,y,MIx1,MIy1,MIx2,MIy2);
Mouse(x,y,4,4,False);
if not Players[CurrentPlayer].Integers[1] = 1 then
begin
if(ChooseOption('Drop'))
then Dec(ea);
end else
begin
Fail;
result := false;
end;
until (ea = 9);
if (ea < 9) then
begin
WriteLn('Recommended function is with 9 buckets and 1 pickaxe not equipped.')
end;
end;



// InvControl drops all the random crap you've picked up while mining
function InvControl: boolean;
var
InvDatabase: TPointArray;
i,x,y: Integer;
TB: TBox;
begin
if not LoggedIn then Exit;
SetLength(InvDatabase,28);
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if not FindDTM(HardClay, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
if not FindDTM(EmptyBucket, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
if not FindDTM(AnyPickaxe, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
if not FindDTM(FullBucket, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
begin
Mouse((TB.x1+TB.x2)/2,(TB.y1+TB.y2)/2,5,5,false);
Wait(500+Random(1000));
if not ChooseOption('rop') then
begin
if not Randoms then Fail;
end;
wait(2000+Random(1000));
end;
end;
result := true;
end;

procedure MineClay;
var
x,y,clickcount,tol: Integer;
begin
if not LoggedIn then Exit;
tol := 5;
repeat
if(FindColorTolerance(x,y,5873088,MSX1,MSY1,MSX2,MSY2,tol))then
begin
tol := 5;
MMouse(x,y,2,2);
if(IsUpText('ine'))then
begin
Mouse(x,y,6,6,true);
SleepAndMoveMouse(1700+Random(1500));
end;
end else
begin
tol := tol + 5;
inc(clickcount);
end;
if clickcount>7 then
begin
Randoms;
clickcount:=0;
end;
until InvFull;
if not InvControl then MineClay; //yaay recursion
end;

function ClickFountain(fountainClear: boolean):boolean;
var
b,c,maxwait: Integer;
begin
if not LoggedIn then Exit;
GetMousePos(b, c);
HoldMouse(b, c, fountainClear); //My modified mouse procedure
Wait(83+Random(117)); //This wait calculation is the same as that of Mouse()
ReleaseMouse(b,c,fountainClear);
if not fountainClear then
begin
Wait(500+Random(300));
ChooseOption('ountai');
end;
repeat
if maxwait>7 then break;
SleepAndMoveMouse(500+Random(500));
Inc(maxwait);
until not FindDTM(EmptyBucket,b,c,MIx1,MIy1,MIx2,MIy2);
result := true;
end;

procedure FillBuckets;
var
fontx,fonty,x,y: Integer;
begin
if not LoggedIn then Exit;
FindDTM(EmptyBucket,x,y,MIx1,MIy1,MIx2,MIy2);
if(FindColorTolerance(fontx,fonty,9866342,MSX1,MSY1,MSX2,MSY2,3)) then
begin
Mouse(x,y,3,3,false);
Wait(1000+Random(500));
ChooseOption('se ');
Wait(300+Random(500));
MMouse(fontx,fonty,3,3);
ClickFountain(IsUpText('> F'));
SleepAndMoveMouse(800+Random(200));
end;
end;

// Fills buckets and softens clay. Stops when there is no more clay
// to soften.
procedure SoftenClay;
var
clayx,clayy,waterx,watery: integer;
hhclay,hsclay,heb,hfb: boolean;
begin
if not LoggedIn then Exit;
Randoms;
if FindDTM(SoftClay,clayx,clayy,MIx1,MIy1,MIx2,MIy2) then
hsclay := true;
if FindDTM(HardClay,clayx,clayy,MIx1,MIy1,MIx2,MIy2) then
hhclay := true;
if FindDTM(EmptyBucket,waterx,watery,MIx1,MIy1,MIx2,MIy2) then
heb := true;
if FindDTM(Fullbucket,waterx,watery,MIx1,MIy1,MIx2,MIy2) then
hfb := true;
if heb then
begin
FillBuckets;
SoftenClay;
end else
if hfb then
begin
if hhclay then
begin
Mouse(waterx,watery,3,3,false);
Sleep(700+Random(500));
ChooseOption('se');
Mouse(clayx,clayy,3,3,true);
Sleep(200+Random(300));
Mouse((MCx1+MCx2)/2, (MCy1+MCy2)/2, 3, 3,false);
Sleep(200+Random(500));
ChooseOption(' Al');
SleepAndMoveMouse(6000+Random(1000));
SoftenClay;
end;
end;
end;

// Walks from somewhere to somewhere else
function WalkThePath(PathArray: TPointArray): boolean;
var
i:Integer;
begin
if not LoggedIn then Exit;
SetRun(true);
for i:=0 to Length(PathArray)-1 do
begin
if not WalkToTile(PathArray[i],1,4) then
begin
WriteLn('Could not walk to point at index '+IntToStr(i)+'. Trying again.');
SleepAndMoveMouse(4000+Random(3000));
if not WalkToTile(PathArray[i],0,4) then begin
WriteLn('No luck captain, switching players');
Result := false;
NextPlayer(false);
Exit;
end;
end;
end;
Result := true;
end;

procedure SetupPlayer;
begin
repeat
if not(LoggedIn) then LoginPlayer;
MakeCompass('n');
SetAngle(true);
case Players[CurrentPlayer].Integers[1] of
1: begin
CheckBuckets;
if WalkThePath(BankToMinePath) then
Players[CurrentPlayer].Integers[1] := 2;
end;
2: begin
MineClay;
if WalkThePath(MineToFountainPath) then
Players[CurrentPlayer].Integers[1] := 3;
end;
3: begin
SoftenClay;
if WalkThePath(FountainToBankPath) then
Players[CurrentPlayer].Integers[1] := 4;
end;
4: begin
Bank;
total := TimeFromMark(time);
WriteLn(FloatToStr(1.0*scount/total*60000));
Players[CurrentPlayer].Integers[1]:=1;
end;
else begin
WriteLn('Improper value of Integers[1] in Players array.');
Exit;
end;
end;
until not (LoggedIn);
end;

begin
SetupSRL;
declarePlayers;
SmartSetupEx(WorldNumber,True,True,False);
SetTargetDC(SmartGetDC);
SmartSetDebug(True);
SetPaths;
if not LoggedIn then LoginPlayer;
ItemMapSetup;
WriteName;
MarkTime(time);
SetupPlayer;
end.

——————————————————
<!– END TEMPLATE: formanswers –>

MasterKill

2008-08-26 17:25:56

still looking over the code, might change my mind

done:

I say your ALLMOST there. but I end up giving a no sorry. You might wana improve your object finding ("FindObjectTPA"?). And failsaves for the reflection walking are kind of a must :(

Anyway you made a very good start but it's just not good enough yet IMO.

Good luck scripting!

Claymore

2008-08-26 17:34:29

Where do you noobs learn reflections…. (I want to learn how to as well.) But a NO for me because there is no advanced functions.

boberman

2008-08-26 17:38:14

Im saying yes, even though reflections isn't backed up, the script looks pretty good and clean.

There are one or two problems with spacing and indentations but not many.

One other thing is the single use of recursion. Recursion is the root of all evil and should only be used when it significantly reduces the complexity of the problem. In the case where you used it. It doesn't. You would be much better off using a while loop there instead.

The reason that was a particularly bad place for recursion is because you've just created the potential for a lot of overhead for a basic loop. That is not needed. Unless you are solving the Tower of Hannoi, you should almost always avoid recursion.

NiCbaZ

2008-08-26 17:40:06

no. reflection, not fully backup by SRL. no.

MylesMadness

2008-08-26 20:49:10

No, reflection must have a color backup

P1nky

2008-08-27 00:00:56

From: Mylesmadness
No, reflection must have a color backup


.

Naike

2008-08-27 02:22:02

Try using RadialWalk as it is a requerment to be an SRL member…

nielsie95

2008-08-27 11:45:35

From: Mylesmadness
No, reflection must have a color backup


From: NiCbaZ
no. reflection, not fully backup by SRL. no.


From: N1ke!
Try using RadialWalk as it is a requerment to be an SRL member…


Those aren't reasons to refuse.. The code looks good, doesn't it?

boberman

2008-08-27 12:04:06

From: nielsie95
Those aren't reasons to refuse.. The code looks good, doesn't it?


Aye, thats what I thought. I'm pretty sure SRL Membership isn't about correctly using radialwalk. It is about ones ability to script.

This script looks good. as I stated above, other then some more backups to walking it really does look like the author put a good amount of thought and effort in it.

Nava2

2008-08-27 12:49:47

Ugly code, lacking spaces.

God, I am way to sticky with that.

your mining is slow, and you use no advanced functions.

Reflection is more or less a mitigating factor, if you don't back it up.

WELLL… I'm going to say no. Fix it up, and reapply again. When you do that, I will happily say yes.

Naike

2008-08-27 13:25:42

Nielsie -> Well, Reflections without failsaves is WAAY to simple to do… And radialwalk is a requrement isnt it? >=)

Gu3st...

2008-08-27 16:40:05

From: N1ke!
Nielsie -> Well, Reflections without failsaves is WAAY to simple to do… And radialwalk is a requrement isnt it? >=)


If you make a perfect walking without radialwalk then its not a requrement, I would say its a requrement as a backup if you are using reflection.

Im not going to vote for this one, I think it is too short, and not lots of failsafes…

Naike

2008-08-28 16:51:52

Zytex! -> I fully agree, But this guy got nothing exept Reflections…
Im sorry but its a No.

nielsie95

2008-08-31 08:04:51

It seems like you're not getting in, sorry.
You may try again in one month, good luck :)
Closed.