SRL Archive - OSR Help

best banking produce to use for castle wars


randy marsh

2013-04-27 14:25:34

Hello im trying to make a oak chopper which will chop just outside of castle wars ,

im tying to find out what the best banking method would be as i never made or used banking before.


In the simba function list i get this options


(*
OpenBankChest
~~~~~~~~~~~~~

.. code-block:: pascal

function OpenBankChest(WhichBank): Boolean;

Opens the bank. Valid arguments are:
* SRL_BANK_SW (Soul Wars Bank)
* SRL_BANK_CW (Castle Wars Bank)
* SRL_BANK_B (Burthrope)

.. note::

Author: SRL Dev Team
Last Modified: 18/01/2012

Example:

.. code-block:: pascal

if OpenBankChest(SRL_BANK_SW) then
Withdraw(...);
*)
function OpenBankChest(WhichBank: Integer): Boolean;
begin
result := false;
if BankScreen or PinScreen then
begin
Result := True;
Exit;
end;

Result := OpenBankChestEdge(WhichBank);

end;



Or

(*
OpenBankChestEdge
~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function OpenBankChestEdge(Location: String): Boolean;

Opens the bank. Valid arguments are:
* SRL_BANK_SW (Soul Wars Bank)
* SRL_BANK_CW (Castle Wars Bank)
* SRL_BANK_B (Burthrope)
* SRL_BANK_GG (Gamer's Grotto)
* SRL_BANK_SP (Shantay Pass)

.. note::

Author: -daazndagger-
Last Modified: Jan 27th, 2013

Example:

.. code-block:: pascal

if OpenBankChestEdge(SRL_BANK_SW) then
Withdraw(...);
*)
function OpenBankChestEdge(Location: Integer): Boolean;
var
bo, i, l, c, z: Integer;
Info: TVariantArray;
Chests: TPointArray;
AChests: T2DPointArray;
UpText, ChooseOp: TStringArray;
B: TBox;
begin
result := false;
if (not LoggedIn) then
Exit;
if BankScreen or PinScreen then
begin
Result := True;
Exit;
end;
if Location = SRL_BANK_SP then
begin
UpText := ['Shantay', 'chest', 'tay che'];
ChooseOp := ['Open', 'pen Sh'];
end else
begin
UpText := ['Bank', 'chest', 'nk che'];
ChooseOp := ['Use', 'se'];
end;
{ 0 1 2 3 4 5 6 7 8 9 10 }
case Location of { Sort X Sort Y Color Tol Hue Sat Count SplitTPA? W H Compass}
SRL_BANK_SW : Info := [MSCX , MSCY, 10198185, 21, 0.08, 0.25, 50, True , 10, 10, 'w'];
SRL_BANK_CW : Info := [MSCX , MSCY, 10198185, 21, 0.08, 0.25, 50, True , 10, 10, 'n'];
SRL_BANK_B : Info := [MSCX , MSCY, 10198185, 21, 0.08, 0.25, 50, True , 10, 10, 'n'];
SRL_BANK_GG : Info := [MSCX , MSCY, 5921630, 9 , 0.47, 0.08, 50, True , 10, 10, 'n'];
SRL_BANK_SP : Info := [MSCX , MSCY, 6715270, 4 , 0.19, 0.29, 50, True , 10, 10, 'n'];

else
begin
srl_Warn('OpenBankChestEdge', 'Unknown bank: '+IntToStr(Location), warn_AllVersions); //will output loc as int (no longer string)
Exit;
end;
end;

MakeCompass(Info[10]);
//SetAngle(SRL_ANGLE_HIGH); //??
z := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Info[4], Info[5]);

FindColorsSpiralTolerance(Info[0], Info[1], Chests, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
ColorToleranceSpeed(z);
SetColorSpeed2Modifiers(0.2, 0.2);

{ Split to ATPA. }
if Info[7] then
AChests := SplitTPA(Chests, 3)
else
AChests := TPAtoATPA(Chests, 10);

Chests := [];

{ Go through ATPA. }
l := GetArrayLength(AChests) -1;
for i := 0 to l do
begin
{ Too few pixels. }
if (Length(AChests[i]) < Info[6]) then
Continue;

{ Too small TPA bounds. }
B := GetTPABounds(AChests[i]);
If ((B.X2 - B.X1) < Info[8]) Or ((B.Y2 - B.Y1) < Info[9]) Then
Continue;

Inc(bo);
SetArrayLength(Chests, bo);
Chests[bo-1] := MiddleBox(GetTPABounds(AChests[i]));

end;

SortTPAFrom(Chests, Point(Info[0], Info[1]));

l := GetArrayLength(Chests) -1;
for i := 0 to l do
begin

MMouse(Chests[i].X, Chests[i].Y, 3, 3);
if WaitUpTextMulti(UpText, 1000) Then
begin
GetMousePos(Chests[i].X, Chests[i].Y);
Case Random(9) of
0..7: Mouse(Chests[i].X, Chests[i].Y, 0, 0, mouse_left);
8: begin
Mouse(Chests[i].X, Chests[i].Y, 0, 0, mouse_right);
if not WaitOptionMulti(ChooseOp, 1000) then Exit;
end;
end;
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;



What would be a better option?

rj

2013-04-27 14:27:56

They are the same thing, the first one you posted checks if the bank screen is open

jelknab

2013-04-27 14:27:56

I usually just search for the glass colour of a bank, and when the uptext says something like: 'ooth' from 'Bank Booth' in it, I make it click.

It hasn't failed a single time yet.

randy marsh

2013-04-27 14:31:15

From: Officer Barbrady
They are the same thing, the first one you posted checks if the bank screen is open


Ok im being a dumb arse but will do i change the script, to input what chest location i will be using?



i.e //* SRL_BANK_CW (Castle Wars Bank)
i will be using the 2nd one..

rj

2013-04-27 14:34:15

From: randy marsh
Ok im being a dumb arse but will do i change the script to say what bank im using? i will be using the 2nd one..


function OpenBankChestEdge(Location: Integer): Boolean;

You put in put in which one you want to use

Opens the bank.  Valid arguments are:
* SRL_BANK_SW (Soul Wars Bank)
* SRL_BANK_CW (Castle Wars Bank)
* SRL_BANK_B (Burthrope)
* SRL_BANK_GG (Gamer's Grotto)
* SRL_BANK_SP (Shantay Pass)

randy marsh

2013-04-27 14:37:40

function OpenBankChestEdge( SRL_BANK_CW : Integer): Boolean;

like that?

rj

2013-04-27 14:47:41

From: randy marsh
function OpenBankChestEdge( SRL_BANK_CW : Integer): Boolean;

like that?


no like

OpenBankChestEdge(SRL_BANK_CW);