Results 1 to 4 of 4

Thread: Question!

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Question!

    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?

  2. #2
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    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.

  3. #3
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Perhaps this will work:

    SCAR Code:
    {*******************************************************************************
    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.

  4. #4
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    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,
    SCAR Code:
    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.
    SCAR Code:
    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •