// It is also possible to register custom commands, that will be called in a similar way to the other bot commands, // such as /bot waypoint. These command functions will recieve a table that is filled with all the additional options // that were part of the command. // For example, if the user typed the following command into the games console // testme hi how are you // This testcommand function would be called, and the params variable would be a table that contains 4 items // These items can be referenced by a number, such as params[0], params[1], etc... // Script commands are an easy way to bind complex script functions to a command that can be executed from // the games console. /////////////////////////////////////////////////////////////////////////////// Commands["testme"] = function(_params) { print("Test Command"); foreach ( name and val in _params ) { print( val ); } }; /////////////////////////////////////////////////////////////////////////////// Commands["showweapons"] = function(_params) { print("Printing Weapon List"); foreach ( name and Id in WEAPON ) { print("Weapon " + name +" : id " + Id); } }; /////////////////////////////////////////////////////////////////////////////// Commands["showevents"] = function(_params) { print("Printing Event List"); foreach ( name and Id in EVENT ) { print("Event " + name +" : id " + Id); } }; /////////////////////////////////////////////////////////////////////////////// Commands["dumpglobals"] = function(_params) { print("Dumping Global functions, references and typefunctions"); dumpGlobals("globals_functions.gm", DUMP.FUNCTIONS); dumpGlobals("globals_references.gm", DUMP.REFERENCES); dumpGlobals("globals_typefunctions.gm", DUMP.TYPEFUNCTIONS); dumpGlobals("globals_all.gm", DUMP.ALL); dumpGlobals("globals_all2.gm"); }; /////////////////////////////////////////////////////////////////////////////// Commands["showscriptgoals"] = function(_params) { print("Printing Bot Script Goals"); foreach ( gameId and bot in BotTable ) { print(bot, bot.scriptgoal); } }; /////////////////////////////////////////////////////////////////////////////// Commands["mywpmode"] = function(_params) { ExecCommand("waypoint_view 1"); Util.EnableWaypointAutoSave( true, 20 ); }; /////////////////////////////////////////////////////////////////////////////// Commands["numthreads"] = function(_params) { allThreads = threadAllIds(); print("Number of threads", tableCount(allThreads)); }; /////////////////////////////////////////////////////////////////////////////// Commands["goal_exp"] = function(_params) { goallist = table(); GetGoals(goallist, 0, _params[0]); print("goal_exp"); foreach ( index and goal in goallist ) { print(index, goal, goal.GetName()); } }; /////////////////////////////////////////////////////////////////////////////// Commands["console"] = function( _params ) { if ( _params == "off" ) { status = false; } else { status = true; } EnableDebugConsole( status ); }; /////////////////////////////////////////////////////////////////////////////// Commands["debug"] = function( _params ) { if ( _params == "off" ) { status = false; } else { status = true; } Util.EnableBotDebug( status ); }; /////////////////////////////////////////////////////////////////////////////// Commands["skip"] = function() { Util.SetSkip(); }; /////////////////////////////////////////////////////////////////////////////// Commands["skipreset"] = function() { Util.ResetSkip(); }; /////////////////////////////////////////////////////////////////////////////// Commands["stopall"] = function() { Util.StopAllBots(); }; /////////////////////////////////////////////////////////////////////////////// Commands["startall"] = function() { Util.StartAllBots(); }; /////////////////////////////////////////////////////////////////////////////// // // This is a Game Monkey Script function that creates a thread using the function we defined above. // Uncomment the following line if you want to run the function above. //thread(stresstest); Commands["stresstest"] = function() { thread( Util.StressTest ); }; /////////////////////////////////////////////////////////////////////////////// Commands["dg"] = function( _params ) { Util.DisplayGoal( _params[ 0 ], _params[ 1 ] ); }; /////////////////////////////////////////////////////////////////////////////// Commands["dwon"] = function() { EnableDebugWindow( 1 ); }; /////////////////////////////////////////////////////////////////////////////// Commands["dwoff"] = function() { EnableDebugWindow( 0 ); }; /////////////////////////////////////////////////////////////////////////////// Commands["kt"] = function( _params ) { Util.KillTeam( _params[ 0 ] ); }; /////////////////////////////////////////////////////////////////////////////// Commands["showentityinfo"] = function() { Util.ShowEntityInfo(); }; /////////////////////////////////////////////////////////////////////////////// Commands["sei"] = function() { Util.ShowEntityInfo(); }; /////////////////////////////////////////////////////////////////////////////// Commands["sg"] = function( _params ) { Util.SetGoal( _params[ 0 ], _params[ 1 ] ); }; /////////////////////////////////////////////////////////////////////////////// Commands["cg"] = function( _params ) { Util.ClearGoal( _params[ 0 ], _params[ 1 ] ); };