MEGS - This is the economy gamescript running on Midgard, a public OpenTTD server. It's a heavily changed version of https://openttd-polska.pl/Thread-Inne-Projekt-skrypt-New-World-Disorder

main.nut 678B

123456789101112131415161718192021222324252627282930313233
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. require ("nwd.nut");
  5. require ("ac.nut");
  6. class Manager extends GSController
  7. {
  8. function Start ();
  9. }
  10. function Manager::Start()
  11. {
  12. local modules = [];
  13. modules.push (NWD (this));
  14. modules.push (AC (this));
  15. foreach (v in modules)
  16. v.Init ();
  17. while (true)
  18. {
  19. while (GSEventController.IsEventWaiting ())
  20. {
  21. local e = GSEventController.GetNextEvent ();
  22. foreach (v in modules)
  23. v.OnEvent (e);
  24. }
  25. foreach (v in modules)
  26. v.OnLoop ();
  27. this.Sleep (74);
  28. }
  29. }