Results 1 to 16 of 16

Thread: [OGL] Walking

  1. #1
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default [OGL] Walking

    So here is the pretty reliable way that I walk with OGL. I use 3 relatively simple functions.


    Simple wait while the flag texture is shown on the map.
    Simba Code:
    procedure waitFlag;
    begin
      wait(250);
      while (not ogl.getTextures(1275).isEmpty()) do
        wait(500);
    end;

    Walks via tiles offset from player position.
    Simba Code:
    function tileWalk(randomization: integer; offSetTiles: TPointArray): boolean;
    var
      rx, ry, i: integer;
    begin
      for i:=0 to high(offSetTiles) do
      begin
        rx := randomrange(-(randomization), randomization);
        ry := randomrange(-(randomization), randomization);
        mouse.click(minimap.getScreenPosition(minimap.getLocalPosition().adjustposition(offsetTiles[i].x+rx, offsetTiles[i].y+ry)), 1);
        if ((offSetTiles[i].y > 20) or (offSetTiles[i].y < -20)) or ((offSetTiles[i].x > 15) or (offSetTiles[i].x < -15)) then
          wait(3500)
        else
          wait(1000);
        waitflag;
      end;
    end;

    Walks based on static icons on the minimap.
    Simba Code:
    function iconWalk(randomization: integer; icon: glTextureArray; offSetTiles: TPoint): boolean;
    var
      rx, ry :integer;
    begin
      rx := randomrange(-(randomization), randomization);
      ry := randomrange(-(randomization), randomization);
      if icon.isEmpty() then
        result:=false
      else
      begin
        mouse.click(minimap.getScreenPosition(minimap.getLocalPosition(icon[0]).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;
        result:=true;
      end;
      exit(result);
    end;



    Sample code of the above could look something like this:
    Simba Code:
    function walkToBank(): boolean;
    begin
      lodestoneTeleport;
      pointWalk(2, [[-10, 5], [-15, 0], [-10, -3]]);
      if (not iconWalk(1, ogl.getTextures([45052], [4668991]), [5, -1]) then
        exit(false);
      openBank();
    end;

    So to break it down, it would click a points on the minimap that are:
    [left 10, down 5], [left 15, 0], [left 10, up 3] all with a randomness of 2 tiles (meaning it can go up, down, left, and/or right by a max of 2 tiles)
    followed by clicking a point that is [right 5, down 1] of the icon texture of the bank, with a randomness of 1 tile, if the texture exists.


    And that's it! Very simple. A couple of notes:
    • Use randomness liberally in areas where accuracy doesn't matter much
    • Use iconWalk() to make sure you stay on an exact path, it is much more accurate than tileWalk().
    • Use failsafes for iconWalk() in case it doesn't find the texture like I did above.
    • Remember not to offset points wider/higher than your minimap dimensions.
    • Set the number at the end of mouse.click() to 2 in either function to debug one point at a time, since 2 just hovers the mouse.

  2. #2
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

    Apparently I can't rep but this is much better then what I've been doing, thanks!

  3. #3
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by Clutch View Post
    Apparently I can't rep but this is much better then what I've been doing, thanks!
    You're welcome

  4. #4
    Join Date
    Aug 2012
    Posts
    188
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    This is great, my convoluted walking procedure just became legible! Thanks a ton!

    Here's an idea for the waitflag procedure. What if you added a distance between the player dot and the flag, and when the player is close enough it exits, so that it looks less bot like.

  5. #5
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by Swag Bag View Post
    This is great, my convoluted walking procedure just became legible! Thanks a ton!

    Here's an idea for the waitflag procedure. What if you added a distance between the player dot and the flag, and when the player is close enough it exits, so that it looks less bot like.
    The flag disappears well before the character stops walking, but that's an easy thing to implement.

  6. #6
    Join Date
    Aug 2012
    Posts
    188
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    How accurate is this? I just wrote a few procedures based on yours during a 10 hour car trip. But we don't have SPS so...

  7. #7
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Ross View Post
    The flag disappears well before the character stops walking, but that's an easy thing to implement.
    You could literally use the SPS walkpath code but substitute the TPA for your array of offset points (+ a few small mods).

  8. #8
    Join Date
    Aug 2012
    Posts
    188
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    You could literally use the SPS walkpath code but substitute the TPA for your array of offset points (+ a few small mods).
    I just spend a 13 hour car ride improving and randomizing these procedures and now I hear this? -____-
    photo_1436396825935.jpg

  9. #9
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Some walking procedures are in the works for ogLib, where you supply a TPA just like in SPS. No map needed obviously, since ogLib is based on your local position. Until then, Ross' are great.

  10. #10
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Swag Bag View Post
    I just spend a 13 hour car ride improving and randomizing these procedures and now I hear this? -____-
    photo_1436396825935.jpg
    That's some serious coding

  11. #11
    Join Date
    Jul 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    As a new coder, thank you all. I am learning a lot from this thread.

  12. #12
    Join Date
    Aug 2012
    Posts
    188
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    Thanks @Clarity;. Does anyone know if this is accurate over long distances? I rewrote this a little bit and I'll be able to test it when I get home later on.

  13. #13
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by Swag Bag View Post
    Thanks @Clarity;. Does anyone know if this is accurate over long distances? I rewrote this a little bit and I'll be able to test it when I get home later on.
    It's 100% accurate, as with anything in OGL interception. The TPA you supply though has to be correct. Note that the local position resets every time a new map region is loaded

  14. #14
    Join Date
    Feb 2013
    Location
    The Boonies
    Posts
    203
    Mentioned
    9 Post(s)
    Quoted
    70 Post(s)

    Default

    Not sure if there has been improvements made on this method of walking in ogL, but I'm getting an error in tileWalk saying that the 'click' in 'mouse.click' is an unknown declaration. Not sure how to deal with that.

    EDIT: It's caused by including the SRL library.
    Last edited by Lama; 11-02-2015 at 02:48 AM.

  15. #15
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by Lama View Post
    Not sure if there has been improvements made on this method of walking in ogL, but I'm getting an error in tileWalk saying that the 'click' in 'mouse.click' is an unknown declaration. Not sure how to deal with that.

    EDIT: It's caused by including the SRL library.
    All methods that conflict with srl-6 require the type in front
    i.e. tmouse.click(), tinventory.getItems(), etc...

    I wouldn't use this for walking, use SPS.

  16. #16
    Join Date
    Feb 2013
    Location
    The Boonies
    Posts
    203
    Mentioned
    9 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Ross View Post
    All methods that conflict with srl-6 require the type in front
    i.e. tmouse.click(), tinventory.getItems(), etc...

    I wouldn't use this for walking, use SPS.
    Yeah, I've begun going that route aha, thanks though!

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
  •