<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://x-lexikon.bosl.info/index.php?action=history&amp;feed=atom&amp;title=Selbstausf%C3%BChrende_Scripts</id>
	<title>Selbstausführende Scripts - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://x-lexikon.bosl.info/index.php?action=history&amp;feed=atom&amp;title=Selbstausf%C3%BChrende_Scripts"/>
	<link rel="alternate" type="text/html" href="https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;action=history"/>
	<updated>2026-04-09T08:55:50Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in X-Lexikon</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=48129&amp;oldid=prev</id>
		<title>Boronenherrscher am 25. August 2011 um 19:26 Uhr</title>
		<link rel="alternate" type="text/html" href="https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=48129&amp;oldid=prev"/>
		<updated>2011-08-25T19:26:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 25. August 2011, 21:26 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Zeile 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{TutorialBar2|[[Globale und lokale Variablen]]| &quot;[[X3:Terran Conflict Scripting-Tutorial]]&quot;|[[Arrays]]}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{TutorialBar2|[[Globale und lokale Variablen]]| &quot;[[X3&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:Terran Conflict Scripting-Tutorial|X³&lt;/ins&gt;: Terran Conflict Scripting-Tutorial]]&quot;|[[Arrays]]}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Es ist eigentlich bei fast jedem Scriptpaket notwendig, ein Script zu haben, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dass &lt;/del&gt;sich selbst bei Spielbeginn ausführt. Sonst würde keines der Scripte in diesem Scriptpaket &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wahrscheinlich &lt;/del&gt;je ausgeführt werden. Zudem ist es sehr schlecht, dem Benutzer des Scripts später erst einmal erklären zu müssen, wie man ein Script überhaupt aufruft.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Es ist eigentlich bei fast jedem Scriptpaket notwendig, ein Script zu haben, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;das &lt;/ins&gt;sich selbst bei Spielbeginn ausführt. Sonst würde &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wahrscheinlich &lt;/ins&gt;keines der Scripte in diesem Scriptpaket je ausgeführt werden. Zudem ist es sehr schlecht, dem Benutzer des Scripts später erst einmal erklären zu müssen, wie man ein Script überhaupt aufruft.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ob Scripte sich selbst ausführen, hängt von ihrem Namen, bzw. von dessen Präfix ab. Folgende Präfixe führen zu einem selbstausführenden Script:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ob Scripte sich selbst ausführen, hängt von ihrem Namen, bzw. von dessen Präfix ab. Folgende Präfixe führen zu einem selbstausführenden Script:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Zeile 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Wichtige Hinweise==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Wichtige Hinweise==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nur einmal ausführen===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nur einmal ausführen===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys. &amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Wie klappt das?====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Wie klappt das?====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim ersten Mal ergibt die Abfrage nicht &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039;, sondern &#039;&#039;&#039;&quot;null&quot;&#039;&#039;&#039;, da es die &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Globale &lt;/del&gt;Variable am Anfang noch gar nicht gibt. Anschließend wird die &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Globale &lt;/del&gt;Variable auf &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039; gesetzt.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim ersten Mal ergibt die Abfrage nicht &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039;, sondern &#039;&#039;&#039;&quot;null&quot;&#039;&#039;&#039;, da es die &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;globale &lt;/ins&gt;Variable am Anfang noch gar nicht gibt. Anschließend wird die &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;globale &lt;/ins&gt;Variable auf &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039; gesetzt.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim nächsten Mal ergibt die Abfrage &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da die globale Variable ja eben auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt wurde. Somit wird das ganze nur einmal ausgeführt, es sei denn, ein anderes Script verändert den Wert der globalen Variable wieder.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim nächsten Mal ergibt die Abfrage &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da die globale Variable ja eben auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt wurde. Somit wird das ganze nur einmal ausgeführt, es sei denn, ein anderes Script verändert den Wert der globalen Variable wieder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Zeile 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nicht zu lange dauern===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nicht zu lange dauern===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Wichtig ist auch, dass alle selbstausführenden Scripts nacheinander laufen. Um nicht andere Scripts aufzuhalten&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;sollte &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;euer &lt;/del&gt;Setup &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;script &lt;/del&gt;nicht lange &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;von der Ausführung her &lt;/del&gt;dauern. Sobald es länger als 2 Sekunden läuft, empfiehlt sich eher, ein anderes Script aufzurufen, und den Code, der viel Zeit beansprucht, dorthin zu verlagern.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Wichtig ist auch, dass alle selbstausführenden Scripts nacheinander laufen. Um nicht andere Scripts aufzuhalten sollte &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;die Ausführung Eures &lt;/ins&gt;Setup&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-Scripts &lt;/ins&gt;nicht lange dauern. Sobald es länger als 2 Sekunden läuft, empfiehlt sich eher, ein anderes Script aufzurufen, und den Code, der viel Zeit beansprucht, dorthin zu verlagern.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Boronenherrscher</name></author>
	</entry>
	<entry>
		<id>https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=43727&amp;oldid=prev</id>
		<title>4th Fleet Commander am 26. Februar 2011 um 14:28 Uhr</title>
		<link rel="alternate" type="text/html" href="https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=43727&amp;oldid=prev"/>
		<updated>2011-02-26T14:28:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 26. Februar 2011, 16:28 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot;&gt;Zeile 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nur einmal ausführen===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nur einmal ausführen===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys. &amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys. &amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039; gesetzt. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;/del&gt;Wie klappt das?&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&#039;&#039;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &#039;&#039;&#039;&quot;[TRUE]&quot;&#039;&#039;&#039; gesetzt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;====&lt;/ins&gt;Wie klappt das?&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim ersten Mal ergibt die Abfrage nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, sondern &amp;#039;&amp;#039;&amp;#039;&amp;quot;null&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da es die Globale Variable am Anfang noch gar nicht gibt. Anschließend wird die Globale Variable auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim ersten Mal ergibt die Abfrage nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, sondern &amp;#039;&amp;#039;&amp;#039;&amp;quot;null&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da es die Globale Variable am Anfang noch gar nicht gibt. Anschließend wird die Globale Variable auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim nächsten Mal ergibt die Abfrage &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da die globale Variable ja eben auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt wurde. Somit wird das ganze nur einmal ausgeführt, es sei denn, ein anderes Script verändert den Wert der globalen Variable wieder.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Beim nächsten Mal ergibt die Abfrage &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da die globale Variable ja eben auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt wurde. Somit wird das ganze nur einmal ausgeführt, es sei denn, ein anderes Script verändert den Wert der globalen Variable wieder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>4th Fleet Commander</name></author>
	</entry>
	<entry>
		<id>https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=43726&amp;oldid=prev</id>
		<title>4th Fleet Commander am 26. Februar 2011 um 14:27 Uhr</title>
		<link rel="alternate" type="text/html" href="https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=43726&amp;oldid=prev"/>
		<updated>2011-02-26T14:27:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 26. Februar 2011, 16:27 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot;&gt;Zeile 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So würde zum Beispiel ein Script namens &amp;quot;init.rassenkonflikte&amp;quot; von selbst ausgeführt werden. So einfach ist das. Es gibt aber noch einige...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So würde zum Beispiel ein Script namens &amp;quot;init.rassenkonflikte&amp;quot; von selbst ausgeführt werden. So einfach ist das. Es gibt aber noch einige...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;==Wichtige Hinweise&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Wichtige Hinweise==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;===Nur einmal ausführen&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Nur einmal ausführen===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys. &amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys. &amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt. &amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wie klappt das?&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt. &amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wie klappt das?&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot;&gt;Zeile 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;*Hier kommen die Aktionen hin, die immer ausgeführt werden sollen.&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;*Hier kommen die Aktionen hin, die immer ausgeführt werden sollen.&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===Nicht zu lange dauern===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Wichtig ist auch, dass alle selbstausführenden Scripts nacheinander laufen. Um nicht andere Scripts aufzuhalten, sollte euer Setup script nicht lange von der Ausführung her dauern. Sobald es länger als 2 Sekunden läuft, empfiehlt sich eher, ein anderes Script aufzurufen, und den Code, der viel Zeit beansprucht, dorthin zu verlagern.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>4th Fleet Commander</name></author>
	</entry>
	<entry>
		<id>https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=43622&amp;oldid=prev</id>
		<title>4th Fleet Commander: Die Seite wurde neu angelegt: „{{TutorialBar2|Globale und lokale Variablen| &quot;X3:Terran Conflict Scripting-Tutorial&quot;|Arrays}}  Es ist eigentlich bei fast jedem Scriptpaket notwendig,…“</title>
		<link rel="alternate" type="text/html" href="https://x-lexikon.bosl.info/index.php?title=Selbstausf%C3%BChrende_Scripts&amp;diff=43622&amp;oldid=prev"/>
		<updated>2011-02-19T17:11:22Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „{{TutorialBar2|&lt;a href=&quot;/index.php?title=Globale_und_lokale_Variablen&quot; title=&quot;Globale und lokale Variablen&quot;&gt;Globale und lokale Variablen&lt;/a&gt;| &amp;quot;&lt;a href=&quot;/index.php?title=X3:Terran_Conflict_Scripting-Tutorial&quot; title=&quot;X3:Terran Conflict Scripting-Tutorial&quot;&gt;X3:Terran Conflict Scripting-Tutorial&lt;/a&gt;&amp;quot;|&lt;a href=&quot;/index.php?title=Arrays&quot; title=&quot;Arrays&quot;&gt;Arrays&lt;/a&gt;}}  Es ist eigentlich bei fast jedem Scriptpaket notwendig,…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{TutorialBar2|[[Globale und lokale Variablen]]| &amp;quot;[[X3:Terran Conflict Scripting-Tutorial]]&amp;quot;|[[Arrays]]}}&lt;br /&gt;
&lt;br /&gt;
Es ist eigentlich bei fast jedem Scriptpaket notwendig, ein Script zu haben, dass sich selbst bei Spielbeginn ausführt. Sonst würde keines der Scripte in diesem Scriptpaket wahrscheinlich je ausgeführt werden. Zudem ist es sehr schlecht, dem Benutzer des Scripts später erst einmal erklären zu müssen, wie man ein Script überhaupt aufruft.&lt;br /&gt;
&lt;br /&gt;
Ob Scripte sich selbst ausführen, hängt von ihrem Namen, bzw. von dessen Präfix ab. Folgende Präfixe führen zu einem selbstausführenden Script:&lt;br /&gt;
*setup.&lt;br /&gt;
*init.&lt;br /&gt;
*!setup.&lt;br /&gt;
*!init.&lt;br /&gt;
&lt;br /&gt;
So würde zum Beispiel ein Script namens &amp;quot;init.rassenkonflikte&amp;quot; von selbst ausgeführt werden. So einfach ist das. Es gibt aber noch einige...&lt;br /&gt;
&lt;br /&gt;
===Wichtige Hinweise===&lt;br /&gt;
====Nur einmal ausführen====&lt;br /&gt;
Manchmal müssen selbstausführende Scripts zwar jedes Mal starten, aber bestimmte Aktionen nur einmal vornehmen, zum Beispiel das Definieren eines Hotkeys. &amp;lt;br&amp;gt;&lt;br /&gt;
Dafür nutzt man normalerweise globale Variablen. Das selbstausführende Script fragt zunächst eine bestimmte globale Variable ab, und prüft deren Wert. Ist er nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, so wird die Aktion ausgeführt und der Wert anschließend auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt. &amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;Wie klappt das?&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Beim ersten Mal ergibt die Abfrage nicht &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, sondern &amp;#039;&amp;#039;&amp;#039;&amp;quot;null&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da es die Globale Variable am Anfang noch gar nicht gibt. Anschließend wird die Globale Variable auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt.&amp;lt;br&amp;gt;&lt;br /&gt;
Beim nächsten Mal ergibt die Abfrage &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039;, da die globale Variable ja eben auf &amp;#039;&amp;#039;&amp;#039;&amp;quot;[TRUE]&amp;quot;&amp;#039;&amp;#039;&amp;#039; gesetzt wurde. Somit wird das ganze nur einmal ausgeführt, es sei denn, ein anderes Script verändert den Wert der globalen Variable wieder.&lt;br /&gt;
&lt;br /&gt;
Beispielcode:&lt;br /&gt;
{{ScriptCode|&amp;lt;nowiki&amp;gt;$check = get global variable: name=&amp;#039;s304.milit.angriff.setup.check&amp;#039;&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;If not $check == [TRUE]&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;*Hier kommen die Aktionen hin, nur einmal ausgeführt werden sollen.&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;set global variable: name=&amp;#039;s304.milit.angriff.setup.check&amp;#039; value=[TRUE]&amp;lt;/nowiki&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
end&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;*Hier kommen die Aktionen hin, die immer ausgeführt werden sollen.&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;}}&lt;/div&gt;</summary>
		<author><name>4th Fleet Commander</name></author>
	</entry>
</feed>