Difference between revisions of "User:Sub4rctic/Any"
From TerraFirmaCraft Plus Wiki
Line 1: | Line 1: | ||
<!-- | <!-- | ||
{{User:Sub4rctic/Woods}} | {{User:Sub4rctic/Woods}} | ||
− | List of all woods with < and > as | + | List of all woods with < and > as PREFIX and SUFFIX, semicolon separated |
{{#replace:string|search term|replacement term}} | {{#replace:string|search term|replacement term}} | ||
Line 9: | Line 9: | ||
use the woods template as the string | use the woods template as the string | ||
− | {{#replace:{{User:Sub4rctic/Woods}}|>|<nowiki/> <nowiki/> | + | {{#replace:{{User:Sub4rctic/Woods}}|>|<nowiki/> <nowiki/>SUFFIX}} |
If a space is used in the replacement term, must be nowiki'd out with self-closing tags | If a space is used in the replacement term, must be nowiki'd out with self-closing tags | ||
− | {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>| | + | {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|SUFFIX}}|<|PREFIX}} |
− | nest | + | nest SUFFIX replacement inside a PREFIX replacement |
+ | |||
+ | {{#explode:string|delimiter|position|limit}} | ||
+ | explode syntax. Pos counted from 0 | ||
+ | |||
+ | {{#explode:{{{1}}}|,|0}} | ||
+ | Returns before comma | ||
+ | |||
+ | {{#explode:{{{1}}}|,|1}} | ||
+ | returns string after comma | ||
+ | |||
+ | {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|SUFFIX,{{#explode:{{{1}}}|,|1}}}}|<|PREFIX}} | ||
+ | after the suffix add a comma and add param 1 string after comma | ||
{{#switch: comparison string | {{#switch: comparison string | ||
Line 28: | Line 40: | ||
{{#switch: {{{1}}} | {{#switch: {{{1}}} | ||
| #default = Item not found | | #default = Item not found | ||
− | | Barrel = {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|)}}|<|{{{1}}}<nowiki/> <nowiki/>(}} | + | | Barrel = {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|),{{#explode:{{{1}}}|,|1}}}}|<|{{{1}}}<nowiki/> <nowiki/>(}} |
| Chest = {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|)}}|<|{{{1}}}<nowiki/> <nowiki/>(}} | | Chest = {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|)}}|<|{{{1}}}<nowiki/> <nowiki/>(}} | ||
| Chopped Log = {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|)}}|<|{{{1}}}<nowiki/> <nowiki/>(}} | | Chopped Log = {{#replace:{{#replace:{{User:Sub4rctic/Woods}}|>|)}}|<|{{{1}}}<nowiki/> <nowiki/>(}} |
Revision as of 04:36, 7 October 2019
Item not found