SRL Archive - Reflection Help

R_ChooseOption not working correctly


Frt

2009-03-09 19:23:51

Hi,

I'm in the progress of making a TutRunner in reflection, but I'm stuck already at the cooking fish part.

I've made a function to interact with objects (posted further down) and it works with opening doors, clicking trees but I can't get it to interact with a fire.
It right clicks the fire and then it just freezes and doesn't choose the option it's supposed to do.

function ObjectClicker(id, offx, offy: integer; options: String):Boolean;
var
Ti: TPoint;
FS, FS2: integer;
begin
repeat
if(FindObject(Ti, id)) then
begin
if not TileOnMS(Ti, 0) then
WalkToTile(Ti, 0, 0);
Ti := TileToMS(Ti, 0);
Mous(Ti.x + offx, Ti.y + offy, 2, 2, false, 500);
if R_ChooseOption(options) then Break;
repeat
if(FS > 10) then Break;
W(500);
Inc(FS);
until(not(CharacterMoving));
end;
Inc(FS2);
until(FS2 > 10);
end;

And the part where I'm calling it to cook the fish:

MouseItem(5, true);
ObjectClicker(2732, 0, 0, 'Fire');

mormonman

2009-03-09 20:51:46

It is because the Fire is a special object. Anvils have the same problem, and I ended up just using normal ChooseOption, lol.

Method

2009-03-09 21:07:23

Is 'Fire' of the same case it is in game? If that doesn't fix it, try giving us a paste of the result of GetOptionsMenuText when you're hovered over the fire to see what might be the problem.

Nava2

2009-03-10 17:52:52

Might be the math issue still..

lordsaturn

2009-03-11 01:15:13

From: Nava2
Might be the math issue still..

I had it fixed, then you reverted it. :p

Guess I should go fix that..