Loading

Paste #pciylxx8w

  1. import("Library.SCPLib", "SCPLib", 45);
  2. import("Library.SCPClient_CompanyValue", "SCPClient_CompanyValue", 1);
  3. //require("scp.nut");
  4.  
  5. class LuDiAIAfterFix extends AIController {
  6.     scp = null;
  7.     scptile = null;
  8.     cvgs = null;
  9.  
  10.     function Start();
  11. }
  12.  
  13.  
  14. function LuDiAIAfterFix::Start() {
  15.  
  16.     this.scp = SCPLib("LDAF", 8);
  17.     this.scp.SCPLogging_Info(true);
  18.     this.scp.SCPLogging_Error(true);
  19.     this.scptile = this.scp.SCPGetCommunicationTile();
  20.     this.cvgs = SCPClient_CompanyValue(this.scp);
  21.  
  22.     while (AIController.Sleep(1)) {
  23.         // Read incoming SCP messages (up to 5 per loop)
  24.         if (this.scp != null) {
  25.             this.scp.SCPLogging_Info(true);
  26.             for (local j = 0; j < 5 && this.scp.Check(); j++){}
  27.             if (cvgs.IsCompanyValueGSGame()) {
  28.                 AILog.Info("This is a Company Value GS game!");
  29.             } else {
  30.                 AILog.Info("This is not a Company Value GS game!")
  31.             }
  32.         }
  33.     }
  34. }

Comments