Difference between revisions of "User:©TriMoon™/Sandbox"

From Salem Wiki
Jump to: navigation, search
Line 185: Line 185:
 
</ol></li>
 
</ol></li>
 
</ol>
 
</ol>
 
----
 
{{#arraymap:
 
{{#show:{{{page|Axe}}} |?RequiredBy |link=none}}
 
|,
 
|xXx
 
|<nowiki>[[</nowiki>xXx]] OR <nowiki></nowiki>
 
|}}
 
<nowiki>[[</nowiki>:+]] <nowiki>[[</nowiki>RequiresObj::~{{{page|Axe}}};*]] OR
 
<nowiki>[[</nowiki>:+]] <nowiki>[[</nowiki>RepairedWith::~{{{page|Axe}}};*]] OR
 
<nowiki>[[</nowiki>:+]] <nowiki>[[</nowiki>RequiresTech::{{{page|Axe}}}]]
 
----
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#arraymap:{{#show:{{{page|Axe}}} |?RequiredBy |link=none}} |, |xXx |^s^xXx^e^ OR <nowiki></nowiki>|}}
 
^s^:+^e^ ^s^RequiresObj::~{{{page|Axe}}};*^e^ OR
 
^s^:+^e^ ^s^RepairedWith::~{{{page|Axe}}};*^e^ OR
 
^s^:+^e^ ^s^RequiresTech::{{{page|Axe}}}^e^
 
|^s^|\[\[}}
 
|^e^|\]\]}}
 
|\|}}
 
 
----
 
 
{{#ask: {{#replace:
 
{{#replace:
 
{{#replace:
 
{{#arraymap:{{#show:{{{page|Axe}}} |?RequiredBy |link=none}} |, |xXx |^s^xXx^e^ OR <nowiki></nowiki>|}}
 
^s^:+^e^ ^s^RequiresObj::~{{{page|Axe}}};*^e^ OR
 
^s^:+^e^ ^s^RepairedWith::~{{{page|Axe}}};*^e^ OR
 
^s^:+^e^ ^s^RequiresTech::{{{page|Axe}}}^e^
 
|^s^|\[\[}}
 
|^e^|\]\]}}
 
|\|}}
 
|{{#ifeq: {{{template|y}}} | y | | sep={{{sep|,}}} }}
 
|link=none
 
|{{#ifeq: {{{template|y}}} | y | format=template }}
 
|{{#ifeq: {{{template|y}}} | y | template=PropVals/List RequiredBy/query template }}
 
|{{#ifeq: {{{template|y}}} | y | intro=<ul> }}
 
|{{#ifeq: {{{template|y}}} | y | outro=</ul> }}
 
|{{#ifeq: {{{template|y}}} | y | limit={{{limit|10}}} }}
 
}}
 

Revision as of 13:31, 4 July 2012

Infobox

{{infobox}}:
Template:Infobox/debugTheme Template:Infobox/debugTheme
Template:Infobox/debugTheme Template:Infobox/debugTheme

Semantic Wiki related

Lets try to describe properties of Objects using their placement in the game-menus to aid in later auto-categorization....

See Property:IsinGameMenu for current menu-names.

fe. Blazing Brazier, would need:

  • isGameMenu=n
  • isinGameMenu=Claims & Defenses
See these pages for documentation

SetProp

  1. Automatic property setting in mind: {{SetProp|propname=propvalues|propname=propvalues|...}}
    Where propvalues consist of single values separated by commas, that are used to set propname multiple times using each value.
    The single-values are depended on the format of the property to set, which can't have commas in their format ofcourse...
    1. {{#arraymap: propvalues |, |xXx |{{#set:propname=xXx}} |}}
    2. {{SetProp|RequiresTech=Simple Fences,Quarrying|RequiresObj=Anvil,Flint;1,Stone;3,Lime;15;Startpost,Flint;15;Startpost,Stone;30;Startpost,Lime;8;Cornerpost,Flint;8;Cornerpost,Stone;15;Cornerpost,Board;10,Nails;4}}
      Would execute:
      SetProp/single:
      You need to provide an amount for “Anvil” in the RequiresObj parameter !
      1. {{#arraymap: Simple Fences,Quarrying |, |xXx |{{#set:RequiresTech=xXx}} |}}
      2. {{#arraymap: Anvil,Flint;1,Stone;3,Lime;15;Startpost,Flint;15;Startpost,Stone;30;Startpost,Lime;8;Cornerpost,Flint;8;Cornerpost,Stone;15;Cornerpost,Board;10,Nails;4 |, |xXx |{{#set:RequiresObj=xXx}} |}}
    3. {{PropVals|prop=RequiresTech|page=User:©TriMoon™/Sandbox}} gives:
      • {{PropVals|prop=RequiresObj|page=User:©TriMoon™/Sandbox}} gives:

      HasProp

      {{#if: {{HasProp|Has icon}}
      | [[{{#show:User:©TriMoon™/PropVals testdata|?Has icon|link=none}}]]
      }}
      


      Property:RequiresObj

      1. Listing values for Property:RequiresObj on current test data page
        1. {{#show: User:©TriMoon™/PropVals testdata |?RequiresObj |link=none |sep=<br/> }}
        2. {{#ask: [[User:©TriMoon™/PropVals testdata]] [[RequiresObj::+]] | ?RequiresObj= |link=none |sep=<br/> }}
        3. Automatic listing in mind: {{PropVals |prop={{{prop|RequiresObj}}} |page={{FULLPAGENAME}}}}
          1. {{PropVals/getRecords|prop=RequiresObj|page=User:©TriMoon™/PropVals testdata }}
          2. {{PropVals/Group | <output from step above> }} internally using {{PropVals/Split}}
            • As you can see the usage below doesn't work because the parser does not recognize the records as extra arguments...
              • {{PropVals/Group |{{PropVals/getRecords|prop=RequiresObj|page=User:©TriMoon™/PropVals testdata }} }}
              • PropVals/Group:
                You need to provide records tobe processed !
            • Therefore we need to use {{#arraymap:}} as a wrapper to inject the records as extra arguments...
              • {{#arraymap: {{PropVals/getRecords|prop=RequiresObj|page=User:©TriMoon™/PropVals testdata }}{{{grpsep|/\}}} |{{{grpsep|/\}}} |xXx |{{PropVals/Group |sep={{{sep|;}}} |grpsep={{{grpsep|/\}}} |xXx }} |}}
              • {{PropVals/getGroupedRecords|prop=RequiresObj|page=User:©TriMoon™/PropVals testdata |sep={{{sep|;}}}|grpsep={{{grpsep|/\}}} }}
          3. <ul>{{#arraymap: <output from step above> |{{{grpsep|/\}}} |xXx |{{PropVals/List|sep={{{sep|;}}}|xXx}} |}}</ul>
          4. {{PropVals|prop=RequiresObj|page=User:©TriMoon™/PropVals testdata}} gives:

        Property:RequiresTech

        1. Listing pages using Property:RequiresTech
          1. {{#ask: [[RequiresTech::+]] }}
          2. {{#ask: [[:+]] [[RequiresTech::+]] }}
          3. Listing values for Property:RequiresTech on current test data page
            1. {{PropVals|prop=RequiresTech|page=User:©TriMoon™/PropVals testdata}} gives:

          Property:RequiredBy

          1. Listing pages having a certain value for Property:RequiresObj
            1. {{#ask: [[:+]] [[RequiresObj::~Nails*]] }}
          2. Listing pages having a certain value for Property:RequiresTech
            1. {{#ask: [[:+]] [[RequiresTech::Simple Fences]] }}
          3. Listing pages having a certain value for Property:RequiresObj OR Property:RepairedWith OR Property:RequiresTech
            1. {{#ask: [[:+]] [[RequiresObj::~{{PAGENAME}}*]] OR [[:+]] [[RepairedWith::~{{PAGENAME}}*]] OR [[:+]] [[RequiresTech::{{PAGENAME}}]] }}
              1. {{#ask: [[:+]] [[RequiresObj::~Nails*]] OR [[:+]] [[RepairedWith::~Nails*]] OR [[:+]] [[RequiresTech::Nails]] |format=ul}}
              2. {{PropVals/List RequiredBy |page=Nails |template=n |sep={{{sep|,}}} |limit=5}}
                Template:PropVals/List RequiredBy
              3. {{PropVals/List RequiredBy |page=Nails |template=y |sep={{{sep|,}}} |limit=5}}
                Template:PropVals/List RequiredBy
          ... more about "©TriMoon™/Sandbox"
          ~©TriMoon™/Sandbox* +  and ~Nails* +
          Flint;1 +, Stone;3 +, Lime;15;Startpost +, Flint;15;Startpost +, Stone;30;Startpost +, Lime;8;Cornerpost +, Flint;8;Cornerpost +, Stone;15;Cornerpost +, Board;10 +, Nails;4 +, + +, ~Nails* +  and ~©TriMoon™/Sandbox* +