Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function updateWidget() {
- var tops = []
- for (i=1;i<200000;i++) {
- if(acc.users[i]) {
- if(acc.users[i].level < 4) {
- tops.push({id: i, idvk: acc.users[i].id});
- }
- }
- }
- var script = {
- title: `Топ лучших игроков! `,
- more: `Обновился ${data()} в ${time()}`,
- more_url: `vk.com/write-186743893`,
- head: [
- {
- text: 'Ник'
- },
- {
- text: 'Деньги',
- align: 'right'
- },
- {
- text: 'Бицухи',
- align: 'right'
- },
- {
- text: 'Привелегия',
- align: 'right'
- },
- ],
- body: []
- }
- for (var g = 0; g < 10; g++) {
- if (tops.length > g) {
- var ups = g;
- ups += 1;
- if(g <= 8) ups = `${ups}`
- if(g == 9) ups = `10`
- script.body.push([
- {
- icon_id: `id${tops[g].idvk}`,
- text: `${acc.users[tops[g].id].prefix}`,
- url: `vk.com/id${tops[g].idvk}`
- },
- {
- text: `${spaces(acc.users[tops[g].id].balance)}$`
- },
- {
- text: `${spaces(acc.users[tops[g].id].bomj.pvp)}`
- },
- {
- text: `'${Args.uid}' ${acc.users[tops[g].id].level.toString().replace(/0/gi, "🚬 Бомж").replace(/1/gi, "💰Богач").replace(/2/gi, "💸 Министр").replace(/3/gi, "🔮СНАК🔮").replace(/4/gi, "Администратор").replace(/5/gi, "Гл.Администратор").replace(/6/gi, "👑 CREATOR 👑")}`
- },
- ])
- }
- }
- requests.post({url: 'https://api.vk.com/method/appWidgets.update', form:{
- v: '5.95',
- type: 'table',
- code: `return ${JSON.stringify(script)};`,
- access_token: `${config.wdt}`
- }
- },
- function(err, resp, body) {
- console.log(`${JSON.stringify(body)}`)
- })
- }
- updateWidget()
- setInterval(updateWidget, 30000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement