Page 2 of 7 FirstFirst 1234 ... LastLast
Results 26 to 50 of 152

Thread: [OSR] Walking & positioning system

  1. #26
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Hey man good job!

    I tried your walking system but I can't find out what's wrong, maybe it's only because it's in beta state but I'll post this anyway.

    I tried calling single procedure that would walk my path fron varrock bank to fountain. My script looks like this:

    Simba Code:
    program walk;
    {$DEFINE SMART}
    {$DEFINE WALKER}
    {$i AeroLib/AeroLib.Simba}
    {$i Reflection/Reflection.Simba}
    var
      MyPlayer : TReflectLocalPlayer;

    procedure DeclarePlayer;
    begin
      MyPlayer.Username := '';
      MyPlayer.Password := '';
      MyPlayer.Pin := '';
      MyPlayer.Active := True;
    end;

    procedure w_ClickMouse(box:TBox; btn:Int32); override;
    begin
      MouseBox(box, btn); //call a click-mousefunction from the include you use
    end;

    procedure walkmypath;
    var
      RSW : TRSWalker;
      toWaterPath : TPointArray;
    begin
      RSW.Init('surface', 'softclaymap.jpg', w_GetClientPID());
      Writeln('RSW is set up');
      toWaterPath := [Point(117, 119), Point(121, 120), Point(125, 121), Point(130, 122), Point(137, 123),
      Point(140, 123), Point(147, 121), Point(154, 121), Point(158, 121), Point(164, 123), Point(169, 123),
      Point(173, 126), Point(179, 126), Point(184, 127), Point(188, 129), Point(193, 127), Point(201, 130),
      Point(207, 129), Point(213, 130)];

      RSW.WalkPath(toWaterPath);

      RSW.Free();
    end;

    begin
      initAL();
      Reflect.Setup;

      DeclarePlayer;
      MyPlayer.Login;
    /////////////////

      walkmypath;
    end.

    I get acces violation and "base" tab opens @ line 137
    Simba Code:
    Paired with SMART[1752]
    [AL] Startup complete!
    [10:11:06:041] [Reflection] [Status] Successfully setup!
    Error: Access violation at line 137
    Execution failed.
    The following DTMs were not freed: [0]
    The following bitmaps were not freed: [0, 1, 2, 3, 4, 5]

    Simba Code:
    procedure TRSPosFinder.Init(PID:Int32);
    begin
      with Self do
      begin
        matchAlgo := TM_CCOEFF_NORMED;
        scanRatio := 8;
        numSamples := 100;
        process := PID;

        if PID >= 0 then scan.Init(process); //LINE 137
        addr := 0;
        bufferW := 512;
        bufferH := 512;
      end;
    end;

    Script works until it comes to RSW.WalkPath, same is with RSW.GetMyPos, I haven't tried others yet tho
    Last edited by Verfy; 02-17-2015 at 09:21 AM.

  2. #27
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by ineedbot View Post
    Great work, seems to run great now on OSBuddy, one small thing; they recently opened up a back door at varrock west bank. And I noticed on your world map there, seems to be outdated.
    Yeah, I am aware. The change is so small tho so it will not affect the positioning in any way.. I am waiting for GE (should be exist within 2 weeks) before I do any update to the varrock area.
    Tho thanks for grabbing the map, appriciate it.
    Last edited by slacky; 02-18-2015 at 06:14 AM.
    !No priv. messages please

  3. #28
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by magicalll View Post
    Hey man good job!

    I tried your walking system but I can't find out what's wrong, maybe it's only because it's in beta state but I'll post this anyway.
    Script works until it comes to RSW.WalkPath, same is with RSW.GetMyPos, I haven't tried others yet tho
    Issue is that you are using SMART, yet you initalize with "w_GetClientPID". You should grab the PID from SMART (or target SMART manually with Simba):

    Simba Code:
    {$IFDEF SMART}
        RSW.Init('surface', 'softclaymap.jpg', OS_SMART.ID); //Grab the PID from SMART
      {$ELSE}
        Walker.Init('surface', 'softclaymap.jpg', w_getClientPID()); //Not using SMART.. Grab the client targeted with Simba.
      {$ENDIF}

    PS: I would recommend only creating the walker once.. and reusing the instance.. Loading the map you use over and over again isn't really optimal.
    So somthing like this, perhaps:
    Simba Code:
    program walk;
    {$DEFINE SMART}
    {$DEFINE WALKER}
    {$i AeroLib/AeroLib.Simba}
    {$i Reflection/Reflection.Simba}

    var
      MyPlayer: TReflectLocalPlayer;
      RSW: TRSWalker;

    procedure DeclarePlayer;
    begin
      MyPlayer.Username := '';
      MyPlayer.Password := '';
      MyPlayer.Pin      := '';
      MyPlayer.Active   := True;
    end;

    //this is not needed with AeroLib anymore..
    (*procedure w_ClickMouse(box:TBox; btn:Int32); override;
    begin
      MouseBox(box, btn);
    end;*)


    procedure WalkMyPath;
    var
      toWaterPath: TPointArray;
    begin
      toWaterPath := [
         Point(117, 119), Point(121, 120), Point(125, 121), Point(130, 122), Point(137, 123), Point(140, 123),
         Point(147, 121), Point(154, 121), Point(158, 121), Point(164, 123), Point(169, 123), Point(173, 126),
         Point(179, 126), Point(184, 127), Point(188, 129), Point(193, 127), Point(201, 130), Point(207, 129),
         Point(213, 130)
      ];

      RSW.WalkPath(toWaterPath);
    end;


    procedure OnTermination();
    begin
      RSW.Free();
    end;

    begin
      initAL();
      Reflect.Setup;

      {$IFDEF SMART}
        RSW.Init('surface', 'softclaymap.jpg', OS_SMART.ID);
      {$ELSE}
        Walker.Init('surface', 'softclaymap.jpg', w_getClientPID());
      {$ENDIF}
      Writeln('RSW is set up');

      DeclarePlayer;
      MyPlayer.Login;
      /////////////////

      WalkMyPath();
    end.
    That should work.
    Last edited by slacky; 02-18-2015 at 06:04 AM.
    !No priv. messages please

  4. #29
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    Issue is that you are using SMART, yet you initalize with "w_GetClientPID". You should grab the PID from SMART (or target SMART manually with Simba):
    ...
    Thanks for your response, but I have another problem I did everything like you said but now when I call
    Simba Code:
    RSW.Init('surface', 'miningmap.png', OS_SMART.ID);
    debug says RSW: Invalid map. I hvae tried verious extensions like .png, .jpg and .bmp but I can't find any of them to work I tried putting "\" and "/" in front of map name and still, no success. Tried changing from 'surface' to 'custom' even tho I don't know difference between them. I'm saving my maps in OSRWalker/maps and I also tried AeroLib/maps/ which I think is right but doesn't work And as I checked I think the right extention is .png

    Figured that one out, I didn't have to use the extention in string like it said in tut

    ...but I tried running it loads and everything except walk the path :/
    Last edited by Verfy; 02-20-2015 at 02:49 PM.

  5. #30
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by magicalll View Post
    Thanks for your response, but I have another problem I did everything like you said but now when I call
    Simba Code:
    RSW.Init('surface', 'miningmap.png', OS_SMART.ID);
    debug says RSW: Invalid map. I hvae tried verious extensions like .png, .jpg and .bmp but I can't find any of them to work I tried putting "\" and "/" in front of map name and still, no success. Tried changing from 'surface' to 'custom' even tho I don't know difference between them. I'm saving my maps in OSRWalker/maps and I also tried AeroLib/maps/ which I think is right but doesn't work And as I checked I think the right extention is .png

    Figured that one out, I didn't have to use the extention in string like it said in tut
    If you're having issues it's probably because the way RSW is called in AeroLib is different from this tutorial. Slacky shouldn't have to help with issues like that, if you have problems you can post on the AeroLib thread or PM me directly.

    Using the code I'm quoting you with, here's what you would do for setting up RSW:
    Simba Code:
    {$IFDEF SMART}
      RSW.Init('surface', 'miningmap', OS_SMART.ID);
     {$ELSE}
      RSW.Init('surface','miningmap', w_getClientPID());
     {$ENDIF}

    Notice ".png" is not included when setting up because AL will automatically (and only) load PNG map images. Again, if anyone who is using RSW with AeroLib and has issues don't bother Slacky, it's not his responsibility to fix it. You can post on the AeroLib thread or contact me directly.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #31
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    My experiment to speed up memory-scanning in OSBuddy seems to have failed after the GE update (some? class members shift order).

    There are always some consistencies, so should not be too hard to work in an "adaptive" solution, this does however mean that initialization might get slower (the first scan). I'll look at it soon.
    Last edited by slacky; 02-27-2015 at 11:55 AM.
    !No priv. messages please

  7. #32
    Join Date
    Aug 2013
    Posts
    82
    Mentioned
    0 Post(s)
    Quoted
    35 Post(s)

    Default

    I finally got it to work slacky. But something isnt clear to me. Do we substract the non-walkable pixels from our height and width we want to walk to?

  8. #33
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Athylus View Post
    But something isnt clear to me. Do we substract the non-walkable pixels from our height and width we want to walk to?
    No.
    !No priv. messages please

  9. #34
    Join Date
    Aug 2013
    Posts
    82
    Mentioned
    0 Post(s)
    Quoted
    35 Post(s)

    Default

    Yeah I just picked a piece of map from google, but I should've used the map picker. It's working now. Love this, thanks!

  10. #35
    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    This looks very nice I'm trying to use it on a rsps and the script to get my position works fine, but I seem to be lost when it comes to actually walking.. any tips?

  11. #36
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by The_Prince View Post
    This looks very nice I'm trying to use it on a rsps and the script to get my position works fine, but I seem to be lost when it comes to actually walking.. any tips?
    This is for OSRS only....
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  12. #37
    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Well that's a shame it looked very promising when it could give me my world position. What is the reasoning for it not working, minimap issues? I don't have it set up correctly so I actually cannot say whether it does work or not.

    With this part in my code

    Code:
    //we need to override the rswalker's ClickMouse as it doesn't have it's own mouse-methods.
    procedure w_clickMouse(box:TBox; btn:Int32); override;
    begin
      MouseBox(box, mouse_left); //call a click-mousefunction from the include you use
    end;
    I get this error "No default value for parameter 3", which has something to do with box.

  13. #38
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by The_Prince View Post
    Well that's a shame it looked very promising when it could give me my world position. What is the reasoning for it not working, minimap issues? I don't have it set up correctly so I actually cannot say whether it does work or not.

    With this part in my code

    Code:
    //we need to override the rswalker's ClickMouse as it doesn't have it's own mouse-methods.
    procedure w_clickMouse(box:TBox; btn:Int32); override;
    begin
      MouseBox(box, mouse_left); //call a click-mousefunction from the include you use
    end;
    I get this error "No default value for parameter 3", which has something to do with box.
    What include are you including in that script?
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  14. #39
    Join Date
    Mar 2011
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    What include are you including in that script?
    SRL-OSR/SRL.simba

    Edit: Just after posting that reply I realised that I was using the srl-6 MouseBox syntax, I changed my include and its better now.

    Edit2: Wow this works amazingly well.
    Last edited by The_Prince; 03-31-2015 at 09:01 PM.

  15. #40
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    @Slacky

    Flight gave me a really interested function so that i would be able to pin point my locations better but its not working..

    Code:
    function pointsInDist(Pt1, Pt2: TPoint; Dist: Integer): Boolean;
    begin
      result := (distance(Pt1.X, Pt1.Y, Pt2.X, Pt2.Y) <= Dist);
    end;
    Ive put in:

    Code:
    pointsInDist(Point(231,121), Point(232,123), Walker.getMyPos(), 3);

  16. #41
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    1,395
    Mentioned
    30 Post(s)
    Quoted
    107 Post(s)

    Default

    Quote Originally Posted by Rules of Joe View Post
    @Slacky

    Flight gave me a really interested function so that i would be able to pin point my locations better but its not working..

    Code:
    function pointsInDist(Pt1, Pt2: TPoint; Dist: Integer): Boolean;
    begin
      result := (distance(Pt1.X, Pt1.Y, Pt2.X, Pt2.Y) <= Dist);
    end;
    Ive put in:

    Code:
    pointsInDist(Point(231,121), Point(232,123), Walker.getMyPos(), 3);
    There is a good reason - function accepts 3 parameters (Pt1, Pt2, Dist) but you have used 4 (Point(231,121), Point(232,123), Walker.getMyPos(), 3).
    So, as you can see, you have an extra TPoint there (I would guess (231,121) or (232,123)).

  17. #42
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    oh, just realized that. so when i make the box how will it know that i am in the box if it cant read my pos but only has the pos of the box??? and its distance

  18. #43
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Rules of Joe View Post
    oh, just realized that. so when i make the box how will it know that i am in the box if it cant read my pos but only has the pos of the box??? and its distance
    It doesn't take a box. It measures the distance between TWO points (using euclidean distance), and then checks if the distance is less then the given max-distance (last param).
    >> PointsInDist(I_AM_HERE, I_WANT_TO_BE_HERE, THO_I_ALLOW_THIS_MUCH_VARIATION);
    >> PointsInDist(Walker.getMyPos(), [231,121], 12);
    Last edited by slacky; 03-30-2015 at 10:15 AM.
    !No priv. messages please

  19. #44
    Join Date
    Oct 2013
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Hey, I just updated AeroLib and manually installed RSWalker to try to use this script https://villavu.com/forum/showthread.php?t=112904
    which starts off

    program DaviAutoSmeltr;
    {$DEFINE SMART}
    {$DEFINE WALKER}
    {$I AeroLib/AeroLib.simba }

    and keep getting the error message "exception in Script: Unknown compiler directives at 6:3." Guessing it's referring to {$DEFINE WALKER}, and I don't know how to get around this. Any ideas would be greatly appreciated :P

  20. #45
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by liams007 View Post
    Hey, I just updated AeroLib and manually installed RSWalker to try to use this script https://villavu.com/forum/showthread.php?t=112904
    which starts off

    program DaviAutoSmeltr;
    {$DEFINE SMART}
    {$DEFINE WALKER}
    {$I AeroLib/AeroLib.simba }

    and keep getting the error message "exception in Script: Unknown compiler directives at 6:3." Guessing it's referring to {$DEFINE WALKER}, and I don't know how to get around this. Any ideas would be greatly appreciated :P
    AeroLib comes with this walking system already, you don't need to install it once more. Have you made sure to set your Simba's interpreter to Lape? (Script > Interpreter > Lape) Also if you're having issues with a script then you should be asking for assistance in that thread or from the scripter directly; the problem you're having is not directly because of this walking system.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  21. #46
    Join Date
    Dec 2007
    Posts
    289
    Mentioned
    4 Post(s)
    Quoted
    86 Post(s)

    Default

    Would it be possible to have a function output the bitmap it has read from memory? Potentially this could make the creation of custom maps easier.

  22. #47
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by honeyhoney View Post
    Would it be possible to have a function output the bitmap it has read from memory? Potentially this could make the creation of custom maps easier.
    I've actually written a thingy for that: https://github.com/WarPie/RSWalker/b...pGrabber.simba
    !No priv. messages please

  23. #48
    Join Date
    Dec 2007
    Posts
    289
    Mentioned
    4 Post(s)
    Quoted
    86 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    I've actually written a thingy for that: https://github.com/WarPie/RSWalker/b...pGrabber.simba

    Thanks! Sorry for not digging around in the code before asking

  24. #49
    Join Date
    Apr 2015
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Is there a way to add camera movement while walking? It seems i can't find solution and walking with same camera position everytime looks very botish. I tried adding this,but no luck so far :/ Any ideas?

    Code:
    procedure RandomCam
    
    var
    RC : timer;
    
    begin
    RC.start
      begin
        if(RC.timeElapsed > (1000 * (random(6)))) then
          begin
          WriteLn('Performing antiban');
          case random(8) of
            0: RandomKeys0;
            1: RandomKeys1;
            2: RandomKeys2;
            3: RandomKeys3;
            4: hoverSkill('random', false);
            5: RandomKeys4;
            6: RandomKeys5;
            7: RandomKeys6;
            8: RandomKeys7;
          end;
          end;
      end;
    end;

  25. #50
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by xujnea View Post
    Is there a way to add camera movement while walking? It seems i can't find solution and walking with same camera position everytime looks very botish. I tried adding this,but no luck so far :/ Any ideas?
    ...
    Yes there are ways to add movement like that. You'd have to hook the "onMoveEvent", and do shit in there.

    pascal Code:
    procedure WhileMoving(Sender:TObject; pos:TPoint);
    begin
      //.. do shit here (Sender is the TRSWalker instance, pos is where we are now)
    end;


    var
      RSW:TRSWalker;
      path:TPointArray;
    begin
      RSW.Init(...);
      ...
      RSW.onMoveEvent := @WhileMoving;
      ...
    end.
    I will however NOT help you make such a function. Since it's mostly unrelated to RSWalker, and more related to general OSR-"scripting" you'd have to ask for help elsewhere.

    Btw, I've never really been one to move the camera while walking.. So does that make ME a bot? Also, moving the camera randomly doesn't make much more sense..
    Last edited by slacky; 05-11-2015 at 01:16 AM.
    !No priv. messages please

Page 2 of 7 FirstFirst 1234 ... LastLast

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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