SRL Archive - Bugs

R_OpenBankBooth (pic)


doom0791

2011-03-06 04:50:49

If you get directly beside the bank booth (I believe in any bank) R_OpenBankBooth will get in an endless loop of failure because you cannot open a bank booth from the side.

For those interested, in Varrock East Bank, these are tiles:
[Tile(3250, 3419), Tile(3257, 3419)];


Harry

2011-03-06 05:28:01

So it chooses the option to open the bank, but then the RS client doesn't walk to it? Or what do you mean? I'll poke at it tomorrow but I'd like some more information about what happens; if it's mainly a reflection bug, or a Jagex/RS bug that simply goofs up reflection.

Bad Boy JH

2011-03-06 07:54:23

Well its a fairly simple solution, we make it choose the second closest bank booth, if its on either of those tiles.

Basicaly we have an array of tiles which cannot access the closest BankBooth, and then if GetMyPos returns any of those tiles we use the second closest bank booth, it allows us to change it later, if any more stupid positions like that get added…

Echo_

2011-03-06 08:26:59

I added this failsafe, now the bank function works just fine :)

  if (Bank = 'veb') or (Bank = 'varrock east') then
begin
if (GetMyPos = Tile(3250, 3419)) or (GetMyPos = Tile(3257, 3419)) then
begin
WalkToTile(Tile(3253, 3421), 1, 0);
end;
end;

So now the entire R_OpenBankBooth function looks like this:
{*******************************************************************************
Function R_OpenBankBooth(Bank : String): Boolean;
By: ss23 & TheGuyWhoGotOn
Description: Opens the bank using Bank Booth.
*******************************************************************************}
function R_OpenBankBooth(Bank : String) : Boolean;
var
Tiles: TPointArray;
P: TPoint;
Tries: Integer;
begin
Result := R_BankScreen or R_PinScreen;
if Result then Exit;

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)];
'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)];
'anb', 'ardougne north': Tiles := [Point(2618, 3331), Point(2619, 3331), Point(2614, 3331)];
'asb', 'ardougne south': Tiles := [Point(2656, 3286), Point(2656, 3283), Point(2656, 3280)];
'pc', 'pest control':
Tiles := [Point(2667, 2652), Point(2666, 2652), Point(2665, 2652),
Point(2668, 2652)];
'cw', 'castle wars': Tiles := [Point(2445, 3083)];
else
begin
SRL_Warn('R_OpenBankBooth', 'Unsupported bank name.', -1);
Exit;
end;
end;
SortTPAFrom(Tiles, GetMyPos);
if (DistanceFrom(Tiles[0]) > 3) or not TileOnMS(Tiles[0], 10) then
begin
if not(TileOnMM(Tiles[0])) then
begin
SRL_Warn('R_OpenBankBooth', 'Could not find Bank Booth.', 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_OpenBankBooth', 'Could get MS Point.', Warn_AllVersions);
Exit;
end;
end;

if (Bank = 'veb') or (Bank = 'varrock east') then
begin
if (GetMyPos = Tile(3250, 3419)) or (GetMyPos = Tile(3257, 3419)) then
begin
WalkToTile(Tile(3253, 3421), 1, 0);
end;
end;

P := TileToMS(Tiles[0], 10);
MMouse(p.x - 5, p.y - 5, 11, 11);
Wait(RandomRange(200, 300));
if IsUpTextMultiCustom(['ank', 'ooth']) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, false);
Wait(RandomRange(80, 110));
P.x := 0;
if R_ChooseOptionMulti(['Use-quickly']) then
repeat
R_Flag;
Wait(RandomRange(50, 90));
Inc(Tries);
if (Length(Players) > 0) then
if Players[CurrentPlayer].Pin <> '' then
Result := InPin(Players[CurrentPlayer].Pin);
Result := R_BankScreen or R_PinScreen;
until Result or (Tries > 40);
end else if IsUpTextMultiCustom(['ank', 'hest']) then //one-click bank chests
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, true);
Wait(RandomRange(80, 110));
P.x := 0;
repeat
R_Flag;
Wait(RandomRange(50, 90));
Inc(Tries);
if (Length(Players) > 0) then
if Players[CurrentPlayer].Pin <> '' then
Result := InPin(Players[CurrentPlayer].Pin);
Result := R_BankScreen or R_PinScreen;
until Result or (Tries > 40);
end;
end;

Edit: Sent a pull request to pyroryan on GitHub, maybe this will get officially added :D

Coh3n

2011-03-06 12:11:00

I hope so, I had this problem a couple times last night. :)

pyroryan

2011-03-06 14:04:18

From: Echo_

Edit: Sent a pull request to pyroryan on GitHub, maybe this will get officially added :D


I'm not the only one on there. But committed.

doom0791

2011-03-07 03:56:37

Yeah, I've been using the failsafe for my script, but I figure there are lots of scripts out there that use the same bank function.

And I believe its a RS client bug that just goofs up reflection. I'm not sure on how to explain it better than this:
If you click to open a bank booth and you're standing to the side, the client will not walk to the front of the bank booth (where it's openable from) so it will just sit there with the MM flag up attempting to open the bank booth.


Thank you, pyroryan!

Harry

2011-03-07 04:01:12

I can't load the RS client right now, but I think VEB is the only bank that has those "sides" on it. You should report the bug to Jagex and explain how to reproduce it and they'll probably fix it (but don't mention your bot was the one that discovered it ;P). Echo's fix was committed, and if that works fine then yay. If not, report back. Or if you find any other banks it happens at.

Echo_

2011-03-07 08:29:28

From: Harry
I can't load the RS client right now, but I think VEB is the only bank that has those "sides" on it. You should report the bug to Jagex and explain how to reproduce it and they'll probably fix it (but don't mention your bot was the one that discovered it ;P). Echo's fix was committed, and if that works fine then yay. If not, report back. Or if you find any other banks it happens at.


I think Jagex put those corners there on purpose, just makes it easier to find the bots when they get stuck.