SRL Archive - OSR Help

Is there a way to...


mcbrozu

2013-02-28 13:53:37

I've looked everywhere I can think of on these forums, and I cannot find the answer so now i'm asking you guys.

Is there a way to set up an action so it will only execute a specific number of times before terminating?

i.e withdrawing 10 items from bank, or buying 10 items from a store, chopping 10 trees, mining 10 ores?

Runehack123

2013-02-28 14:01:40

What exactly are you trying to do?
Yes you can withdraw 10 items from the bank if you looked at the include you would see how the function WithdrawEx works.
On the other hand, chopping 10 trees or mining 10 ores is completely different.
I would go about this by creating some sort of loop. Then everytime you chop a tree or mine an ore you can increase an integer variable within that loop. Make it loop through your loopy loopdi loop loop loopness (sorry :o) until your integer has reached a certain value.
Looking at InvCount might be easier though in that case.
May I ask what exactly you're trying to do?

tealc

2013-02-28 14:03:14

it a for loop


procedure ForToDoExample;
var
i: Integer;
begin
for i := 1 to 10 do // Notice the assignment mentioned earlier? The assignment is the ":="
begin
Wait(500);
WriteLn('The variable i = ' + IntToStr(i));
end;
end;
heres a tutorial look at the loops section
http://villavu.com/forum/showthread.php?t=58935

mcbrozu

2013-02-28 14:09:03

Ahh that makes a lot sense thanks.

I'm trying to make a script where it purchases feathers, goes and fishes, banks, and repeats buying the feathers. The issue was arrising when buying feathers as the price goes up quite significantly as they are being bought.

Runehack123

2013-02-28 14:45:41

From: bob_saget
it a for loop


procedure ForToDoExample;
var
i: Integer;
begin
for i := 1 to 10 do // Notice the assignment mentioned earlier? The assignment is the ":="
begin
Wait(500);
WriteLn('The variable i = ' + IntToStr(i));
end;
end;
heres a tutorial look at the loops section
http://villavu.com/forum/showthread.php?t=58935


Can be, but doesn't have to. You can use any loop all loop loopiness looop di doooopie looop nooopie dooopie works :o

mcbrozu

2013-02-28 15:26:29

Yeah I got that part working as intended now =D thanks for you're help, now to code the rest