Quote:
Originally Posted by Tectronus
This is beond awesome TDW.... Good news.. Great work!
|
Automation just made a turn to being even more powerful. Anything you can do in a script, and I mean anything, you can do in a custom command. You define a custom command like so:
# a TC command
class AutomationTCCommand( TDWAutomation.AutomationScriptInFile.BaseAutomatio nCommandUndefined ):
def Initialize( self ):
self.complete = True
def Execute( self ):
Menu.TimeCompression = self.param1
return self.complete
then your custom command has to be added to the undefined commands so Automation will recognize it:
# these are commands either made by user or not defined in commands.cfg
# these commands will use the BaseAutomationCommandUndefined class
#
undefinedcommands = [
[ "Set_Time_Compression", AutomationTCCommand ]
#,[ "Loop", AutomationLoopCommand ]
]
Once defined and 'registered' with undefinedcommands you are free to use those commands in your automation script!
Now those that are unfamiliar with programming and classes will not see the great power I have given here. What I've done is allowed you all to extend the commands Automation 'knows' and the commands in the game by defining custom commands. These custom commands can only be used currently in Automation but there's no reason they couldn't be used outside of it also (with some supporting code).