mirror of
https://github.com/jie65535/mirai-console-jhr-plugin.git
synced 2025-06-02 17:39:16 +08:00
增加 利润榜
This commit is contained in:
parent
21767d233c
commit
92a339a24d
@ -496,6 +496,19 @@ object JHorseRacing : KotlinPlugin(
|
||||
}
|
||||
subject.sendMessage(msgB.asMessageChain())
|
||||
}
|
||||
msg == "利润榜" -> {
|
||||
val msgB = MessageChainBuilder(11)
|
||||
msgB.append("利润榜\n")
|
||||
JHRPluginData.playerStat.entries.filter {
|
||||
subject.contains(it.key)
|
||||
&& it.value.totalProfit != 0
|
||||
}.sortedByDescending { it.value.totalProfit }
|
||||
.take(10)
|
||||
.onEach {
|
||||
msgB.append("| ${it.value.totalProfit} | ${subject[it.key]!!.nameCardOrNick}\n")
|
||||
}
|
||||
subject.sendMessage(msgB.asMessageChain())
|
||||
}
|
||||
msg == "统计" -> {
|
||||
val ret = MessageChainBuilder()
|
||||
ret.append(message.quote())
|
||||
|
@ -37,10 +37,15 @@ class PlayerStatistics {
|
||||
var totalWinScore = 0
|
||||
|
||||
/**
|
||||
* 失败积分累计
|
||||
* 失败积分累计 (负数)
|
||||
*/
|
||||
var totalLossScore = 0
|
||||
|
||||
/**
|
||||
* 总利润
|
||||
*/
|
||||
val totalProfit get() = totalWinScore + totalLossScore
|
||||
|
||||
override fun toString(): String {
|
||||
return "下注次数:${betCount}\n" +
|
||||
"获胜次数:${winCount}\n" +
|
||||
|
Loading…
Reference in New Issue
Block a user