forked from Ilhamskhyi/botv1-Md
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inv.js
115 lines (114 loc) · 18.8 KB
/
inv.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
let levelling = require('../lib/levelling')
let handler = async (m, { conn, usedPrefix }) => {
let healt = global.db.data.users[m.sender].healt
let sword = global.db.data.users[m.sender].sword
let armor = global.db.data.users[m.sender].armor
let warn = global.db.data.users[m.sender].warning
let budak = global.db.data.users[m.sender].budak
let pet = global.db.data.users[m.sender].pet
let kucing = global.db.data.users[m.sender].kucing
let _kucing = global.db.data.users[m.sender].anakkucing
let rubah = global.db.data.users[m.sender].rubah
let _rubah = global.db.data.users[m.sender].anakrubah
let kuda = global.db.data.users[m.sender].kuda
let _kuda = global.db.data.users[m.sender].anakkuda
let diamond = global.db.data.users[m.sender].diamond
let potion = global.db.data.users[m.sender].potion
let common = global.db.data.users[m.sender].common
let makananpet = global.db.data.users[m.sender].makananpet
let uncommon = global.db.data.users[m.sender].uncommon
let mythic = global.db.data.users[m.sender].mythic
let legendary = global.db.data.users[m.sender].legendary
let level = global.db.data.users[m.sender].level
let money = global.db.data.users[m.sender].money
let exp = global.db.data.users[m.sender].exp
let limit = global.db.data.users[m.sender].limit
let sampah = global.db.data.users[m.sender].sampah
let { max } = levelling.xpRange(level, exp, global.multiplier)
let name = m.fromMe ? conn.user : conn.contacts[m.sender]
let sortedmoney = Object.entries(global.db.data.users).sort((a, b) => b[1].money - a[1].money)
let sortedlevel = Object.entries(global.db.data.users).sort((a, b) => b[1].level - a[1].level)
let sorteddiamond = Object.entries(global.db.data.users).sort((a, b) => b[1].diamond - a[1].diamond)
let sortedpotion = Object.entries(global.db.data.users).sort((a, b) => b[1].potion - a[1].potion)
let sortedsampah = Object.entries(global.db.data.users).sort((a, b) => b[1].sampah - a[1].sampah)
let sortedcommon = Object.entries(global.db.data.users).sort((a, b) => b[1].common - a[1].common)
let sorteduncommon = Object.entries(global.db.data.users).sort((a, b) => b[1].uncommon - a[1].uncommon)
let sortedmythic = Object.entries(global.db.data.users).sort((a, b) => b[1].mythic - a[1].mythic)
let sortedlegendary = Object.entries(global.db.data.users).sort((a, b) => b[1].legendary - a[1].legendary)
let usersmoney = sortedmoney.map(v => v[0])
let usersdiamond = sorteddiamond.map(v => v[0])
let userspotion = sortedpotion.map(v => v[0])
let userssampah = sortedsampah.map(v => v[0])
let userslevel = sortedlevel.map(v => v[0])
let userscommon = sortedcommon.map(v => v[0])
let usersuncommon = sorteduncommon.map(v => v[0])
let usersmythic = sortedmythic.map(v => v[0])
let userslegendary = sortedlegendary.map(v => v[0])
let str = `
Inventory *${name.vnmae || name.notify || name.name || ('+' + name.jid.split`@`[0])}*\n
♥️ Health: *${healt}*
🗡️ Sword: *${sword == 0 ? 'Tidak Punya' : '' || sword == 1 ? 'Stone Sword' : '' || sword == 2 ? 'Iron Sword' : '' || sword == 3 ? 'Gold Sword' : '' || sword == 4 ? 'Diamond Sword' : '' || sword == 5 ? 'Netherite Sword' : ''}*
👕 Armor: *${armor == 0 ? 'Tidak Punya' : '' || armor == 1 ? 'Leather Armor' : '' || armor == 2 ? 'Iron Armor' : '' || armor == 3 ? 'Gold Armor' : '' || armor == 4 ? 'Diamond Armor' : '' || armor == 5 ? 'Netherite Armor' : ''}*\n
💵 Money: *${money}*
📈 Level: *${level}*
💫 Exp: *${exp}*
✨Limit: *${limit}*\n
*Inventory*
💎 Diamond: *${diamond}*
🧪 Potion: *${potion}*
🗑️ Sampah: *${sampah}*
🥫 Makanan Pet: *${makananpet}*
Total inv: *${diamond + potion + sampah + makananpet}* item\n
*Crate*
Common: *${common}*
Uncommon: *${uncommon}*
Mythic: *${mythic}*
Legendary: *${legendary}*
Pet: *${pet}*\n\n
Budak: *${budak == 0 ? 'Tidak Punya' : '' || budak == 1 ? 'Level 1' : '' || budak == 2 ? 'Level 2' : '' || budak == 3 ? 'Level 3' : '' || budak == 4 ? 'Level 4' : '' || budak == 5 ? 'Level MAX' : ''}*
*Pet*
Kuda: *${kuda == 0 ? 'Tidak Punya' : '' || kuda == 1 ? 'Level 1' : '' || kuda == 2 ? 'Level 2' : '' || kuda == 3 ? 'Level 3' : '' || kuda == 4 ? 'Level 4' : '' || kuda == 5 ? 'Level MAX' : ''}*
Rubah: *${rubah == 0 ? 'Tidak Punya' : '' || rubah == 1 ? 'Level 1' : '' || rubah == 2 ? 'Level 2' : '' || rubah == 3 ? 'Level 3' : '' || rubah == 4 ? 'Level 4' : '' || rubah == 5 ? 'Level MAX' : ''}*
Kucing: *${kucing == 0 ? 'Tidak Punya' : '' || kucing == 1 ? 'Level 1' : '' || kucing == 2 ? 'Level 2' : '' || kucing == 3 ? 'Level 3' : '' || kucing == 4 ? 'Level 4' : '' || kucing == 5 ? 'Level MAX' : ''}*\n\n
*Proges*\n
╭────────────────
│Level *${level}* To Level *${level}*
│Exp *${exp}* -> *${max}*
╰────────────────
╭────────────────
│Budak ${budak == 0 ? 'Tidak Punya' : '' || budak > 0 && budak < 5 ? `Level *${budak}* To level *${budak + 1}*\n│Exp *${_budak}* -> *${budak *100}*` : '' || budak == 5 ? '*Max Level*' : ''}
╰────────────────
╭────────────────
│Rubah ${rubah == 0 ? 'Tidak Punya' : '' || rubah > 0 && rubah < 5 ? `Level *${rubah}* To level *${rubah + 1}*\n│Exp *${_rubah}* -> *${rubah *100}*` : '' || rubah == 5 ? '*Max Level*' : ''}
╰────────────────
╭────────────────
│Kucing ${kucing == 0 ? 'Tidak Punya' : '' || kucing > 0 && kucing < 5 ? `Level *${kucing}* To level *${kucing + 1}*\n│Exp *${_kucing}* -> *${kucing *100}*` : '' || kucing == 5 ? '*Max Level*' : ''}
╰────────────────
╭────────────────
│Kuda ${kuda == 0 ? 'Tidak Punya' : '' || kuda > 0 && kuda < 5 ? `Level *${kuda}* To level *${kuda + 1}*\n│Exp *${_kuda}* -> *${kuda *100}*` : '' || kuda == 5 ? '*Max Level*' : ''}
╰────────────────\n\n
*achievement*
1.Top level *${userslevel.indexOf(m.sender) + 1}* dari *${userslevel.length}*
2.Top Money *${usersmoney.indexOf(m.sender) + 1}* dari *${usersmoney.length}*
3.Top Diamond *${usersdiamond.indexOf(m.sender) + 1}* dari *${usersdiamond.length}*
4.Top Potion *${userspotion.indexOf(m.sender) + 1}* dari *${userspotion.length}*
5.Top Common *${userscommon.indexOf(m.sender) + 1}* dari *${userscommon.length}*
6.Top Uncommon *${usersuncommon.indexOf(m.sender) + 1}* dari *${usersuncommon.length}*
7.Top Mythic *${usersmythic.indexOf(m.sender) + 1}* dari *${usersmythic.length}*
8.Top Legendary *${userslegendary.indexOf(m.sender) + 1}* dari *${userslegendary.length}*
9.Top Sampah *${userssampah.indexOf(m.sender) + 1}* dari *${userssampah.length}*
\n${readMore}\n
Warn: *${warn}*
Banned: *No*
`.trim()
conn.reply(m.chat, str, m)
}
handler.help = ['inventory', 'inv']
handler.tags = ['rpg']
handler.command = /^(inv(entory)?|bal)$/i
handler.group = true
handler.register = true
module.exports = handler
const more = String.fromCharCode(8206)
const readMore = more.repeat(4001)