SRL Archive - Help

Smart NoMouse


Yago

2011-04-03 19:31:06

When running a script … sometimes then mouse goes out of the mainscreen and does not come back. Like it goes off screen of something.

Any ideas. Im guessing right then and there the obj tiles probably changed to -1…

Edit: Turns out no to be the problem… Its still going off screen.

Home

2011-04-05 10:00:25

What script?
Link.

~Home

Yago

2011-04-05 18:24:09

A personal one …

Harry

2011-04-05 18:41:37

Replace all your MM/Mouses with a copy from SRL, but with writelning the values? It's probably object finding, TileToMS is weird. (I assume you're using Reflection, anyways)

Try something like this (I use this, works like a charm, no longer leaves the screen):

function r_TileOnMSH(moix,moiy: integer) : Boolean; // Drags111
begin
Result := PointInBox(Point(moix,moiy), IntToBox(MSX1, MSY1, MSX2, MSY2));
end;

procedure objStuff;
var J: TPoint; tx,ty: integer;
begin
J := TileToMS(Tile(3048,3270), 300); // example - replace it with something like
if r_TileOnMSH(J.X,J.Y) then
begin
Mouse(J.X,J.Y,10,10,True);
writeln('etc');
end else
begin
WriteLn('run the object finding again / walkToTile (if static object) / etc');
wait(1);
end;
end;

HarryJames

2011-04-05 18:42:43

I've found it to do this, it's what happens if the object/tile isn't found, it just defaults to -1 as it's not an actual value for the client, or so I think.

Yago

2011-04-05 19:00:50

ok yeah I added a few failsafes for mull points/tiles and so far so good … thanks