SRL Archive - Reflection Help

Doors


Bad Boy JH

2010-08-30 07:43:57

I have asked before about opening doors with reflection, however I didn't really get an answer. Is there a plan to be able to open doors with reflection, is it possible? they had to do it with RSBot, so I assume its possible. I would really like it, cause whist I could do it in color, it would be easier to differentiate whether a door is open or not…

Shuttleu

2010-08-30 07:49:27

i will make a door opener in reflection
sit tight

~shut

EDIT:
function OpenDoor(id: Integer): Boolean;
var
TheDoor: TRSObject;
MSPos: TPoint;
begin
TheDoor:= GetObjectByID(id, OBJECT_TYPE_INTERACTABLE, 15);
MSPos:= TileToMS(TheDoos.Tile, 10);
Mouse(MSPos.x, MSPos.y, 0, 0, False);
Result:= ChooseOptionMulti(['pen', 'oor']);
end;
just enter the door id which you can get from something like RS bot

i think doors are interactable, so it may or may not work, just try

~shut

ZephyrsFury

2010-08-30 08:40:00

Open doors and closed doors have different object IDs so it is possible to check and open/close doors accordingly. But because doors are actually positioned on the edges of tiles you have to be careful where you move the mouse. The best way to click a door would be to use TileToMSEx where you can specify the point as on the edge or in the middle of a tile.



{*******************************************************************************
function TileToMSEx(tile: TTile; offx, offy : extended; height : integer): TPoint;
By: BenLand100
Description: Converts the global tile position, a position on that tile in the
range [(0,0), (1,1)] with (0.5, 0.5) being center and a height above
ground level to a screen location on the main screen, taking camera
position and rotation into account.
*******************************************************************************}

Shuttleu

2010-08-30 08:45:02

From: ZephyrsFury
Open doors and closed doors have different object IDs so it is possible to check and open/close doors accordingly. But because doors are actually positioned on the edges of tiles you have to be careful where you move the mouse. The best way to click a door would be to use TileToMSEx where you can specify the point as on the edge or in the middle of a tile.



{*******************************************************************************
function TileToMSEx(tile: TTile; offx, offy : extended; height : integer): TPoint;
By: BenLand100
Description: Converts the global tile position, a position on that tile in the
range [(0,0), (1,1)] with (0.5, 0.5) being center and a height above
ground level to a screen location on the main screen, taking camera
position and rotation into account.
*******************************************************************************}


i will use that

~shut

EDIT: this?
function Door(id: Integer; DoorDirection: string; OpenDoor: Boolean): Boolean;
var
TheDoor: TRSObject;
MSPos: TPoint;
DoorX, DoorY: Extended;
begin
case DoorDirection of
'n': begin
DoorX:= 0.5;
DoorY:= 0.0;
end;
'e': begin
DoorX:= 1.0;
DoorY:= 0.5;
end;
's': begin
DoorX:= 0.5;
DoorY:= 1.0;
end;
'w': begin
DoorX:= 0.0;
DoorY:= 0.5;
end;
end;
TheDoor:= GetObjectByID(id, , 15);
MSPos:= TileToMSEx(TheDoos.Tile, DoorX, DoorY, 10);
Mouse(MSPos.x, MSPos.y, 0, 0, False);
if OpenDoor then
Result:= ChooseOptionMulti(['pen', 'oor'])
else
Result:= ChooseOptionMulti(['lose', 'oor'])
end;

mormonman

2010-08-30 17:24:30

I think bad boy is referring to hooking object models…

Cstrike

2010-08-30 17:37:35

From: Shuttleu
]just enter the door id which you can get from something like RS bot

How easy are the ID's to get from RSBot? Can one hover over a door and it will return the ID? I just DL'ed it but I've never used it before.

Tickyy

2010-08-30 17:44:27

From: cstrike
How easy are the ID's to get from RSBot? Can one hover over a door and it will return the ID? I just DL'ed it but I've never used it before.


Just login, and look a bit up, you'll see "File, Edit, View, Help", Click View, and you'll see all the debugging.

Shuttleu

2010-08-30 17:51:30

From: Tickyy
Just login, and look a bit up, you'll see "File, Edit, View, Help", Click View, and you'll see all the debugging.


Like that, but choose Objects on the View menu

~shut

Cstrike

2010-08-30 19:59:48

Is there any other ways to get the ID's? RSBot [free version] is apparently down.
Is there reflection code I could use to return ID's? If it can identify them… could it not also blindly identify them and return a host of numbers for me to wad through?

Tickyy

2010-08-30 20:02:58

From: cstrike
Is there any other ways to get the ID's? RSBot [free version] is apparently down.
Is there reflection code I could use to return ID's? If it can identify them… could it not also blindly identify them and return a host of numbers for me to wad through?


I guess you've got the wrong rsbot, did you download it from www.powerbot.org?

or even better, a bot from us(Well, not us :p, but he's from srl :)): http://www.tribot.org/

Cstrike

2010-08-30 20:08:23

From: Tickyy
I guess you've got the wrong rsbot, did you download it from www.powerbot.org?

or even better, a bot from us(Well, not us :p, but he's from srl :)): http://www.tribot.org/


I got it from http://www.rsbot.com/

I really hope it's not some scam site or something retarded. Today has been sort of a crappy day for me, so I wouldn't be surprised if I screwed myself over… D:

TriBot is amazing, like it much better. Thank you for the link (I went with him cause he's from SRL)


EDIT: Do you know how one would go about learning how GetObjectByID(id, OBJECT_TYPE_INTERACTABLE, 15); has "OBJECT_TYPE_INTERACTABLE" as a variable there? Is there a reason for this type of name?
Basically, how can I learn reflection so I can be as good as you :p ?

jennypatel

2010-09-08 05:26:30

Well, it is a nice idea that the door is opening in reflection. It is possible using the RSBot and you can do that easily with that.