<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.fetishquest.com/index.php?action=history&amp;feed=atom&amp;title=MathScript_Snippets</id>
	<title>MathScript Snippets - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.fetishquest.com/index.php?action=history&amp;feed=atom&amp;title=MathScript_Snippets"/>
	<link rel="alternate" type="text/html" href="https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;action=history"/>
	<updated>2026-05-29T18:56:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;diff=308&amp;oldid=prev</id>
		<title>JasX at 17:49, 25 September 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;diff=308&amp;oldid=prev"/>
		<updated>2025-09-25T17:49:00Z</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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:49, 25 September 2025&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-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&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;lt;code&amp;gt;actions = arraySlice(actions, 0,4)&amp;lt;/code&amp;gt; Get the first 4 actions of the array.&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;lt;code&amp;gt;actions = arraySlice(actions, 0,4)&amp;lt;/code&amp;gt; Get the first 4 actions of the array.&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;lt;code&amp;gt;setDvar(&amp;quot;sfq_town&amp;quot;, &amp;quot;trainer_skills&amp;quot;, actions)&amp;lt;/code&amp;gt; Sets the trainer_skills dungeon var in the dungeon labeled sfq_town to the array of actions.&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;lt;code&amp;gt;setDvar(&amp;quot;sfq_town&amp;quot;, &amp;quot;trainer_skills&amp;quot;, actions)&amp;lt;/code&amp;gt; Sets the trainer_skills dungeon var in the dungeon labeled sfq_town to the array of actions.&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;Said mathScript game action is run every time the player enters the gym.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key fqwiki:diff:1.41:old-307:rev-308:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>JasX</name></author>
	</entry>
	<entry>
		<id>https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;diff=307&amp;oldid=prev</id>
		<title>JasX at 17:47, 25 September 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;diff=307&amp;oldid=prev"/>
		<updated>2025-09-25T17:47:45Z</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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:47, 25 September 2025&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-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&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;=== Update a dvar array on new day. ===&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;=== Update a dvar array on new day. ===&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;In this example, we use a dungeon with the label &amp;lt;code&amp;gt;sfq_town&amp;lt;/code&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. We have &lt;/del&gt;the following dVars:&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;In this example, we use a dungeon with the label &amp;lt;code&amp;gt;sfq_town&amp;lt;/code&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;with &lt;/ins&gt;the following dVars:&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;* &amp;lt;code&amp;gt;last_trainer_reset&amp;lt;/code&amp;gt; Which we store the day when this math script was run last.&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;lt;code&amp;gt;last_trainer_reset&amp;lt;/code&amp;gt; Which we store the day when this math script was run last.&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;lt;code&amp;gt;trainer_skills&amp;lt;/code&amp;gt; Where we store an array of 4 action labels that we&amp;#039;ll use in conditions to decide which skills are available at a trainer.&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;lt;code&amp;gt;trainer_skills&amp;lt;/code&amp;gt; Where we store an array of 4 action labels that we&amp;#039;ll use in conditions to decide which skills are available at a trainer.&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;&amp;lt;pre&amp;gt;setDvar(&quot;sfq_town&quot;,&quot;last_trainer_reset&quot;,&quot;!$g_day&quot;)&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The point of the script is to pick a random set of trainer skills each day to present to the player when visiting a trainer. We do this by having game actions checking if action labels are present in the trainer_skills dvar.&lt;/ins&gt;&amp;lt;pre&amp;gt;setDvar(&quot;sfq_town&quot;,&quot;last_trainer_reset&quot;,&quot;!$g_day&quot;)&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;actions = getAssetLabelsRegex(&amp;#039;Action&amp;#039;, &amp;#039;^sfq_pc&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;actions = getAssetLabelsRegex(&amp;#039;Action&amp;#039;, &amp;#039;^sfq_pc&amp;#039;)&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;shuffle(actions)&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;shuffle(actions)&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-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&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;setDvar(&amp;quot;sfq_town&amp;quot;, &amp;quot;trainer_skills&amp;quot;, actions)&amp;lt;/pre&amp;gt;Explanation:&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;setDvar(&amp;quot;sfq_town&amp;quot;, &amp;quot;trainer_skills&amp;quot;, actions)&amp;lt;/pre&amp;gt;Explanation:&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;* &amp;lt;code&amp;gt;setDvar(&quot;sfq_town&quot;,&quot;last_trainer_reset&quot;,&quot;!$g_day&quot;)&amp;lt;/code&amp;gt; Sets a dvar called last_trainer_reset in the dungeon labeled sfq_town to the current day.&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;* &amp;lt;code&amp;gt;setDvar(&quot;sfq_town&quot;,&quot;last_trainer_reset&quot;,&quot;!$g_day&quot;)&amp;lt;/code&amp;gt; Sets a dvar called last_trainer_reset in the dungeon labeled sfq_town to the current day&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. The !$ prefix in the setDvar function is used to mark that the rest of the data should be evaluated as a formula. g_day is a game mathvar (used in ALL formulas) and is an integer value specifying how many days have elapsed in the active game&lt;/ins&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;*&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;*&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;actions = getAssetLabelsRegex(&#039;Action&#039;, &#039;^sfq_pc&#039;)&amp;lt;/code&amp;gt; Scans through the Action library and return an array of all actions starting with sfq_pc (^sfq_pc is a regular expression).&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;*&amp;lt;code&amp;gt;shuffle(actions)&amp;lt;/code&amp;gt; Shuffles the action array.&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;*&amp;lt;code&amp;gt;actions = arraySlice(actions, 0,4)&amp;lt;/code&amp;gt; Get the first 4 actions of the array.&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;*&amp;lt;code&amp;gt;setDvar(&quot;sfq_town&quot;, &quot;trainer_skills&quot;, actions)&amp;lt;/code&amp;gt; Sets the trainer_skills dungeon var in the dungeon labeled sfq_town to the array of actions.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key fqwiki:diff:1.41:old-306:rev-307:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>JasX</name></author>
	</entry>
	<entry>
		<id>https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;diff=306&amp;oldid=prev</id>
		<title>JasX: Created page with &quot;A collection of snippets you can use in math scripts.  === Update a dvar array on new day. === In this example, we use a dungeon with the label &lt;code&gt;sfq_town&lt;/code&gt; . We have the following dVars:  * &lt;code&gt;last_trainer_reset&lt;/code&gt; Which we store the day when this math script was run last. * &lt;code&gt;trainer_skills&lt;/code&gt; Where we store an array of 4 action labels that we&#039;ll use in conditions to decide which skills are available at a trainer. &lt;pre&gt;setDvar(&quot;sfq_town&quot;,&quot;last_t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.fetishquest.com/index.php?title=MathScript_Snippets&amp;diff=306&amp;oldid=prev"/>
		<updated>2025-09-25T17:41:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;A collection of snippets you can use in math scripts.  === Update a dvar array on new day. === In this example, we use a dungeon with the label &amp;lt;code&amp;gt;sfq_town&amp;lt;/code&amp;gt; . We have the following dVars:  * &amp;lt;code&amp;gt;last_trainer_reset&amp;lt;/code&amp;gt; Which we store the day when this math script was run last. * &amp;lt;code&amp;gt;trainer_skills&amp;lt;/code&amp;gt; Where we store an array of 4 action labels that we&amp;#039;ll use in conditions to decide which skills are available at a trainer. &amp;lt;pre&amp;gt;setDvar(&amp;quot;sfq_town&amp;quot;,&amp;quot;last_t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A collection of snippets you can use in math scripts.&lt;br /&gt;
&lt;br /&gt;
=== Update a dvar array on new day. ===&lt;br /&gt;
In this example, we use a dungeon with the label &amp;lt;code&amp;gt;sfq_town&amp;lt;/code&amp;gt; . We have the following dVars:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;last_trainer_reset&amp;lt;/code&amp;gt; Which we store the day when this math script was run last.&lt;br /&gt;
* &amp;lt;code&amp;gt;trainer_skills&amp;lt;/code&amp;gt; Where we store an array of 4 action labels that we&amp;#039;ll use in conditions to decide which skills are available at a trainer.&lt;br /&gt;
&amp;lt;pre&amp;gt;setDvar(&amp;quot;sfq_town&amp;quot;,&amp;quot;last_trainer_reset&amp;quot;,&amp;quot;!$g_day&amp;quot;)&lt;br /&gt;
actions = getAssetLabelsRegex(&amp;#039;Action&amp;#039;, &amp;#039;^sfq_pc&amp;#039;)&lt;br /&gt;
shuffle(actions)&lt;br /&gt;
actions = arraySlice(actions, 0,4)&lt;br /&gt;
setDvar(&amp;quot;sfq_town&amp;quot;, &amp;quot;trainer_skills&amp;quot;, actions)&amp;lt;/pre&amp;gt;Explanation:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;setDvar(&amp;quot;sfq_town&amp;quot;,&amp;quot;last_trainer_reset&amp;quot;,&amp;quot;!$g_day&amp;quot;)&amp;lt;/code&amp;gt; Sets a dvar called last_trainer_reset in the dungeon labeled sfq_town to the current day.&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>JasX</name></author>
	</entry>
</feed>