Ross
06-07-2015, 10:48 PM
So here is the pretty reliable way that I walk with OGL. I use 3 relatively simple functions.
Simple wait while the flag texture is shown on the map.
procedure waitFlag;
begin
wait(250);
while (not ogl.getTextures(1275).isEmpty()) do
wait(500);
end;
Walks via tiles offset from player position.
function tileWalk(randomization: integer; offSetTiles: TPointArray): boolean;
var
rx, ry, i: integer;
begin
for i:=0 to high(offSetTiles) do
begin
rx := randomrange(-(randomization), randomization);
ry := randomrange(-(randomization), randomization);
mouse.click(minimap.getScreenPosition(minimap.getL ocalPosition().adjustposition(offsetTiles[i].x+rx, offsetTiles[i].y+ry)), 1);
if ((offSetTiles[i].y > 20) or (offSetTiles[i].y < -20)) or ((offSetTiles[i].x > 15) or (offSetTiles[i].x < -15)) then
wait(3500)
else
wait(1000);
waitflag;
end;
end;
Walks based on static icons on the minimap.
function iconWalk(randomization: integer; icon: glTextureArray; offSetTiles: TPoint): boolean;
var
rx, ry :integer;
begin
rx := randomrange(-(randomization), randomization);
ry := randomrange(-(randomization), randomization);
if icon.isEmpty() then
result:=false
else
begin
mouse.click(minimap.getScreenPosition(minimap.getL ocalPosition(icon[0]).adjustposition(offsetTiles.x+rx, offsetTiles.y+ry)), 1);
if ((offSetTiles.y > 20) or (offSetTiles.y < -20)) or ((offSetTiles.x > 15) or (offSetTiles.x < -15)) then
wait(3500)
else
wait(1000);
waitflag;
result:=true;
end;
exit(result);
end;
Sample code of the above could look something like this:
function walkToBank(): boolean;
begin
lodestoneTeleport;
pointWalk(2, [[-10, 5], [-15, 0], [-10, -3]]);
if (not iconWalk(1, ogl.getTextures([45052], [4668991]), [5, -1]) then
exit(false);
openBank();
end;
So to break it down, it would click a points on the minimap that are:
[left 10, down 5], [left 15, 0], [left 10, up 3] all with a randomness of 2 tiles (meaning it can go up, down, left, and/or right by a max of 2 tiles)
followed by clicking a point that is [right 5, down 1] of the icon texture of the bank, with a randomness of 1 tile, if the texture exists.
And that's it! Very simple. A couple of notes:
Use randomness liberally in areas where accuracy doesn't matter much
Use iconWalk() to make sure you stay on an exact path, it is much more accurate than tileWalk().
Use failsafes for iconWalk() in case it doesn't find the texture like I did above.
Remember not to offset points wider/higher than your minimap dimensions.
Set the number at the end of mouse.click() to 2 in either function to debug one point at a time, since 2 just hovers the mouse.
Simple wait while the flag texture is shown on the map.
procedure waitFlag;
begin
wait(250);
while (not ogl.getTextures(1275).isEmpty()) do
wait(500);
end;
Walks via tiles offset from player position.
function tileWalk(randomization: integer; offSetTiles: TPointArray): boolean;
var
rx, ry, i: integer;
begin
for i:=0 to high(offSetTiles) do
begin
rx := randomrange(-(randomization), randomization);
ry := randomrange(-(randomization), randomization);
mouse.click(minimap.getScreenPosition(minimap.getL ocalPosition().adjustposition(offsetTiles[i].x+rx, offsetTiles[i].y+ry)), 1);
if ((offSetTiles[i].y > 20) or (offSetTiles[i].y < -20)) or ((offSetTiles[i].x > 15) or (offSetTiles[i].x < -15)) then
wait(3500)
else
wait(1000);
waitflag;
end;
end;
Walks based on static icons on the minimap.
function iconWalk(randomization: integer; icon: glTextureArray; offSetTiles: TPoint): boolean;
var
rx, ry :integer;
begin
rx := randomrange(-(randomization), randomization);
ry := randomrange(-(randomization), randomization);
if icon.isEmpty() then
result:=false
else
begin
mouse.click(minimap.getScreenPosition(minimap.getL ocalPosition(icon[0]).adjustposition(offsetTiles.x+rx, offsetTiles.y+ry)), 1);
if ((offSetTiles.y > 20) or (offSetTiles.y < -20)) or ((offSetTiles.x > 15) or (offSetTiles.x < -15)) then
wait(3500)
else
wait(1000);
waitflag;
result:=true;
end;
exit(result);
end;
Sample code of the above could look something like this:
function walkToBank(): boolean;
begin
lodestoneTeleport;
pointWalk(2, [[-10, 5], [-15, 0], [-10, -3]]);
if (not iconWalk(1, ogl.getTextures([45052], [4668991]), [5, -1]) then
exit(false);
openBank();
end;
So to break it down, it would click a points on the minimap that are:
[left 10, down 5], [left 15, 0], [left 10, up 3] all with a randomness of 2 tiles (meaning it can go up, down, left, and/or right by a max of 2 tiles)
followed by clicking a point that is [right 5, down 1] of the icon texture of the bank, with a randomness of 1 tile, if the texture exists.
And that's it! Very simple. A couple of notes:
Use randomness liberally in areas where accuracy doesn't matter much
Use iconWalk() to make sure you stay on an exact path, it is much more accurate than tileWalk().
Use failsafes for iconWalk() in case it doesn't find the texture like I did above.
Remember not to offset points wider/higher than your minimap dimensions.
Set the number at the end of mouse.click() to 2 in either function to debug one point at a time, since 2 just hovers the mouse.