A Wiki in the Desert
Log in

Difference between revisions of "Template:ProducesTable"

From A Wiki in the Desert
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{#arraydefine:produces|{{#ask:
 
{{#arraydefine:produces|{{#ask:
     [[Has subobject::<q>[[producer::{{FULLPAGENAME}}]]</q>]] | link=none |limit = 1000
+
     [[Has subobject::<q>[[producer::{{FULLPAGENAME}}]]</q>]] | link=none
 
}}}}{{#loop: i
 
}}}}{{#loop: i
 
   | 0
 
   | 0
 
   | {{ #arraysize:produces }}
 
   | {{ #arraysize:produces }}
   |
+
   | <nowiki />{{#vardefine:count_produced|{{#ask: [[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] [[producer::{{FULLPAGENAME}}]] |?count#= |mainlabel=- }}}}{{#vardefine:time|{{#ask: [[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] [[producer::{{FULLPAGENAME}}]] |?time#= |mainlabel=- }}}}
  {{#vardefine:count_produced|{{#ask: [[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] [[producer::{{FULLPAGENAME}}]] |?count#= |mainlabel=- }}}}
+
{{#vardefine:should_exclude|{{#ask:[[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] [[producer::{{FULLPAGENAME}}]] |?exclude#= |mainlabel=-}}}}{{#if: {{#var:should_exclude}}|{{#arraydefine:excludes{{#var:i}}|{{#var:should_exclude}}}}}}
  {{#vardefine:time|{{#ask: [[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] [[producer::{{FULLPAGENAME}}]] |?time#= |mainlabel=- }}}}
+
* {{#var:count_produced}} - {{ #arrayindex: produces | {{ #var:i }} }} - {{#var:time}}s{{#arraydefine:requirements|{{#ask:
  * {{#var:count_produced}} - {{ #arrayindex: produces | {{ #var:i }} }} - {{#var:time}}s{{#arraydefine:requirements|{{#ask:
+
     [[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] {{#if: {{#arraysize:excludes{{#var:i}}}} |{{#arrayprint:excludes{{#var:i}}||@|[[requires::!@]]}}|[[requires::+]]}} | link=none
     [[-Has subobject::{{ #arrayindex: produces | {{ #var:i }} }}]] [[requires::+]]| link=none |limit = 1000
+
   }}
   }}}}{{#loop: j
+
  }}{{#loop: j
 
     | 0
 
     | 0
 
     | {{ #arraysize:requirements }}
 
     | {{ #arraysize:requirements }}
     |
+
     |<nowiki/>{{#vardefine:count_required|{{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?count#= |mainlabel=- }}}}{{#vardefine:item_required|{{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?requires#= |mainlabel=- }}}}
    {{#vardefine:count_required|{{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?count#= |mainlabel=- }}}}
+
** {{ #expr: {{#var:count_produced}}*{{#var:count_required}}round0}} - {{#var:item_required}}
    {{#vardefine:item_required|{{#ask: [[{{ #arrayindex: requirements | {{ #var:j }} }}]] |?requires#= |mainlabel=- }}}}
+
   }}
    ** {{ #expr: {{#var:count_produced}}*{{#var:count_required}}round0}} - {{#var:item_required}}
 
   }}<br>
 
 
}}
 
}}

Latest revision as of 18:15, 10 May 2021