PDA

View Full Version : How can I know if player is standing in a tile, and how can I walk to that tile..



Patriq
07-03-2014, 11:05 PM
I wanna be able to check if I am, imagige in the tile with the coordinates of 1092, 2091, 0.
How would be the best way to do this in RS3? If its is through reflection I would like if someone could help me with the hook and multiplier I have to search for :)

And another question, is this the best way to walk in a screen tile?
Like I wanna get to a tile that is on screen by click it, can I click this point?
23487

Thank you very much,
PatriqDesigns

The Mayor
07-04-2014, 12:28 AM
I wanna be able to check if I am, imagige in the tile with the coordinates of 1092, 2091, 0.
How would be the best way to do this in RS3? If its is through reflection I would like if someone could help me with the hook and multiplier I have to search for :)

And another question, is this the best way to walk in a screen tile?
Like I wanna get to a tile that is on screen by click it, can I click this point?
23487

Thank you very much,
PatriqDesigns

There is currently no way to walk to MM 'tiles' in SRL6. There is no reflection.

KeepBotting
07-04-2014, 12:31 AM
SRL-6 doesn't use reflection. You'll have to use SPS-RS3 for walking.

Clarity
07-04-2014, 03:13 AM
MM to MS projection is the best way, you could search for player dots, form a search box on the mainscreen around the dot's location, check for certain colors, make a decision whether to walk or not.

Patriq
07-04-2014, 06:49 AM
MM to MS projection is the best way, you could search for player dots, form a search box on the mainscreen around the dot's location, check for certain colors, make a decision whether to walk or not.

And how would I know in which tile my player is standing in?

The Mayor
07-04-2014, 07:17 AM
And how would I know in which tile my player is standing in?

It is possible to check that your player is on a (x, y) point using SPS. The x or y coordinates might be accurate to +/- 3 pixels so it probably better to check that your player is inside a box.

Say I had a SPS map already setup. If I wanted to check that my player was inside this mine, I could get the coordinates to make the box (from my SPS map). Let's say the top left and bottom right points of the box were:

http://puu.sh/9WdR8/bd29627bd7.png

If I wanted to check that my player was inside this box, I could use SPS.getPlayerPos() which returns a TPoint of where your player currently is on your SPS map. You can then check if that point is inside your box.


function isInsideBox(): boolean;
var
pos: TPoint;
mineBox: Tbox;
begin
mineBox := intToBox(100, 100, 200 200);
pos := SPS.getPlayerPos();

result := pointInBox(pos, mineBox);
end;

Patriq
07-04-2014, 11:54 AM
I need an exact tile and not an area, that point is not an exact world point right? Is a point relative to the top left corner, which is not what im looking for ;(

KeepBotting
07-04-2014, 12:27 PM
I need an exact tile and not an area, that point is not an exact world point right? Is a point relative to the top left corner, which is not what im looking for ;(It's going to be really, really hard to walk to an exact tile in RS3 without using reflection (which doesn't exist).

I suppose you could just make a really small box, but I'm not sure how SPS would handle that.

Maybe if you post the general process your script is trying to accomplish, we can help you think of other ways :)

Patriq
07-04-2014, 12:38 PM
The problem isnt walking since I can get a point to click with the TRSMinimap.pointToMainscreen function. What im struggling to know is how do i know if my player is standing on her. Well if I dont ever change the camera angle I dont know if I could use dtm's. Damm this is so hard.

KeepBotting
07-04-2014, 12:50 PM
The problem isnt walking since I can get a point to click with the TRSMinimap.pointToMainscreen function. What im struggling to know is how do i know if my player is standing on her. Well if I dont ever change the camera angle I dont know if I could use dtm's. Damm this is so hard.Look into DDTMS, never used them myself but they might work.

Patriq
07-04-2014, 01:15 PM
Look into DDTMS, never used them myself but they might work.
Are they different than normal DTM's? They just seem to be more user friendly, so later you can change colours and tolerance..

KeepBotting
07-04-2014, 01:31 PM
Are they different than normal DTM's? They just seem to be more user friendly, so later you can change colours and tolerance..
They're a bit different. Where DTMs are deformable template models, DDTMs are dynamic deformable template models. They can autocolor themselves, among other things

check this out http://garrettlongonline.com/tutorial it has a DDTM section

Patriq
07-09-2014, 05:49 PM
It is possible to check that your player is on a (x, y) point using SPS. The x or y coordinates might be accurate to +/- 3 pixels so it probably better to check that your player is inside a box.

Say I had a SPS map already setup. If I wanted to check that my player was inside this mine, I could get the coordinates to make the box (from my SPS map). Let's say the top left and bottom right points of the box were:

http://puu.sh/9WdR8/bd29627bd7.png

If I wanted to check that my player was inside this box, I could use SPS.getPlayerPos() which returns a TPoint of where your player currently is on your SPS map. You can then check if that point is inside your box.


function isInsideBox(): boolean;
var
pos: TPoint;
mineBox: Tbox;
begin
mineBox := intToBox(100, 100, 200 200);
pos := SPS.getPlayerPos();

result := pointInBox(pos, mineBox);
end;


Does sps has a function like MM to MS? So I can get the point on the screen, opr maybe a fucntion to turn the point im looking in sps, to minimap coordinates?

Patriq
07-11-2014, 06:57 PM
Well since no one replied I try my hardest to find a solution and here it is. With this snippet people will be able to walk to tiles using screen points and will be able to check if they are in a tile, that is in a sps map. In other words, if you have the sps point of your tile you can check if you are standing on her or walk to her if she is on screen! :D



program Test;

{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i sps\lib\sps-rs3.simba}

var
t : TPoint;


function spsToMainscreen(spsPoint : TPoint) : TPoint;
var
minimapPoint, p, vector : TPoint;
box : TBox;
begin
vector.X := minimap.getCenterPoint.X-sps.getPlayerPos.X;
vector.Y := minimap.getCenterPoint.Y-sps.getPlayerPos.Y;

minimapPoint.X := spsPoint.X+vector.X;
minimapPoint.Y := spsPoint.Y+vector.Y;

result := minimap.pointToMainscreen(minimapPoint);
result.Y := result.Y+8;
end;

function inTile(spsPoint : TPoint) : boolean;
var
box : TBox;
begin
box := mainscreen.playerBox;
box.edit(0,10 ,0 ,-10);
result := box.isPointInside(spsToMainscreen(spsPoint));
end;

function walkTile(spsPoint : Tpoint) : boolean;
var
p : TPoint;
//box : TBox;
begin
if not(inTile(spsPoint)) then
begin
p := spsToMainscreen(spsPoint);
if mainScreen.getBounds().isPointInside(p) then
begin
//box.setBounds(p.X-3, p.Y, p.X+3, p.Y+3);
//mouseBox(box);
mouse(p);
fastClick(MOUSE_LEFT);
repeat
wait(250);
until not(minimap.isPlayerMoving);
end;
end;
result := inTile(spsPoint);
end;

procedure start();
begin
sps.setup('MAP_01', RUNESCAPE_SURFACE);
t := Point(298, 302);
smartImage.clear;
end;

procedure loop();
begin
writeln(walkTile(t));
end;

procedure poll();
var
minimapPoint, p, vector : TPoint;
box, b : TBox;
begin
vector.X := minimap.getCenterPoint.X-sps.getPlayerPos.X;
vector.Y := minimap.getCenterPoint.Y-sps.getPlayerPos.Y;

minimapPoint.X := t.X+vector.X;
minimapPoint.Y := t.Y+vector.Y;

p := minimap.pointToMainscreen(minimapPoint);
box.setBounds(p.X-3, p.Y-3, p.X+3, p.Y+3);

smartImage.drawBox(box, false, clRed);
b := mainscreen.playerBox;
B.edit(0, 15, 0, -10);
smartImage.drawBox(b, false, clRed);
end;

procedure stop();
begin
end;

begin
smartEnableDrawing := true;
setupSRL();

start();

while true do
begin
//poll();
loop;
end;
end.

Patriq
07-13-2014, 01:14 PM
I need a better walk method, I would love if someone could join forces with me and help doing the dream come true, pm me :D