Item Filtering:修订间差异

跳转到导航 跳转到搜索
添加854字节 、​ 2023年4月19日 (星期三)
无编辑摘要
第17行: 第17行:
<!-- End of "Filters" category -->
<!-- End of "Filters" category -->


== Filter Syntax ==
== 筛选语法规则 ==
Filters contain rules for how items should be displayed in-game. Each rule has '''''Input''''' and '''''Output''''' and follows this basic format:
过滤器包含物品如何在游戏内显示的规则。. 每条规则都有'''''输入(Input)''''' '''''输出(Output)''''' 并遵循以下基本语法格式:
ItemDisplay[ '''''输入(Input)''''' ]: '''''输出(Output)'''''


ItemDisplay[ '''''Input''''' ]: '''''Output'''''
“输入”指定项目必须满足的一组“条件”,规则才能应用于该项目,“输出”指定找到匹配项目时使用的操作(“文本”或“关键字”)。


The '''''Input''''' specifies a set of ''conditions'' an item must satisfy for the rule to apply to it, and '''''Output''''' specifies the actions (''text'' or ''keywords'') used when a matching item is found.
如果某一行语句不遵循这种格式,它将不会被视为规则,这意味着它不会影响对应物品在游戏中的显示方式。如果想故意忽略这一行,它应该以“”//“”(双斜线)开头,这样计算机就可以立即忽略它,而不是花时间检查行的其余部分以确定它是否是一条规则。


If a line doesn't follow this format, it won't be considered a rule, which means it won't affect how items will be displayed in-game. If a line is intentionally ignored like this, it should begin with '''''//''''' (double slash) so the computer can ignore it immediately rather than spend time checking the rest of the line to determine whether it's a rule or not.
过滤规则按从上到下的顺序进行处理。根据它们满足的条件的第一规则的输出来显示项目。如果对应的规则不包括“”“%CONTINUE%”“”“”,则该过程将暂停,并且不再检查其他规则。通过这种方式,比其他规则更高的规则具有更高的优先级。唯一的例外是[[Item_Filtering#Notification_Keywords|notification keywords]],无论它们在筛选器中的位置如何,都适用。


最简单的规则是没有任何条件或输出的规则。在没有条件的情况下,该规则将适用于所有物品。如果没有输出,则不会显示这些物品的任何内容。
<code>ItemDisplay[]:</code> <span style="color:gray;">''隐藏所有物品''</span>


Filter rules are processed in-order from top to bottom. Items are displayed according to the output of the first rule whose conditions they satisfy. If the matching rule doesn't include '''''%CONTINUE%''''', the procedure is halted and no additional rules are checked. In this way, rules that are higher than others have higher priority. The only exception is for [[Item_Filtering#Notification_Keywords|notification keywords]], which apply regardless of where they are in the filter.
下一个最简单的规则是使用默认名称外观显示所有物品。输出关键字“”“%NAME%”“”“”指的是物品的默认名称外观,并且根据显示的项目而有所不同。默认情况下,所有物品都会显示出来——在开始处理过滤器的规则之前,游戏基本上将此规则添加到过滤器的底部。
<code>ItemDisplay[]: %NAME%</code> <span style="color:gray;">''显示具有默认名称外观的所有物品''</span>


=== 条件Conditions ===
条件描述规则应应用于哪些物品。


The simplest rule is one without any conditions or output. Sans conditions, the rule will apply to all items. Sans output, nothing will be displayed for those items.
大部分条件指的是单个物品或物品组的判定。判定遵循布尔逻辑(即是与否),具体判定(判定为是或者不是某个物品)取决于要查看的物品是否符合规则。
<code>ItemDisplay[key]:</code> <span style="color:gray;">''隐藏钥匙(仍然可以从商家那里购买)''</span>
<span style="color:red;">注释:输入条件为“KEY”(即是否是钥匙),如果是钥匙,则隐藏不显示(因为输出部分为空,即不显示)。


<code>ItemDisplay[]:</code> <span style="color:gray;">''hides all items''</span>
“值”条件通常指被查看项的特定属性的值。它们每个都有三部分:代码、比较运算符('''<''','''>''','''='''), 和要比较的值
<code>ItemDisplay[GOLD<100]:</code> <span style="color:gray;">''如果金币<100,则隐藏它们''</span>


具有多个条件的规则可以使用逻辑运算符(“AND”、“OR”、“!”)来指定条件之间的关系。如果在条件之间不使用运算符(即只有1个空格),则规则会假定逻辑运算符为为“AND”。
<code>ItemDisplay[NMAG AND SOCK=1 AND CLVL>10]:</code> <span style="color:gray;">''如果角色在10级以上,则隐藏仅1孔的普通物品''</span>
<span style="color:red;">注释:输入条件为“非魔法物品 AND 孔数=1 AND 角色等级>10”,如果符合这个条件则隐藏名称。


The next simplest rule is one that displays all items with their default appearances. The output keyword '''''%NAME%''''' refers to an item's default appearance, and varies depending on which item is being shown. All items are displayed by default - the game essentially adds this rule to the bottom of the filter before beginning to process the filter's rules.
<code>ItemDisplay[NMAG SOCK=1 CLVL>10]:</code> <span style="color:gray;">''如果角色在10级以上,则隐藏仅1孔的普通物品''</span>
<span style="color:red;">注释:这条语法规则与上一条相比,少了逻辑运算符“AND”,即没有任何逻辑运算符,则规则仍默认多个条件间的逻辑运算符为“AND”


<code>ItemDisplay[]: %NAME%</code> <span style="color:gray;">''displays all items with their default appearances''</span>
若要将规则应用于一组条件中的任何一个物品,请使用“OR”和圆括号()。
<code>ItemDisplay[NMAG (BOOTS OR GLOVES OR BELT) CLVL>10]:</code> <span style="color:gray;">''如果角色在10级以上,则隐藏普通的靴子/手套/腰带''</span>


=== Conditions ===
()括号也可以在其他方面帮助完成条件组合。
Conditions describe which item(s) the rule should apply to.
<code>ItemDisplay[(GOLD<100 OR (GOLD<1000 CLVL>50))]:</code> <span style="color:gray;">''如果金币小于100,则隐藏金币;如果角色在50级以上,则小于1000的金币都被隐藏''</span>


Many conditions refer to a single item or item group. These boolean conditions will be either true or false, depending on which item is being looked at.
否定(有时称为“NOT”运算符)使条件的含义与其他条件的含义相反。若要否定条件,请在其前面使用“''!''”。
<code>ItemDisplay[MAG ETH ARMOR !ID]:</code> <span style="color:gray;">''隐藏未鉴定的无形的魔法防具''</span>
<span style="color:red;">注释:判定条件——魔法物品+无形+防具+未鉴定(!鉴定)


<code>ItemDisplay[key]:</code> <span style="color:gray;">''hides keys (they can still be purchased from merchants)''</span>
条件组合可以用同样的方式进行否定
 
<code>ItemDisplay[MAG !ID HELM !(BAR OR DRU OR ELT)]:</code> <span style="color:gray;">''隐藏非野蛮人头盔、德鲁伊头盔或精英的未鉴定魔法头盔''</span>
 
<span style="color:red;">注释:判定条件——魔法物品+未鉴定(!鉴定)+非野蛮人头盔、德鲁伊头盔或精英的头盔{!(野蛮人或德鲁伊或精英物品),!否定了圆括号的所有条件}
Value conditions typically refer to the value of a specific property on the item being looked at. They each have three parts: code, comparison operator ('''<''','''>''','''='''), and value to compare against.
 
<code>ItemDisplay[GOLD<100]:</code> <span style="color:gray;">''hides gold stacks if they are less than 100''</span>
 
 
Rules with multiple conditions may use logic operators ('''AND''','''OR''','''!''') to specify how the conditions relate to each other. If no operator is used between conditions, '''AND''' will be assumed.
 
<code>ItemDisplay[NMAG AND SOCK=1 AND CLVL>10]:</code> <span style="color:gray;">''hides regular 1-socket items if the character is above level 10''</span>
 
<code>ItemDisplay[NMAG SOCK=1 CLVL>10]:</code> <span style="color:gray;">''hides regular 1-socket items if the character is above level 10''</span>
 
 
To make a rule apply to any item from within a group of conditions, use '''OR''' and parentheses.
 
<code>ItemDisplay[NMAG (BOOTS OR GLOVES OR BELT) CLVL>10]:</code> <span style="color:gray;">''hides regular boots/gloves/belts if the character is above level 10''</span>
 
Parentheses can help combine conditions in other ways too.
 
<code>ItemDisplay[(GOLD<100 OR (GOLD<1000 CLVL>50))]:</code> <span style="color:gray;">''hides gold stacks if they are less than 100, or less than 1000 if the character is above level 50''</span>
 
 
Negation (sometimes called the "NOT" operator) makes conditions mean the opposite of what they would otherwise. To negate a condition, use "'''!'''" in front of it.
 
<code>ItemDisplay[MAG ETH ARMOR !ID]:</code> <span style="color:gray;">''hides magic ethereal armor that is not identified''</span>
 
Groups of conditions can be negated in the same way.
 
<code>ItemDisplay[MAG !ID HELM !(BAR OR DRU OR ELT)]:</code> <span style="color:gray;">''hides magic unidentified helms that are not barbarian helms, druid pelts, or elite''</span>


=== Output ===
=== Output ===
119

个编辑

导航菜单