Skip to content

Commit

Permalink
Rewards HOTFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronopoldo committed Dec 26, 2021
1 parent 5fc292a commit 07d139c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/UserData/544902183007813652/badges/active
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
0
428
435
2 changes: 1 addition & 1 deletion data/UserData/544902183007813652/badges/lastActve
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11 26 1
11 26 2
2 changes: 1 addition & 1 deletion data/UserData/544902183007813652/integers/exp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7
9.000000000000002
2 changes: 1 addition & 1 deletion data/UserData/544902183007813652/integers/money
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1014
1131
9 changes: 8 additions & 1 deletion src/calculateUserData.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,18 @@ InputMassive[0] = CurrentDate.getMonth()

let lastActiveLvl = Number(fs.readFileSync('./data/UserData/' + msg.author.id + '/tasks/lastActve', "utf8"));
let activeDays = [0,2,4,7,10,14,18,21,25,31,45,60,90]
let rewards = [0,50,100,150,200,400,500,550,600,1000,700,1000,5000]
if (InputMassive[2] >= activeDays[lastActiveLvl])
{
let Money2 = fs.readFileSync('./data/UserData/' + msg.author.id + '/integers/money', "utf8");
Money2 = Number(Money2) + rewards[lastActiveLvl]
fs.writeFileSync('./data/UserData/' + msg.author.id + '/integers/money', Money2.toString(), 'utf8')


lastActiveLvl = lastActiveLvl + 1
fs.writeFileSync('./data/UserData/' + msg.author.id + '/tasks/lastActve', lastActiveLvl.toString(), 'utf8')
msg.reply(':tada: **__Поздравляю!__**\nВы получили новый ' + lastActiveLvl + ' уровень в категории "Ежедневный актив"')
msg.reply(':tada: **__Поздравляю!__**\nВы получили новый ' + lastActiveLvl + ' уровень в категории "Ежедневный актив"\nПолучено монет: ' + rewards[lastActiveLvl-1])

}


Expand Down

0 comments on commit 07d139c

Please sign in to comment.