Log in

View Full Version : Banking (SRL_ResetNavBar;)



Getdropped
10-26-2012, 11:32 PM
Umm well i was just messing around with an old script I had and I noticed that it would no longer bank and I found that if I changed the loggedin function I would work....

Here is my banking function:
procedure Bank;
var
FailSafe, SuperFailSafe : Integer;
BankPath : TPointArray;
begin
FailSafe := 0;
repeat
FindNormalRandoms;
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
OpenBankNPC;
Inc(FailSafe);
if (FailSafe > 5) and not(BankScreen) and not(PinScreen) then
begin
Writeln('Walking back to bank....');
WalkToBank;
end;
if (FailSafe > 10) and not(BankScreen) and not(PinScreen) then
begin
Writeln('Bank tele safe.');
LoadStone;
WalkToBank;
FailSafe := 0;
{Mouse(664, 81, RandomRange(-2, 2), RandomRange(-2, 2), true); }
end;
FindNormalRandoms;
until BankScreen or PinScreen; //or not(LoggedIn);
if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen; //or not(LoggedIn);
end;
if BankScreen then
begin
writeln('in');
Wait(RandomRange(200, 300));
InvMouse((Random(15) + 2), 0);
//Mouse(700, 315, 3, 3, Mouse_Right);
WaitOptionMulti(['ll', 'All'], 300);
Wait(RandomRange(200, 300));
CloseBank;
//Mouse(490, 60, RandomRange(-3, 3), RandomRange(-3, 3), Mouse_Left);
Wait(RandomRange(500, 700));
end;

end;

and here is what I changed in simba players to make it bank:
function LoggedIn: Boolean;
begin
//White text on Report Abuse Button
//SRL_ResetNavBar;
Result := (GetColor(472, 490) = 16777215);
end;

line 137

What happens is when i opens the bank it thinks you are not logged in because if the not(loggedin) are uncommented they trigger.... When i use my other scripts that I have it banks fine.... which is really odd.... this used to work.... I am banking at edgeville bank, it works fine without the reset of the nav bar so im not sure if this is a bug so just wanted to tell everyone before a million posts are put up with thisproblem... Any ideas?

~Getdropped :cool:

Ashaman88
10-26-2012, 11:37 PM
I had this problem in my scripts, but I'm not sure what causes it. Instead of taking the time to do that I wrote a waitloggedin function - Pretty much just waits to see if it's loggedin for however long you want. Since putting that in nobody has had that problem with my scripts. You can see it in any of my scripts

riwu
10-27-2012, 01:09 AM
Is there anything that could be covering up your NAV BAR at the top? Specifically the 's' of the Forums (used to be the 'H' of Home if you haven't update your SRL).
You could debug the error by adding this to the end of LoggedIn:
if not Result then
begin
writeln('FoundBar: ' + ToStr(FoundBar));
writeln('Color: ' + ToStr(GetColor(472, 490) = 16777215));
end;
Then you can find out which part went wrong.

Getdropped
10-27-2012, 01:24 AM
Is there anything that could be covering up your NAV BAR at the top? Specifically the 's' of the Forums (used to be the 'H' of Home if you haven't update your SRL).
You could debug the error by adding this to the end of LoggedIn:
if not Result then
begin
writeln('FoundBar: ' + ToStr(FoundBar));
writeln('Color: ' + ToStr(GetColor(472, 490) = 16777215));
end;
Then you can find out which part went wrong.

All my extensions are still up to date.... And all the points arnt covered at the time when it checks.... the R in "Report" and the H in "Home".... I just changed the code to:
(*
LoggedIn
~~~~~~~~

.. code-block:: pascal

function LoggedIn: Boolean;

Returns True if Logged in.

.. note::

by WT-Fakawi, Getdropped

Example:

.. code-block:: pascal

*)
function LoggedIn: Boolean;
begin
//White text on Report Abuse Button
if (GetColor(472, 490) = 16777215) then
begin
Result := true;
Exit;//no need to do anything to the navbar
end;
SRL_ResetNavBar;
Result := (GetColor(472, 490) = 16777215);
end;

because it is rather pointless to check for the nav bar when you already found the report button.... it would be more efficient