SRL Archive - OSR Help

Quick question


DionHacker

2012-10-28 14:25:39

Hi, I am kinda new to scripting, I've done alot of tutorials but I am trying to work out a little thing with InvCount.
How do i make it so the script will go to the bank if there is nothing in the inventory?

I tried to make it so the script delivers some text if there is nothing there, but when I start the script it displays the message even if there is stuff in the inventory.

:o so far I have:
begin
SetupSRL;
If InvCount = 0 Then;
begin
WriteLn('No More Logs'); // Will change this to banking later
end;
LogsUnBurnto;
Repeat
Wait(6000);
LogsToBurno;
Until(InvCount = 0);
end.


Oh, and yes, I did try googling it ): and searching it, but all the InvCount's there were not what I needed.

Thanks for your help :)

Master BAW

2012-10-28 14:28:34

try this:

begin
SetupSRL;
If InvCount = 0 Then // you did a ; here, which you shouldn't do after 'then'.
begin
WriteLn('No More Logs'); // Will change this to banking later
end;
LogsUnBurnto;
Repeat
Wait(6000);
LogsToBurno;
Until(InvCount = 0);
end.

And to open a bank you have to call a OpenBank function, I don't know which one but it should be one of these:

* OpenBank
* OpenBankChest
* OpenBankChestEdge
* OpenBankFast
* OpenBankNPC
* OpenBankQuiet

Or you could of course make your own bank opening function or change one of these.

DionHacker

2012-10-28 14:35:28

What a silly mistake ): lol

Thanks so much :)

Roflme

2012-10-29 17:01:08

I'm assuming you want to firemake? Judging by the name "Logs to Burn"?


You could do:



// Something to begin the fire

repeat
// Insert failsafes, waits, etc. You will want to make sure that
// if the fire goes out and there's still logs it'll make another fire, or
// whatever you may want to check for.
until InvCoult=0


// Whatever procedures/functions you want to do after Inv is empty.
// Like Walking to Bank
// Then Banking
// Then Walking to the spot
// Then restarting the fire, etc.