Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let daily_path = 'logs\\daily\\',
- time_path = 'logs\\alltime\\',
- today,
- total
- function getToday(){
- return moment().tz('America/Sao_Paulo').format("DD-MM-YYYY")
- }
- let log = {
- daily: {
- get: ()=>{
- try {
- let today = jsonfile.readFileSync(daily_path + getToday() + '.json')
- return today
- }catch(e){
- let today = {
- base: 0,
- character: 0,
- effect:0,
- etc:0,
- item:0,
- list:0,
- map:0,
- mob:0,
- morph:0,
- npc:0,
- quest:0,
- reactor:0,
- skill:0,
- sound:0,
- string:0,
- tamingmob:0,
- ui:0,
- x86: 0,
- x64: 0,
- altered: 0
- }
- return today
- }
- },
- save: ()=>{
- try{
- jsonfile.writeFileSync(daily_path + getToday() + '.json')
- }catch(e){
- console.log('Error saving daily log')
- }
- }
- },
- total: {
- get: ()=>{
- try {
- let total = jsonfile.readFileSync(total_path + '.json')
- return total
- }catch(e){
- let total = {
- base: 0,
- character: 0,
- effect:0,
- etc:0,
- item:0,
- list:0,
- map:0,
- mob:0,
- morph:0,
- npc:0,
- quest:0,
- reactor:0,
- skill:0,
- sound:0,
- string:0,
- tamingmob:0,
- ui:0,
- x86: 0,
- x64: 0,
- altered,
- verify
- }
- return total
- }
- },
- save: ()=>{
- try{
- jsonfile.writeFileSync(total_path + '.json')
- }catch(e){
- console.log('Error saving all-time log')
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement