Map Movement Recording
Squigglyo
2008-05-17 09:20:02
I know how much work would be needed to put in a function such as this but i believe its uses would be great.
What if, you could record where you walked. SO when backtracking, you knew where to go.
For example, you click the area 5 squares right and 2 squares above you. TO Scar, youve clicked a random coordinant, but if scar knew how many squares you traveled, and with alot of recording it could figure out how to get back, even taking random movement into account.
With this kind of procedure it could get to the point where you can tell the function to walk a number of squares down/up and left/right.
WalkSquares(17,35);
^^ Walks 17 squares up, and 35 left. Not all at once, so it map walks itself, eventualy getting to that area.
Something to this effect would be great i reckon.
And dont go off telling me 'omg going to the same square would be detetable'…OBVIOSLY. This is a base idea, so randomness would be put into it.
Harry
2008-05-17 09:26:03
Hey Squig =]
I don't really understand what you are saying - just a thing to record how many times you walk north, south, east, or west, to get back to the begin point?
Ex:
if WalkNorth then
Inc(NorthWalked);
if NorthWalked >= 1 then
begin
WalkSouth;
NorthWalked := 0;
end;
Right?
MylesMadness
2008-05-17 09:31:09
Way ahead of you ;)
Santa_Clause
2008-05-17 09:32:20
Similar to KYAB?
Bobarkinator
2008-05-17 10:31:08
TileWalking is already around through client reflection. I would suggest KYAB but nobody updates it anymore. Even the most basic bots on MITB have TileWalking so you can check those out.
Lastly if you want to do it in SCAR, it's possible, but it would be hard, I guess you could time how long the flag is present and where it is in relation to where you are at. If I remember right Tiles are 16 x 16 either on the mainscreen or minimap, probably minimap. But not completely sure. I think Benland knows.
mixster
2008-05-17 10:34:43
Alternatively, record all minimap mouse clicks and inverse them to walk back? E.g. RRW that clicks at -50, -3 from MMCX, MMCY so to backtrack you click 50, 3 to walk back to the same place :)
nielsie95
2008-05-17 10:40:13
It shouldn't be too hard. If you take the MiniMap Center as base and with every click you take xOff and yOff and store them in an array. When you want to walk back you reverse the array and inverse the xOff and yOff.
EDIT: Mixster beat me :p
For randomness you shouldn't use SRL's mouse randomness, but add some randomness before, so you can record how much offset you should take from your next point.
I don't the idea for long walks though, what if you are lost? It would still be clicking on the minimap? I think it good work pretty good for short distances.
SKy Scripter
2008-05-17 10:41:35
I don't know if i would waist your time in this area actually.
The tile thing just wouldn't work really… with SCAR and Colors.
plus what could you do really?
Edit: if it works good, i would be surprised.
Camaro'
2008-05-17 11:43:51
From: nielsie95
It shouldn't be too hard. If you take the MiniMap Center as base and with every click you take xOff and yOff and store them in an array. When you want to walk back you reverse the array and inverse the xOff and yOff.
EDIT: Mixster beat me :p
For randomness you shouldn't use SRL's mouse randomness, but add some randomness before, so you can record how much offset you should take from your next point.
I don't the idea for long walks though, what if you are lost? It would still be clicking on the minimap? I think it good work pretty good for short distances.
But if you made the function good then if your lost it could detect it ..Like, hmm ..
If its not the similar color then stop clicking and exit the function..
And btw shouldnt this be in srl discussions?
MylesMadness
2008-05-17 15:23:09
I was using ddtms in run time and puts the main point where it clicked last time. So I guess you could just make it change the main point and you got what your talking about. I'm using that technic in a script thats out soon. All thats left is the walking.
Dan Cardin
2008-05-17 16:27:17
I would be surprized it this ended up being relieable, because of screen rotation, and only recording the spot on the map that was clicked would allow for easy getting lost. It seems to me that if you were to make some type of recognition system(getting the amount of some color on the screen, or something to that effect, then checking it on the way back with tolerance, then if it was way off you could have the script backtrack and try to redo it) of the land that you're in, as well as the coordinates then it would be much more reliable.
Macrosoft
2008-05-17 23:20:58
Edit: Please excuse the fact that this is in note form, its late lol
Edit Edit:Never Mind, using the "N" as a reference wont work, trying to think of a new way…
Maybe use something similar to radial walk on the compass to find the angle, then use that angle on the mm? (to find y-axis)
Even with screen rotation, it could still be done, but this would require thinking in a different way.
over 3 down 1 is like saying three in the direction of the x axis and -1 in the direction of the y axis
With the map rotating, the x and y axis must also rotate
The equation of the y axis is found using one of the lines on the "N"
Then a loop increases x by one each time and plugs it into the equation, then checks to see if the coords are a certain distance from the center of the mini map. What this does is find the intersections between the line and the mini map circle. This continues to find the second intersection. Find the midpoint by adding the x coords and dividing by 2 and adding the y coords and dividing by 2.
Now, follow the y-axis line with x increasing (positive coord) or decreasing (negative coord). Check the distance between the midpoint of the Y-axis and the current point every time within a loop. The loop must repeat until the distance is equal to the abs value of the y coord. This new found point is then used with the negative reciprical of the slope of the y-axis in point slope form to make another equation. The same thing is done with this equation as with the y-axis and the point to click on is found.
A alternate procedure must be taken for when the compass is perfectly north or south.
WOW, that response turned out longer than expected, prob would have been easier to script it myself.
Sir R. M8gic1an
2008-05-18 03:38:52
if i were to do this i'd have two ways of doing it.
making a DDTM on every step and storing it in a TIntegerArray
or
making a 2DTIntegerArray with:
T2D[0]:=[Distance(x) to MMCX, Distance(y) to MMCY, GetCompassAngle]
using the angle which it had at the time you clicked and knowing exactly where you clicked (you can check for the flag) you can then reverse the x and y coords and use the 'GetCompassAngle' you stored to click back on the same place ;)
untested, but should be able to work…i think :p
~RM
mixster
2008-05-18 06:09:59
for i := 0 to High(intArr) do
begin
x := MMCX - Round(intArr[i].x * Cos(Radians(intArr[i].a - 90)));
y := MMCY - Round(intArr[i].y * Sin(Radians(intArr[i].a - 90)));
Mouse(x, y, 2, 2, True);
FFlag(0);
end;
Just store the minimap clicks into a type that has 'x', 'y' and 'a' (angle) and you're sorted (maybe make a modified R/RW that stores clicks) :)
Hugolord
2008-05-18 08:11:18
I lol'd you wouldn't use KYAB but you would use this..
lol haha
what a crazy little function
Sir R. M8gic1an
2008-05-18 14:35:18
who says we wouldn't? Would still make me proud to do something as good as KYAB through scar.
should we actually give this a try? :)
/me goes read the Sin and Tan guides :)
~RM
Gu3st...
2008-05-18 15:54:47
i think we should :D
Squigglyo
2008-05-18 18:34:15
From: Hugolord
I lol'd you wouldn't use KYAB but you would use this..
lol haha
what a crazy little function
keeping in mind im ancient. YOu crazy SRL guys have all crazy new things, much more than we ever had in the good old days, lol.
Im a fan of scar though, so anything done from some other program, can be done in scar, and should be. Cause…its scar.
JuKKa
2008-05-18 20:48:58
Program test;
{.Include SRL/SRL.Scar}
var
tilex, tiley: integer;
Procedure WalkTile(wTx, wTy: Integer; Backwards: Boolean);
Begin
If(BackWards)Then
Begin
wTx := MMX2 - (wTx * 4);
wTy := MMY2 - (wTy * 4);
End Else
Begin
wTx := MMX1 + (wTx * 4);
wTy := MMY1 + (wTy * 4);
End;
If(rs_OnMinimap(wTx, wTy))Then
Begin
if(tilex > 0)Then
tilex := tilex - random(20)
else tilex := tilex + random(20);
if(tiley > 0)Then
tiley := tiley - random(20)
else tiley := tiley + random(20);
MouseFlag( wTx + tilex, wTy + tiley, 0, 0);
FFlag(10);
End;
End;
begin
Setupsrl;
WalkTile(20, 28, True);
WalkTile(20, 28, True);
WalkTile(20, 28, True);
WalkTile(20, 28, True);
End.
a start atleast…
Drakan
2008-05-18 21:20:16
From: Squigglyo
keeping in mind im ancient. YOu crazy SRL guys have all crazy new things, much more than we ever had in the good old days, lol.
Im a fan of scar though, so anything done from some other program, can be done in scar, and should be. Cause…its scar.
So what your saying is, scar can find ID's of characters, items, and pretty much everything, and make a flawless bot without using color? And can tell what tile on the map of runescape you are on? Sweet. Give me those functions!
XD
BenLand100
2008-05-18 23:38:22
From: Bobarkinator
TileWalking is already around through client reflection. I would suggest KYAB but nobody updates it anymore. Even the most basic bots on MITB have TileWalking so you can check those out.
Lastly if you want to do it in SCAR, it's possible, but it would be hard, I guess you could time how long the flag is present and where it is in relation to where you are at. If I remember right Tiles are 16 x 16 either on the mainscreen or minimap, probably minimap. But not completely sure. I think Benland knows.
Tiles are 4x4 px on the minimap. And if you want to know how far you walked, all you need to know is the flag position (e.g. where you clicked) and the compass angle. ;)
itSchRis917
2008-05-18 23:54:06
From: BenLand100
And if you want to know how far you walked, all you need to know is the flag position (e.g. where you clicked) and the compass angle. ;)
Explain please?
Sir R. M8gic1an
2008-05-19 01:59:03
From: BenLand100
Tiles are 4x4 px on the minimap. And if you want to know how far you walked, all you need to know is the flag position (e.g. where you clicked) and the compass angle. ;)
yay, that's what i said!
From: RM
making a 2DTIntegerArray with:
T2D[0]:=[Distance(x) to MMCX, Distance(y) to MMCY, GetCompassAngle]
using the angle which it had at the time you clicked and knowing exactly where you clicked (you can check for the flag) you can then reverse the x and y coords and use the 'GetCompassAngle' you stored to click back on the same place
untested, but should be able to work…i think:p
~RM
~RM
mixster
2008-05-19 02:43:36
That must be the first time Benland has said something scripting-related and we all understood it! My suggestion of a type though makes more sense though as having 2d arrays can get complicated while an array with .x .y and .a (angle) looks cooler :p
Anyway, I already made a basic function using that if you filled it out it *should* work though probably won't at all since I didn't test it, but you know how it is :)
skilld u
2008-05-19 16:19:28
program iBotWalk;
{.include SRL/SRL.scar}
var
t: integer;
procedure TileWalk(ntw: integer; direction: string);
var
wx, wy: integer;
pcy: boolean;
begin
markTime(t);
case lowercase(direction) of
'n': begin
MakeCompass('5');
wx := MMCx - (8);
wy := MMCy - (ntw * 8);
pcy := True;
end;
's': begin
MakeCompass('5');
wx := MMCx + (8);
wy := MMCy + (ntw * 8);
pcy := True;
end;
'e': begin
MakeCompass('5');
wx := MMCx + (ntw * 8);
wy := MMCy + (8);
pcy := True;
end;
'w': begin
MakeCompass('5f');
wx := MMCx - (ntw * 8);
wy := MMCy - (8);
pcy := True;
end;
end;
if pcy then
begin
Mouse(wx, wy, 5, 5, true);
FFlag(0);
end;
end;
begin
SetupSRL;
ActivateClient;
Wait(500 + random(500));
t := 0;
MarkTime(t);
TileWalk(3, 'n'); //how many 4x4 tiles to walk, direction to walk.
TileWalk(4, 'e');
TileWalk(9, 's');
TileWalk(2, 'w');
WriteLn('Took ' + inttostr(TimeFromMark(t)) + ' ms to walk there');
end.
this will walk from feb to the mining guild.
Took 5107 ms to walk there
Sir R. M8gic1an
2008-05-19 17:09:41
this is a question of walking back, skilld u, but still nice work. might want to try adding some combinations like NE, NW, SE, SW.
~RM
From: skilld u
program iBotWalk;
{.include SRL/SRL.scar}
var
t: integer;
procedure TileWalk(ntw: integer; direction: string);
var
wx, wy: integer;
pcy: boolean;
begin
markTime(t);
case lowercase(direction) of
'n': begin
MakeCompass('5');
wx := MMCx - (8);
wy := MMCy - (ntw * 8);
pcy := True;
end;
's': begin
MakeCompass('5');
wx := MMCx + (8);
wy := MMCy + (ntw * 8);
pcy := True;
end;
'e': begin
MakeCompass('5');
wx := MMCx + (ntw * 8);
wy := MMCy + (8);
pcy := True;
end;
'w': begin
MakeCompass('5f');
wx := MMCx - (ntw * 8);
wy := MMCy - (8);
pcy := True;
end;
end;
if pcy then
begin
Mouse(wx, wy, 5, 5, true);
FFlag(0);
end;
end;
begin
SetupSRL;
ActivateClient;
Wait(500 + random(500));
t := 0;
MarkTime(t);
TileWalk(3, 'n'); //how many 4x4 tiles to walk, direction to walk.
TileWalk(4, 'e');
TileWalk(9, 's');
TileWalk(2, 'w');
WriteLn('Took ' + inttostr(TimeFromMark(t)) + ' ms to walk there');
end.
this will walk from feb to the mining guild.
Took 5107 ms to walk there
I like this idea… But surely that'd look REALLY bottish, switching your maps all the time lol :s
JuKKa
2008-05-19 17:39:15
how do i reverse the coordinate using sin & cos? if i have a coord at 700, 90 and i want it at the other side of MMCX, MMCY.
skilld u
2008-05-19 18:52:01
would it be possible to make a HUGE collection of every tile in rs by making a bitmap of each one and saving it in an include. each bitmap would have a number and when you wanted to use the tilewalk in your script all you would have to do is this:
program Wootness;
{.include TileWalk.scar}
begin
Walk(1); //this would fine the bitmap called 1 and then click it and check for flag. :D
end.
@jukka, i think that n3ss3s made a tut on sin, cos and tan somewhere.
EDIT:
this took me a long time to find:
http://www.villavu.com/forum/showthread.php?t=24648?t=26933
Dan Cardin
2008-05-19 19:14:18
From: skilld u
would it be possible to make a HUGE collection of every tile in rs by making a bitmap of each one and saving it in an include. each bitmap would have a number and when you wanted to use the tilewalk in your script all you would have to do is this:
program Wootness;
{.include TileWalk.scar}
begin
Walk(1); //this would fine the bitmap called 1 and then click it and check for flag. :D
end.
@jukka, i think that n3ss3s made a tut on sin, cos and tan somewhere.
EDIT:
this took me a long time to find:
http://www.villavu.com/forum/showthread.php?t=24648?t=26933
I really doubt it. Even if someone did make it(though it wont happen because one update would screw everything up) it wouldnt be able to work like that because you'd need to load each bitmap. You would have to load them in squares of like 10x10 tiles or less. Seems to me very inefficient, not even considering the time it would take to make it.
I quite like my idea of a failsafe, for getting the amount of a color(preferrably the most common color on the minimap) and saving that to an array along with the coordinates. Its a lot more general than something like a ddtm/dtm/bitmap, because it could be recorded easily, while walking, but its specific enough to not be mistaken for a different place on the map, all the time. Then when walking back you check the color amount/most common color again/, and see if it matches up closely enough to call it the same place. Then if its wrong you would just backtrack until you can find your way back(hopefully backtracking one space would be enough to find your way again).
Also, how is this being planned? For example, are you recording the beginning place as a legit coordinate, or are you making it the origin? I think making it into the origin would be a good idea, because then you could make other functions, like some mouse functions, that would get you from point a(origin) to point b(end point) with a pattern(like a curve; in a spiral, if you're looking for something; straight; in circle; etc). Seems like this could turn into something that would look quite human like.
Another problem i could see happening, would be if you were to click on a place where you cant walk. Then it could screw up your coordinate system, and make you fail.
skilld u
2008-05-19 19:17:39
awww…does anyone know how ibot's walking system works?
Bobarkinator
2008-05-19 20:00:18
From: skilld u
awww…does anyone know how ibot's walking system works?
Ya…it's client reflection.
Drakan
2008-05-19 22:06:21
Yah iBot and KYAB and all those bots don't use color for their tile walking, its all based on getting the variables from the client itself. its JAVA! :spot:
Widget
2008-05-19 23:08:42
Whatever happened to that Web Walker or something? It looked promising and it should probably be started back up again. :)
Also, wouldn't a function like TileWalk(35,-15); be useful for walking 35 tiles east and 15 tiles south? If you could distribute it over several clicks, and have the middle points be random, with the same ending point (you would need to detect the rotation of the minimap, not the compass though).
Wizzup?
2008-05-20 03:46:52
I have already made something like this some time ago, it turned out to be useless because the RuneScape compass angle isn't even close to the Runescape Minimap angle, they differ at least 5 to 10 degrees.
Bobarkinator
2008-05-20 08:14:35
Perhaps use LordGregGreg's perfect angle function. The one that lined up the compass based on a white line on the minimap. I remember it not working the best so it could be tweaked and that would give us a base to start.
Doofy
2008-07-16 19:22:03
Hey guys, it's been a while since I've been on and I'm just surfing around. But I think that I tried making something like this around a year or so ago, and I don't remember if it worked or failed miserably. Also, I know SRL and RuneScape changed and everything so half of the functions and stuff are probably long gone. It used a special compass angle changer I made (which got owned by nielsie i think), but I'll post it here, and hopefully it'll help you somehow. I don't know, just trying to help. You can try it out, as I cannot without a RuneScape account =P. Good luck though, good idea. Attached.
EDIT: It does not store the coords or anything, I just thought this might help with the walking portion, if RuneScape still has the same pixels and shit.
Wanted
2008-07-16 23:17:12
From: Wizzup?
I have already made something like this some time ago, it turned out to be useless because the RuneScape compass angle isn't even close to the Runescape Minimap angle, they differ at least 5 to 10 degrees.
Yea that's exactly right.
Even if this WAS to work perfectly, it'd only be good as blind clicking with angle (CompassWalking/MiniMapAngleWalking)
But as Wizzup? said, it's way to hard to detect the angle of the Mini-Map accurately enough for Angle Walkage to ever work effectively.
I suggest normal DTMs with tolerance or Dynamic DTMs for walking seeing as they are more relaible, I would use symbols and other DTMs for fail safes and finally blind clicking or Angle Walkage for a final fail safe.
From: Doofy
Hey guys, it's been a while since I've been on and I'm just surfing around. But I think that I tried making something like this around a year or so ago, and I don't remember if it worked or failed miserably. Also, I know SRL and RuneScape changed and everything so half of the functions and stuff are probably long gone. It used a special compass angle changer I made (which got owned by nielsie i think), but I'll post it here, and hopefully it'll help you somehow. I don't know, just trying to help. You can try it out, as I cannot without a RuneScape account =P. Good luck though, good idea. Attached.
EDIT: It does not store the coords or anything, I just thought this might help with the walking portion, if RuneScape still has the same pixels and shit.
Doofy!!
Go to see you around!
Wizzup?
2008-07-17 06:33:13
From: IceFire908
But as Wizzup? said, it's way to hard to detect the angle of the Mini-Map accurately enough for Angle Walkage to ever work effectively.
I made one that uses walls actually… :)
Doofy
2008-07-18 13:40:44
wizzups wall one sounds interesting but would not work for many areas i would think.
yeah im on here once and a while… good to see you too
king vash
2008-07-22 17:48:18
I wrote air crafter this way once, it worked decently well it had two portions one moving four minimaps sizes and one moving 6 minimap sizes (so 5 clicks for one and 8 for the other)
It worked but random rotations of the compass and bad readings of get compass angle can screw you up.
It can be done if you have a couple mid points on your route to the destination. I use DDTM paired with offset to make this work
so it looks like this
Mouse(ddtmx-10,ddtmy-10) for my first click then
Mouse(ddtmx+10,ddtmy+10) so I can move from just seeing the ddtm on one side of the screen to the just seeing it on the other side reducing the number of ddtm I need by about 1/3
Wanted
2008-07-22 23:04:18
From: king vash
I wrote air crafter this way once, it worked decently well it had two portions one moving four minimaps sizes and one moving 6 minimap sizes (so 5 clicks for one and 8 for the other)
It worked but random rotations of the compass and bad readings of get compass angle can screw you up.
It can be done if you have a couple mid points on your route to the destination. I use DDTM paired with offset to make this work
so it looks like this
Mouse(ddtmx-10,ddtmy-10) for my first click then
Mouse(ddtmx+10,ddtmy+10) so I can move from just seeing the ddtm on one side of the screen to the just seeing it on the other side reducing the number of ddtm I need by about 1/3
Compass detection is baddddd….
I would use reflection map angle detection backed up with a fully working DTM that finds the angle of walls.
Widget
2008-07-25 05:12:16
From: IceFire908
Compass detection is baddddd….
I would use reflection map angle detection backed up with a fully working DTM that finds the angle of walls.
If we're doing reflection for map angle why not just use tiles? >.<
Wanted
2008-07-25 14:19:55
From: Widget
If we're doing reflection for map angle why not just use tiles? >.<
As a fail safe, I thought we have been over this.
boberman
2008-08-09 16:34:05
I tried to impliment something like this in one of my scripts once. Here are the two problems I ran into.
1. the map streches ans scews ever so slightly.
2. the compass doesn't always line up with the way the map is pointed.
What I wanted to do is forget about the compass all together and focus on something like a path finding script. So rather then save angles you would follow the road to where you wanted to go.
Look up the A* algorithm to get an Idea of what I was thinking. I don't know if I can convey it very well.