Results 1 to 5 of 5

Thread: OGL icon walk issues

  1. #1
    Join Date
    May 2012
    Posts
    58
    Mentioned
    2 Post(s)
    Quoted
    23 Post(s)

    Default OGL icon walk issues

    Hi, I've been working on some scripts over the last few months and after updating OGL yesterday I've been having nightmares trying to get things up and running again.

    I've fixed quite a few errors so far but am stuck on one with this IconWalk function.

    Is there an easy fix I'm missing or should I update all my walking to use inDirection/TileWalk (or something else)?

    Thanks a lot.

    Code:
    Error: Can't assign "record [0]Int32; [4]Int32; [8]Int32; [12]Int32; [16]Int32; [20]record [0]Int32; [4]Int32; [8]Int32; [12]Int32; end; end" to "record [0]Int32; [4]Int32; end" at line 526
    Code:
    function iconWalk(randomization: integer; icon: glTextureArray; offSetTiles: TPoint; maxWait : Integer = 15000): boolean;
    var
      rx, ry :integer;
      closestIcon, pPoint : TPoint;
    begin
      rx := randomrange(-(randomization), randomization);
      ry := randomrange(-(randomization), randomization);
      if icon.isEmpty() then
        result:=false
      else
      begin
        pPoint := minimap.getScreenPosition(minimap.getLocalPosition());
        closestIcon := icon.closestTo(pPoint)[0];
    
        mouse.click(minimap.getScreenPosition(minimap.getLocalPosition(closestIcon).adjustposition(offsetTiles.x+rx, offsetTiles.y+ry)), 1);
        if ((offSetTiles.y > 20) or (offSetTiles.y < -20)) or ((offSetTiles.x > 15) or (offSetTiles.x < -15)) then
          wait(3500)
        else
          wait(1000);
        waitFlag(maxWait);
        exit(true);
      end;
      exit(false);
    end;

  2. #2
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    closestIcon is a tPoint.
    glTextureArray.closestTo(tPoint) returns a sorted glTextureArray.

    minimap.getScreenPosition(minimap.getLocalPosition ()) can be replaced by minimap.getPlayer().

    Keep in mind, minimap icons are anchored by their bottom-center coord. Therefore walking to the center of the icon, if the map is rotated, will not be accurate. Also, remember you can use Minimap.clickLocalPosition() and just supply the coords.


    Great function idea, though!




    Skype: obscuritySRL@outlook.com

  3. #3
    Join Date
    May 2012
    Posts
    58
    Mentioned
    2 Post(s)
    Quoted
    23 Post(s)

    Default

    Hi Obscurity,

    Thanks for the quick response.

    What I'm not understanding is this 'should' return the closest point in the array (and always has before updating ogl), what changed?
    Code:
    closestIcon := icon.closestTo(pPoint)[0];
    How do you usually go about walking in your scripts?

    Thanks

  4. #4
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    It used to return a tPointArray. It no longer does. It returns a glTextureArray sorted by distance from the said point.

    Depends on the distance of the walk. For example, when botting WC on DarkScape, you spawn directly west or north of the trees when killed. So, I'll used a minimap.clickDirection('east') or minimap.clickDirection('south') until I see a bank icon which I can relate my position to.

    Other times, I monitor my localPosition while walking. if it changes by too much, a new map was loaded and I should offset my positions. That's what I did here (volume warning):
    https://www.youtube.com/watch?v=eYfH5fJmgEA
    Where I told it to walk to the bank, then to the furnace, then to the GE.

    Or, as you suggested, icon walk.




    Skype: obscuritySRL@outlook.com

  5. #5
    Join Date
    May 2012
    Posts
    58
    Mentioned
    2 Post(s)
    Quoted
    23 Post(s)

    Default

    Awesome, thanks for your help.

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
  •