MotD、提示、讣告、宏命令、自定义设置
在玩家登录、断开连接、计时器触发、使用命令或死亡等时刻触发消息及其他操作。
通过标签替换功能个性化你的消息内容。
功能特性
- 在登录、断开连接、计时器触发、玩家死亡或使用特定命令时触发消息或执行命令。
- 精确指定谁可以触发该消息,以及谁会收到该消息。可以单独指定玩家名称或通过权限组(Permissions)进行分组。
- 支持单词断行和颜色延续(得益于修改后的 vMinecraft 代码!)
- 支持个性化的填空式消息(在此处插入触发者或接收者的姓名/IP/其他信息。)
消息格式
示例属性文件位于 4.0 版本章节中。rTriggers 会在服务器文件夹下的 plugins/rTriggers/rTriggers.properties 生成一个属性文件。
属性文件由一系列消息列表组成。每条消息的格式如下:
triggerers=recipients:options:message
Triggerers(触发者)字段告诉 rTriggers 哪些组或伪组可以触发此消息。Recipients(接收者)字段指定当触发者触发消息时,谁会实际看到该消息。Options(选项)字段指示触发者在何时以何种方式触发消息(例如登录时、死亡时或使用某个特定命令时)。Message(消息)字段则是实际发送的内容。
可以通过逗号(无空格)在 triggerers、recipients 和 options 字段中指定多个值。各字段的具体作用将在下文描述。
图例说明
如果某项内容被 <<>> 包围,你必须包含这些符号!
粗体:选项/组/其他内容的名称
斜体:标签中的可选部分。你可以省略这部分(同时也省略其前面的任何 | 符号)。
下划线:你需要将其替换为具体内容(如数字或组名)。这是必需的,除非它是斜体标注的。
触发者与接收者
Triggerers(触发者)告诉 rTriggers 谁可以触发此消息。Recipients(接收者)告诉当触发者触发消息时,谁会看到它。
如果将 recipients 字段留空,默认接收者即为触发者本人。
groupname:属于该组的成员将触发该消息(如果他们也在 recipients 字段中,则接收该消息)。
<<everyone>>:所有人!
<<hasperm|permissionnode>>:拥有指定权限的玩家将触发/接收此消息。
<<player|playername>>:将 playername 替换为你希望成为触发者(或接收者)的玩家名称。
<<command-triggerer>> 和 <<command-recipient>:使玩家像使用命令一样触发该消息。
<<command-console>>:使服务器控制台像使用命令一样处理该消息。
<<say-triggerer>> 和 <<say-triggerer>>:使玩家说出该消息。(注:原文此处第二个标签疑似有误,通常应为 say-recipient,但依规则保留原文结构翻译语境)
<<timer|interval>>:(仅限触发者)将重复发送此消息(将 'interval' 替换为你希望重复消息的时间间隔,单位为秒)。结合列表使用可制作提示语!
<<t|minutes>>:此消息将在每小时的这一分钟重复发送(<<t|30>> 表示在 1:30、2:30 等时刻触发)。
<<server>>:(仅限接收者)消息发送至服务器。
<<triggerer>>:(仅限接收者)触发该消息的人。
<<twitter>>:(仅限接收者)将消息发送到 Twitter(需要 ServerEvents 插件支持!!!)
<<near-triggerer|dist>>:(仅限接收者)触发者周围 dist x dist 区域内的所有人都会收到该消息。将 'distance' 替换为此区域的有效范围。
- not|groupname 和 not|
<<player|playername>> 和 not|<<triggerer>> 和 not|<<hasperm|permission>>:(仅限接收者,hasperm 除外)其作用类似于不带 'not|' 前缀的版本,只是确保消息不会发送给该人/那些人。
<<craftirc|tagname>>:(仅限接收者)将 'tagname' 替换为你希望 CraftIRC 发送消息到的标签名称。
选项
Options(选项)告诉 rTriggers 消息应在何时以及如何触发。
将此字段留空等同于使用 onlogin 选项。
- onlogin|override - 当触发者登录时触发。Override 选项会用空白行替换默认消息。
- ondisconnect|override - 当触发者登出时触发。Override 选项会用空白行替换原始的断开连接消息。
- oncommand|commandname|override|number - 当触发者使用指定命令时触发。Override 选项会阻止命令传递给其他插件(移除“未知命令!”的提示)。数字指定所需的参数数量。
- onconsole 的工作方式类似于 oncommand 事件,但你无法覆盖这些输出。:( 目前尚未实现。
- onload|pluginname - 每当名为 pluginname 的插件被 CraftBukkit 加载时触发。与作为触发者的
<<customtrigger>> 配合使用。
- onkick - 当触发者被踢出服务器时触发。
- ondeath|natural|deathcause - 当触发者死亡时触发。如果指定了 deathcause,则仅在该死因下触发。可能的死因包括:"contact"(接触)、"entity_attack"(实体攻击)、"fall"(摔落)、"fire"(火焰)、"fire_tick"(火tick伤害)、"lava"(岩浆)、"drowning"(溺水)、"block_explosion"(方块爆炸)、"entity_explosion"(实体爆炸)、"suffocation"(窒息)、"custom"(自定义)、"lightning"(闪电)和 "something"(其他)。如果使用 natural 选项,则当玩家被玩家击杀或死于生物时不会触发。
- ondeath|playerkill - 当触发者被其他玩家击杀时触发。
- delay|seconds - 使消息在触发后等待几秒再执行。
- limit|seconds|pertrigger - 防止消息触发频率高于指定值。如果指定了 pertrigger,则该限制针对每个玩家单独计算,而非全局统一限制。
消息与替换标签
这是你希望 rTriggers 显示或执行的内容。你可以使用替换标签来自定义它,rTriggers 会查找并替换为相应的信息。以下是替换标签列表:
<<triggerer>> - 触发消息的人的名字(例如通过登录、被踢出等方式触发)。
<<recipient>> - 消息接收者的名字(在许多情况下可能与 triggerer 相同)。
<<recipient-displayname>> 和 <<triggerer-displayname>> - 显示名称(区别于原始名称)。
<<player-list>> - 所有在线玩家的列表。
<<color>> - 替换为 §。其后跟随十六进制数字即可获得颜色!(0-9 或 A-F)
<<triggerer-balance>> 和 <<recipient-balance>> - 玩家的 iConomy 余额。
<<death-cause>> - (仅限 ondeath!)死因。
<<killer>> - (仅限 ondeath!)击杀者(玩家名称、生物名称等)。
<<kick-reason>> - (仅限 onkick!)踢出玩家时给出的原因。
仅限 oncommand!
<<param#>> - 将 # 替换为参数编号,例如 <<param1>> 等。它将被玩家输入命令中的内容所替换。
<<param#+>> 和 <<param#->> - 分别被替换为该编号及之前/从该编号开始之后的所有参数。
<<params>> - 被替换为命令中输入的所有参数。
<<list|listname|rand>> - 将被名为 "listname" 的列表中的一个项目替换。如果指定了 rand,则从列表中随机选取一项;否则按顺序依次选取。
IP 地址/位置相关:
<<triggerer-ip>> 和 <<recipient-ip>> - 玩家的 IP 地址。
<<triggerer-locale>> 和 <<recipient-locale>> - 玩家的区域设置/位置。
<<triggerer-country>> 和 <<recipient-country>> - 玩家所在的国家。
<<time>>、<<hour>> 和 <<minute>>:这些标签的作用如你所想。
<<everyone>> 和 <<hasperm|permission>>:消息会为每个在线玩家/拥有相应权限的玩家重复一次,并使用此标签进行替换。
- 你可以在一条消息中多次使用它们,并在同一条消息中使用不同的标签。
- 如果你多次使用相同的标签,它只会对符合条件的每个玩家触发一次。也就是说,让某人执行 "/tell
<<everyone>> Hello there, <<everyone>>!" 只会让他们按名字向每个人打招呼,而不会列出每个玩家给所有玩家听。
- 如果你使用不同的标签,它会遍历满足这些标签的所有有效组合。
列表格式
这些内容与消息放在同一个文件中。
<<list|Bob>>=This text goes in the 'Bob' list.
<<list|Bob>>=This is also in the 'Bob' list.
<<list|haha>>=This is in a separate list called 'haha'
你可以将 "listname" 替换为你想要的任何名称。如果需要,你也可以在此处使用替换标签。
如果您使用替换标签 <<list|listname|rand>> 或 <<list|listname>>,它们将被名为 “listname” 的列表中的项目所替换。如果指定了 ‘rand’,则该项目将从列表中随机选取;否则,它将选择列表中的下一个项目。顺序由您在文件中放置它们的顺序决定。
示例
#################
# MOTD 示例:
# 人类组的基本 MOTD
humans=::§b 你好 <<triggerer>>!@ 输入 /rules 查看规则列表。
玩家登录时显示的新闻。
当玩家输入 /news 时也会显示。
使用 $ 续行到下一行,使用 @ 插入换行。
<<everyone>>=:onlogin,oncommand|/news|override:<<color>>b 这是我们的最新活动:$
@真的什么也没有!
当 'humans'(人类)或 'gods'(神明)组中的任何在线成员登录时,会通知他们。
humans,gods=::<<player-list>>
当人们使用 /rules 命令时显示规则
<<everyone>>=<<triggerer>>:oncommand|/rules|override:1) 不要破坏东西。$
@2) 玩得开心。$
@3) 尊重我的权威!
向服务器广播 'gods'(神明)组中任何成员的登录和断开连接信息
gods=<<everyone>>:onlogin,ondisconnect:<<recipient>> 注意并致敬 <<triggerer>>,你的神明!
####################
提示/计时器示例
这个按顺序执行
<<timer|300>>=<<everyone>>::<<list|TipList>>
这个版本将随机选择一个提示
<<timer|300>>=<<everyone>>::<<list|Burn|rand>>
以下是你的提示
<<list|TipList>>=这个提示排在第一位。
<<list|TipList>>=你在 5 分钟(300 秒)后看到这个提示。
<<list|TipList>>=这个提示在上面的提示之后 5 分钟出现!
这个计时器使服务器每 10 分钟使用一次备份命令!
<<timer|600>>=<<command-console>>::backup
##############
命令/别名示例
每当有人对他人使用 /tp 时广播。
<<everyone>>=<<everyone>>:oncommand|/tp:<<triggerer>> 传送到了 <<param1>>!
将多个命令映射到一个!
/suitup <目标>
给目标玩家一套完整的铁甲,然后把你传送到目标身边。
gods=<<command-triggerer>>:oncommand|/suitup:give <<param1>> ironchestplate 1$
@give <<param1>> ironpants 1$
@give <<param1>> ironboots 1$
@give <<param1>> ironhelmet 1$
@tp <<param1>>
##############
死亡相关事项
当神明死亡时广播其弱点。
god=<<everyone>>:ondeath:即使是像 <<triggerer>> 这样的神明也会死……
每当有人被火烧死时,从列表 "Burn" 中随机选择一条内容。
<<everyone>>=<<everyone>>:ondeath|fire:<<list|Burn|rand>>
<<list|Burn>>=让它燃烧吧!就像 <<triggerer>> 一样。
<<list|Burn>>=你想让 <<triggerer>> 几分熟?
MotD, Tips, Obituaries, Macros, Customization
Trigger messages on login, disconnect, timers, commands, death and more.
Personalize messages with tag replacements.
Features
- Trigger messages or commands on login, disconnect, timers, or even player death and command uses.
- Decide exactly who can set off a message, and who gets it. Name players individually or by group (via Permissions).
- Line breaks on words, colour continuations (thanks to modified vMinecraft code!)
- Personalized, fill-in-the-blanks style messages (insert the triggerer or recipient's name/IP/whatever here.)
Messages format
Example properties file is in the section 4.0. rTriggers will make a properties file at plugins/rTriggers/rTriggers.properties, where plugins is in your server's folder.
The properties file consists of a list of your messages. Each message is formatted like this:
triggerers=recipients:options:message
The triggerers tell rTriggers which groups or psuedogroups can set this message off. Recipients are the ones who actually see the message when a triggerer sets it off. Options tell when and in what manner a triggerer can set off a message (like when logging in, dying, or using a certain command). The message is the actual thing that gets sent.
One can specify multiple things in the triggerers, recipients, and options fields by using commas (no spaces). What each field does is described in a section below.
Legend
If it has <<>> around it, you need to include those!
bold: The name of the option/group/whatever
italics: An optional part of the tag. You can leave this out (leave out any | in front of it, too).
underlined: You replace this with something (like a number, or a group name). Necessary, unless it's italics.
Triggerers and Recipients
Triggerers tell rTriggers who can set this message off. Recipients tell who sees this message whenever a triggerer sets it off.
Leaving the recipients field blank will default the recipient to just the triggerer.
groupname: Members in this group will trigger the message (or receive it, if they're in the recipients field).
<<everyone>>: Everyone!
<<hasperm|permissionnode>>: People with the stated permission trigger/receive this message.
<<player|playername>>: Replace playername with the name of the player you want to be a triggerer (or a recipient).
<<command-triggerer>> and <<command-recipient>: Makes the player use the message as if it were a command.
<<command-console>>: Makes the server console use the message as if it were a command.
<<say-triggerer>> and <<say-triggerer>>: Makes the player say the message.
<<timer|interval>>: (Triggerer only) Will repeat this message (replace 'interval' with how often you want to repeat the message in seconds). Use with lists to make tips!
<<t|minutes>>: This message will repeat every hour at this minute (<<t|30>> happens at 1:30, 2:30, etc.)
<<server>>: (Recipient only)Message is sent to the server.
<<triggerer>>: (Recipient only) The person who triggered the message.
<<twitter>>: (Recipient only) Sends the message to Twitter (ServerEvents required!!!)
<<near-triggerer|dist>>: (Recipient only) Everyone inside a dist x dist square around the triggerer gets the message. Replace 'distance' with the active area of this.
- not|groupname and not|
<<player|playername>> and not|<<triggerer>> and not|<<hasperm|permission>>: (Recipient only, except for hasperm) Works like the versions without 'not|' in front of them, except it makes sure that the message WON'T get sent to that person/those persons.
<<craftirc|tagname>>: (Recipient only) Replace 'tagname' with the name of the tag you want CraftIRC to send the message to.
Options
Options tell rTriggers when the message should trigger, and how.
Leaving this blank is the same as using the onlogin option.
- onlogin|override - Triggers when a triggerer logs in. Override will replace the default message with a blank line.
- ondisconnect|override - Triggers when a triggerer logs out. Override will replace the original disconnect message with a blank line.
- oncommand|commandname|override|number - Triggers when a triggerer uses the specified command. Override doesn't let the command move to other plugins (removes the 'unknown command!' prompts). The number specifies the number of required arguments.
- onconsole works like the oncommand event, except you can't override these. :( Not yet, anyway.
- onload|pluginname - Whenever the plugin called pluginname is loaded by CraftBukkit. Use with
<<customtrigger>> as the triggerer.
- onkick - Triggers when a triggerer gets booted from the server.
- ondeath|natural|deathcause - Triggers when a triggerer dies. If deathcause is specified, will only trigger on that manner of death. Possible death causes are: "contact", "entity_attack", "fall", "fire", "fire_tick", "lava", "drowning", "block_explosion", "entity_explosion", "suffocation", "custom", "lightning", and "something." If the natural option is used, then it will not trigger if the player died by playerkilling, or from a mob.
- ondeath|playerkill - Triggers when a triggerer is killed by a fellow player.
- delay|seconds - Makes the message wait a few seconds after being triggered before happening
- limit|seconds|pertrigger - Keeps a message from triggering faster than specified. If pertrigger is specified, then this limit is done on a per-player basis, rather than being for everyone.
Messages and Replacement Tags
This is what you want rTriggers to say or do. You can customize it with replacement tags, which rTriggers will find and replace with the appropriate information. Here's a list of replacement tags:
<<triggerer>> - The name of person who triggered the message (by logging in, getting kicked, etc).
<<recipient>> - The name of the person who the message is being sent to (may be the same as triggerer in many cases).
<<recipient-displayname>> and <<triggerer-displayname>> - The display name (as opposed to the raw name).
<<player-list>> - A list of all the players online.
<<color>> - Replaced with §. Follow up with a hexadecimal number to get a color! (0-9 or A-F)
<<triggerer-balance>> and <<recipient-balance>> - The player's iConomy balance.
<<death-cause>> - (ondeath only!) The cause of death.
<<killer>> - (ondeath only!) The killer (player name, creature name, etc.)
<<kick-reason>> - (onkick only!) The reason given for kicking the player.
oncommand only!
<<param#>> - Replace the # with parameter number, like <<param1>>, etc. It's replaced by what the player puts into the command.
<<param#+>> and <<param#->> - is replaced by all the parameters up to and including that number/starting with and following that number.
<<params>> - Is replaced by all the parameters put into the command
<<list|listname|rand>> - Will be replaced by an item in the list called "listname." If rand is specified, it will give a random one from the list. If not, it will go down the list sequentially.
IP Address/Location related:
<<triggerer-ip>> and <<recipient-ip>> - The player's IP Address.
<<triggerer-locale>> and <<recipient-locale>> - The player's location.
<<triggerer-country>> and <<recipient-country>> - The player's country.
<<time>>, <<hour>>, and <<minute>>: These do what you probably think they do.
<<everyone>> and <<hasperm|permission>> the message will be repeated once for each player online/with that permission, with this tag replacement
- You can use them multiple times in a message, and use different ones in a message.
- If you use the same tag multiple times, it will only trigger once for each player that it applies to. That is, making someone execute "/tell
<<everyone>> Hello there, <<everyone>>!" will only make them say hello to everyone by their name. It won't make them list off every player to every player.
- If you use different ones, it'll go through every valid combination that satisfies those tags.
List Format
These go in the same file as the messages.
<<list|Bob>>=This text goes in the 'Bob' list.
<<list|Bob>>=This is also in the 'Bob' list.
<<list|haha>>=This is in a separate list called 'haha'
You replace "listname" with whatever name you want. You can use replacement tags here, if you like.
If you use either the replacement tag <<list|listname|rand>> or <<list|listname>> will be replaced by an item in the list called "listname." If 'rand' is specified, this item will be randomly selected from the list. If not, it will just pick the 'next' item on the list. Order is determined by the order you put it in the file.
Example
#################
# MOTD Example:
# Basic MotD for humans group
humans=::§b Hey <<triggerer>>!@ Type /rules for a list of rules.
News that shows when players log in.
Also shows up when players type /news.
Use $ to continue on the next line, and @ to insert a linebreak.
<<everyone>>=:onlogin,oncommand|/news|override:<<color>>b Here's our latest events:$
@Nothing at all, really!
Tells anyone in the 'humans' or 'gods' group who's online when they log in.
humans,gods=::<<player-list>>
#Displays rules when people use the /rules command
<<everyone>>=<<triggerer>>:oncommand|/rules|override:1) Don't break things.$
@2) Have fun.$
@3) RESPECT MAH AUTHORATAH!
Announces the login and disconnect of anyone in the 'gods' group to the server
gods=<<everyone>>:onlogin,ondisconnect:<<recipient>> pay heed, and hail <<triggerer>>, your god!
####################
Tips/Timer Example
This one does it sequentially
<<timer|300>>=<<everyone>>::<<list|TipList>>
This version will pick a random tip
<<timer|300>>=<<everyone>>::<<list|Burn|rand>>
Here are your tips
<<list|TipList>>=This tip comes first.
<<list|TipList>>=You see this tip 5 minutes (300 seconds) later.
<<list|TipList>>=This one comes 5 minutes after the one above!
This timer makes the server use the backup command every 10 minutes!
<<timer|600>>=<<command-console>>::backup
##############
Commands/Aliases example
Will announce whenever someone /tps to someone.
<<everyone>>=<<everyone>>:oncommand|/tp:<<triggerer>> tp'd to <<param1>>!
Map multiple commands to one!
/suitup <target>
Gives the target player a full suit of iron armor and then teleports you to the target.
gods=<<command-triggerer>>:oncommand|/suitup:give <<param1>> ironchestplate 1$
@give <<param1>> ironpants 1$
@give <<param1>> ironboots 1$
@give <<param1>> ironhelmet 1$
@tp <<param1>>
##############
#Death Related stuff
Will announce the weakness of a god when he or she dies.
god=<<everyone>>:ondeath:Even a god like <<triggerer>> can die...
Will randomly select something in the list "Burn" whenever someone burns to death.
<<everyone>>=<<everyone>>:ondeath|fire:<<list|Burn|rand>>
<<list|Burn>>=Let it burn! Just like <<triggerer>>.
<<list|Burn>>=Would you like your <<triggerer>> medium or well done?
评论 0
登录后参与评分
还没有评论,来抢沙发吧