SRL Archive - OSR Help

My script won't bank :( Please help


IceTruckKiller

2013-03-30 17:33:01

Ok here is my code, No idea why but it won't bank, it doesn't even open the bank.

Here is my source code and the method where I think it's causing the problem

program EnchantingSapphire;

{$DEFINE SMART8}
{$I SRL-OSR/SRL.simba}
{$i srl/srl/skill/magic.simba}
var
i,x:integer;
const
LVL_1_ENCHANT = 5;
procedure CastSpell(NAME: Integer);
begin
if (not inRange(name, 0, 62)) and (not GameTab(Tab_Magic)) then
Exit;
Mouse((570 + (name mod 7) * 24), (238 + (name div 7) * 24), 6, 6, Mouse_Left);
end;

procedure enchant;
var
i: Integer;
begin
Ftab(tab_Magic);//selects the magic tab, using F keys
for i:= 2 to 28 do //loops to do each inventory item
begin
CastSpell(LVL_1_ENCHANT); //finds the spell name and clicks on it once
Writeln('Casting spell');
Wait(RandomRange(100, 350));
InvMouse((i), 1); //clicks the invent slot (i = invent slot and 1 is the input click)
Wait(RandomRange(1200, 1500));
end;
Writeln('Finished Enchanting');
end;

procedure doBank();
begin
Wait(RandomRange(350, 1000));
writeln('Banking');
if OpenBank('wvb', True, False) then
begin
Wait(RandomRange(1000, 1700));
Deposit(2,28,True)
Wait(RandomRange(600, 1300));
WithdrawEx(8,1,27,['apphire race','ace','re ac']);
Wait(RandomRange(750, 1235));
writeln('Finished Banking');
CloseBank; //closes bank
end;
end;

begin
SetupSRL;
activateclient;
ClearDebug;
writeln('Start script with a full inv of un-enchanted braces, runes in slot 1 ');
x:=0
while x<1000 do
begin
enchant();
doBank();
x:=x+1;
end;
end.

All help is greatly appreciated.

SeanStar

2013-04-02 02:24:22

Hmmm…
if OpenBank('wvb', True, False) then

wvb? Don't you mean vwb? (Varrock West Bank)

And if that doesn't fix it, I'm going to guess that OpenBank hasn't been patched in the SRL-OSR include yet, so it's trying to find the EoC version of the bank booth. Keep in mind that the include isn't finished, it will be released when it is. Until then, you could make your own bank booth object finding function?