Results 1 to 5 of 5

Thread: Relocation without knowing location ;)

  1. #1
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Relocation without knowing location ;)

    I'm making an AIO fighter which will hopefully include relocation.

    This is what I have:
    Simba Code:
    Procedure Relocate;
    var x,y,i,testval:integer;
        MP:TPoint;
        TPA:TPointArray;
        ATPA:Array of TPointArray;
    begin
      if not doRelocate then exit;
      if not loggedin then exit;
      FindNormalRandoms;
      TPA:=GetMiniMapDots('y'); //get MM dots, store to array
      SortTPAFrom(TPA,Point(mmcx,mmcy));

      if (distance(MMCx,MMCy,TPA[0].x,TPA[0].y) < 30) then exit; //quick check if we actually need to

      atpa := SplitTPA(tpa,30); //break into parts
      testVal := 0;
      for i:= 0 to high(atpa) do //basically, it finds the TPA in the ATPA with the most dots
      begin
        if High(atpa[i]) > testVal then
        begin
          TestVal := I; //and stores the index of that TPA here
        end;
      end;
      MP := MiddleTPA(atpa[testval]); //calculates the middle of that TPA
      SMART_DrawDots(atpa[testval]);
        mouse(MP.x,MP.y,5,5,mouse_left); //click
        FFlag(5); //wait
    end;

    TL;DR it finds the area of highest concentration of yellow MM dots, and clicks there. The problem is when a dot gets in the very edge and messes everything (middle of the area then moves to somewhere we may not want to go).

    Thus, I had a few ideas on how to solve this issue:
    1) Generate an objectDTM right off the bat.
    2) SPS? Wouldn't necessarily work underground, unless the user set it to do so. And would you have to load every single area too?
    3) Create a bitmap, filtering out all minimap dots (and symbols?)
    4) Somehow improve my current method's accuracy
    5) Filter out dots that are behind minimap walls, like so:


    (orange area would be filtered out, btw.)
    I don't know how, or if it could be done (ideally with minimal resource use)

    The problem is, while all of these ideas would likely work, I want to minimize resource consumption if possible. And then there's also the actual doing it.

    So, what do you think is the best way to do it? And how would you go about it?
    Last edited by nickrules; 02-27-2012 at 02:27 AM. Reason: commented the code

  2. #2
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Bump. Any ideas or help appreciated, really

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Make an abstract box/polygon or shape using sps points.. and filter them from the minimap..
    Now Filter TPA using ur npc points.
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    You could use findColorsTolerance on the yellow NPC dot color, then call splitTPA(tpa, sizeOfFightArea), then loop through the resulting atpa, setting a maxLength (which would act as the most dense area of the NPC color on the MM). Then, click in the middle of that tpa. Just quickly wrote this up, not sure if it'll actually work.
    Simba Code:
    const
      _NPC_COLOR = 0;
      _NPC_TOL   = 10;

      _FIGHTING_AREA_SIZE = 50;

    function relocate(): boolean;
    var
      i, l, maxDensityIndex: integer;
      p: TPoint;
      tpa: TPointArray;
      atpa: T2DPointArray;
    begin
      if (not loggedIn()) then
        exit;

      if (findColorsTolerance(tpa, _NPC_COLOR, MMX1, MMY1, MMX2, MMY2, _NPC_TOL)) then
      begin
        atpa := splitTPA(tpa, _FIGHTING_AREA_SIZE);
        maxDensityIndex := -1;

        for i := 0 to high(atpa) do
        begin
          l := length(atpa[i]);

          if (l > maxDensityIndex) then
            maxDensityIndex := i;
        end;

        p := middleTPA(atpa[maxDensityIndex]);
        mouse(p.x, p.y, 5, 5, mouse_Move);
        result := true;
      end;
    end;

  5. #5
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    Make an abstract box/polygon or shape using sps points.. and filter them from the minimap..
    Now Filter TPA using ur npc points.
    Wouldn't it be easier to get the players location, and just walk back when the distance is too great? Remember, we're talking everywhere, not just the place in the picture.

    Can you get the location without loading every SPS map section into memory? I'd check, but I'm not on my PC right now.

    E: @Coh3n, aside from the dynamic fight area size, we have basically the same thing, except rather than manipulate all yellow pixels, I only use a single point for each dot.

    Unless you do something different, and I don't see it.
    Last edited by nickrules; 02-28-2012 at 04:51 AM.

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
  •