bin/ai/SQNoAI/main.nut
branchnoai
changeset 9444 fd27df7ca2a0
parent 9441 03da911c8d5f
child 9449 8b688e6517d0
--- a/bin/ai/SQNoAI/main.nut	Fri Mar 16 21:35:01 2007 +0000
+++ b/bin/ai/SQNoAI/main.nut	Fri Mar 16 22:00:07 2007 +0000
@@ -6,6 +6,7 @@
 	industry = null;
 	map      = null;
 	town     = null;
+	stop     = false;
 
 	constructor() {
 		this.base = AIBase();
@@ -17,14 +18,15 @@
 	}
 
 	function Start();
+	function Stop();
 }
 
 /* Define the GameLoop. This is called every tick. */
 function SQNoAI::Start()
 {
-	while (true) {
+	while (!this.stop) {
 		print("Look at me!" + this.GetTick());
-		this.Sleep(5);
+		this.Sleep(50);
 	}
 	return;
 	if (this.GetTick() == 1) {
@@ -76,6 +78,10 @@
 	}
 }
 
+function SQNoAI::Stop()
+{
+	this.stop = true;
+}
 
 class FSQNoAI extends AIFactory {
 	function GetAuthor()      { return "OpenTTD Dev Team"; }