SRL Archive - Unofficial Development

[OSR] Walking & positioning system


slacky

2015-02-12 13:48:44

Presenting RSWalker (RSW)

What is RSW?

  • It can give you the pixel/point where you are standing (on the world map) with decent accuracy.
  • It allows you to walk long distances as well as short once.
  • It uses image-processing to locate your position (image cross-correlation) (color)
  • It does not use reflection, and works without SMART.
  • It can, if preferred scan through your memory to find a map-chunk of the area your are in (works in official client, as well as in SMART) this is used to speed it up.
  • It's quite fast!

Motivation

First of SPS doesn't really work for OSR, and some has turned to use some proto-typeish code I wrote some time ago (the so-called SEWalker) which ain't that much better then SPS. Due to this I figured I had to try to make something that works well, and the fact that @Olly kept bugging me about writing a new walker weighted in a bit, I guess.

The performance was better than what I initially expected (before I started working on it): Every test I've ran seems to have been able to quite precisely pinpoint my position (we are talking off by a few tiles at worst), and if I recall correctly it used around 50-60ms on my computer to find my world-position (yes, with the whole world map loaded), tho all my tests are with memory scanning enabled, and that increases the speed and accuracy.


"Memory scanning"?

[SPOILER=Some boring text..]The idea was simple, many of us has used tools like Cheat-Engine to find stored values in a single-player games (then modify it eg to get a bit more money ingame). RSW uses the same technique as Cheat-Engine uses to search through the memory owned by any process for a particular value (it doesn't modify anything). This is quite straight forward, and I believe it's fairly safe to do so, you are just parsing through your computes own RAM, right (no fancy-schmacy stuff).

The steps we take:
  1. Search for a bitmap in the client using for example known information like the images size, then store it's address. This search must be insensitive to changes like reordering of class-fields.
  2. Grab your ingame minimap (the normal way), and cross-correlates that image to the chunk we grabbed from the clients memory.
  3. – Proceed to extract the best highest rated match from the cross-correlation. Call it our "local position", – This is quite useless by itself since it's varies.
  4. We crop out a 200x200 bitmap around the "local position" from the chunk we grabbed (This gives us a nice looking ~200x200 bitmap around our player).
  5. Using that 200x200 minimap, we cross-correlate it with the "world map" (a map image loaded when you initialized RSWalker).
  6. – Again, we proceed to extract the highest rated match. The result of this is our global position.

The the correlation of our new 200x200 minimap to the world map only happens every time the image in the clients memory is changed, this saves us a lot of time.

[/SPOILER]

How to use in a script

So, version 1 and beyond will be specialized towards SRL, and requires a Simba 1.2 build which you just use instead of your regular Simba (place it in the same old folder).

{$I SRL/OSR.simba}
{$I RSWalker/Walker.simba}

var
RSW: TRSWalker;
path: TPointArray;
begin
//How to init depends on your usage:
//* Default : RSW.Init('world.png'); { Automatic detection }
//* if SMART : RSW.Init('world.png', SMART.PID); { or whatever it's named in your include }
//* no memscan : RSW.Init('world.png', -1);
RSW.Init('world.png');
AddOnTerminate(@RSW.Free); // automatic free once script shuts down

//alternative setup (default works fine tho)
RSW.skipClose := 25; //how close to the target point before we try to click the next point.

path := [Point(4171, 3457), Point(4136, 3444)]; //some path
end.


Use it to get your world position

Should be quite simple:
1. initialize it with the world bitmap you have (there is one shipped with RSW: `world.png`)
2. call MyWalker.GetMyPos();

{$I SRL/OSR.simba}
{$I RSWalker/Walker.simba}

var
RSW:TRSWalker;
t:UInt32;
begin
RSW.Init('world.png');
WriteLn('RSW is setup!');

// The first scan is a lot slower then the next scans, it's used to setup stuff..
t := GetTimeRunning();
WriteLn('I am here: ', RSW.GetMyPos(), ' used: ', GetTimeRunning()-t,'ms');

// scan again.. this time it will be pretty much "instant".. same for all of the future times.
t := GetTimeRunning();
WriteLn('I am here: ', RSW.GetMyPos(), ' used: ', GetTimeRunning()-t,'ms');

// one more time to prove my point..:
t := GetTimeRunning();
WriteLn('I am still here: ', RSW.GetMyPos(), ' used: ', GetTimeRunning()-t,'ms');

RSW.Free();
end.
You should keep in mind that the bitmap `world.png` is very large, you might wanna crop out a smaller part of that bitmap around where you want to use it, both to save memory, and to speed up initialization of your script. Tho it's not needed, I use the whole world map all the time :p


Other notes

  • As of version 1, RSWalker requires you to use SRL
  • MemScan only works on Windows (with 32bit Simba), and with Lape as your interpreter, and 32bit Java.
  • Path making is done in the same way as with SPS. Open any SPS path-making tool, load your map, make a path, copy the path to your script… done.
  • Supports "blindwalk" in the WalkPath function, so you can for example supply it a single point of where you want to walk to that's far away.
  • There now exists handling for loading particular "map pieces" (like sps does). I have yet to document this.
  • It's shipped with a script to grab world map pieces so you create your own custom maps, it's located in the folder `maps` under the name `MapGrabber.simba`.
  • With mem-scanning enabled you must provide a map that's extra large, it has a 100px radius which will be "non-walkable", while without mem-scanning it has an extra 55px which is "non-walkable" (or there-about):
  • Your path must be outside the "none-walkable" area, if it's not, then you need a larger map.


Credits

A thanks to @Olly, he was the one who "manually" (using CheatEngine) parsed through the memory and came across the minimap-buffer, once he found it, and told me about it I started playing around with this idea; Make the search for it "automatic"… And after a little back and forward, some playing around and so on, this walker was created. I didn't really focus on writing pretty code, as it wasn't like super-interesting, just knew we needed something reliable.


Download, and install it

  1. Download it: https://github.com/slackydev/RSWalker/releases (Download the one tagged: Latest release)
  2. Extract it to your `Includes`-Folder (usually located in `C:\Simba\`)

A nice and useful path making tool: https://github.com/TheTS/SPSToolbox/tree/2

Myke

2015-02-12 13:52:46

Awesome I will test this out tomorrow after work and update how I get along. Looks amazing

Floor66

2015-02-12 14:35:37

Great effort! I'll be sure to test this out. If it really works as good as you've experienced so far I could really see this as backup method for when Reflection is out :-)

rj

2015-02-12 14:59:01

This looks nice, so just to be clear - let's say I want to use this for a RSPS. I would have to 1) have the bitmap I want to use, and 2) I would need the pid of the client correct? How does one go about getting this pid (I can just loop through Tprocess thing?)

slacky

2015-02-12 15:11:08

From: Robert
This looks nice, so just to be clear - let's say I want to use this for a RSPS. I would have to 1) have the bitmap I want to use, and 2) I would need the pid of the client correct? How does one go about getting this pid (I can just loop through Tprocess thing?)

w_GetClientPID() returns the PID of the window you have targeted with Simba. If you use SMART and don't wanna target SMART with Simba, you use smarts own SmartGetClientPID(smartInstance). You also don't HAVE to use the memory scanning tho, it can be ignored if you only have like a 500x500 bitmap, maybe even as large as 1000x1000, then just pass `-1` as the PID.

Pretty sure this is covered in the initial post.

However it's not designed for anything else the oldschool runescape, so your RSPS has to have the minimap placed in the exact same spot as the official rs07-game for it to work, unless you think about modifying the source. If the RSPS is very modified it might not even find the map-buffer, that is if it has a different than 512x512.

The Mayor

2015-02-12 15:11:27

Nice work slacky and Olly!

kingarabian

2015-02-12 16:05:31

Great job!

Maybe hybrid scripts can come back from the dead now.

Olly

2015-02-12 16:33:35

RS3 will come eventually too. But that's dead easy compared to this. :p

ineedbot

2015-02-12 16:51:53

Looks intriguing! I'll have to have a look at this! Nice job.

EDIT:
I am very impressed! Drop dead accurate!

Hoodz

2015-02-12 16:59:26

finally!

Shatterhand

2015-02-12 17:57:21

Looks promising, good job.

Flight

2015-02-12 18:06:44

I added this last night and actually did integrate it with AeroLib. I'd like to set it up in the style you used with SEWalker; I think it was neatly written. Yes I did run into some compatibility issues with SimbaExt and, to avoid a mess of "IFDEFINE"/"ELSE", I just replaced the neat, time-saving functions (from SimbaExt) with the original stock Simba functions. Not as tidy as before but this way SimbaExt wouldn't be required to run AL (as SEW being the primary dependent).

It's worked wonderfully for me so far, very accurate and very fast. You've done an amazing job again, Slacky.

slacky

2015-02-12 20:41:07

From: ineedbot
Looks intriguing! I'll have to have a look at this! Nice job.

You can debug the local position with the Test2.simba script found in the tests (that is after a couple of modifications). Tho this will only show the local position, but this pos is normally the outcome position only offset based on the loaded worldmap.. but let's not get in to more detail about that.

So, for debugging of your current position this will do:

var
RSW:TRSWalker;
begin
RSW.Init('world.png');
AddOnTerminate(@RSW.Free);
while 1 do
RSW.DebugPos();
end;

Debugs made with a modified version of the above + some photoshop (to make it in to one image):

Myke

2015-02-13 06:10:06

awesome^


[ATTACH=CONFIG]25022[/ATTACH]

Frement

2015-02-13 06:14:27

I smell KYAB.

Flight

2015-02-13 09:00:33

From: Frement
I smell KYAB.


AFAIK KYAB was reflection-based, the first.

Frement

2015-02-13 16:07:15

From: Flight
AFAIK KYAB was reflection-based, the first.


I'm aware, but same concept :)

slacky

2015-02-13 17:56:48

From: Frement
I'm aware, but same concept :)

I do not see how you can make that claim. It does indeed read the memory which is in a way related to everything in programming (not just reflection), reflection does what I do in a quite different way. I search for a value (width*height), and see if referenced somewhere else in the mem, a place that should hold two other values (width and height) to figure out if it's a bitmap-like structure. If it is.. I know I have a bitmap.. This concept can be used more generally, it's not limited to Java-applications.

Reflection on the other hand just "asks java" to look up some variables based on the variables name.

ineedbot

2015-02-13 18:18:58

I am having trouble with using OSBuddy and RSWalker accuracy. No biggie, I can use the original client, but OSBuddy has somethings that can be useful.

Harrier

2015-02-13 18:36:09

From: ineedbot
I am having trouble with using OSBuddy and RSWalker accuracy. No biggie, I can use the original client, but OSBuddy has somethings that can be useful.

Think more info could be helpful. I'm using OSBuddy atm and I'm getting 1-4 pixels out at max (Do you have any plugins that could be messing with it?)

ineedbot

2015-02-13 18:54:49

From: Hawker
Think more info could be helpful. I'm using OSBuddy atm and I'm getting 1-4 pixels out at max (Do you have any plugins that could be messing with it?)

When the map loads a new area on OSBuddy, it takes maybe 20 seconds for it to return to normal. Often i get 'Error: Image buffer can't be found at line 71' On MemScan

On original client, it works just fine and fast.

Frement

2015-02-13 19:23:33

From: slacky
I do not see how you can make that claim. It does indeed read the memory which is in a way related to everything in programming (not just reflection), reflection does what I do in a quite different way. I search for a value (width*height), and see if referenced somewhere else in the mem, a place that should hold two other values (width and height) to figure out if it's a bitmap-like structure. If it is.. I know I have a bitmap.. This concept can be used more generally, it's not limited to Java-applications.

Reflection on the other hand just "asks java" to look up some variables based on the variables name.


I meant more in regards to the functionality.

Ross

2015-02-13 19:46:17

From: Olly
RS3 will come eventually too. But that's dead easy compared to this. :p


Really looking forward to it!

slacky

2015-02-13 19:48:28

From: ineedbot
I am having trouble with using OSBuddy and RSWalker accuracy. No biggie, I can use the original client, but OSBuddy has somethings that can be useful.

Yeah, I noticed that. It's not that it doesn't work, but memory-scanning is horribly slow on OSBuddy for some reason. I think I can speed it up, but that requires me to rewrite some internal processing stuff. I'll look in to it when/if I feel up for it.
OSBuddy can add up to another ~500MB of memory to scan through on top of the >150MB from the client it self, and that can also mean a bunch of new "almost" matches in memory, and I have to check all these "false-positives" every scan.

You can use it with a smaller part of the world map, and disable memory scanning by passing `0` as PID to the init-procedure.
To do so, just open the `world.png` in any image editor, and crop out the area you need (pluss the extra of at least 55px radius of "nonwalkable" area, see topic post), save it, and load it in to the walker. Tho keep in mind that without the memscanning, it could turn slow if your custom map is very large, I would _guess_ that up to 1000x1000 image would work.

Hope this helps! :)


Edit:
A new version is available. It solves the OSBuddy issue, but it will be a few times slower at updating in OSBuddy since it uses MUCH more mem then the official client.
- https://github.com/WarPie/RSWalker/releases/tag/0.32

ineedbot

2015-02-16 14:02:49

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.

Verfy

2015-02-17 04:16:41

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:


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

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]


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

slacky

2015-02-18 00:44:39

From: ineedbot
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.

slacky

2015-02-18 00:59:34

From: magicalll
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):


{$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:

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.

Verfy

2015-02-20 09:01:11

From: slacky
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
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 :/

Flight

2015-02-20 09:29:39

From: magicalll
Thanks for your response, but I have another problem :) I did everything like you said but now when I call
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:

{$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.

slacky

2015-02-27 06:41:46

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.

Athylus

2015-03-04 11:18:11

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?

slacky

2015-03-10 14:46:14

From: Athylus
But something isnt clear to me. Do we substract the non-walkable pixels from our height and width we want to walk to?

No.

Athylus

2015-03-12 12:08:33

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!

The_Prince

2015-03-22 01:31:17

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?

Harrier

2015-03-22 03:30:21

From: The_Prince
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….

The_Prince

2015-03-22 04:30:35

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

//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.

Kyle

2015-03-22 09:09:11

From: The_Prince
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

//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_Prince

2015-03-23 03:09:54

From: elfyyy
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.

BigRedJapan

2015-03-26 06:16:23

@Slacky

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

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

Ive put in:

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

Janilabo

2015-03-26 06:58:25

From: Rules of Joe
@Slacky

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

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

Ive put in:

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)).

BigRedJapan

2015-03-26 12:21:14

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

slacky

2015-03-30 06:12:23

From: Rules of Joe
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);

liams007

2015-05-02 20:15:01

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

Flight

2015-05-02 21:13:29

From: liams007
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.

honeyhoney

2015-05-07 14:57:43

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.

slacky

2015-05-07 15:50:37

From: honeyhoney
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/blob/master/maps/MapGrabber.simba

honeyhoney

2015-05-08 13:27:53

From: slacky
I've actually written a thingy for that: https://github.com/WarPie/RSWalker/blob/master/maps/MapGrabber.simba



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

xujnea

2015-05-10 12:02:54

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?

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;

slacky

2015-05-10 19:45:28

From: xujnea
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.


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..

Unfold

2015-05-19 20:06:59

I'm really confused. Every time I run my script, the position of my character changes.. Not sure what i'm doing wrong.



//i declare that
Walker.init('surface', 'WorldMap');
Walker.skipClose := 4;
Walker.minRunEnergy := 35;
Walker.walkStyle := wsSPS;


writeln(Walker.GetMyPos());


Edit:

Okay, It's displaying different positions at different angles. Is there any way to display the same position at all angles.

Flight

2017-08-01 09:34:27

From: jokerface25
Hey Slacky, I'm experiencing some issues with RSWalker im not sure what I'm doing wrong, could you have a look at this and tell me if anything is out of order? Thanks :)


program Walking;
//{$DEFINE SMART}
{$DEFINE Walker}
{$i AeroLib/AeroLib.Simba}




var
BronzePick:TItem;
pnt:tpoint;
RSW: TRSWalker;
path: TPointArray;


Procedure Login
begin
Me.Active := True;
Me.Name := '';
Me.Pass := '';
Me.Member := False;
end;

Procedure LoadItem;

begin
BronzePick.DTM := DTMFromString('mAAEAAHic42FgYOADYkYgZgNiTgYIYAZiViBmAWJuIBYFYgkgFoaqZWRAAEkgFgdiESDmBWIOKGaH6k/w1EHShRsbKCiAaUkG0gBhk1ExMgAAhTYCZA==');
end;

Procedure UseItem;
Begin
if BronzePick.InInventory then
WriteLn('Found Item in Invetory yeah!');
if Bronzepick.interact(Mouse_Left) then
WriteLn('We have the pick!');

end;
procedure Move

begin
pnt := [331,162];
HumanMMouse(pnt, 5, 5);
GameTab(TAB_INV);
GameTab(TAB_STATS);
end;



begin
initAl();
Login;
if (not isLoggedIn()) then
loginPlayer(false);
LoadItem;
UseItem;
Move;
RSW.Init('WorldMap');
RSW.walkStyle := wsSPS;
RSW.anyAngle := True;
RSW.skipClose := 15;
path := [Point(4536,2943),Point(4518,2907),Point(4494,2847)];
RSW.WalkPath(path);

RSW.Free();


end.

This is the error message I get everytime, the walker was working at first but it seemed to stop after a few uses.

Error: Out of memory at line 93
Execution failed.
The following DTMs were not freed: [0]
The following bitmaps were not freed: [0, 1, 2]

If you could help I'd really appreciate it! Thanks


I've had the issue of running out of memory before while using RSWalker, especially when loading "WorldMap". In my own experience I found it's from loading and freeing a large map multiple times with a single instance of Simba. This may be caused from testing & running a script that loads such a large map file, and even though you free it correctly in your example script you're still getting that error. And while I can't explain the cause, I can recommend simply saving your script and restarting Simba itself. You don't have to close out your SMART (if you're using it), just a simple restart of Simba to free anything that's chewing up memory.

Also after looking at the script I notice you're not freeing the BronzePick.DTM. Don't forget, all DTMs and Bitmaps must be freed when the script terminates. That's probably not the issue you're running into in this case, but it could contribute.

wthomas

2019-06-30 12:22:48

for anyone that gets the following error:
"Runtime error: "Access violation" at line 209, column 41 in file "C:\Simba\Includes\RSWalker\Walker.simba""


You need to remove the -1 in the initialization eg replace
Walk.Init('world.png', -1);
with
Walk.Init('world.png');

rsbotter123

2019-08-25 15:40:53

From: wthomas
for anyone that gets the following error:

You need to remove the -1 in the initialization eg replace with


Thanks for the help ill try that fix.

LordJashin

2019-08-31 06:10:35

Since this thread has been bumped already. Might as well ask my noob questions here.

[INDENT]1. What is the difference between RS Walker onMove, and OnWalk. What should i use each for. I was thinking of throwing waits/antibans in there occasionally.
2. Does WalkPath introduce any randomness or does it click the same path every time.
3. Has anyone ported Slacky's webber script to Simba 1.3?[/INDENT]

bluecereal

2019-08-31 16:41:47

From: LordJashin
Since this thread has been bumped already. Might as well ask my noob questions here.

[INDENT]1. What is the difference between RS Walker onMove, and OnWalk. What should i use each for. I was thinking of throwing waits/antibans in there occasionally.
2. Does WalkPath introduce any randomness or does it click the same path every time.
3. Has anyone ported Slacky's webber script to Simba 1.3?[/INDENT]


1: onMove happens constantly while you are moving. onWalk occurs each time you start walking to a new point/waypoint in your path.
2: WalkPath randomizes waypoints but not the destination point.
3: Maybe? Dunno, I'm sure someone has ;). You can add points and paths manually, it's not so bad.

Poking around the source would have answered your questions pretty quick :google:

LordJashin

2019-09-01 04:16:54

Thanks.
Alright after hours of fun. Here it is.
The complete F2P map. Made yesterday. And huge graph i made for it with webber.simba from slacky.
This has about everything graphed except wilderness. You can load the graph and add to it if u wish.
Cheers. Gonna use these for my scripts.
map: https://i.imgur.com/EPhfyA8.png

free.zip

LordJashin

2019-09-02 10:28:18

Well i decided to go ahead and do the full thing. Enjoy.
These maps are completely walked within the last 2-3 days. Hosidius is updated, etc.

Updated Slack's world and correctly overlayed it. With Islands done as well - https://i.imgur.com/MJC2h2M.png
Slacky's world + 3200 pixels to the left to add ZEAH - https://i.imgur.com/GtKFtiN.jpg
Here's zeah by itself if anyone wants that - https://i.imgur.com/DQ0WZE6.png


world.zip - https://mega.nz/#!tpZB2YbS!2HkoLb7uQ6TgD7BoF8FMVIfEjdK1_fN8YQmfH1inmmQ

Here's what it looks like with the graph overlayed. - https://i.imgur.com/C1YrC7O.png

OMEGA BUMP