I'll try.
Function SomeFunction() ; This should be what causes the OnUpdate to fire. registerForUpdate(1) ; This makes the OnUpdate actually run, you decide how many seconds between each run - in this case one second.EndFunctionEvent OnUpdate() ; Here you put the code that you want to repeat once every second.EndEvent
So what it does is loop through the actions within the event once every X seconds (where X is the number you specify when registering for update.)
It will keep looping like this until you unregister, using: "UnregisterForUpdate()" within the OnUpdate() -event.
Looping is "risky business": if you forget to unregister (end/break the loop) it will keep looping forever and slow down your computer a lot.
I prefer using "RegisterForSingleUpdate(1)", as explained in this example:
Function StartChain() RegisterForSingleUpdate(1) ; Give us a single update in one secondendFunctionEvent OnUpdate() bool bkeepUpdating = true ; Do stuff here, and update the bkeepUpdating variable depending on whether you want another update or not if bkeepUpdating RegisterForSingleUpdate(1) endIfendEvent
This way you will run the "OnUpdate()" only once, then check if "bkeepUpdating" == true. If it is, it runs "OnUpdate()" again, and makes another check - and continues to do so, until "bkeepUpdating" == false; which breaks the loop.
"bkeepUpdating" could be replaced with a global variable, and be controlled from several other scripts, if you wish. -Making it easier to break the loop as a "safety feature".
Sources:
http://www.creationkit.com/OnUpdate_-_Form
http://www.creationkit.com/RegisterForSingleUpdate_-_Form
http://www.creationkit.com/UnregisterForUpdate_-_Form