-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
138 lines (119 loc) · 4.71 KB
/
Copy pathindex.js
File metadata and controls
138 lines (119 loc) · 4.71 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/**
* Project: GitHub Contribution Pro
* Developer: (SPY-E / 123Tool)
* Version: 2.5 (Interactive)
*/
const simpleGit = require('simple-git');
const fs = require('fs');
const path = require('path');
const moment = require('moment');
const colors = require('colors');
const readline = require('readline');
// Konfigurasi Dasar
const git = simpleGit();
const FILE_PATH = path.join(__dirname, 'contribution_log.txt');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// ===================== MATRIX PATTERN (SPY E) =====================
// Pola 7 baris untuk membentuk tulisan di grid GitHub
const PATTERN_SPYE = [
[1,1,1,0, 1,1,1,0, 1,0,1,0, 0, 1,1,1],
[1,0,0,0, 1,0,1,0, 1,0,1,0, 0, 1,0,0],
[1,1,1,0, 1,1,1,0, 1,1,1,0, 0, 1,1,1],
[0,0,1,0, 1,0,0,0, 0,1,0,0, 0, 1,0,0],
[1,1,1,0, 1,0,0,0, 0,1,0,0, 0, 1,1,1]
];
// ===================== CORE ENGINE =====================
/**
* Fungsi pembantu untuk eksekusi commit
*/
const executeCommit = async (date, intensity = 1) => {
for (let i = 0; i < intensity; i++) {
const logContent = `Log Hash: ${Math.random().toString(36).substring(7)} | Date: ${date}\n`;
fs.appendFileSync(FILE_PATH, logContent);
await git.add(FILE_PATH);
await git.commit(`chore: system sync activity ${i}`, { '--date': date });
}
};
/**
* Mode 1: Natural Activity (Acak)
*/
const runNaturalMode = async () => {
console.log('\n[>] Memulai Mode Natural (Riwayat Acak)...'.cyan);
const totalCommits = 250;
for (let i = 0; i < totalCommits; i++) {
const randomDay = Math.floor(Math.random() * 365);
const date = moment().subtract(randomDay, 'days').format();
await executeCommit(date, 1);
if (i % 10 === 0) process.stdout.write('▓'.green);
}
console.log('\n\n[✔] Sukses! Riwayat kontribusi natural telah dibuat.'.green);
};
/**
* Mode 2: Architect Mode (Tulisan "SPY E")
*/
const runArchitectMode = async () => {
console.log('\n[>] Memulai Mode Architect (Pola "SPY E")...'.cyan);
const WEEKS_AGO = 30; // Posisi di grafik (sekitar tengah tahun)
for (let col = 0; col < PATTERN_SPYE[0].length; col++) {
for (let row = 0; row < PATTERN_SPYE.length; row++) {
if (PATTERN_SPYE[row][col] === 1) {
// Kalkulasi tanggal berdasarkan baris (hari) dan kolom (minggu)
const targetDate = moment()
.subtract(WEEKS_AGO, 'weeks')
.add(col, 'weeks')
.startOf('week')
.add(row, 'days')
.format();
await executeCommit(targetDate, 12); // Intensity 12 agar ijo pekat
process.stdout.write('█'.green);
} else {
process.stdout.write('░'.white);
}
}
console.log(); // Baris baru untuk terminal visualizer
}
console.log('\n[✔] Sukses! Pola visual "SPY E" telah diterapkan.'.green);
};
// ===================== INTERFACE ENGINE =====================
const showMenu = () => {
console.clear();
console.log('==========================================='.green);
console.log(' GITHUB CONTRIBUTION SUITE v2.5'.bold.white);
console.log(' Professional Developer Utility'.italic.white);
console.log('==========================================='.green);
console.log('Developed by: Rolandino (SPY-E)\n'.gray);
console.log('PILIH MODE OPERASI:');
console.log(colors.white('1.') + ' Mode Natural ' + colors.gray('(Terlihat rajin secara acak)'));
console.log(colors.white('2.') + ' Mode Architect ' + colors.gray('(Gambar tulisan "SPY E")'));
console.log(colors.white('3.') + ' Keluar');
rl.question('\nMasukkan pilihan (1/2/3): ', async (answer) => {
// Cek file log
if (!fs.existsSync(FILE_PATH)) fs.writeFileSync(FILE_PATH, 'Init\n');
switch (answer) {
case '1':
await runNaturalMode();
break;
case '2':
await runArchitectMode();
break;
case '3':
console.log('\nEksit... Sampai jumpa, Bos!'.yellow);
process.exit();
break;
default:
console.log('\nPilihan tidak valid!'.red);
setTimeout(showMenu, 1500);
return;
}
console.log('\n-------------------------------------------'.green);
console.log(colors.bold('TUGAS SELESAI!'));
console.log('Langkah terakhir, jalankan: ' + colors.cyan('git push origin main'));
console.log('-------------------------------------------\n'.green);
rl.close();
});
};
// Start Application
showMenu();