SRL Archive - Reflection Development

Maze Development Thread.


Wyn

2010-10-13 15:53:46

Has I have been saying around I have been working on maze for a last while. Taking me little by little to sort everything out.

THIS PROBABLY DOESN'T EVEN COMPILE YET; IT IS HAS ROUGH HAS IT GETS.

THE FINAL VERSION WILL NOT EVEN LOOK LIKE THIS IN THE END; JUST A STAB.


^^In caps cause of the generic idiot to botting.(Rsbot for example.)

Credits to cstrike for the doorclicking.

function R_InMaze: Boolean;
begin
if (ValidInterface(0) then //get interface
if Result := true; then start;
end;

procedure start;
begin
if distanceFrom(tile(xxx, yyy) < 1 then
writeln('Orange');
DoOrange;
end else
begin
if distanceFrom(tile(xxx, yyy) < 1 then
writeln('Purple');
DoPurple;
end else
begin
if distanceFrom(tile(xxx, yyy) < 1 then
writeln('Green');
DoGreen;
end else
begin
if distanceFrom(tile(xxx, yyy) < 1 then
writeln('Yellow');
DoYellow;
end else
begin
if distanceFrom(tile(xxx, yyy) < 1 then
writeln('Blue');
DoBlue;
end;

function OpenDoor(id: Integer): Boolean;
var
TheDoor: TRSObject;
MSPos: TPoint;
begin
TheDoor:= GetObjectByID(id, OBJECT_TYPE_INTERACTABLE, 3);
MSPos:= TileToMS(TheDoor.Tile, 3);
Mouse(MSPos.x, MSPos.y, 0, 0, False);
Result:= ChooseOptionMulti(['pen', 'oor']);
end;

Procedure DoOrange;
var
door1 : TTile;
door2 : TTile;
door3 : TTile;
door4 : TTile;
door5 : TTile;
door6 : TTile;
door7 : TTile;
door8 : TTile;
door9 : TTile;
door10 : TTile;
door11 : TTile;
begin
door1 := Tile(2891, 4588);
door2 := Tile(2889, 4596);
door3 := Tile(2893, 4600);
door4 := Tile(2901, 4598);
door5 := Tile(2897, 4596);
door6 := Tile(2894, 4587);
door7 := Tile(2896, 4582);
door8 := Tile(2898, 4570);
door9 := Tile(2900, 4567);
door10 := Tile(2911, 4566);
door11 := Tile(2906, 4585);

writeln('Here we go orange');
WalkToTile(door1, 1, 0);
R_Compass('n');
OpenDoor(3628);
OpenDoor(3629); ///Door Ids 3628, 3629, 3630, 3631, 3632
OpenDoor(3630);
OpenDoor(3631);
OpenDoor(3632); //The ids are random >.>
R_Flag;
WalktoTile(door2, 1, 0);
OpenDoor(3628);
OpenDoor(3629); ///Door Ids 3628, 3629, 3630, 3631, 3632
OpenDoor(3630);
OpenDoor(3631);
OpenDoor(3632); //The ids are random >.>
R_Flag;
WalktoTile(door3, 1, 0);
OpenDoor(3628);
OpenDoor(3629); ///Door Ids 3628, 3629, 3630, 3631, 3632
OpenDoor(3630);
OpenDoor(3631);
OpenDoor(3632); //The ids are random >.>
R_Flag;
WalktoTile(door4, 1, 0);
R_Compass('s');
OpenDoor(3628);
OpenDoor(3629); ///Door Ids 3628, 3629, 3630, 3631, 3632
OpenDoor(3630);
OpenDoor(3631);
OpenDoor(3632); //The ids are random >.>
R_flag;
WalktoTile(door5, 1, 0);
OpenDoor(3628);
OpenDoor(3629); ///Door Ids 3628, 3629, 3630, 3631, 3632
OpenDoor(3630);
OpenDoor(3631);
OpenDoor(3632); //The ids are random >.>
R_flag;



Procedure DoPurple;
begin
end

Procedure DoGreen;
begin
end

Procedure DoYellow;
begin
end

Procedure DoBlue;
begin
end

Discuss/Feedback. (Could this be moved to the devs corner? Thanks)

Naike

2010-10-13 16:29:59

Problem is, in devs' corner only a handful of people could post..
Therefor it'll have no meaning being in there :)

Nice going though, don't give up!

Cstrike

2010-10-13 16:30:33

This is good, you could even make Types out of them, like

Type.Red.Door[1]
Type.Blue.Tile[4]
etc

Are the last door ID's random?
If so, that's still beatable if you can get next do them, since you can rotate the screen and use TileToMS to get the mouse on the door [w/ the tile].
And even without the tile, rotating and seeing door = good ;)

mormonman

2010-10-13 16:40:21

From: cstrike
This is good, you could even make Types out of them, like

Type.Red.Door[1]
Type.Blue.Tile[4]
etc

Are the last door ID's random?
If so, that's still beatable if you can get next do them, since you can rotate the screen and use TileToMS to get the mouse on the door [w/ the tile].
And even without the tile, rotating and seeing door = good ;)


I agree with both ideas. You need to add a parameter to the door function that takes a direction. opendoor(tile, direction);

pyroryan

2010-10-13 16:58:14

From: wyn10

Discuss/Feedback. (Could this be moved to the devs corner? Thanks)


But then I can't post D:

Naike

2010-10-13 17:00:29

Pss.. TileToMSEx for doors :)

Wyn

2010-10-13 17:28:45

From: Naike
Problem is, in devs' corner only a handful of people could post..
Therefor it'll have no meaning being in there :)

Nice going though, don't give up!


Thanks; I won't. Just not used of the formatting for making a random.

From: cstrike
This is good, you could even make Types out of them, like

Type.Red.Door[1]
Type.Blue.Tile[4]
etc

Are the last door ID's random?
If so, that's still beatable if you can get next do them, since you can rotate the screen and use TileToMS to get the mouse on the door [w/ the tile].
And even without the tile, rotating and seeing door = good ;)


Someone told me the door's were random while getting input. I haven't had the maze in over 3 months >.>

From: mormonman
I agree with both ideas. You need to add a parameter to the door function that takes a direction. opendoor(tile, direction);


Ok I'll see what I can do.

From: pyroryan
But then I can't post D:


Whoops.

From: Naike
Pss.. TileToMSEx for doors :)


Ok I'll see what I can do.

pyroryan

2010-10-13 17:31:06

From: wyn10

Someone told me the door's were random while getting input. I haven't had the maze in over 3 months >.>


Then you cheat and look at rsbot's random solvers.

mormonman

2010-10-13 18:12:26

From: Naike
Pss.. TileToMSEx for doors :)


That is the same as using x, y offsets.

Wyn

2010-10-13 22:27:33

From: pyroryan
Then you cheat and look at rsbot's random solvers.


I never said my friends weren't random solvers themselves….

And I don't use rsbot unless for debugging.

Smartzkid

2010-10-13 22:30:30

Yes, but if RSBot can solve mazes, you can pretty much port their code to pascal..

mormonman

2010-10-13 22:32:58

From: Smartzkid
Yes, but if RSBot can solve mazes, you can pretty much port their code to pascal..


Except the looping part. You can port all the data, but you still have to make the logic different.

Naike

2010-10-14 08:32:31

From: wyn10
I never said my friends weren't random solvers themselves….

And I don't use rsbot unless for debugging.


In this case, cheating is a good thing.. he didn't say it trying to be negative and trying to drag down your good work. Miss-understanding here ^^

Cstrike

2010-10-14 14:35:46

Borrowed from Naum's maze thread

Wyn

2010-10-15 10:53:45

From: cstrike
Borrowed from Naum's maze thread


Named mine differently.

Cstrike

2010-10-15 11:31:49

From: wyn10
Named mine differently.


Found a non doodled on one at rune wiki

Sorry I just like saying where I found it from :D

Wyn

2010-10-19 10:42:08

Sorry I haven't been updating this topic but I have two sections done now.

WIll update when I get home.

Cstrike

2010-10-19 11:42:55

BTW another idea: If the ID's are random, you can always get near them and do an object dump in a range of 3 (ive got code that does that if you want)

Wyn

2010-10-19 19:27:06

From: cstrike
BTW another idea: If the ID's are random, you can always get near them and do an object dump in a range of 3 (ive got code that does that if you want)


Fuck post it don't ever hesitate on the ideas. :spot:

Cstrike

2010-10-19 19:29:16

From: wyn10
Fuck post it don't ever hesitate on the ideas. :spot:


program ReflectionBasic;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}

const
{---SMART Setup Constants---}
WORLD = 121;
MEMBERS = false;
SIGNED = true;
{---------------------------}

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
End;
End;

// Outputs everything [minus interfaces] in a radius (box) around you.
// A radius of 4 will get 4 tiles on northwest of you, to 4 tiles southeast of you.
procedure DumpRadius (tileRadius : Integer);
var mp, curTile : TTile;
NPCs : TNPCArray;
ItemArr : TGroundItemArray;
RSObj : TRSObject;
x1, y1, x2, y2, i, j, k, objA : Integer;
begin
mp := GetMyPos;
writeln ('Character Tile('+inttostr(mp.x)+','+inttostr(mp.y)+')');
writeln ('**************************');
x1 := (mp.x - tileRadius);
y1 := (mp.y - tileRadius);
x2 := (mp.x + tileRadius);
y2 := (mp.y + tileRadius);
for i:=0 to (x2-x1) do
begin
for j:=0 to (y2-y1) do
begin
curTile := Tile(x1+i,y1+j);
writeln ('==============================');
writeln ('DUMPING TILE('+inttostr(curTile.x)+','+inttostr(curTile.y)+') DATA');
if mp = curTile then writeln ('** On tile for your character');
writeln ('==============================');
writeln ('');
writeln ('Dumping NPC Data:');
writeln ('-----------------');
NPCs := GetNPCsAt(curTile);
DumpNPCs (NPCs);
writeln ('');
writeln ('Dumping Ground Object Data:');
writeln ('---------------------------');
ItemArr := GetItemsAt(curTile);
if high(ItemArr) > -1 then
begin
for k:=0 to high(ItemArr) do
begin
writeln ('Item ID: '+inttostr(ItemArr[k].ID)+', Item stack: '+inttostr(ItemArr[k].Stack));
end;
end else writeln ('No ground object data found on this tile');
ItemArr := []; // Clean array
writeln ('');
writeln ('Dumping Object Data:');
writeln ('--------------------');
for objA:=0 to 3 do
begin
RSObj := GetObjectAt (curTile ,objA);
if RSObj = NULL_RSOBJECT then
begin
writeln ('No object found on this tile [Type: '+inttostr(objA)+']');
end else
begin
writeln ('Object ID: '+inttostr(RSObj.ID)+', ObjType :'+inttostr(RSObj.objType));
end;
//GetObjectAt(T: TTile; objType: Integer): TRSObject;
end;
writeln ('');
end;
end;
end;

begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
SetUpReflectionEx(true);
DeclarePlayers;
LoginPlayer;
Cleardebug;
wait (2500+random(1000));
DumpRadius (1);
end.

;)