**BANNED The Man
2011-02-13 08:28:48
{*******************************************************************************
Function R_AtBank(Bank : String): Boolean;
By: Dynamite
Description: Will result true if at specified bank.
*******************************************************************************}
function R_AtBank(Bank : String) : Boolean;
var
Tiles: TPointArray;
P: TPoint;
Tries: Integer;
begin
case LowerCase(Bank) of
'veb', 'varrock east':
Tiles := [Point(3251,3419), Point(3252,3419), Point(3253,3419),
Point(3254,3419), Point(3255,3419), Point(3256,3419)];
'vwb', 'varrock west':
Tiles := [Point(3190,3435), Point(3190,3437), Point(3190,3439),
Point(3190,3441), Point(3190,3443), Point(3181,3444),
Point(3181,3442), Point(3181,3440), Point(3181,3438),
Point(3181,3436)];
'falador west', 'fwb':
Tiles := [Point(2945,3367), Point(2946,3367), Point(2947,3367),
Point(2948,3367)];
'falador east', 'feb':
Tiles := [Point(3010,3354), Point(3011,3354), Point(3012,3354),
Point(3013,3354), Point(3014,3354), Point(3015,3354)];
'lumbridge', 'lb':
Tiles := [Point(3208,3221)];
'draynor', 'db':
Tiles := [Point(3091,3245), Point(3091,3243), Point(3091,3242)];
'al kharid', 'akb':
Tiles := [Point(3268,3168), Point(3268,3167), Point(3268,3166),
Point(3268,3169), Point(3268,3164)];
'seb', 'seers':
Tiles := [Point(2729,3494), Point(2728,3494), Point(2727,3494),
Point(2724,3494), Point(2722,3494), Point(2721,3494)];
'ctb', 'catherby':
Tiles := [Point(2807,3442), Point(2809,3442), Point(2810,3442),
Point(2811,3442)];
'eb', 'edgeville':
Tiles := [Point(3095,3489), Point(3095,3491), Point(3095,3493),
Point(3097,3495)];
'cb', 'catherby':
Tiles := [Point(2807, 3442), Point(2809, 3442), Point(2810, 3442), Point(2811, 3442)];
'fgb', 'fishing guild':
Tiles := [Point(2584, 3423), Point(2584, 3422)];
'mc', 'moonclan':
Tiles := [Point(2098, 3920), Point(2097, 3920), Point(2098, 3920)];
'yb', 'yanille':
Tiles := [Point(2614, 3094), Point(2614, 3092), Point(2614, 3091)];
'da', 'duel arena': Tiles := [Point(3381, 3269), Point(3382, 3270)];
'asb', 'ardougne south': Tiles := [Point(2656, 3286), Point(2656, 3283)];
'pc', 'pest control':
Tiles := [Point(2667, 2652), Point(2666, 2652), Point(2665, 2652),
Point(2668, 2652)];
else
begin
SRL_Warn('R_AtBank', 'Unsupported bank name.', -1);
Exit;
end;
end;
SortTPAFrom(Tiles, GetMyPos);
if (DistanceFrom(Tiles[0]) > 4) or not TileOnMS(Tiles[0], 10) then
begin
if not(TileOnMM(Tiles[0])) then
begin
SRL_Warn('R_AtBank', 'Not At '+Bank, Warn_AllVersions);
Exit;
end;
WalkToTile(Tiles[0], 0, 0);
Wait(50);
R_Flag;
Wait(RandomRange(100, 200));
end;
if not(TileOnMS(Tiles[0], 10)) then
begin
SetAngle(True);
MakeCompass('n');
Wait(RandomRange(200, 400));
if not(TileOnMS(Tiles[0], 10)) then
begin
SRL_Warn('R_AtBank', 'Couldnt get MS Point.', Warn_AllVersions);
Exit;
end;
end;
Result := DistanceFrom(Tiles[0]) =< 4;
end;If you are within 4 tiles of one of the bank tiles specified it will result true, else false.
-Boom