Loading

Paste #pijrjcpdk

  1. class MyNewAI extends AIController
  2. {
  3.  
  4.   function Start()
  5.   {
  6.     //This function is inside the class declaration.
  7.   }
  8.    
  9.   //These are optional prototypes. Notice the ; at the end rather than {}.
  10.   //Squirrel doesn't require it, but some programmers like to use them.
  11.   function Save();
  12.   function Load(version, data);
  13. }
  14.  
  15. function MyNewAI::Save()
  16. {
  17.    //This function is outside the class declaration and requires the name of the class so squirrel can assign it to the right place.
  18. }
  19.  
  20. function MyNewAI::Load(version, data)
  21. {
  22. }
  23.  
  24. function MyNewAI::Start()
  25. {
  26.   while (true) {
  27.     AILog.Info("I am a very new AI with a ticker called MyNewAI and I am at tick " + this.GetTick());
  28.     this.Sleep(50);
  29.   }
  30. }

Comments