SRL Archive - RS3 Help

Long wait time after bankScreen.open


Fredecus

2014-12-15 23:11:48

This is my second day learning SRL and pascal script. I am working on a very simple function that opens the bank and withdraws the second preset by pressing the 2 key.

procedure withdrawItems();
begin
if not isLoggedin() then
exit;

if isLoggedin() then
begin
writeLn('1');
bankScreen.open(bankType);
wait(randomRange(300,750));
writeLn('2');
end;


if (bankScreen.isOpen()) then
begin
writeLn('3');
SendKeys('2', 300, 0);
end;
end;

My problem is that once the bank is open, there is up to a 10 second wait time before the '2' is selected. What is causing this wait time? I used writeLn's to see where it was hanging.

Again, just to be clear my script prints "1" in the debug, pauses for up to 10 seconds, then prints the "2", "3", and uses sendKeys quickly after.

akarigar

2014-12-15 23:17:32

From: Fredecus
This is my second day learning SRL and pascal script. I am working on a very simple function that opens the bank and withdraws the second preset by pressing the 2 key.

procedure withdrawItems();
begin
if not isLoggedin() then
exit;

if isLoggedin() then
begin
writeLn('1');
bankScreen.open(bankType);
wait(randomRange(300,750));
writeLn('2');
end;


if (bankScreen.isOpen()) then
begin
writeLn('3');
SendKeys('2', 300, 0);
end;
end;

My problem is that once the bank is open, there is up to a 10 second wait time before the '2' is selected. What is causing this wait time? I used writeLn's to see where it was hanging.

Again, just to be clear my script prints "1" in the debug, pauses for up to 10 seconds, then prints the "2", "3", and uses sendKeys quickly after.


Hey, if you just want to select the second preset and use the key, you can just do this:

bankScreen.clickButton(BANK_BUTTON_PRESET_2, true);

riwu

2014-12-15 23:30:51


bankScreen.open(bankType);
This is for opening the bank? So between debug 1 and 2 u are actually opening the bank?

Fredecus

2014-12-15 23:50:06

From: akarigar
Hey, if you just want to select the second preset and use the key, you can just do this:

bankScreen.clickButton(BANK_BUTTON_PRESET_2, true);


Thanks, I know about that way, I was just playing around with the different things.

EDIT: I actually just tried this again. It seems to attempt to withdraw preset 1 maybe 2/10 times.

From: riwu

bankScreen.open(bankType);
This is for opening the bank? So between debug 1 and 2 u are actually opening the bank?


Yes sorry I forgot that I changed that to a variable.

var
bankType : integer = BANK_NPC_BLUE

Yes between debug 1 and 2 I am opening the bank. Debug 2 does not print for up to 10 seconds after debug 1.