TomTuff
2011-07-24 14:16:35
[R_WithdrawX] Error withdrawing item.I get this error quite frequently when using R_WithdrawX() :( Any idea why this may be happening/how to fix it?E:
Looking at this piece of the code:
if (not (R_OptionExists('Withdraw-' + IntToStr(Amount)))) then
begin
Result := R_WaitOption('Withdraw-X', 3000);
MarkTime(T);
while(R_GetInterfaceText(752, 4) <> 'Enter amount:')do
begin
if(TimeFromMark(T) > 5000)then
begin
Result := False;
R_Debug('Could not enter amount.', 'R_WithdrawX');
Exit;
end;
wait(50+Random(50));
end;
wait(500+Random(1000));
TypeSend(ToStr(Amount));
end else
Result := R_WaitOption('Withdraw-' + IntToStr(Amount) + ' ' + Item.Name, 3000);It's strange this is happening. I'm attempting to withdraw 14 of the item, and that's already the number that has been previously chosen.I think this problem is due to lag.
As a proposed fix, add this to timing.simba:
function R_WaitOptionExists(Text: string; Time: Integer): Boolean;
var
T: Integer;
begin
T := GetSystemTime + Time;
while (GetSystemTime < T) and not(Result) do
Result := R_OptionExists(Text);
end;
and replace line 1022 in Bank.simba with
if (not(R_WaitOptionExists('Withdraw-' + IntToStr(Amount), 500))) then