SRL Archive - Discussions and Debates

Solving the Maze random.


Wanted

2007-07-24 23:13:01

UPDATE: http://hosted.filefront.com/icefire908/ then click Maze.rar, contains data to solve maze updated frequently!


I remember the maze from a long time ago when I played RS legit for a little while on my main account that was banned a long time ago. I found this screen shot posted in another thread


And I was thinking, it wouldn't be to hard to make some DTMs or DDTMs based off your white dot relative to walls for example:


complete the maze based off of starting position, then just walking using DTM/DDTMs/Compass Walking/ Blindclicking/ RadialWalk or whatever wouldn't be impossible to do…

Originally posted by: RuneHQ.


Edit: I've been thinking a lot lately about these 'unsolvable' randoms, but it seems that we are overlooking some of them not just the maze.

Santa_Clause

2007-07-24 23:14:55

I doubt it's that easy. There are also some doors that can't be opened…

Wanted

2007-07-24 23:25:06

I think it's worth looking into.

bullzeye95

2007-07-24 23:48:16

I'll certainly be willing to help if you want to start it.

Bobarkinator

2007-07-25 00:12:59

This would have to be a large project because you can start in different areas and you would have to memorize a path to make the DTM's off of but that' might work.

bullzeye95

2007-07-25 00:21:49

Somebody (ruler maybe?) was talking about this. I think he said something about getting to one of the edges and then working your way in.

lardmaster

2007-07-25 00:29:55

From: Icefire908
I remember the maze from a long time ago when I played RS legit for a little while on my main account that was banned a long time ago. I found this screen shot posted in another thread


And I was thinking, it wouldn't be to hard to make some DTMs or DDTMs based off your white dot relative to walls for example:


complete the maze based off of starting position, then just walking using DTM/DDTMs/Compass Walking/ Blindclicking/ RadialWalk or whatever wouldn't be impossible to do…



Edit: I've been thinking a lot lately about these 'unsolvable' randoms, but it seems that we are overlooking some of them not just the maze.


i have thought about this a lot.

there are NO unopenable doors, they just dont show up on the minimap-

rulers idea of working your way in (or whoevers it was) would work, but it would require location recognition greater than what dtms can offer. it would require either reflection/bcel (kyab), or a different approach.

if it was does procedurally, where you just looked for the solution of the box you are in, it makes the problem much simpler. finding the bounds of the box should be simple, and thus the center would be too… the computation of which (long) side of the box you are on would take more thinking, but after that, you could just walk to the other side, and open the door. if this was just repeated indefinetly, it would eventually reach the middle, the way the maze is constructed. this sort of computation would definitley be possible in java or c, but might be too slow for scar (i dont know, maybe it would work with the divi upgrades). even it was, it could still be accomplished with a plugin, at superior speeds.

Boreas

2007-07-25 00:42:21

It can be done with just colors, but when was the last time you got a maze? I've gotten it once. Ever.

Bobarkinator

2007-07-25 00:50:09

Go and auto badly and get flagged. I got it twice within an hour and another time a couple hours later.

lardmaster

2007-07-25 01:04:39

From: Boreas
It can be done with just colors, but when was the last time you got a maze? I've gotten it once. Ever.


yes, colors, but not dtms.

jhildy

2007-07-25 03:08:29

you get it a lot when fletching.

Widget

2007-07-25 04:06:13

I only seem to get it while selling/buying stuff (essence usually).

On the RuneHQ map there's 4 little triangles. Those are the doors that you can't go through. Now that I think about it, it's probably so people like us can't go to each of the starting points for the maze.

Pyro

2007-07-25 05:25:44

Maybe im being a asshole :p but you dont get randoms while in bank. So how can you get it while fletching…. i know even that first pic he is fletching but….

n3ss3s

2007-07-25 07:14:10

Im also willing to help, just tell what to do…

Pentti

2007-07-25 07:26:25

From: Pyro
Maybe im being a asshole :p but you dont get randoms while in bank. So how can you get it while fletching…. i know even that first pic he is fletching but….

Yes, you can get random while you are in the bank.

And it would be very cool to try solve maze, but… its really rare random…

Pyro

2007-07-25 07:38:25

Are you serious? Maybe its just came inl Because i made a automerchanter and i didnt put any antirandoms in it because i never got randoms while merchanting in bank

Bobarkinator

2007-07-25 11:03:27

Ya I think it's relatively new. But I think its older than when you came back.

Infantry001

2007-07-25 18:56:09

Actually, yes you can. Got a zombie once while burying my bones :)

Wanted

2007-07-25 19:30:02

Oh, I don't play RS anymore enough to get the maze I remember I got it 3 times in one week though.

Heh, I think trying to solve the maze would be a lot of fun.

Santa_Clause

2007-07-25 21:24:05

From: lardmaster
i have thought about this a lot.

there are NO unopenable doors, they just dont show up on the minimap-

rulers idea of working your way in (or whoevers it was) would work, but it would require location recognition greater than what dtms can offer. it would require either reflection/bcel (kyab), or a different approach.

if it was does procedurally, where you just looked for the solution of the box you are in, it makes the problem much simpler. finding the bounds of the box should be simple, and thus the center would be too… the computation of which (long) side of the box you are on would take more thinking, but after that, you could just walk to the other side, and open the door. if this was just repeated indefinetly, it would eventually reach the middle, the way the maze is constructed. this sort of computation would definitley be possible in java or c, but might be too slow for scar (i dont know, maybe it would work with the divi upgrades). even it was, it could still be accomplished with a plugin, at superior speeds.


There are unopenable doors. 'I don't think this is the right way' and it doesn't let you go through. Sounds unopenable to me.

lardmaster

2007-07-25 21:34:44

From: SantaClause
There are unopenable doors. 'I don't think this is the right way' and it doesn't let you go through. Sounds unopenable to me.


ok., sorry, ive just never encountered them in the 5 or so mazes ive done, so i figured they didnt exhist.

that adds a little complication, but that also rases the issue: how many doors are there per chamber.

Wanted

2007-07-25 22:12:20


I don't know what you mean, but can't you count them just from that?

Cheesehunk

2007-07-25 22:53:03

From: Pyro
Are you serious? Maybe its just came inl Because i made a automerchanter and i didnt put any antirandoms in it because i never got randoms while merchanting in bank

You only get randoms in the bank if you are actually doing something skill-wise (IE. Burying bones, fletching, etc) if I am correct..

Pyro

2007-07-25 23:34:46

O wait yes. But you never get randoms that use findtalk in bank. Only ones that whisk you away immediatly.

lardmaster

2007-07-26 01:57:41

argg… looking at that map, it would take something more than just repeating a procedure…

really, what it needs is something that can actually trace out where you have been, by recognizing the shape of the box you are in.

actually.. now that i think about it, if you did shape filling, you could find a pattern of shapes, and find your location that way, and actually use colors to solve it based on the maze shape.

Pancakes

2007-07-26 05:23:40

Something tells me that jagex specifically designed the maze like this (I mean look at the walls) so people couldn't do it colorbased… Utilising the minimap would be the best way.

Also, one thing that has been overlooked it how to find the doors using color, as they are very similar in appearance to the walls themselves.

Just my 2 cents.

Santa_Clause

2007-07-26 05:49:12

Tiny bitmaps…?

lardmaster

2007-07-26 14:04:37

naw, they are different enough, at least the keyholes… what it really comes down to again is shape recognition, as in recognizing the shapes of the containers.

RAM

2007-07-26 19:38:59

I've had many many many randoms…many in bank…even talking ones, and from just "dancing" with my gf, or just trading or organizing bank…I speculate on a certain amount of time while being logged in and not changing your behavior may be one of the ways it's triggered….

As Santa Said "There are unopenable doors. 'I don't think this is the right way' and it doesn't let you go through. Sounds unopenable to me."….You cannot open certain doors….

I'd be willing to loan an account out the next time I get a maze, usually every few days, if someone has created a foundation they want to try…or maybe we can create a video from it, exploring different angles, if you guys think it would be beneficial ?

Also, judging from the map posted here, it looks like the triangles would be the doors that are need to be opened to access each chamber…..It says one way doors, implying that once you go through the correct door, that it's text changes to 'I don't think this is the right way', but I'm almost positive, you can go back through…almost…

~RAM

Cheesehunk

2007-07-26 19:43:53

From: RAM_RUNE
I've had many many many randoms…many in bank…even talking ones, and from just "dancing" with my gf, or just trading or organizing bank…I speculate on a certain amount of time while being logged in and not changing your behavior may be one of the ways it's triggered….

When I used to run masq's merchanter (with edits by Pyro and myself..:p ) I never got a single randoms. I ran it for hours on end at times, with a single player.

Wanted

2007-07-26 20:24:47

What happens if you sit in a maze and try to do random stuff and just let the time run out?

Bobarkinator

2007-07-26 20:27:25

It doesn't matter. It still makes you finish.

Wanted

2007-07-26 20:34:25

I think it's very solvable, we just need to get there.

oliver1205

2007-07-26 22:42:51

some doors do say " cannot be opened ". i guess it would be possible. it would be wayyy eaiser if the whole thing wasnt gray.

Pyro

2007-07-27 00:41:43

From: Cheesehunk
When I used to run masq's merchanter (with edits by Pyro and myself..:p ) I never got a single randoms. I ran it for hours on end at times, with a single player.


O yeah forgot about using masqs aswell. Yeah that thign rocked :p and i second that. 0 randoms. I know for sure you cant get fighting and most definitely not ones that you have to talk to. There is to much talking on screen so they dont bother inside banks.

Freddy1990

2007-07-27 06:07:20

Heh, good luck with this, you'll need it ;)

Santa_Clause

2007-07-27 06:43:31

Very encouraging words Freddy…*Sarcastic*

Markus

2007-07-27 17:02:10

Is Piv still working on his one? He was doing some edge detection stuff for the doors.

Pyro

2007-07-27 22:44:17

My god. Ok i just got the damn maze again. And i cant do it myself. Its confusing as hell.

Bobarkinator

2007-07-28 00:05:50

Yes it's hard to do alone which is why I think that SCAR might actually have the advantage if we solve this.

RudeBoiAlex

2007-07-29 07:26:19

From: Boreas
It can be done with just colors, but when was the last time you got a maze? I've gotten it once. Ever.


yesterday and a few weeks before that while PLAYING LEGIT

Wanted

2007-07-29 20:57:32

If some one has an account in maze, tell us please?

Bobarkinator

2007-07-30 00:00:12

I just got one. So, if anyone is going to be starting to solve this tell me. If everybody wants access to this I would be fine posting it somewhere where all the leeching members wouldn't get to it.

Edit: I also have a pinball random. If anybody has any desire to start solving that. I think it's been solved before but I think that we could do it better.

Edit2: Lol actually 2 acounts in the pinball.

Wanted

2007-07-30 00:11:22

From: bobarkinator
I just got one. So, if anyone is going to be starting to solve this tell me.

Edit: I also have a pinball random. If anybody has any desire to start solving that. I think it's been solved before but I think that we could do it better.

Edit2: Lol actually 2 acounts in the pinball.


Get on MSN and we can start mapping it out better.

Edit: Actually I think Wizzup? recently fixed up solve pinball, worth looking at though :)

Bobarkinator

2007-07-30 00:19:04

Where is the pinball solver at Wizzup? made? Is it going to be in SRL 4.0?

Wanted

2007-07-30 01:40:26

From: bobarkinator
Where is the pinball solver at Wizzup? made? Is it going to be in SRL 4.0?


I think it came out in recent SRL updates (like 3.8 or 3.81)

Here is what data I have so far uploaded to my file front, download here

http://hosted.filefront.com/icefire908/ then click on Maze.rar…

Also, remember I can update that file so just re download for a data update.

BTW: Talk to me or bob on MSN, bob has an account in maze right now.

Post any functions or procedures you'd like such as door openers, right now all we need are a bunch of colors taken from different worlds for auto coloring as well as starting points when you first get to maze along with screen shots of the north east, east, and south east sections of the maze.

Good luck everyone :sasmokin:

da_professa

2007-07-30 02:39:36

The whole time I have played rs, legit and autoed, I have only gotten 3 mazes.. The first time I failed :p had no idea..

It'll be fun to make, but not really a necessity

bullzeye95

2007-07-30 03:10:27

I figure we could maybe do the door finding by using the black color of the keyhole. The only problem I've seen is if the player is wearing something blackish. What we need, probably, is a FindColorSkipBoxSpiral.

Wanted

2007-07-31 00:21:09

Look at maze.rar…

Bobarkinator

2007-07-31 00:27:02

As I've stated before I will let any member use the account I have in the maze to study. Just talk to me on MSN. Quite a few of you have it but if you don't its [email]monkeyaregoodpeople@gmail.com[/email]

bullzeye95

2007-07-31 01:08:38

From: Icefire908
Look at maze.rar…


I did. What exactly do you want me to look at?

WOOT 1500th POST!

Bobarkinator

2007-07-31 01:19:01

All the pictures.

bullzeye95

2007-07-31 01:20:02

Err, I did. That's where my idea came from…

*confused*

Bobarkinator

2007-07-31 01:27:54

I don't know what Ice was saying then. But he had the same idea. I can create an RGB autocolor of it I think (I'm looking to get better at that)

Boreas

2007-07-31 10:17:03

program New;
{.include srl/srl.scar}
const name='chris';

var BankBmp,w,i,h:integer;// 16777215
LetsContinue,SecondType,room,xbox,MrMordaut:integer;
roomb,first,second,done:boolean;

begin
setupsrl;
LetsContinue:= DTMFromString('78DA63EC666060A86564C00660A28C6D40A28' +
'D809A5540A299809A9D44A83105B266E256C30CA23F00891904D4' +
'E403598D04D494015953F1AB0100886F08F6');
//+3 for paint
GetClientDimensions(w,h);
repeat
BankBmp:=BitmapfromString(w,h,'');
CopyClientToBitmap(BankBmp,3,3,w+3,h+3); wait(250);
try
SaveBitmap(BankBmp,'D:\ran2/'+name+inttostr(i)+'.bmp');
except
writeln('error');
end;
freebitmap(bankbmp);
i:=i+1;

done:=false;
//////////////////////////////////////////////
if not first then
// if FindDTM(LetsContinue,x,y,111,375,492,411) then
begin
FreeDTM(LetsContinue);
SecondType := DTMFromString('78DA632C616060A86564C00660A28C6544A8A' +
'904123504D480EC6A27C2AE36026AEA81ACB504D4DC0512EB08A8' +
'79056435E257030021A5090D');
writeln('waiting for you to click to continue');
done:=true;
first:=true;
repeat
wait(100);
until FindDTM(SecondType,x,y,110,374,501,436);
end;
//////////////////////////////////////////////
if not second then
if not done then
if FindDTM(SecondType,x,y,110,374,501,436) then
begin
// FreeDTM(SecondType);
writeln('waiting for you to click to continue again');
// Xbox:= DTMFromString('78DA633CCEC8C060C48002E6AD980FA619A17' +
// 'CC6134096090135A7812C43026A8E015916449843400D0048C90E' +
// '7B');
done:=true;
second:=true;
repeat
wait(100);
until not FindDTM(SecondType,x,y,110,374,501,436);//FindDTM(Xbox,x,y,445,38,467,66);

MrMordaut:= DTMFromString('78DA636461646028026224D000A561A28C203' +
'59904D47003591904D40813619709116A8C80AC7C22CCC925A026' +
'9208BB2280AC3C026AA208DB0500B7520B44');
room := DTMFromString('78DA6374646460580AC458004C9411A466150' +
'1352E4498E349841A6F206B390135014498130464AD20C21C42FE' +
'8A22424D3411EE0925AC0600B17F0AAE');
end;
//////////////////////////////////////////////
if first and second then
if not done then
if FindDTM(MrMordaut,x,y,256,357,352,375) then
begin

writeln('waiting for you to click to continue again');

done:=true;
repeat
wait(100);
if not FindDTM(MrMordaut,x,y,256,357,352,375) then
break;
if FindDTM(room,x,y,316,418,356,431) then
break;
until isfkeydown(12);
end;
//////////////////////////////////////////////
if not done then
if FindDTM(room,x,y,316,418,356,431) then
begin

writeln('waiting for you to click to continue again');

done:=true;
roomb:=true;
repeat
wait(100);
if not FindDTM(room,x,y,316,418,356,431) then
break;
until isfkeydown(12);
end;
if roomb then wait(500);

//////////////////////////////////////////////
if isfkeydown(11) then
begin
writeln('pausing '+inttostr(i));
repeat
wait(30);
until isfkeydown(10);
repeat
wait(30);
until not isfkeydown(10);
writeln('resuming '+inttostr(i));
end;
//////////////////////////////////////////////

until ((isfkeydown(12))or(not nogametab));

end.

take out lines 27-112, change 20 to path you want, change name const for each account. Since you aren't IDing spinning objects, you prolly don't need to take so many per second. Make sure you have plenty of HD space, I just had to buy a new one :p

Bobarkinator

2007-07-31 11:08:08

Boreas I don't get it… You named your variables weird.

Here is an autocolor I made for the keyhole. If you find a keyhole it doesn't work on than get the color of it and tell me.
function AutoColorKeyHole: Integer;
var
TPA: TPointArray;
tmpColor: Array of Integer;
i: Integer;
X,Y,Z: Extended;
begin
FindColorsTolerance(TPA,1184277,MSX1,MSY1,MSX2,MSY2,7);
tmpColor:= GetColors(TPA);
for i:= 0 to GetArrayLength(tmpColor)-1 do
begin
ColorToXYZ(tmpColor[i],X,Y,Z);
if (X >= 0.56) and (X <= 0.66) then
if (Y >= 0.56) and (Y <= 0.67) then
if (Z >= 0.55) and (Z <= 0.65) then
begin
WriteLn('Keyhole color: ' + IntToStr(tmpColor[i]));
Result:=tmpColor[i];
Exit;
end;
end;
end;

Wanted

2007-07-31 13:19:03

From: bobarkinator
Boreas I don't get it… You named your variables weird.

Here is an autocolor I made for the keyhole. If you find a keyhole it doesn't work on than get the color of it and tell me.
function AutoColorKeyHole: Integer;
var
TPA: Array of TPoint;
tmpColor: Array of Integer;
i: Integer;
X,Y,Z: Extended;
begin
FindColorsTolerance(TPA,1184277,MSX1,MSY1,MSX2,MSY2,7);
tmpColor:= GetColors(TPA);
for i:= 0 to GetArrayLength(tmpColor)-1 do
begin
if (X >= 0.56) and (X <= 0.66) then
if (Y >= 0.56) and (Y <= 0.67) then
if (Z >= 0.55) and (Z <= 0.65) then
begin
WriteLn('Keyhole color: ' + IntToStr(tmpColor[i]));
Result:=tmpColor[i];
end;
end;
end;


I'll test it then post an edit, that and, don't you need an Exit after Result?

bullzeye95

2007-07-31 15:51:51

From: bobarkinator
As I've stated before I will let any member use the account I have in the maze to study. Just talk to me on MSN. Quite a few of you have it but if you don't its [email]monkeyaregoodpeople@gmail.com[/email]


Um, could you PM it to me instead please? I don't have an MSN, and I'm not allowed (-.-) to have one.

RAM

2007-07-31 20:19:12

I have a player in it now as well, if anyone wants to test…I started doing it, and almost at the end, so a few of the one way doors have closed already :redface:, but if anyone wants to use it, just PM me ASAP, I'd like to put them back into action relatively soon ;)

~RAM

Wanted

2007-07-31 20:37:13

From: RAM_RUNE
I have a player in it now as well, if anyone wants to test…I started doing it, and almost at the end, so a few of the one way doors have closed already :redface:, but if anyone wants to use it, just PM me ASAP, I'd like to put them back into action relatively soon ;)

~RAM


Damn, next time take a screen shot from Perfect North where you start, I'm trying to find all starting points.

bullzeye95

2007-07-31 21:35:09

Here are the different colors I got from RAM's account after 50 tries.
1052692
1118484
1118485
1184277
1184278
The best color tolerance speed is 0. The best color is 1118485. They come out 1 tolerance away from 1118485.

Here are the RGB, HSL, and XYZ lists of them:
H = 0, S = 11.1111097037792, L = 7.05882385373116
H = 0, S = 8.10810700058937, L = 7.25490227341652
H = 0, S = 10.5263143777847, L = 7.45098069310188
H = 0, S = 7.69230723381042, L = 7.64705911278725
H = 0, S = 9.99999940395355, L = 7.84313753247261

R = 20, G = 16, B = 16
R = 20, G = 17, B = 17
R = 21, G = 17, B = 17
R = 21, G = 18, B = 18
R = 22, G = 18, B = 18

X = 0.567308129875653, Y = 0.567767983310559, Z = 0.556715045723387
X = 0.590116839421173, Y = 0.613109883702387, Z = 0.590090957070984
X = 0.610886204760996, Y = 0.614081873884392, Z = 0.600797957728711
X = 0.634747786422585, Y = 0.661516800298446, Z = 0.635714533458753
X = 0.656364183677215, Y = 0.662528430916812, Z = 0.646858195089049

Wanted

2007-07-31 22:39:11

From: bullzeye95
Here are the different colors I got from RAM's account after 50 tries.
1052692
1118484
1118485
1184277
1184278
The best color tolerance speed is 0. The best color is 1118485. They come out 1 tolerance away from 1118485.

Here are the RGB, HSL, and XYZ lists of them:
H = 0, S = 11.1111097037792, L = 7.05882385373116
H = 0, S = 8.10810700058937, L = 7.25490227341652
H = 0, S = 10.5263143777847, L = 7.45098069310188
H = 0, S = 7.69230723381042, L = 7.64705911278725
H = 0, S = 9.99999940395355, L = 7.84313753247261

R = 20, G = 16, B = 16
R = 20, G = 17, B = 17
R = 21, G = 17, B = 17
R = 21, G = 18, B = 18
R = 22, G = 18, B = 18

X = 0.567308129875653, Y = 0.567767983310559, Z = 0.556715045723387
X = 0.590116839421173, Y = 0.613109883702387, Z = 0.590090957070984
X = 0.610886204760996, Y = 0.614081873884392, Z = 0.600797957728711
X = 0.634747786422585, Y = 0.661516800298446, Z = 0.635714533458753
X = 0.656364183677215, Y = 0.662528430916812, Z = 0.646858195089049


Thanks, added to maze.rar.

Bobarkinator

2007-08-01 15:01:24

From: Icefire908
I'll test it then post an edit, that and, don't you need an Exit after Result?


Thanks for pointing that out. I changed it.

bullzeye95

2007-08-01 18:40:48

We probably need something like this:
function FindNearestKeyHole(var xx, yy: Integer): Boolean;
var
I, x1, y1, x2, y2, ChangeAmt: Integer;
H, S, L, X, Y, Z: Extended;
begin
ColorToleranceSpeed(0);
x1:= MSCX;
y1:= MSCY;
x2:= MSCX;
y2:= MSCY;
for I:= 0 to 5 do
begin
ChangeAmt:= ChangeAmt + 10;
x1:= x1 - ChangeAmt;
y1:= y1 - ChangeAmt;
x2:= x2 + ChangeAmt;
y2:= y2 + ChangeAmt;
if(FindColorSkipBoxTolerance(xx, yy, 1118485, x1, y1, x2, y2, 1, InttoBox(467, 279, 514, 335)))then
begin
ColortoHSL(GetColor(xx, yy), H, S, L);
ColortoXYZ(GetColor(xx, yy), X, Y, Z);
if(L > 6.8)then if(L < 8.1)then if(X > 0)then if(X < 1)then if(Y > 0)then if(Y < 1)then if(Z > 0)then if(Z < 1)then
begin
MMouse(x, y, 1, 1);
if(IsUpText('Ope'))then
begin
Result:= True;
exit;
end;
end;
end;
end;
end;
It'll spiral (to a point…) outwards to find the keyhole color, while skipping a box with your character in it. We either need a FindColorSkipBoxSpiralTolerance, or FindColorsSkipBoxTolerance for this to be better.

Wanted

2007-08-01 18:43:13

Hmm… yea ok but we really need a record of all starting points in the maze as well as paths to get to the center.

Auto Color for red walls on mini-map?

bullzeye95

2007-08-01 18:44:07

Would Boreas's door profiles work for this?

Wanted

2007-08-01 18:46:17

From: bullzeye95
Would Boreas's door profiles work for this?


No.

bullzeye95

2007-08-01 18:47:00

You tried? Well I guess just searching for a red color on the minimap would work… what else is red?

Wanted

2007-08-01 18:51:56

From: bullzeye95
You tried? Well I guess just searching for a red color on the minimap would work… what else is red?


Everything including the doors are part of a red wall, nothing else is red.

bullzeye95

2007-08-01 18:53:59

Yes, exactly. If we just search for the red color with a high tolerance then get the color at the coords that it returns, then we should have that color.

EDIT: It seems the best CTS is 2, and a tolerance of 10-15 should be used… But that's just a guess. If you get the colors, I'll find the best CTS, tolerance, and color.

Wanted

2007-08-01 19:07:27

Edit: Ok now try.

{.Include SRL/SRL.SCAR}

{*******************************************************************************
function Maze_FindRedWallColor: LongInt;
By: IceFire908.
Description: Returns the color of the red wall on the mini-map in the maze random.
*******************************************************************************}

function Maze_FindRedWallColor: LongInt;
var
S: Integer;
FWC: TPoint;
begin
FWC := IntToPoint(MMCX, MMCY);
ColorToleranceSpeed(2);
MarkTime(S);
repeat
FindColorSpiralTolerance(FWC.X, FWC.Y, 239, MMX1, MMY1, MMX2, MMY2, 2);
if (TimeFromMark(S) > 5000) then
begin
ColorToleranceSpeed(1);
Exit;
end;
Wait(1);
until(RS_OnMiniMap(FWC.X, FWC.Y));
Result := GetColor(FWC.X, FWC.Y);
ColorToleranceSpeed(1);
end;

begin
SetUpSRL;
Wait(1000);
ActivateClient;
WriteLn('Red wall color = ' + IntToStr(Maze_FindRedWallColor) + '.');
end.

bullzeye95

2007-08-01 19:15:59

=0 No CTS? I think you should change it to 2. The colors 245 and 232 have a tolerance of 13 with CTS 0 and 1, but a tolerance of 3 with CTS of 2.

Wanted

2007-08-01 19:21:51

From: bullzeye95
=0 No CTS? I think you should change it to 2. The colors 245 and 232 have a tolerance of 13 with CTS 0 and 1, but a tolerance of 3 with CTS of 2.


Alright give me a second.

danrox2004

2007-08-01 19:35:52

I have an autocolor for the walls and floor on the minimap, will post it tonight. Oh, and also to find keyholes i used a findColorsTolerance, and rearranged it by distance to player, and removed all points within 5 of each other - i will post this tonight too.

Edit: Here it is

function getMazeFloorColor: Integer;
var
i: integer;
begin
for i := 0 to 20 do
begin
if(findColorTolerance(x, y, 9014165, MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10, i)) then //paint
begin
result := getColor(x, y);
writeln('Maze floor color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find maze floor color!');
end;

function getMazeWallColor: Integer;
var
i: Integer;
begin
for i := 0 to 20 do
begin
if(findColorTolerance(x, y, 255, MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10, i)) then //paint + 3
begin
result := getColor(x, y);
writeln('Maze wall color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find maze wall color!');
end;

Anyone know why this doesn't seem to work - doesn't arrange by closest or remove the ones on the player:


procedure removeFromTPointArray(var arr: array of tPoint; n: integer);
var
i, j: integer;
tmpArr: array of tPoint;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
if(not n = i) then
begin
j := getArrayLength(tmpArr);
setArrayLength(tmpArr, j + 1);
tmpArr[j] := arr[i];
end;
end;
setArrayLength(arr, j + 1);
arr := tmpArr;
end;

procedure removeBoxFromPoints(var arr: array of tPoint; box: tBox);
var
i: integer;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
if(inRange(arr[i].x, box.x1, box.x2) and inRange(arr[i].y, box.y1, box.y2)) then
begin
removeFromTPointArray(arr, i);
end;
end;
end;

procedure addToTPointArray(var arr: array of tPoint; point: tPoint);
var
i: integer;
begin
i := getArrayLength(arr);
setArrayLength(arr, i + 1);
arr[i] := point;
end;

procedure arrangePointsByDistance(var arr: array of tPoint; x, y: integer);
var
i, j, k, l: integer;
tempArr: array of tPoint;
begin
repeat
if(getArrayLength(arr) <= 0) then
begin
setArrayLength(arr, getArrayLength(tempArr));
arr := tempArr;
exit;
end;
for i := 0 to getArrayLength(arr) - 1 do
begin
//writeln(intToStr(i));
j := distance(x, y, arr[i].x, arr[i].y);
if((j < k) or (k <= 0)) then
begin
k := j;
l := i;
end;
end;
//writeln(intToStr(arr[l].x) + ', ' + intToStr(arr[l].y));
addToTPointArray(tempArr, arr[l]);
removeFromTPointArray(arr, l);
l := 0;
j := 0;
k := 0;
until(false)
end;

procedure removePointsByDistance(var arr: array of tPoint; dist: integer);
var
i, j: integer;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
for j := 0 to getArrayLength(arr) - 1 do
begin
if(i = j) then
begin
break;
end;
if(distance(arr[i].x, arr[i].y, arr[j].x, arr[j].y) <= dist) then
begin
removeFromTPointArray(arr, j);
removePointsByDistance(arr, dist);
end;
end;
end;
end;

procedure findDoor;
var
playerBox: TBox;
i, j: integer;
doors: array of tPoint;
begin
playerBox := intToBox(255, 148, 284, 187);
for i := 0 to 20 do
begin
findColorsTolerance(doors, 1118485, MSX1, MSY1, MSX2, MSY2, i); //paint
if(getArrayLength(doors) > 0) then
begin
removeBoxFromPoints(doors, playerBox);
arrangePointsByDistance(doors, MSCX, MSCY);
removePointsByDistance(doors, 5);
if(getArrayLength(doors) <= 0) then
begin
exit;
end;
//writeln(intToStr(getArrayLength(doors)));
for j := 0 to getArrayLength(doors) - 1 do
begin
//writeln(intToStr(doors[j].x) + ', ' + intToStr(doors[j].y));
mMouse(doors[j].x, doors[j].y, 5, 5);
Wait(20 + random(50));
if(isUpTextMulti('pen', 'en W', 'all')) then
begin
GetMousePos(x, y);
mouse(x, y, 0, 0, True);
FFlag(5);
Flag;
wait(500 + random(1000));
end;
end;
end
end
end;

Wanted

2007-08-01 19:59:52

Try my auto-color now.

bullzeye95

2007-08-01 20:04:38

I can't, I don't have access to an account in the maze ;)

But you should probably bring the tolerance up to 7-10, just to be safe.

We're getting closer…

EDIT: Ok now that I look at the function I see a problem. It will find the same color every time, even if you repeat it, so that part's… useless :p. Mind if I have a go at it?

EDIT2: For some reason, yours didn't work… here's mine
function FindMazeWallColor: Integer;
var
I: Integer;
Cols: TPointArray;
begin
if(not(Loggedin))then Exit;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MMCX, MMCY, Cols, 239, MMX1, MMY1, MMX2, MMY2, 10);
for I:= 0 to Length(Cols) - 1 do
begin
if(CountColor(GetColor(Cols[I].x, Cols[I].y), MMX1, MMY1, MMX2, MMY2) > 350)then
begin
Result:= GetColor(Cols[I].x, Cols[I].y);
writeln('Maze wall color = ' + inttostr(Result));
ColorToleranceSpeed(1);
Exit;
end;
end;
ColorToleranceSpeed(1);
end;

And another EDIT: Fixed my FindNearestKeyHole
function FindNearestKeyHole(var xx, yy: Integer): Boolean;
var
I, x1, y1, x2, y2, ChangeAmt: Integer;
H, S, L, X, Y, Z: Extended;
begin
ColorToleranceSpeed(0);
x1:= MSCX;
y1:= MSCY;
x2:= MSCX;
y2:= MSCY;
for I:= 0 to 5 do
begin
ChangeAmt:= ChangeAmt + 10;
x1:= x1 - ChangeAmt;
y1:= y1 - ChangeAmt;
x2:= x2 + ChangeAmt;
y2:= y2 + ChangeAmt;
if(FindColorSkipBoxTolerance(xx, yy, 1118485, x1, y1, x2, y2, 1, InttoBox(243, 148, 287, 195)))then
begin
ColortoHSL(GetColor(xx, yy), H, S, L);
ColortoXYZ(GetColor(xx, yy), X, Y, Z);
if(L > 6.8)then if(L < 8.1)then if(X > 0)then if(X < 1)then if(Y > 0)then if(Y < 1)then if(Z > 0)then if(Z < 1)then
begin
MMouse(xx, yy, 1, 1);
if(IsUpText('Ope'))then
begin
Result:= True;
exit;
end;
end;
end;
end;
end;

TOB

2007-08-11 00:00:45

Anyone thought of getting the mappings for every maze start point and drawing the minimap to canvas, identifying the start point, and have preset paths drawn for debug. Next time someone gets maze set PerfectNorth; and screenshot the start point then click a point and screen shot directions EVERY time you make a turn or go through a door. Then we can draw lines manually with a path on them on how to solve every start point. Using canvas you can try and match up start points according to bitmaps, or DTMs may work better. Then when the maze solver is written it should also draw on debug the path it takes when making turns so we can compare them. Hard to say, even harder to make.

JuKKa

2007-08-11 10:26:48


{.Include SRL/SRL.Scar}

Var
XX, YY: Integer;

Function FindKeyHole(xx, yy, KeyHoleColor: Integer): Boolean;
Var
I, Closest: Integer;
KeyPoints: TPointArray;
Begin
ColorToleranceSpeed(0);
Closest:= 9999;
FindColorsSpiralTolerance(xx, yy, KeyPoints, KeyHoleColor, MSX1, MSY1, MSX2, MSY2,1);
For I:= 0 To GetArrayLength(KeyPoints)-1 Do
Begin
If(Distance(MSCX, MSCY, KeyPoints[I].X, KeyPoints[I].Y) <= Closest)Then
Begin
Closest:= Distance(MSCX, MSCY, KeyPoints[I].X, KeyPoints[I].Y)
xx:= KeyPoints[I].X;
yy:= KeyPoints[I].Y;
End;
End;
If(GetArrayLength(KeyPoints)-1 >= 1)Then
Begin
MMouse(XX, YY, 1, 1);
Wait(25);
If(IsUpText('Ope'))Then
Begin
Result:= True;
Exit;
End;
End;
End;

Begin
SetupSRL;
If(FindKeyHole(XX,YY, 8388608))Then
Mouse(XX, YY, 0, 0, True);
End.

Finds closest door using (Distance).


Edit:


Function FindFurthestKeyHole(XX, YY, KeyHoleColor: Integer): Boolean;
Var
I, Closest: Integer;
KeyPoints: TPointArray;
Begin
T:= GetSystemTime;
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(xx, yy, KeyPoints, KeyHoleColor, MSX1, MSY1, MSX2, MSY2,1);
For I:= 0 To GetArrayLength(KeyPoints)-1 Do
Begin
If(Distance(MSCX, MSCY, KeyPoints[I].X, KeyPoints[I].Y) >= Closest)Then
Begin
Closest:= Distance(MSCX, MSCY, KeyPoints[I].X, KeyPoints[I].Y)
xx:= KeyPoints[I].X;
yy:= KeyPoints[I].Y;
End;
End;
Writeln('Time: ' +Inttostr(GetSystemTime - T)+' Msec');
If(GetArrayLength(KeyPoints)-1 >= 1)Then
Begin
MMouse(XX, YY, 1, 1);
Wait(25);
If(IsUpText('Ope'))Then
Begin
Result:= True;
Exit;
End;
End;
End;

Begin
SetupSRL;
If(FindFurthestKeyHole(XX,YY, 16711935))Then
Mouse(XX, YY, 0, 0, True);
End.

That finds the furthest color. Also using distance.

danrox2004

2007-08-11 21:00:30

Since I stopped working on this I might as well post what I had. Credit me if you use it. Also, I think i used someones findNearestKey hole, credit them too.

How it works:
Tries to find its way into the center based on it's position in the maze relative to the center square. The maze is divided up into sections - the rooms array.
Dx and Dy are the coords to walk to if in the section. The boolean is whether it needs to rotate the compass to find the door. I have only made up the paths for the middle bit of the maze. The maze is too big to do it like this however and you will need to create more landmarks - maybe one in each corner, as you cant always see the center square on the map. As you can see i used lots of trial and error =). I left the commented code in incase anyone wants to use it.

PS. The positioning thing isn't always very accurate :P


program Maze;
{.include SRL/SRL.scar}

type
Box = record
x1, y1, x2, y2: integer;
dx, dy: integer;
rotate: boolean;
end;

var
mazeWallColor, mazeFloorColor: integer;
//x, y: integer;
//mazeCenterDTM: integer;
//c: integer;
mazeCenterMask: integer;
rooms: array of box;
squarePosx, squarePosy: integer;

function getMazeWallColor: Integer;
var
{mazeWallDTMC: TDTMPointDef;
mazeWallDTMP: Array[0..1] of TDTMPointDef;
mazeWallDTMT: TDTM;
mazeWallDTM: Integer;}
i: Integer;
begin
{//with mazeWallDTMC do
//begin
mazeWallDTMC.x := 674;
mazeWallDTMC.y := 122;
mazeWallDTMC.areaSize := 0;
mazeWallDTMC.areaShape := 0;
mazeWallDTMC.color := 255;
//end
//with mazeWallDTMP[0] do
//begin
mazeWallDTMP[0].x := 674;
mazeWallDTMP[0].y := 117;
mazeWallDTMP[0].areaSize := 0;
mazeWallDTMP[0].areaShape := 0;
mazeWallDTMP[0].color := 255;
//end
//with mazeWallDTMP[1] do
//begin
mazeWallDTMP[1].x := 674;
mazeWallDTMP[1].y := 127;
mazeWallDTMP[1].areaSize := 0;
mazeWallDTMP[1].areaShape := 0;
mazeWallDTMP[1].color := 255;
//end
mazeWallDTMT.mainPoint := mazeWallDTMC;
mazeWallDTMT.subPoints := mazeWallDTMP;
for i := 0 to 20 do
begin
mazeWallDTMC.tolerance := i;
mazeWallDTMP[0].tolerance := i; getC
mazeWallDTMP[1].tolerance := i;
mazeWallDTM := addDTM(mazeWallDTMT);
//if(FindDTM(mazeWallDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
if(FindDTM(mazeWallDTM, x, y, 579, 48, 741, 201)) then
begin
result := getColor(x, y);
writeln('Maze wall color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find color');}
for i := 0 to 20 do
begin
if(findColorTolerance(x, y, 255, MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10, i)) then //paint + 3
begin
result := getColor(x, y);
writeln('Maze wall color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find maze wall color!');
end;

function getMazeFloorColor: Integer;
var
i: integer;
begin
for i := 0 to 20 do
begin
if(findColorTolerance(x, y, 9014165, MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10, i)) then //paint
begin
result := getColor(x, y);
writeln('Maze floor color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find maze floor color!');
end;

procedure setupDTMS;
//var
{mazeWallDTMC: TDTMPointDef;
mazeWallDTMP: Array[0..7] of TDTMPointDef;
mazeWallDTM: TDTM;
i: integer; }
begin
//mazeCenterMask := BitmapFromString(18, 18, 'z78DA73731BFEC0800600BF5D' +
// 'D475F9A85DA3768DDA356AD7D0B58B3E65EF700200ED4BF8D0');
mazeCenterMask := BitmapFromString2(False, 'a98A6778DAED94BB0EC0200' +
'8457F8928501C6B1FFFFF49E5B2B875324D6A60382137C2619288' +
'E82C0EB2DD211A34752A312836927A388B2117412F77E4B1405B0' +
'5BB3837BEC0CE236978543BF673CC2E5FB7CCE7BB6BEEE5E94A57' +
'BAD2F55FD7377FEF4AF5009DE');
{mazeWallDTMC.y := 86;
mazeWallDTMC.areaSize := 5;
mazeWallDTMC.areaShape := 0;
mazeWallDTMC.tolerance := 0;
mazeWallDTMC.color := mazeFloorColor;
for i := 0 to 7 do
begin
mazeWallDTMP[i].areaSize := 1;
mazeWallDTMP[i].areaShape := 0;
mazeWallDTMP[i].tolerance := 0;
mazeWallDTMP[i].color := mazeWallColor;
end;
mazeWallDTMP[0].x := 648;
mazeWallDTMP[0].y := 80;

mazeWallDTMP[1].x := 648;
mazeWallDTMP[1].y := 86;

mazeWallDTMP[2].x := 648;
mazeWallDTMP[2].y := 94;

mazeWallDTMP[3].x := 655;
mazeWallDTMP[3].y := 94;

mazeWallDTMP[4].x := 662;
mazeWallDTMP[4].y := 94;

mazeWallDTMP[5].x := 662;
mazeWallDTMP[5].y := 87;

mazeWallDTMP[6].x := 662;
mazeWallDTMP[6].y := 80;

mazeWallDTMP[7].x := 655;
mazeWallDTMP[7].y := 80;
mazeWallDTM.mainPoint := mazeWallDTMC;
mazeWallDTM.subPoints := mazeWallDTMP;
mazeCenterDTM := addDTM(mazeWallDTM); }
end;

procedure getMazeColors;
begin
mazeWallColor := getMazeWallColor;
mazeFloorColor := getMazeFloorColor;
end;

procedure addToRoomsArray(var arr: array of box; x1, y1, x2, y2, dx, dy: integer; rotate: boolean);
var
i: integer;
begin
i := getArrayLength(arr);
setArrayLength(arr, i + 1);
{arr[i].x1 := x1 - 94;
arr[i].y1 := y1 - 98;
arr[i].x2 := x2 - 94;
arr[i].y2 := y2 - 98;
arr[i].dx := dx - 94;
arr[i].dy := dy - 98;}
arr[i].x1 := x1;
arr[i].y1 := y1;
arr[i].x2 := x2;
arr[i].y2 := y2;
arr[i].dx := dx;
arr[i].dy := dy;
arr[i].rotate := rotate;
end;

procedure setupRooms;
begin
{addToRoomsArray(rooms, 91, 95, 104, 108, 98, 102);
addToRoomsArray(rooms, 104, 87, 112, 116, 91, 102);
addToRoomsArray(rooms, 83, 87, 91, 116, 91, 101);
addToRoomsArray(rooms, 91, 87, 104, 95, 91, 101);
addToRoomsArray(rooms, 91, 108, 104, 116, 91, 101);}

{addToRoomsArray(rooms, -3, -3, 10, 10, 3, 3);
addToRoomsArray(rooms, 10, -11, 18, 18, -3, 4);
addToRoomsArray(rooms, -11, -11, -3, 18, -3, 3);
addToRoomsArray(rooms, -3, -11, 10, -3, -3, 3);
addToRoomsArray(rooms, -3, 9, 10, 18, -3, 3);
addToRoomsArray(rooms, 18, -18, 25, 25, 4, 18);
addToRoomsArray(rooms, -18, -18, -11, 25, 5, 18);
addToRoomsArray(rooms, -11, -18, 18, -11, 4, 18);
addToRoomsArray(rooms, -11, 18, 18, 05, 4, 18);
addToRoomsArray(rooms, 25, -26, 33, 21, 5, -26);
addToRoomsArray(rooms, 25, 21, 33, 33, -26, 17);
addToRoomsArray(rooms, -26, -26, -18, -14, 4, -26);
addToRoomsArray(rooms, -26, -14, -18, 33, -26, 17);
addToRoomsArray(rooms, -18, -26, 25, -18, 4, -26);
addToRoomsArray(rooms, -18, 25, 25, 33, 22, 33);
addToRoomsArray(rooms, 33, -34, 41, -18, 4, -26);
addToRoomsArray(rooms, 33, -18, 41, 41, -26, 18);
addToRoomsArray(rooms, -34, -34, -26, 41, -14, -34);
addToRoomsArray(rooms, -26, -34, -7, -26, -14, -34);
addToRoomsArray(rooms, -7, -34, 33, -26, 4, -26);
addToRoomsArray(rooms, -26, 33, 9, 41, -14, -34);
addToRoomsArray(rooms, 9, 33, 33, 41, 22, 33);
addToRoomsArray(rooms, -42, -42, -35, -8, -29, -42);
addToRoomsArray(rooms, -42, -8, -34, 21, -37, -22);
addToRoomsArray(rooms, -42, 21, -34, 49, -21, 45);
addToRoomsArray(rooms, 41, -42, 49, -10, 27, -38);
addToRoomsArray(rooms, 41, -10, 49, 16, 36, 17);
addToRoomsArray(rooms, 41, 16, 49, 49, 42, 16);
addToRoomsArray(rooms, -34, -42, -22, -34, -39, -25);
addToRoomsArray(rooms, -22, -42, 41, -34, 17, -34);
addToRoomsArray(rooms, -34, 41, -5, 49, 5, 45);
addToRoomsArray(rooms, -5, 41, 29, 49, 3, 37);
addToRoomsArray(rooms, 29, 41, 49, 49, 44, 28);}

addToRoomsArray(rooms, -3, -3, 10, 10, 3, 4, False); //1
addToRoomsArray(rooms, 10, -11, 18, 18, -3, 3, True); //2
addToRoomsArray(rooms, -11, -11, -3, 18, -3, 3, True); //3
addToRoomsArray(rooms, -3, -11, 10, -3, -3, 2, True); //4
addToRoomsArray(rooms, -3, 10, 10, 18, -3, 4, True); //5
addToRoomsArray(rooms, 18, -18, 25, 25, 4, 18, False); //6
addToRoomsArray(rooms, -18, -18, -11, 25, 4, 18, False);
addToRoomsArray(rooms, -11, -18, 18, -11, 21, 4, False);
addToRoomsArray(rooms, -11, 18, 18, 25, 5, 18, False); //9
addToRoomsArray(rooms, 25, -26, 33, 21, 25, 2, True);
addToRoomsArray(rooms, 25, 21, 33, 33, 4, 29, True);
addToRoomsArray(rooms, -26, -26, -18, -14, 1, -23, True);
addToRoomsArray(rooms, -26, -14, -18, 33, -25, 17, True);
addToRoomsArray(rooms, -18, -26, 25, -18, 25, 4, True);
addToRoomsArray(rooms, -18, 25, 25, 33, -26, 16, True); //15
addToRoomsArray(rooms, 33, -34, 41, -18, 6, -30, False);
addToRoomsArray(rooms, 33, -18, 41, 41, 22, 33, False);
addToRoomsArray(rooms, -34, -34, -26, 2, -14, -34, False); //18 - everthing here move down!!!!!!
addToRoomsArray(rooms, -34, 3, -26, 41, -27, -23, False);
addToRoomsArray(rooms, -26, -34, -7, -26, -14, -34, False);
addToRoomsArray(rooms, -7, -34, 33, -26, 4, -26, False);
addToRoomsArray(rooms, -26, 33, 9, 41, -28, 2, False); //22
addToRoomsArray(rooms, 9, 33, 33, 41, 22, 33, False);
addToRoomsArray(rooms, -42, -42, -35, -8, -34, 6, True); //24
addToRoomsArray(rooms, -42, -8, -34, 21, -34, 6, True);
addToRoomsArray(rooms, -42, 21, -34, 49, -4, 45, False);
addToRoomsArray(rooms, 41, -42, 49, -10, 18, -34, False);
addToRoomsArray(rooms, 41, -10, 49, 16, 41, 15, True); //28
addToRoomsArray(rooms, 41, 16, 49, 49, 41, 15, True);
addToRoomsArray(rooms, -34, -42, -22, -34, -37, -21, False);
addToRoomsArray(rooms, -22, -42, 41, -34, 17, -34, False);
addToRoomsArray(rooms, -34, 41, -5, 49, 6, 43, False);
addToRoomsArray(rooms, -5, 41, 29, 49, 5, 41, False);
addToRoomsArray(rooms, 29, 41, 41, 49, 43, 15, True);
end;

procedure removeFromTPointArray(var arr: array of tPoint; n: integer);
var
i, j: integer;
tmpArr: array of tPoint;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
if(not (n = i)) then
begin
j := getArrayLength(tmpArr);
setArrayLength(tmpArr, j + 1);
tmpArr[j] := arr[i];
end;
end;
setArrayLength(arr, j + 1);
arr := tmpArr;
end;

procedure removeBoxFromPoints(var arr: array of tPoint; box: tBox);
var
i: integer;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
if(inRange(arr[i].x, box.x1, box.x2) and inRange(arr[i].y, box.y1, box.y2)) then
begin
removeFromTPointArray(arr, i);
end;
end;
end;

procedure addToTPointArray(var arr: array of tPoint; point: tPoint);
var
i: integer;
begin
i := getArrayLength(arr);
setArrayLength(arr, i + 1);
arr[i] := point;
end;

procedure arrangePointsByDistance(var arr: array of tPoint; x, y: integer);
var
i, j, k, l: integer;
tempArr: array of tPoint;
begin
repeat
if(getArrayLength(arr) <= 0) then
begin
setArrayLength(arr, getArrayLength(tempArr));
arr := tempArr;
exit;
end;
for i := 0 to getArrayLength(arr) - 1 do
begin
//writeln(intToStr(i));
j := distance(x, y, arr[i].x, arr[i].y);
if((j < k) or (k <= 0)) then
begin
k := j;
l := i;
end;
end;
//writeln(intToStr(arr[l].x) + ', ' + intToStr(arr[l].y));
addToTPointArray(tempArr, arr[l]);
removeFromTPointArray(arr, l);
l := 0;
j := 0;
k := 0;
until(false)
end;

procedure removePointsByDistance(var arr: array of tPoint; dist: integer);
var
i, j: integer;
begin
{for i := 0 to getArrayLength(arr) - 1 do
begin
for j := 0 to getArrayLength(arr) - 1 do
begin
if(i = j) then
begin
break;
end;
try
if(distance(arr[i].x, arr[i].y, arr[j].x, arr[j].y) <= dist) then
begin
removeFromTPointArray(arr, j);
removePointsByDistance(arr, dist);
end;
except
Writeln('error');
end;
end;
end;}
end;

function FindDoor2: Boolean;
var
I, x1, y1, x2, y2, ChangeAmt: Integer;
H, S, L, X, Y, Z: Extended;
xx, yy: integer;
begin
ColorToleranceSpeed(0);
x1:= MSCX;
y1:= MSCY;
x2:= MSCX;
y2:= MSCY;
for I:= 0 to 5 do
begin
ChangeAmt:= ChangeAmt + 10;
x1:= x1 - ChangeAmt;
y1:= y1 - ChangeAmt;
x2:= x2 + ChangeAmt;
y2:= y2 + ChangeAmt;
if(FindColorSkipBoxTolerance(xx, yy, 1118485, x1, y1, x2, y2, 1, InttoBox(243, 148, 287, 195)))then
begin
ColortoHSL(GetColor(xx, yy), H, S, L);
ColortoXYZ(GetColor(xx, yy), X, Y, Z);
if(L > 6.8)then if(L < 8.1)then if(X > 0)then if(X < 1)then if(Y > 0)then if(Y < 1)then if(Z > 0)then if(Z < 1)then
begin
MMouse(xx, yy, 1, 1);
if(IsUpText('Ope'))then
begin
Result:= True;
Mouse(xx, yy, 5, 5, True);
FFlag(5);
Flag;
wait(500 + random(1000));
exit;
end;
end;
end;
end;
end;

procedure findDoor;
var
playerBox: TBox;
i, j: integer;
doors: array of tPoint;
h, s, l, x, y, z: extended;
xx, yy: integer;
begin
playerBox := intToBox(255, 148, 284, 187);
for i := 0 to 20 do
begin
findColorsTolerance(doors, 1118485, MSX1, MSY1, MSX2, MSY2, i); //paint
if(getArrayLength(doors) > 0) then
begin
removeBoxFromPoints(doors, playerBox);
arrangePointsByDistance(doors, MSCX, MSCY);
removePointsByDistance(doors, 5);
if(getArrayLength(doors) <= 0) then
begin
exit;
end;
//writeln(intToStr(getArrayLength(doors)));
for j := 0 to getArrayLength(doors) - 1 do
begin
ColortoHSL(GetColor(doors[j].x, doors[j].y), H, S, L);
ColortoXYZ(GetColor(doors[j].x, doors[j].y), X, Y, Z);
if(L > 6.8)then if(L < 8.1)then if(X > 0)then if(X < 1)then if(Y > 0)then if(Y < 1)then if(Z > 0)then if(Z < 1)then
begin
//writeln(intToStr(doors[j].x) + ', ' + intToStr(doors[j].y));
mMouse(doors[j].x, doors[j].y, 5, 5);
Wait(20 + random(50));
if(isUpTextMulti('pen', 'en W', 'all')) then
begin
GetMousePos(xx, yy);
mouse(xx, yy, 0, 0, True);
FFlag(5);
Flag;
wait(500 + random(1000));
exit;
end;
end;
end;
end
end
end;

procedure touchShrine;
var
playerBox: TBox;
i, j: integer;
shrine: array of tPoint;
begin
writeln('yay we are in the middle!');
playerBox := intToBox(255, 148, 284, 187);
for i := 0 to 20 do
begin
findColorsSpiralTolerance(MSCX, MSCY, shrine, 1907999, MSX1, MSY1, MSX2, MSY2, i); //paint
if(getArrayLength(shrine) > 0) then
begin
removeBoxFromPoints(shrine, playerBox);
arrangePointsByDistance(shrine, MSCX, MSCY);
removePointsByDistance(shrine, 5);
if(getArrayLength(shrine) <= 0) then
begin
exit;
end;
//writeln(intToStr(getArrayLength(shrine)));
for j := 0 to getArrayLength(shrine) - 1 do
begin
//writeln(intToStr(shrine[j].x) + ', ' + intToStr(shrine[j].y));
mMouse(shrine[j].x, shrine[j].y, 5, 5);
Wait(20 + random(50));
if(isUpTextMulti('ouch', 'range', 'rine')) then
begin
GetMousePos(x, y);
mouse(x, y, 0, 0, True);
FFlag(5);
Flag;
wait(500 + random(1000));
Writeln('finished maybe?');
end;
end;
end
end
end;

procedure findArea(mx, my: integer);
var
i: integer;
begin
//mx := mx * -1;
//my := my * -1; //get the inverse
//writeln(IntToStr(mx) + ', ' + intToStr(my));
for i := 0 to getArrayLength(rooms) - 1 do
begin
//writeln('testing if ' + intToStr(mx) + ' is in ' + intToStr(rooms[i].x1) + ', ' + intToStr(rooms[i].x2));
//writeln('testing if ' + intToStr(my) + ' is in ' + intToStr(rooms[i].y1) + ', ' + intToStr(rooms[i].y2));
if(inRange(mx, rooms[i].x1, rooms[i].x2) and inRange(my, rooms[i].y1, rooms[i].y2)) then
begin
Writeln('in room ' + intToStr(i));
if(i = 0) then
begin
touchShrine;
end;
Mouse(rooms[i].dx + squarePosx, rooms[i].dy + squarePosy, 2, 2, True);// in paint so add 3
Flag;
Wait(500 + random(1000));
if(rooms[i].rotate) then
begin
writeln('need to rotate');
case random(2) of
0: makeCompass('w');
1: makeCompass('e');
end;
end;
break;
end;
end;
end;

procedure findCenter;
var
acc: extended;
mazePosx, mazePosy: integer;
begin
//Writeln(intToStr(mazeCenterDTM));
{if(findDTM(mazeCenterDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
Writeln('found the dtm at (' + IntToStr(x) + ', ' + IntToStr(y) + ')');
c := 0;
end else
begin
if(c >= 5) then
begin
writeln('Couldnt find the center! Exiting');
exit;
end;
Writeln('didnt find the dtm, trying again');
Inc(c);
getMazeColors;
findCenter;
end}
//if(FindBitmapMaskTolerance(mazeCenterMask, x, y, MMX1, MMY1, MMX2, MMY2, 20, 20)) then
perfectNorth;
if(FindDeformedBitmapToleranceIn(mazeCenterMask, x, y, MMX1, MMY1, MMX2, MMY2, 20, 1, False, acc)) then //paint
begin
squarePosx := x;
squarePosy := y;
x := x + 9; //in paint so take 3
y := y + 9;
//Writeln('yay it worked at (' + IntToStr(x) + ', ' + IntToStr(y) + ') with accuracy ' + FloatToStr(acc));
//MoveMouseSmooth(x, y);
mazePosx := (MMCX) - x; //paint
mazePosy := (MMCY) - y;
findArea(mazePosx, mazePosy);
end
end;

procedure makeLinesStraight
var
wall: integer;
accuracy, angle: integer;
begin
wall := := BitmapFromString2(False, 'aF1AF178DA333080015367206' +
'1EE6A0E24CDCC0D416C23673869E46A065263ECEA660AA2A94B02' +
'00FA8');
perfectNorth;
findDeformedBitmapToleranceRotationIn(wall, x, y, MMX1, MMY1, MMX2, MMY2, 20, 1, Accuracy, (2 * pi) * (5 / 360), 0, (2 * pi), Angle)
if(angle > 180) then
begin

end;
sendArrowWait();
end;

begin
setupSRL;
perfectNorth;
getMazeColors;
setupRooms;
setupDTMs;
repeat
findCenter;
findDoor;
until(isFKeyDown(12))
//getPosition;
end.

bullzeye95

2007-08-11 21:20:54

From: danrox2004
I have an autocolor for the walls and floor on the minimap, will post it tonight. Oh, and also to find keyholes i used a findColorsTolerance, and rearranged it by distance to player, and removed all points within 5 of each other - i will post this tonight too.

Edit: Here it is

function getMazeFloorColor: Integer;
var
i: integer;
begin
for i := 0 to 20 do
begin
if(findColorTolerance(x, y, 9014165, MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10, i)) then //paint
begin
result := getColor(x, y);
writeln('Maze floor color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find maze floor color!');
end;

function getMazeWallColor: Integer;
var
i: Integer;
begin
for i := 0 to 20 do
begin
if(findColorTolerance(x, y, 255, MMCX - 10, MMCY - 10, MMCX + 10, MMCY + 10, i)) then //paint + 3
begin
result := getColor(x, y);
writeln('Maze wall color is ' + IntToStr(result));
exit;
end;
end;
Writeln('Could not find maze wall color!');
end;

Anyone know why this doesn't seem to work - doesn't arrange by closest or remove the ones on the player:


procedure removeFromTPointArray(var arr: array of tPoint; n: integer);
var
i, j: integer;
tmpArr: array of tPoint;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
if(not n = i) then
begin
j := getArrayLength(tmpArr);
setArrayLength(tmpArr, j + 1);
tmpArr[j] := arr[i];
end;
end;
setArrayLength(arr, j + 1);
arr := tmpArr;
end;

procedure removeBoxFromPoints(var arr: array of tPoint; box: tBox);
var
i: integer;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
if(inRange(arr[i].x, box.x1, box.x2) and inRange(arr[i].y, box.y1, box.y2)) then
begin
removeFromTPointArray(arr, i);
end;
end;
end;

procedure addToTPointArray(var arr: array of tPoint; point: tPoint);
var
i: integer;
begin
i := getArrayLength(arr);
setArrayLength(arr, i + 1);
arr[i] := point;
end;

procedure arrangePointsByDistance(var arr: array of tPoint; x, y: integer);
var
i, j, k, l: integer;
tempArr: array of tPoint;
begin
repeat
if(getArrayLength(arr) <= 0) then
begin
setArrayLength(arr, getArrayLength(tempArr));
arr := tempArr;
exit;
end;
for i := 0 to getArrayLength(arr) - 1 do
begin
//writeln(intToStr(i));
j := distance(x, y, arr[i].x, arr[i].y);
if((j < k) or (k <= 0)) then
begin
k := j;
l := i;
end;
end;
//writeln(intToStr(arr[l].x) + ', ' + intToStr(arr[l].y));
addToTPointArray(tempArr, arr[l]);
removeFromTPointArray(arr, l);
l := 0;
j := 0;
k := 0;
until(false)
end;

procedure removePointsByDistance(var arr: array of tPoint; dist: integer);
var
i, j: integer;
begin
for i := 0 to getArrayLength(arr) - 1 do
begin
for j := 0 to getArrayLength(arr) - 1 do
begin
if(i = j) then
begin
break;
end;
if(distance(arr[i].x, arr[i].y, arr[j].x, arr[j].y) <= dist) then
begin
removeFromTPointArray(arr, j);
removePointsByDistance(arr, dist);
end;
end;
end;
end;

procedure findDoor;
var
playerBox: TBox;
i, j: integer;
doors: array of tPoint;
begin
playerBox := intToBox(255, 148, 284, 187);
for i := 0 to 20 do
begin
findColorsTolerance(doors, 1118485, MSX1, MSY1, MSX2, MSY2, i); //paint
if(getArrayLength(doors) > 0) then
begin
removeBoxFromPoints(doors, playerBox);
arrangePointsByDistance(doors, MSCX, MSCY);
removePointsByDistance(doors, 5);
if(getArrayLength(doors) <= 0) then
begin
exit;
end;
//writeln(intToStr(getArrayLength(doors)));
for j := 0 to getArrayLength(doors) - 1 do
begin
//writeln(intToStr(doors[j].x) + ', ' + intToStr(doors[j].y));
mMouse(doors[j].x, doors[j].y, 5, 5);
Wait(20 + random(50));
if(isUpTextMulti('pen', 'en W', 'all')) then
begin
GetMousePos(x, y);
mouse(x, y, 0, 0, True);
FFlag(5);
Flag;
wait(500 + random(1000));
end;
end;
end
end
end;


I dunno why, but this works for arranging them by closest to a point:
procedure SwapPoints(var a, b: TPoint);
var
c: TPoint;
begin
c:= a;
a:= b;
b:= c;
end;

procedure arrangePointsByDistance(var P: TPointArray; x, y: integer);
var
I, I2: Integer;
begin
for I:= 1 to Length(P) do
for I2:= 1 to Length(P) - 1 do
if(Distance(P[I2].x, P[I2].y, x, y) < Distance(P[I2 - 1].x, P[I2 - 1].y, x, y))then
SwapPoints(P[I2], P[I2 - 1]);
end;
(Based off Bubble by… mutant squirrel I think…)

danrox2004

2007-08-11 21:35:37

From: bullzeye95
I dunno why, but this works for arranging them by closest to a point:
procedure SwapPoints(var a, b: TPoint);
var
c: TPoint;
begin
c:= a;
a:= b;
b:= c;
end;

procedure arrangePointsByDistance(var P: TPointArray; x, y: integer);
var
I, I2: Integer;
begin
for I:= 1 to Length(P) do
for I2:= 1 to Length(P) - 1 do
if(Distance(P[I2].x, P[I2].y, x, y) < Distance(P[I2 - 1].x, P[I2 - 1].y, x, y))then
SwapPoints(P[I2], P[I2 - 1]);
end;
(Based off Bubble by… mutant squirrel I think…)


Heh, thats much easier.

Harry

2007-08-11 22:16:38

I have an idea, just dump this whole idea (I would if I was making it.) You almost never get this random (at least for me) and it will be very hard to do it.

The only reason I would do it would be to get SRL Dev status :rolleyes: .

bullzeye95

2007-08-11 22:37:54

You're probably right, but I think it'll be fun to try to beat it.

Harry

2007-08-11 22:45:55

I don't think so. I think it is actually a waste of time. I would rather have a wildy runeite miner done before I would request this XD

Bobarkinator

2007-08-11 23:20:27

From: hy71194
I don't think so. I think it is actually a waste of time. I would rather have a wildy runeite miner done before I would request this XD


Wouldn't it feel good if you were autoing and you're like, oh look, a random, I can solve that because my script solves any random Jagex can throw at me.

The Claw

2007-08-12 01:36:13

No way is this a waste of time, traditionally this is the hardest random to beat (even by humans :rolleyes:) so imagine if we could solve it, it would be awesome.

bullzeye95

2007-08-12 02:24:55

And what's even better about this one is, if the script messes up and gets totally lost, the character will just look like a normal player :)

TOB

2007-08-12 23:07:55

To be honest, I'd rather run through maze myself because I enjoy beating the timer and getting a prize.

Bobarkinator

2007-08-12 23:52:40

But right now you have hardly any time if your you get timed out cause your auto can solve it.

R0b0t1

2007-08-13 14:26:31

Getting to the end of a maze is like… Finding a whistle in a cracker jack box.


How do you know this would get you dev? I don't think anyone knows what they grade on… Or is it on whim?

Special Ed

2007-08-14 14:29:59

Hey if anyone needs any help with this or some math computations I'd be more than glad to help, also if you'd want to use the MSI SvN for this, you can just let me know and I'll add you to the project, I think that would be easier than re-updating the files everyone time you add something new.

Bam Bam

2007-08-14 18:31:35

Does anyone even get enough mazes to make one of these?

TOB

2007-08-14 18:41:01

I do but I usually solve them myself because it's fun to beat the clock, lol…

RAM

2007-08-14 19:47:09

@ ANYONE with a negative attitude (you know who you are)….It's just the point of the challenge of making this…
for us it is an intellectual challenge: outsmarting the system, solving each trap they set out for us
If you can't respect this,or contribute to a solution…..you are not required or encouraged to post your opinion….

Personally, I like to solve some randoms on my own…but by looking at the "BIG PICTURE"…..How nice would it be, to know your script will not be hindered by ANY random ? (rhetorical question) VERY NICE ! :)

~RAM

Special Ed

2007-08-16 12:45:21

Very well said RAM, and I think that if we keep getting people to compile information we'll eventually have enough data to make this work.

the scar noob

2007-08-16 18:11:25

omg, i read everything a couple of times, it sounds very difficult, why not using some awesome utilities to help us? like DDTM editor (example)…
i really don't get the idea you all are talking about, it's confusing and more than 1 idea w hat makes i teven more confusing :p
can someone explain me a bit how you guys are trying to solve this, btw can you PM me? lol maybe i'll forget this in a few days…

Wanted

2007-08-22 13:44:33

From: TOB
Anyone thought of getting the mappings for every maze start point and drawing the minimap to canvas, identifying the start point, and have preset paths drawn for debug. Next time someone gets maze set PerfectNorth; and screenshot the start point then click a point and screen shot directions EVERY time you make a turn or go through a door. Then we can draw lines manually with a path on them on how to solve every start point. Using canvas you can try and match up start points according to bitmaps, or DTMs may work better. Then when the maze solver is written it should also draw on debug the path it takes when making turns so we can compare them. Hard to say, even harder to make.


I really need as many screen shots as possible, please read the above, LISTEN TO TOB!