Fwd Motion
2012-02-10 19:50:41
So I noticed that the compass would change depending on which bank you were at when using OpenBankChest, but this is not the case for OpenBankFast. I noticed that many banks will require a different compass direction rather than just 'N'. So I put in the directions that are required for most banks, I didn't do anything with the gnome banks, because I'm not sure which direction is required for those. I also made it so that the Varrock west bank parameter creates a random compass direction of either 'E' or 'W'(This might need to stay 'N').
So the compass direction has become "Info[10]".
I also added numbering at the top to make it more convenient for future editors.
Have a look at it and tell me what you think.
(I'm not totally sure this is even 100% necessary, I was just looking for another way to contribute :P)
So the compass direction has become "Info[10]".
I also added numbering at the top to make it more convenient for future editors.
Have a look at it and tell me what you think.
(*
OpenBankFast
~~~~~~~~~~~~
.. code-block:: pascal
function OpenBankFast(Location: String): Boolean;
Opens the bank.
Valid arguments are:
'feb', 'falador east bank'
'fwb', 'falador west bank'
'veb', 'varrock east bank'
'vwb', 'varrock west bank'
'db' , 'draynor bank'
'akb', 'al-kharid bank'
'eb' (Edgeville Bank)
'ctb', 'catherby bank'
'clt', 'camelot bank'
'nab', 'north ardougne bank'
'sab', 'south ardougne bank'
'ynb', 'yanille bank'
'ngb', 'north gnome bank'
'sgb', 'south gnome bank'
'wgb', 'warrior guild bank'
'fgb', 'fishing guild bank'
'tavb', 'taverly bank'
.. note::
Author: Wizzup? and Nielsie95
Last Modified: Unknown
Example:
.. code-block:: pascal
if OpenBankFast('feb') then
Withdraw(...);
*)
function OpenBankFast(Location: String): Boolean;
var
bo, i, l, c, z, vwbint: Integer;
Info: TVariantArray;
Booths: TPointArray;
ABooths: T2DPointArray;
UpText: TStringArray;
B: TBox;
vwbstring:String;
begin
result := false;
if (not LoggedIn) then
Exit;
if BankScreen or PinScreen then
begin
Result := True;
Exit;
end;
UpText := ['Bank booth', 'ank boo'];
{ 0 1 2 3 4 5 6 7 8 9 10 }
case LowerCase(Location) of { Sort X Sort Y Color Tol Hue Sat Count SplitTPA? W H Compass}
'akb', 'al kharid': Info := [MSCX - 50, MSCY, 11196157, 20, 0.20, 1.15, 100, False, 10, 10, 'W']; // Fixed 12/7, #40
'lb', 'lumbridge': Info := [MSCX, MSCY - 50, 6780805, 10, 0.19, 0.27, 100, False, 10, 10, 'N']; // Fixed 12/7, #40
'veb', 'varrock east': Info := [MSCX, MSCY + 50, 3037545, 5, 0.41, 1.32, 100, False, 10, 10, 'S']; // Fixed 12/7, #40
'vwb', 'varrock west': begin vwbint := random(10); case vwbint of 0..5: vwbstring := 'E'; 6..10 : vwbstring := 'W'; end;
Info := [MSCX, MSCY, 3037545, 5, 0.41, 1.32, 100, False, 10, 10, vwbstring]; // Fixed 12/7, #40
end;
'feb', 'falador east': Info := [MSCX, MSCY + 50, 5008519, 10, 0.22, 0.67, 100, False, 10, 10, 'S']; // Fixed 12/7, #40
'fwb', 'falador west': Info := [MSCX, MSCY + 50, 5074569, 15, 0.22, 0.67, 50, False, 10, 10, 'S']; // Fixed 12/7, #40
'db', 'draynor': begin UpText := ['ount', 'unte', 'oun', 'unter'];
Info := [MSCX - 50, MSCY, 5136741, 5, 0.73, 0.49, 15, False, 10, 10, 'W']; // Fixed 12/7, #40
end;
'eb', 'edgeville bank': Info := [MSCX + 20, MSCY, 3561835, 20, 0.32, 0.61, 50, False, 10, 10, 'E']; // Fixed 12/7, #40
'ctb', 'catherby bank': Info := [MSCX, MSCY, 3239049, 8, 0.20, 0.20, 100, False, 10, 10, 'N'];
'clt', 'camelot bank': Info := [MSCX, MSCY, 7636882, 5, 0.20, 0.20, 100, False, 10, 10, 'N'];
'nab', 'north ardougne bank': Info := [MSCX, MSCY, 4084572, 5, 0.20, 0.20, 100, False, 10, 10, 'S'];
'sab', 'south ardougne bank': Info := [MSCX, MSCY, 4084572, 5, 0.20, 0.20, 100, False, 10, 10, 'E'];
'ynb', 'yanille bank': Info := [MSCX, MSCY, 3239049, 7, 0.20, 0.20, 100, False, 10, 10, 'E'];
'ngb', 'north gnome bank': Info := [MSCX, MSCY, 3239049, 7, 0.20, 0.20, 100, False, 10, 10, 'N'];
'sgb', 'south gnome bank': Info := [MSCX, MSCY, 3239049, 7, 0.20, 0.20, 100, False, 10, 10, 'N'];
'wgb', 'warrior guild bank': Info := [MSCX, MSCY, 2578286, 7, 0.20, 0.20, 100, False, 10, 10, 'W'];
'fgb', 'fishing guild bank': Info := [MSCX, MSCY, 2908796, 10, 0.20, 0.20, 100, False, 10, 10, 'W'];
'tavb', 'taverly bank': begin UpText := ['ount','unte','oun','unter'];
Info := [MSCX, MSCY, 3556433, 7, 0.20, 0.20, 100, False, 10, 10, 'W'];
end;
else
begin
srl_Warn('OpenBankFast', 'Unknown bank: '+Location, warn_AllVersions);
Exit;
end;
end;
MakeCompass(Info[10]);
z := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Info[4], Info[5]);
FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
ColorToleranceSpeed(z);
SetColorSpeed2Modifiers(0.2, 0.2);
{ Split to ATPA. }
if Info[7] then
ABooths := SplitTPA(Booths, 1)
else
ABooths := TPAtoATPA(Booths, 10);
Booths := [];
{ Go through ATPA. }
l := GetArrayLength(ABooths) -1;
for i := 0 to l do
begin
{ Too few pixels. }
if (Length(ABooths[i]) < Info[6]) then
Continue;
{ Too small TPA bounds. }
B := GetTPABounds(ABooths[i]);
If ((B.X2 - B.X1) < Info[8]) Or ((B.Y2 - B.Y1) < Info[9]) Then
Continue;
Inc(bo);
SetArrayLength(Booths, bo);
Booths[bo-1] := MiddleTPA(ABooths[i]);
end;
SortTPAFrom(Booths, Point(Info[0], Info[1]));
l := GetArrayLength(Booths) -1;
for i := 0 to l do
begin
MMouse(Booths[i].X, Booths[i].Y, 3, 3);
if WaitUpTextMulti(UpText, 1000) Then
begin
GetMousePos(Booths[i].X, Booths[i].Y);
Mouse(Booths[i].X, Booths[i].Y, 0, 0, mouse_left);
FFLag(0);
MarkTime(c);
repeat
Wait(100);
until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 10000);
Wait(Random(300));
if (HowManyPlayers > 0) then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
if (Result) then Exit;
end;
end;
end;(I'm not totally sure this is even 100% necessary, I was just looking for another way to contribute :P)