SRL Archive - OSR Help

Can't get Deposit to work in 07


armthehomeless

2013-06-04 01:39:46

Having some issues banking. This function can open up the bank but instead of depositing it just finishes. I had some 'luck' by putting in a writeln before and after the Deposit(1, 27, False); Line and it seemed to work a few times then went back to not working. No idea if this is a bug or the more likely cause of something with my crap code..Any help would be very nice :)

Also please let me know if anything isn't as clear as it should be!

function BankItems(): Boolean;
var
x, y:Integer;
begin


result:= false;
if FindObjCustom(x, y, ['xxx'],[xxxxxx], 20) then
begin
MMouse(x, y, 7, 7);
if IsUpText('xxx') then
Mouse(x, y, 1, 1, false);
ChooseOption('Bank');
/////////Fails here?\\\\\\\\\\\\
Deposit(1, 27, False);
closeBank();
result:= true;
end;
end;

Haxz

2013-06-04 01:44:40

Maybe you're expecting it to open the bank too fast. After you click on banking option, there might be a few seconds that your character need to walk to the banker and a few milliseconds for bank screen to appear. If the bank screen is not there, deposit won't work.

You immediately called deposit right after clicking on the 'bank' option, which is quite impossible for bank screen to appear so fast.

Chris!

2013-06-04 03:33:32

From: armthehomeless
Having some issues banking. This function can open up the bank but instead of depositing it just finishes. I had some 'luck' by putting in a writeln before and after the Deposit(1, 27, False); Line and it seemed to work a few times then went back to not working. No idea if this is a bug or the more likely cause of something with my crap code..Any help would be very nice :)

Also please let me know if anything isn't as clear as it should be!

function BankItems(): Boolean;
var
x, y:Integer;
begin


result:= false;
if FindObjCustom(x, y, ['xxx'],[xxxxxx], 20) then
begin
MMouse(x, y, 7, 7);
if IsUpText('xxx') then
Mouse(x, y, 1, 1, false);
ChooseOption('Bank');
/////////Fails here?\\\\\\\\\\\\
Deposit(1, 27, False);
closeBank();
result:= true;
end;
end;


As said above, you should add a wait between the ChooseOption and Deposit. The reason it was working with the WriteLn in there was because the code has to execute the WriteLn before depositing, giving it some extra time to see the bank screen.

function BankItems(): Boolean;
var
x, y:Integer;
begin
result:= false;
if FindObjCustom(x, y, ['xxx'],[xxxxxx], 20) then
begin
MMouse(x, y, 7, 7);
if IsUpText('xxx') then
begin
Mouse(x, y, 1, 1, false);
ChooseOption('Bank');
Wait(RandomRange(1000, 2500)); //You always want some randomness. ;)
/////////Fails here?\\\\\\\\\\\\
Deposit(1, 27, False);
closeBank();
result:= true;
end;
end;
end;

armthehomeless

2013-06-04 15:58:47

The wait got it working! I tried putting a wait there earlier but I think it was only set to 500-300 and didn't actually help.