ZaSz
2009-02-09 00:36:05
Welcome to the Great Offset Tutorial!!!
In here we will learn how to use offsets to click on objects that are in between tiles such as doors.
Have you ever tried using reflection to click a door but it would just click the floor and you have to make the script go:
Well the answer to your problems is offsets!
Offsets just move the mouse the x or the y direction to the object.
An example:
the above is to my auto-miner Iron Man.
Breaking down the procedure:
p is just the var the tile is assigned to. 11714 is the id to a door. That will be different for you unless you use the door for the falador mines.
DistanceFrom(p) < 6 | This is if the door is in clicking range. (you can expand a little more i think.)
v is another var the tile is assigned to.
TileToMS(p, Random(5)): this makes the tile go to the mainscreen.
The above is what you probably came here for, the offsets. lets say the door is on tile (3303,3304). so the click would be the center of (3303,3304).
but the door is to the north of the point right? Thats why in this case we minus 30 pixels so the click will be higher. The nice thing is you can change the x and the y around to get the right offset for you.
Also if the object is south of the point and you want to go down. You could go v.y+30 or so on.
The above method does work on v.x for object east or west of the point.
If you find this tut useful in anyway, feel free to rep me.
In here we will learn how to use offsets to click on objects that are in between tiles such as doors.
Have you ever tried using reflection to click a door but it would just click the floor and you have to make the script go:
setangle(false);Well the answer to your problems is offsets!
Offsets just move the mouse the x or the y direction to the object.
An example:
var P,v : TPoint;
begin
if findobject(p,11714) and (DistanceFrom(p) < 6) then
begin
v := TileToMS(p, Random(5));
mouse(v.x,v.y-30,3,3,true);
end;
end.the above is to my auto-miner Iron Man.
Breaking down the procedure:
if findobject(p,11714) and (DistanceFrom(p) < 6) thenp is just the var the tile is assigned to. 11714 is the id to a door. That will be different for you unless you use the door for the falador mines.
DistanceFrom(p) < 6 | This is if the door is in clicking range. (you can expand a little more i think.)
begin
v := TileToMS(p, Random(5));
mouse(v.x,v.y-30,3,3,true);
end;v is another var the tile is assigned to.
TileToMS(p, Random(5)): this makes the tile go to the mainscreen.
mouse(v.x,v.y-30,3,3,true);The above is what you probably came here for, the offsets. lets say the door is on tile (3303,3304). so the click would be the center of (3303,3304).
but the door is to the north of the point right? Thats why in this case we minus 30 pixels so the click will be higher. The nice thing is you can change the x and the y around to get the right offset for you.
Also if the object is south of the point and you want to go down. You could go v.y+30 or so on.
The above method does work on v.x for object east or west of the point.
If you find this tut useful in anyway, feel free to rep me.