SRL Archive - News and General

Solved Leo (GraveDigger) Random for the first time


SKy Scripter

2008-03-30 01:56:06

Well, i have been working on a project for SRL and it's finished ! xD.
I have Solved Leo The Grave digger.

In case you don't know what this random is :

[ATTACH]11403[/ATTACH]


If you get the chance i would appreciate if you test this!
It does require a plug-in so you must download my attachment.

Here is the Solver. (make sure you put the plug-in in scar before playing script)


program New;


{.include SRL\SRL.scar}


var
Leo_Coffins : array [0..4] of record
Inv: Integer;
Name: string;
end;


{*******************************************************************************
function Leo_WalkToCenter: Boolean;
by: SKy Scripter
Description: Walks to The Center Of Leo (on map).
*******************************************************************************}
function Leo_WalkToCenter: Boolean;
var
Canvas:Tcanvas;
mx, my, bit: Integer;
begin
bit := BitmapFromString(153, 153, '');
canvas := GetBitmapCanvas(bit);
CopyCanvas(GetClientCanvas, Canvas, MMX1, MMY1, MMX2, MMY2, 0, 0, 153, 153);
Leo_GetMiddleFloor(mx, my, Canvas);
if ( mx <> 0) and (my <> 0) then
begin
mx := mx + mmx1;
my := my + mmy1;
Mouse(mx, my, 5, 5, true);
flag;
wait(1000 + random(500));
end;
end;




{*******************************************************************************
function Leo_CheckInventory: Boolean;
by: SKy Scripter
Description: Makes a nice Inventory for the Leo Solver. (burys bones)
*******************************************************************************}
function Leo_CheckInventory: Boolean;
var
DTM, x, y, C: Integer;
begin
if (InvCount > 23) then
begin
DTM := DTMFromString('78DA637462626060636440058C4824903605A' +
'A6125A0C695098987438D1D500D3F0135DE4035EC4498C3845F0D' +
'00DBDA01CB');
C := 0;
while (C < 10) do
begin
C := C + 1;
if (FindDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 3, 3, True);
Wait(1500 + random(800));
end;
end;
FreeDTM(DTM);
if (InvCount > 23) then
begin
Players[CurrentPlayer].Active := false;
Players[CurrentPlayer].Rand := 'Leo Too much inventory';
Logout;
end else
Result := true;
end;
end;




{*******************************************************************************
function Leo_CountCoffins: Integer;
by: SKy Scripter
Description: Counts The Amount of coffins in Inventory.
*******************************************************************************}
function Leo_CountCoffins: Integer;
var
Box: TBox;
DTM, i, x, y: Integer;
begin
Result := 0;
DTM := DTMFromString('78DA634C636260B8C58006189148209D0454F' +
'38C809A7CA09A8F04D49401D53C25A0A61CA8E61D013509403577' +
'F1AB0100CF1C0804');
for i := 1 to 28 do
begin
GetInvItemBounds(i, Box);
if (FindDTM(DTM, x, y, Box.x1, Box.y1, Box.x2, Box.y2)) then inc(result);
end;
freeDtm(dtm);
end;


{*******************************************************************************
function Leo_CheckInventory: Boolean;
by: SKy Scripter
Description: Makes a nice Inventory for the Leo Solver. (burys bones)
*******************************************************************************}

function Leo_GatherCoffins: Boolean;
var
x, y, t: Integer;
begin
if (not(LoggedIn)) then LoginPlayer;
wait(400 + random(200));
Leo_WalkToCenter;
MakeCompass('n');
Leo_CheckInventory;
if (InvCount > 23) then exit;
result := true;

repeat
t := t + 1;
if (not(LoggedIn)) then LoginPlayer;
if (FindObjTPA(x, y, 3695480, 20, 5, 5, 5, 5, ['offi'])) then
begin
Mouse(x, y, 0, 0, False);
ChooseOption('ake');
Wait(200 + random(300));
Flag;
Wait(2000 + random(1000));
end else
begin
Leo_WalkToCenter;
wait(500 + random(200));
end;
until (t > 20) or (Leo_CountCoffins = 5);

wait(1000 + random(1000));
if (t > 20) then
begin
Players[CurrentPlayer].Active := false;
Players[CurrentPlayer].Rand := 'Leo Too much inventory';
Logout;
result := false;
end;
Leo_WalkToCenter;
end;



{*******************************************************************************
procedure Leo_AnalyzeCoffins;
by: SKy Scripter
Description: Saves The Coffins types in variables.
*******************************************************************************}
procedure Leo_AnalyzeCoffins;
var I, DTM, x, y, n, t, w, h, bitmap: Integer;
canvas: tcanvas;
Box: TBox;
begin
if (Leo_CountCoffins < 5) then exit;
DTM := DTMFromString('78DA634C636260B8C58006189148209D0454F' +
'38C809A7CA09A8F04D49401D53C25A0A61CA8E61D013509403577' +
'F1AB0100CF1C0804');

w := 350;
h := 270;
bitmap := BitmapFromString(w, h, '');
Canvas := GetBitmapCanvas(bitmap);

for I:= 1 to 28 do
begin
GetInvItemBounds(i, Box);
if (n > 4) then break;

if (FindDTM(DTM, x, y, Box.x1, Box.y1, Box.x2, Box.y2)) then
begin
Leo_Coffins[n].inv := i;
Leo_Coffins[n].name := 'error';
t := 0;

while (Leo_Coffins[n].name = 'error') and (t < 5) do
begin
Mouse(x, y + 4, 5, 5, true);
wait(2000 +random(500));
try Leo_AnalyzeCoffin(Leo_Coffins[n].name, canvas); except end;
wait(100+ random(200));
CloseWindow;
inc(t);
end;

inc(n);
end;

end;
FreeDTM(DTM);
try FreeBitmap(Bitmap); except end;
wait(1000+random(500));
CloseWindow;
if (n < 5) then
begin
Players[CurrentPlayer].Active := false;
Players[CurrentPlayer].Rand := 'Could not get all coffins';
Logout;
end;
end;

{*******************************************************************************
function Leo_FindUnReadStone(var x, y:integer): Boolean;
by: SKy Scripter
Description: Finds Graves that has no coffins in it. (to solve them)
*******************************************************************************}

function Leo_FindUnReadStone(var x, y:integer): Boolean;
var P: TPointArray;
T: T2DPointArray;
I: Integer;
begin
FindColorsTolerance(P, 8684943, 5, 5, MSX2 - 5, MSY2 - 5, 50);
T := SplitTPAex(P, 10, 10);
SortATPAFromFirstPoint(T, Point(MSCX, MSCY));
for I := 0 to Length(T) - 1 do
if (Length(T[i]) > 15) then
begin
MiddleTPAEx(T[i], x, y);
if (CountColorTolerance(3101798, x - 50, y - 50, x + 50, y + 50, 15) < 20) then
begin
MMouse(x, y, 3, 3);
Wait(100 + random(50));
if (IsUpText('ead')) then
begin
Result := true;
GetMousePos(x, y);
exit;
end;
end;
end;
end;

{*******************************************************************************
procedure Leo_PlaceCoffinIn(I: Integer);
by: SKy Scripter
Description: Places Coffin in the grave.
*******************************************************************************}
procedure Leo_PlaceCoffinIn(xf, yf, I: Integer);
var
Points: TPointArray;
k, x, y: Integer;
s: string;
Box: Tbox;

begin
GetInvItemBounds(Leo_Coffins[I].Inv, Box);
Mouse(Box.x1 + 5, Box.y1 + 5, 10, 10, False);
ChooseOption('Use');

FindColorsSpiralTolerance(xf, yf, Points, 4149085, xf - 50, yf - 50, xf + 50, yf + 50, 20);
for K := 0 to Length(Points) - 1 do
if (Distance(Points[k].x, Points[k].y, x, y) > 10) then
begin
MMouse(Points[k].x, Points[k].y, 2, 2);
GetMousePos(x, y);
s := rs_GetUpText;
if ((Pos('Use', s) <> 0) and (Pos('Grave',s) <> 0) and (Pos('Gravestone', s) = 0)) then
begin
Mouse(x, y, 0, 0, True);
Flag;
Wait(2000 +random(1000));
break;
end;
end;
end;




{*******************************************************************************
function Leo_SolveGraves: Boolean;
by: SKy Scripter
Description: Places All Coffins in the right graves.
*******************************************************************************}
function Leo_SolveGraves: Boolean;
var
x, y, fs, I, t, bitmap, w, h:Integer;
gravestone: string;
canvas: tcanvas;
begin
Leo_WalkToCenter;

fs := 0;
w := 350;
h := 270;
bitmap := BitmapFromString(w, h, '');
Canvas := GetBitmapCanvas(bitmap);
repeat
inc(fs);
GraveStone := 'error';
t := 0;
while (GraveStone = 'error') and (t < 3) do
begin
if (Leo_FindUnReadStone(x, y)) then
begin
Mouse(x, y, 0, 0, true);
flag;
wait(2000 +random(500));
try
Leo_AnalyzeGraveStone(GraveStone, canvas);
except end;
Writeln('Stone: '+GraveStone);
wait(100+ random(200));
CloseWindow;
inc(t);
end else
begin
Leo_WalkToCenter;
wait(500 + random(200));
end;
wait(500 + random(500));
end;

I:= 0;
for I := 0 to 4 do
if (Leo_Coffins[i].name = GraveStone) then break;

if (Leo_Coffins[i].Inv = -1) then break;
Leo_FindUnReadStone(x, y)
Leo_PlaceCoffinIn(x, y, I);
until (Leo_CountCoffins = 0) or (fs > 8);
result := (Leo_CountCoffins = 0);
try freebitmap(bitmap) except end;
end;



{*******************************************************************************
function FindLeo: Boolean;
by: SKy Scripter
Description: Finds The Leo Random and solves it!
*******************************************************************************}

function FindLeo: Boolean;
var i, n, fs, x, y: integer;
gob: boolean;
label reget;
begin
i:= 0;
while (ClickToContinue) and (i < 20) do
begin
inc(i);
wait(100+ random(50));
end;
CloseWindow;
Wait(2000 + random(500));
KeyDown(VK_UP);
wait(2000 + random(1000));
KeyUp(VK_UP);

if (Leo_GatherCoffins) then
begin

reget:

if (fs > 3) then
begin
Players[CurrentPlayer].Active := false;
Players[CurrentPlayer].Rand := 'Could not get all coffins';
Logout;
Exit;
end;

Leo_AnalyzeCoffins;
gob := false;

for i := 0 to 4 do
for n := 0 to 4 do
if (n <> i) then
if (Leo_Coffins[i].Name = Leo_Coffins[n].Name) then
begin
Inc(fs); gob := true; break;
end;

if (gob) then goto reget;

if (not(Leo_SolveGraves)) then FindLeo;
wait(1000 + random(200));
Leo_WalkToCenter;
end;
result := true;
if (Not(Leo_CountCoffins = 0)) then Exit;


i := 0;
repeat
inc(i);
n := 0;

if (FindColor(x, y, 195836, MMX1, MMY1, MMX2, MMY2)) then
if (Distance(MMCX, MMCY, x, y) > 5) then
begin
MouseFlag(x - 2, y - 2, 5, 5);
Wait(1000 + random(500));
end;

if (FindObjTPA(x, y, 7708364, 20, 5, 5, 5, 5, ['alk'])) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('alk');
Flag;
Wait(2000 + random(1000));
while (ClickToContinue) and (n < 20) do
begin
n := n + 1;
wait(100 + random(50));
end;
exit;
end;
until (i > 5);
end;







var i:integer;
begin
FindWindowBySize(766, 504);
SetLength(Players, 1);

SetupSRL;
ActivateClient;
wait(1000);

FindLeo;

for i:= 0 to 4 do
begin
Writeln('inv:'+inttostr(Leo_Coffins[i].Inv));
Writeln('Name:'+Leo_Coffins[i].name);
Writeln('');
end;


//Leo_FindUnReadStone(x, y);
end.

Timothegreat

2008-03-30 02:07:29

looks nice!

il test it when i get this random. :)

munk

2008-03-30 02:26:55

I never bonebury cause of Leo!

awesome, ill try to test

king vash

2008-03-30 03:52:35

every random solved is a god sent, failure to complete randoms is what get's people banned i think, and it interrupts scripts

SKy Scripter

2008-03-30 03:55:32

I also made a new Certer solver :)

ShowerThoughts

2008-03-30 03:59:35

{*******************************************************************************
function Leo_CheckInventory: Boolean;
by: SKy Scripter
Description: Makes a nice Inventory for the Leo Solver. (burys bones)
*******************************************************************************}

function Leo_GatherCoffins: Boolean;

;) good job!

Markus

2008-03-30 04:05:40

You did it! :D
Good job, lets put this in my SRL and turn bone burying on ;)

Naum

2008-03-30 05:00:56

Wel Done.
Even tough it's rare i'll try it.
Wasn't it rumoured that Fakawi had a leo solver in his script aswell???
Anyways GJ!

Richard

2008-03-30 05:06:50

Finally theres a leo solver! I remember when I was going for 70 prayer (never got there) and I got this alot and I wished there was a solver.

GJ! Rep++

Rikje

2008-03-30 05:18:05

From: NaumanAkhlaQ
Wel Done.
Even tough it's rare i'll try it.
Wasn't it rumoured that Fakawi had a leo solver in his script aswell???
Anyways GJ!


Yep, wuzzip told ones that they had a account in the leo random for a few months. in cause it went broke.

but,, sexy work sky!! :)

SKy Scripter

2008-03-30 05:24:56

Lol, lets just hope it keeps working…
that's why i want you guys to test it xD.


Btw, NaumanAkhlaQ.
Lets see i think it was Pups, Wizzup? and wt-fakawi who tried to solve it..
but they never got finished with it.
I think pups was having problems with the stone detection..
and his plug-in would only work if it was put into SCAR because he used too much recursion.

I know because when i was solving it i had the same problem, however, i found my way around it.

But i don't know why they never finished it….

BobboHobbo

2008-03-30 05:45:06

Nice job, means that Tara's chicken killer can run 24/7 with boosting prayer.. yay.

GJ.

Naike

2008-03-30 06:00:36

Nice job ;)
Ive never gotten this random ^^! You get any clothing or items ?

Markus

2008-03-30 06:12:56

From: N1ke!
Nice job ;)
Ive never gotten this random ^^! You get any clothing or items ?

You'll get zombie clothes :)

ShowerThoughts

2008-03-30 06:18:35

From: SKy Scripter
Lol, lets just hope it keeps working…
that's why i want you guys to test it xD.


Btw, NaumanAkhlaQ.
Lets see i think it was Pups, Wizzup? and wt-fakawi who tried to solve it..
but they never got finished with it.
I think pups was having problems with the stone detection..
and his plug-in would only work if it was put into SCAR because he used too much recursion.

I know because when i was solving it i had the same problem, however, i found my way around it.

But i don't know why they never finished it….


I think you want to heir 'Your AWSOME' :P
Not Kidding Good Job, but can you explain the code a bit?

EvilChicken!

2008-03-30 07:11:58

Wow. Good job! Every random solved is a new step towards world domination.

Tell us more about your CerterSolver? Whats different from the old one?

SKy Scripter

2008-03-30 18:53:30

From: Hermpie
I think you want to heir 'Your AWSOME' :P
Not Kidding Good Job, but can you explain the code a bit?



Well do you mean in my plug-in ?


Wow. Good job! Every random solved is a new step towards world domination.

Tell us more about your CerterSolver? Whats different from the old one?

And, I hope this gets included in Rev#15.



Well, my new Certer Solver is more accurate than the old one.
basically i made a new one because i was told my old one wasn't working well.

Widget

2008-03-30 19:57:43

Sweet, so I can get my account back? XD

Now I start a quest to make a Prayer Pure!

[A standard noob with level 99 prayer is only combat level 13. =)]

SKy Scripter

2008-03-30 20:39:01

From: Widget
Sweet, so I can get my account back? XD

Now I start a quest to make a Prayer Pure!

[A standard noob with level 99 prayer is only combat level 13. =)]



Oh yea i forgot to say thanks so much for the account :)
I really found your account useful :)

Markus

2008-03-31 10:33:46

Got a Leo!
Gonna run the solver on it now, you still got that char inside don't you?

Wizzup?

2008-03-31 11:05:37

From: SKy Scripter
Btw, NaumanAkhlaQ.
Lets see i think it was Pups, Wizzup? and wt-fakawi who tried to solve it..
but they never got finished with it.
I think pups was having problems with the stone detection..
and his plug-in would only work if it was put into SCAR because he used too much recursion.

I know because when i was solving it i had the same problem, however, i found my way around it.

But i don't know why they never finished it….


Pups' solver never worked 100%, and it has never been put into SCAR either.
That's basically why we never got round to finishing Leo…

Negaal

2008-03-31 11:27:38

I think I'm going to make prayer to 70. Like 10 levels to do. Im using gilded altar, will I get Leo there?

Nice job SKy Scripter.:)

Naike

2008-03-31 11:29:13

Don't think so! Did 1.4k d bones at gilded altar and No leo for me.

Markus

2008-03-31 12:41:46

From: N1ke!
Don't think so! Did 1.4k d bones at gilded altar and No leo for me.


Only normal burying gives Leo

Naum

2008-03-31 12:49:43

[offtopic] Hey widget! nice sig :p [/offtopic]

SKy Scripter

2008-03-31 13:20:04

From: Wizzup?
Pups' solver never worked 100%, and it has never been put into SCAR either.
That's basically why we never got round to finishing Leo…


Oh i see..


Got a Leo!
Gonna run the solver on it now, you still got that char inside don't you?


hey, uhmm just tell me if you see any problems…
yesterday i was testing my leo again..
and i ran into a few problems….
The Detection works fine… the problem lays more in between the actuall solving process.

but i will make sure it works really good before i even think about releasing it ;)

ShowerThoughts

2008-03-31 13:33:15

Btw, Sky i was talking about your script but the plugin is okay to :P(explain)

SKy Scripter

2008-03-31 13:43:17

From: Hermpie
Btw, Sky i was talking about your script but the plugin is okay to :P(explain)


I don't know what i can explain…

uhmm

  1. this will go to the center.
  2. then it will scan for a coffin and pick it up.. then scan for another until all are picked up
  3. then it will go back in the center and solve every coffin.. and put them in
  4. variables like Inventory 2 has the cooking coffin ect..
  5. then it goes to each grave and solves which grave it is..
  6. if the grave solved cooking then it will go to inven 2 and click it then find the grave hole..
  7. after it's done with all of them
  8. it walks to center, then walks to the yellow dot.. and finally finds leo and
  9. leaves

as for the Detection it's self.. I don't know if i want to write that. xD

ShowerThoughts

2008-03-31 13:44:14

k, i meant the code not how it works :p

msn?
[email]kotsz@live.nl[/email]

Harry

2008-04-27 12:11:18

I ran it, it mixed up the Mining and Woddcutting graves, and it never talked to Leo the first time :/

Looks nice though :)

SKy Scripter

2008-04-27 23:30:45

From: Hy71194
I ran it, it mixed up the Mining and Woddcutting graves, and it never talked to Leo the first time :/

Looks nice though :)


The Good news about that is i had the those switched in the plug-in so really it would have solved ;)