Abu
2012-05-21 16:32:14
Arrow Walking
Not sure why it's not been done. The steps are simple:
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:
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 :)
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 :)