Skip to content

Instantly share code, notes, and snippets.

@mstefarov
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstefarov/63c6fe6b84da71d40b8a to your computer and use it in GitHub Desktop.
Save mstefarov/63c6fe6b84da71d40b8a to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<fCraftAutoRank>
<!-- Each <Criterion> tag is a rule. Either short or fully-qualified rank names can be used.
This example automatically promotes players from builder to veteran rank if
they meet either of the two condition sets. -->
<Criterion fromRank="builder#mTaSFlmnBk1QYVqN" toRank="veteran#yuSfyiJ7AvuE0nc8">
<!-- Tags like <OR>, <AND>, <NOR>, and <NAND> logically combine conditions.
In this example, two alternative sets of conditions are grouped with <AND>.
These groups are then combined by <OR>, which will trigger the promotion
if either of the condition sets is met. -->
<OR>
<AND>
<!-- Conditions come in three flavors: ConditionIntRange (for numeric ranges),
ConditionRankChangeType, and ConditionPreviousRank.
For ConditionIntRange and ConditionPreviousRank, "op" (comparison operation) can be:
- Lt (less than)
- Gt (greater than)
- Lte (less than or equal)
- Gte (greater than or equal)
- Eq (equal)
- Neq (not equal)
For ConditionIntRange, "field" can be:
- TimeSinceFirstLogin (in seconds)
- TimeSinceLastLogin (in seconds)
- LastSeen (time since last log-off, in seconds)
- BlocksBuilt (by hand)
- BlocksDeleted (by hand)
- BlocksChanged (BlocksBuilt + BlocksDeleted)
- BlocksDrawn (with commands)
- TimesVisited (starts at 1 for first-time players)
- MessagesWritten
- TimesKicked
- TotalTime (in seconds)
- TimeSinceRankChange (in seconds)
- TimeSinceLastKick (in seconds) -->
<ConditionIntRange field="TimesKicked" val="0" op="eq" />
<ConditionIntRange field="MessagesWritten" val="500" op="gte" />
<ConditionIntRange field="BlocksChanged" val="30000" op="gte" />
<ConditionIntRange field="TotalTime" val="90000" op="gte" />
<ConditionIntRange field="TimeSinceLastLogin" val="250000" op="lte" />
<!-- For ConditionRankChangeType, "val" can be:
- Default (rank has never been changed)
- Promoted (promoted manually by another player or by console)
- Demoted (demoted manually by another player or by console)
- AutoPromoted (promoted automatically by AutoRank)
- AutoDemoted (demoted automatically by AutoRank) -->
<NAND><ConditionRankChangeType val="Demoted" /></NAND>
</AND>
<AND>
<!-- This is the second alternative set of conditions for promotion. -->
<ConditionIntRange field="TimesKicked" val="1" op="eq" />
<ConditionIntRange field="MessagesWritten" val="600" op="gte" />
<ConditionIntRange field="BlocksChanged" val="40000" op="gte" />
<ConditionIntRange field="TotalTime" val="100000" op="gte" />
<ConditionIntRange field="TimeSinceLastLogin" val="250000" op="lte" />
<ConditionIntRange field="TimeSinceLastKick" val="250000" op="gte" />
<NAND><ConditionRankChangeType val="Demoted" /></NAND>
</AND>
</OR>
</Criterion>
<!-- This example auto-demotes ops to veterans for inactivity... -->
<Criterion fromRank="op#INQ2cjle601IDwig" toRank="veteran#yuSfyiJ7AvuE0nc8">
<AND>
<ConditionIntRange field="LastSeen" val="7776000" op="Gt" />
</AND>
</Criterion>
<!-- But automatically re-promotes them if they come back! -->
<Criterion fromRank="veteran#yuSfyiJ7AvuE0nc8" toRank="op#INQ2cjle601IDwig">
<AND>
<ConditionPreviousRank val="op#INQ2cjle601IDwig" op="Eq" />
<!-- Here we are assuming that AutoRank will check this rule and promote the player
within 5 minutes of them logging in. -->
<ConditionIntRange field="LastSeen" val="300" op="Lte" />
<!-- This check is needed to avoid accidentally re-promoting manually demoted ops. -->
<ConditionRankChangeType val="AutoDemoted" />
</AND>
</Criterion>
</fCraftAutoRank>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment