SC2Mapster.com
Maps
Assets
Teams
Authors
Forums
Wiki
Paste
Sign in
Register new account
SC2Mapster.com Wiki
SC2 API
/
Functions
/
Wait
r4
Source
Markup:
<<apifunction>> <<name>>Wait<</name>> <<description>> <<code>>void Wait (fixed seconds, int timezone);<</code>> Pause the current trigger without blocking. When called, the trigger is being executed in a separate thread not to block the rest of the scripts. The main use of this function is to wrap it with a ##while (1)## in order to have a script executed every X seconds. <</description>> <<param fixed seconds>>Number of seconds to wait<</param>> <<param int timezone>>Timezone used. Can be one of * 0: Game * 1: Real * 2: AI There is no difference in timing between those 3 values in the beta at the moment. Maybe Real won't take in account the Pause, Game will be affected by the speed (Fastest, Slow ...) and AI by the APM?<</param>> <<example Run script every X seconds>> // Define the trigger function bool TriggerTiming (bool checkConds, bool doActions) { while (1) { // Do something every 5 seconds Wait(5, 0); } } // Create a new trigger based off the function trigger t = TriggerCreate("TriggerTiming"); // Run it at map initialization TriggerAddEventMapInit (t); <</example>> <<seealso>>TriggerAddEventMapInit <</seealso>> <<seealso>>AIGetTime<</seealso>> <</apifunction>>
Markup Type:
The type of markup for this entry.
Click here for details
.
BBCode
Markdown
Plain Text
WikiCreole