SRL Archive - Research & Development Lounge

Arrow Walking


Abu

2012-05-21 16:32:14

Arrow Walking

Not sure why it's not been done. The steps are simple:
  • Open the map
  • Type in location
  • Pick an area to walk to - via symbols
  • Follow the blue arrow on the minimap
  • When destination reached, clear marker.

Not the best of walking methods but certainly great for long distances. Currently works flawlessly up until it has reached the destination - I then need it to find the arrow bitmap on the mainscreen and then proceed to clear the marker on the world map.

Here's what I have so far:
program ArrowWalk;
{$DEFINE SMART}
{$i srl\srl.simba}

{*
OpenMap
procedure OpenMap;

- Opens the World Map
*}

procedure OpenMap;
var
x, y: Integer;
MapBox: TBox;
MapTPA: TPointArray;
begin
MapBox := IntToBox(530, 130, 553, 151);
MapTPA := TPAFromBox(MapBox);
MiddleTPAEx(MapTPA, x, y);
MMouse(x, y, 0, 0);
WaitUptext('orld', 2000);
ClickMouse2(True);
Wait(4000);
WaitColorGoneIn(0, 390, 373, 448, 380, 5, 5000);
end;


{*
SelectLoc
procedure SelectLoc(loc: String);

- For 'loc' enter name of city such as Falador, Varrock etc...
*}

procedure SelectLoc(loc: String);
begin
TypeSend(loc);
end;



{*
SelectSymbol
procedure SelectSymbol(Symbol: String; xs, ys, xe, ye: Integer);

- symbol - enter the symbol, see symbol.simba for valid arguments
- Imagine a medium sized box around the symbol
- xs ys; top left hand corner of box around symbol
- xe ye; bottom right hand corner of box around symbol
*}


procedure SelectSymbol(Symbol: String; xs, ys, xe, ye: Integer);
var
x, y: Integer;
CrossBox: TBox;
CrossTPA: TPointArray;
begin
if FindSymbolIn(x, y, Symbol, xs, ys, xe, ye) then
begin
Mouse(x, y, 0, 0, True);
Mouse(x, y, 0, 0, True);
Mouse(x, y, 0, 0, True); // repetitive clicking needed to place marker
Wait(500);
CrossBox := IntToBox(740, 9, 755, 25);
CrossTPA := TPAFromBox(CrossBox);
MiddleTPAEx(CrossTPA, x, y)
Mouse(x, y, 0, 0, True);
end else
begin
Writeln('Couldn''t find symbol');
Exit;
end;
end;


{*
ArrowWalk
procedure ArrowWalk;

- Currently follows arrow till destination reached
- Need to work on method to recognise this
- And then finally clear the marker
*}

procedure ArrowWalk;
var
x, y: Integer;
begin
repeat
WaitFindColor(x, y, 13570055, MMX1, MMY1, MMX2, MMY2, 5, 2000);
Mouse(x, y, 0, 0, True);
FFlag(10);
until (False);
end;


begin
ClearDebug;

Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;

OpenMap;
SelectLoc('Falador');
Wait(500);
SelectSymbol('Bank', 394, 220, 511, 313);
Wait(500);
ArrowWalk;
end.


So far this should walk to Falador Bank from anywhere (f2p) - as long as it doesn't have to pass any barriers such as the Wilderness Wall and Al-Kharid Gate.

It also only walks until the destination is reached and then stops.

Currently, the procedures there can be improved and simplified, but they work for now so oh well :p

Feel free to give any input :)

i luffs yeww

2012-05-21 17:12:19

Typically the problem with something like this is that there's no obstacle detection. This is fine under rather controlled circumstances, but it can get itself into trouble rather often.

I'd like this if it dealt with obstacles, which isn't too simple of a task in runescape. At least not without having a whole map of rs to compare it to with obstacles very well defined.

Element17

2012-05-21 17:45:13

I believe Sin or Flight worked on something very similar to this and called it webwalking….I'll look for the thread and edit this if I can find it again. I like this idea.


**Edit
Flight suggested something very similar to this.

http://villavu.com/forum/showthread.php?t=64368&highlight=webwalking

Abu

2012-05-21 18:21:47

From: i luffs yeww
Typically the problem with something like this is that there's no obstacle detection. This is fine under rather controlled circumstances, but it can get itself into trouble rather often.

I'd like this if it dealt with obstacles, which isn't too simple of a task in runescape. At least not without having a whole map of rs to compare it to with obstacles very well defined.


And by obstacles you mean what exactly? It should be able to walk around walls very easily… it uses FFLag so it doesn't spam click and it will only search for the arrow again once it has gone all the way round a wall.

Though I can see how walking all the way round a wall can be a bit time-consuming.


From: 14578
I believe Sin or Flight worked on something very similar to this and called it webwalking….I'll look for the thread and edit this if I can find it again. I like this idea.


**Edit
Flight suggested something very similar to this.

http://villavu.com/forum/showthread.php?t=64368&highlight=webwalking


Wow that is freaky - he suggested exactly what I'm trying to achieve :blink:

Jokester

2012-05-21 18:26:04

He means like gated that have to be manually opened or things similar to this.

Abu

2012-05-21 18:31:20

From: Jokester
He means like gated that have to be manually opened or things similar to this.


Yeh I mentioned this in the OP, not sure how I could get round it…

Maybe I could add while..do loop around the arrow finding function, so that it searches for gates and doors while walking, but even that might not work :\

i luffs yeww

2012-05-21 18:38:51

I was also curious about large ares that you can walk through that put you completely out of your way; white wolf mountain/that place where the Oracle is, just west of the monastery. I think there are other places as well, just can't think of anything.

Maybe goblin village, as well. Could get into some annoying situations..

I'd say go ahead with this if you want, I just don't think there are too many practical uses. I think it's fine for short distances, but then there's really no need for it, as you can be running blind and it'd be just as effective, and not look as "botty" (opening up the minimap and placing a marker every time you run somewhere..).

Still, no reason not to mess around with any ideas that you're interested in. :)

Element17

2012-05-21 18:43:18

I don't think placing a marker looks like a bot, I use them all the time to make sure I am getting to where I need to go, granted I only do this once or twice while going to a new area or a place I don't visit very often.

i luffs yeww

2012-05-21 18:45:54

From: 14578
I don't think placing a marker looks like a bot, I use them all the time to make sure I am getting to where I need to go, granted I only do this once or twice while going to a new area or a place I don't visit very often.


Right, but if you're going from one place to another over and over and making a marker every time you go back and forth, it looks a bit less like a human, I'd say. ;)

Jokester

2012-05-21 18:56:10

You could just make it without obstacle checking and people could just use it to walk where they want but they would have to make sure there were no obstacles.

Element17

2012-05-22 00:17:16

From: i luffs yeww
Right, but if you're going from one place to another over and over and making a marker every time you go back and forth, it looks a bit less like a human, I'd say. ;)



Yes, yes. That I have to agree with ha.

@Jokester, if that is the case why couldn't they just use SPS, or radial walk or one of the many other methods of walking. I believe this is more of a long distance thing, so avoiding obstacles would be really hard or going around them would take to much time.

Abu

2012-05-22 03:10:38

Should I scrap this? I got many exams and I don't think I can afford to spend time on something that won't actually be of much use.

Main

2012-05-22 03:20:29

This is a good idea, but it'll probably be the best if you keep it on your own script instead. But if srl does choose to commit it then great:)

Its definitely useful.

John

2012-05-22 05:02:16

From: abu_jwka
Should I scrap this? I got many exams and I don't think I can afford to spend time on something that won't actually be of much use.

Don't scrap it, just postpone it until you have time ;)