Log in

View Full Version : Question!



DeSnob
08-10-2010, 09:20 PM
Since the grounditems in reflection aren't safe to use, I'm thinking about a procedure which turns a point (TPoint or simply an x, y coord) into a tile. I don't know if there's an existing procedure that does this. I need it for my script to pick up the swamp toads (it will find the drop dots on the screen, then slowly turn each into a tile while checking if they are swamp toads or not simply by looking at the respawn tile).

Is there any procedure that does this? If there isn't, can someone create it?

i luffs yeww
08-11-2010, 12:13 AM
I think you can get the tile from the minimap, so you could simply mouse the tile and hope for the best, couldn't you? If not, TRiBot (tribot.org) has methods to do this and I could MAYBE port them to Pascal, but it's not really on my to-do list.

ZephyrsFury
08-11-2010, 01:18 AM
Perhaps this will work:


{************************************************* ******************************
function MMToMS(MM: TPoint): TPoint;
By: N1ke!
Description: Turns a Minimap point into a close MS point.
************************************************** *****************************}


You probably need to have your camera angle set to highest.

DeSnob
08-11-2010, 10:58 AM
I have created the function that does what I wanted. You simply insert the x, y coord of the TPA/object you found on the minimap. For example,
Tilee := MMCoordToTile(Point(TPA.x, TPA.y));
Tilee := TileToMM(tilee);
mouse(tilee.x, tilee.y, 5, 5, true);
The above code snippet will change the point into a tile, and then proceed to click it.

Here's the function.
function MMCoordToTile(OurPoint: TPoint): TTile;
var
PlayerPos: TTile;
NewTileX, NewTileY: Integer;
begin
if (OurPoint.x > MMCX) then
NewTileX := OurPoint.x - MMCX
else if (OurPoint.x < MMCX) then
NewTileX := MMCX - OurPoint.x
else if (OurPoint.x = MMCX) then
NewTileX := 0;

if (OurPoint.y > MMCY) then
NewTileY := OurPoint.y - MMCY
else if (OurPoint.y < MMCY) then
NewTileY := MMCY - OurPoint.y
else if (OurPoint.y = MMCY) then
NewTileY := 0;

PlayerPos := GetMyPos;
Writeln('Current position is ' + IntToStr(PlayerPos.x) + ', '
+ IntToStr(PlayerPos.y) + '.');
if (OurPoint.x > MMCX) then
NewTileX := PlayerPos.x + NewTileX
else if (OurPoint.x < MMCX) then
NewTileX := PlayerPos.x - NewTileX
else if (OurPoint.x = MMCX) then
NewTileX := PlayerPos.x;

if (OurPoint.y > MMCY) then
NewTileY := PlayerPos.y + NewTileY
else if (OurPoint.y < MMCY) then
NewTileY := PlayerPos.y - NewTileY
else if (OurPoint.y = MMCY) then
NewTileY := PlayerPos.y;
Writeln('Point position is ' + IntToStr(NewTileX) + ', '
+ IntToStr(NewTileY) + '.');
Result := Tile(Round(NewTileX+1.5), Round(NewTileY-0.5));
end;

Can someone check the function, and give me some feedback? :)