SRL Archive - Reflection Help

Im so confused..


Camaro'

2009-06-14 07:24:39

function LeavePortal: boolean;
var
xx,mm,nn:tpoint;
tx,ty:integer;
begin
if not LoggedIn then LoginPlayer;
tell('searching for portal');
if FindObjectex(xx,2492,111) then
begin
tell('ok we found the bitch');
if not tileonms(xx,5) then
begin
tell('tile is on the dam minimap');
mm := tiletomm(xx);
if tileonmm(mm) then
writeln('its on mm');
if walktotile(xx,1,0) then
begin
tell('walking to portal');
end;
end;
nn := tiletoms(xx, 5);
if (random(4) = 2) then
begin
mmouse(nn.x,nn.y,4,4);
wait(50+random(40));
if isuptext('ortal') then
begin
getmousepos(tx,ty);
Mouse(tx,ty,0,0,false);
wait(40+random(50));
r_chooseoption('Portal');
r_flag;
result := true;
end;
Wait(100 + Random(10));
end else
begin
mmouse(nn.x,nn.y,4,4);
wait(50+random(40));
if isuptext('ortal') then
begin
getmousepos(tx,ty);
mouse(tx,ty,0,0,true);
r_flag;
wait(50+random(40));
result := true;
end;
end;
end;
end;

Ok so im trying to use that, i get up to the tile is on dam mm part , but then it wont write its on mm, when im standing 1 tile on ms away from it ?and walktotile never walks.

Floor66

2009-06-14 15:49:25


function LeavePortal: boolean;
var
xx,mm,nn:tpoint;
tx,ty:integer;
begin
if not LoggedIn then LoginPlayer;
tell('searching for portal');
if FindObjectex(xx,2492,111) then
begin
tell('ok we found the bitch');
if not tileonms(xx,5) then
begin
tell('tile is on the dam minimap');
mm := tiletomm(xx);
if tileonmm(mm) then
writeln('its on mm');
if walktotile(mm,1,0) then
begin
tell('walking to portal');
end;
end;
nn := tiletoms(mm, 5);
if (random(4) = 2) then
begin
mmouse(nn.x,nn.y,4,4);
wait(50+random(40));
if isuptext('ortal') then
begin
getmousepos(tx,ty);
Mouse(tx,ty,0,0,false);
wait(40+random(50));
r_chooseoption('Portal');
r_flag;
result := true;
end;
Wait(100 + Random(10));
end else
begin
mmouse(nn.x,nn.y,4,4);
wait(50+random(40));
if isuptext('ortal') then
begin
getmousepos(tx,ty);
mouse(tx,ty,0,0,true);
r_flag;
wait(50+random(40));
result := true;
end;
end;
end;
end;

try that.

Method

2009-06-14 20:25:57

Why are you converting it to a minimap point then checking to see if that point (which the include assumes to be a tile) is on the minimap? Just call TileOnMM when you have your tile.