<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://www.lets-role.wiki/index.php?action=history&amp;feed=atom&amp;title=Put_a_dice_roll_result_in_the_sheet</id>
	<title>Put a dice roll result in the sheet - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://www.lets-role.wiki/index.php?action=history&amp;feed=atom&amp;title=Put_a_dice_roll_result_in_the_sheet"/>
	<link rel="alternate" type="text/html" href="https://www.lets-role.wiki/index.php?title=Put_a_dice_roll_result_in_the_sheet&amp;action=history"/>
	<updated>2026-05-25T07:05:26Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://www.lets-role.wiki/index.php?title=Put_a_dice_roll_result_in_the_sheet&amp;diff=17&amp;oldid=prev</id>
		<title>Guile le 10 août 2025 à 09:14</title>
		<link rel="alternate" type="text/html" href="https://www.lets-role.wiki/index.php?title=Put_a_dice_roll_result_in_the_sheet&amp;diff=17&amp;oldid=prev"/>
		<updated>2025-08-10T09:14:30Z</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;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 10 août 2025 à 11:14&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;Ligne 2 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 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;div&gt;In this tutorial, we&amp;#039;ll see how to fill a label based on a dice roll result.&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;In this tutorial, we&amp;#039;ll see how to fill a label based on a dice roll result.&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;You will see that the solution can only be made with some script&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, using &lt;/del&gt;a specific action button in the Dice Result.&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;You will see that the solution can only be made with some script&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Here the solution uses &lt;/ins&gt;a specific action button in the Dice Result.&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;=== Step by step ===&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;=== Step by step ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Guile</name></author>
	</entry>
	<entry>
		<id>https://www.lets-role.wiki/index.php?title=Put_a_dice_roll_result_in_the_sheet&amp;diff=14&amp;oldid=prev</id>
		<title>Guile : first tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.lets-role.wiki/index.php?title=Put_a_dice_roll_result_in_the_sheet&amp;diff=14&amp;oldid=prev"/>
		<updated>2025-05-08T21:35:24Z</updated>

		<summary type="html">&lt;p&gt;first tutorial&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Summary ===&lt;br /&gt;
In this tutorial, we&amp;#039;ll see how to fill a label based on a dice roll result.&lt;br /&gt;
&lt;br /&gt;
You will see that the solution can only be made with some script, using a specific action button in the Dice Result.&lt;br /&gt;
&lt;br /&gt;
=== Step by step ===&lt;br /&gt;
&lt;br /&gt;
# create an element that will trigger the dice roll. Ex: a label with the id &amp;lt;code&amp;gt;labelTriggeringDiceRoll&amp;lt;/code&amp;gt;&lt;br /&gt;
# create an element that will receive the dice roll result (or anything based on the dice roll). Ex: a label with the id &amp;lt;code&amp;gt;labelReceivingDiceRoll&amp;lt;/code&amp;gt;&lt;br /&gt;
# in the script, add an click event that rolls the dice you need by using &amp;lt;code&amp;gt;Dice.roll&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;Dice.roll&amp;lt;/code&amp;gt; accepts a list of action buttons as last parameter. This is an object whose keys are the Button label that will be shown in the Dice log and values are a function that is called when the button is clicked (see the [https://lets-role.com/help/en/documentation/v1/scripting/dice-api Actions section in the Dice API documentation]). The parameter given to the function is a [https://lets-role.com/help/en/documentation/v1/scripting/dice-result Dice Result].&lt;br /&gt;
# If correctly defined, the function can have an elegant access to the sheet.&lt;br /&gt;
# This access to the sheet is the main way to change the desired label.&lt;br /&gt;
&lt;br /&gt;
=== Final code ===&lt;br /&gt;
Here is the code used in the [https://lets-role.com/system/system-builder-demo-16760 System Builder Demo]&lt;br /&gt;
 const labelToClick = sheet.get(&amp;quot;labelTriggeringDiceRoll&amp;quot;);      // get the label that will roll dice when clicked&lt;br /&gt;
 labelToClick.on(&amp;quot;click&amp;quot;, function () {                          // handle the click event on the label&lt;br /&gt;
   const actions = {};                                           //   initiate the list of actions in dice result&lt;br /&gt;
   actions[_(&amp;quot;Apply to sheet&amp;quot;)] = function (dice) {              //   add a translated button label&lt;br /&gt;
     const labelToFill = sheet.get(&amp;quot;labelReceivingDiceRoll&amp;quot;);    //     when click on the action button, the code can access to the label to change&lt;br /&gt;
     labelToFill.value(&amp;quot;Last roll was &amp;quot; + dice.total);           //     set anything in the label, based on dice&lt;br /&gt;
   };&lt;br /&gt;
   Dice.roll(sheet, &amp;quot;10+1D10&amp;quot;, &amp;quot;Roll strength&amp;quot;, &amp;quot;all&amp;quot;, actions); // Roll the dice&lt;br /&gt;
 });&lt;br /&gt;
&lt;br /&gt;
=== Live example ===&lt;br /&gt;
You can see a live example in the [https://lets-role.com/system/system-builder-demo-16760 System Builder Demo] in the tab &amp;quot;Fill with Dice Result&amp;quot; (you must run a table in order to have dice rolls, the sheet preview block dice rolls)&lt;br /&gt;
&lt;br /&gt;
You can check the code in the function &amp;lt;code&amp;gt;initFillWithRoll&amp;lt;/code&amp;gt; that illustrates what is described in this tutorial.&lt;/div&gt;</summary>
		<author><name>Guile</name></author>
	</entry>
</feed>