# Schedule

Script
5.1 OC
bool
object obj Object in which the call is to be made. Can be `nil` for no object context.
string script Script to be executed.
int delay Delay after which the first call is made. If repeat is greather than 1, this is also the delay inbetween subsequent calls.
int repeat Number of calls. If 0 or not specified, the call is made exactly once.
Executes a specified script command after a specified delay.
This function is implemented in System.ocg using the effect "IntSchedule" in function eval.
Accordingly, the specified script can be a single command only. It may not contain multiple commands separated by ";".
Schedule(FindObject(Find_ID(Clonk)), "Explode(50)", 1000);
Makes a clonk explode after 1000 ticks delay.
Schedule(`nil`, "DoWealth(GetPlayerByIndex(0), 1)", 1, 100);
Gives one unit of money per frame to the first player for 100 frames. Notice that if the first player is eliminated, the donations will continue for the next (first) player, since the receiving player is determined anew in each execution.
ScheduleCall
PeterW
2005-08