-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRacro.js
252 lines (222 loc) · 9.9 KB
/
Racro.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
const readline = require('readline');
const mineflayer = require('mineflayer');
const axios = require('axios');
const { EmbedBuilder } = require('discord.js');
const chalk = require('chalk');
var figlet = require("figlet");
const {once} = require("events")
const gradient = require('gradient-string');
require('dotenv').config();
const { pathfinder, Movements, goals: { GoalFollow } } = require('mineflayer-pathfinder');
const { CategoryChannel } = require('discord.js');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
function fetchUsernameFromMinecraftWebsite(ssid) {
return axios
.get('https://api.minecraftservices.com/minecraft/profile', {
headers: {
Authorization: 'Bearer ' + ssid,
},
})
.then((response) => response.data)
.catch(() => {
throw new Error(chalk.red('Invalid SSID.'));
});
}
async function main() {
console.clear();
console.log(gradient.vice.multiline`
███▄ ▄███▓▓██ ██▓ ██▀███ ▄▄▄ ▄▄▄█████▓ ██▀███ ▄▄▄ ▄████▄ ██▀███ ▒█████
▓██▒▀█▀ ██▒ ▒██ ██▒▓██ ▒ ██▒▒████▄ ▓ ██▒ ▓▒ ▓██ ▒ ██▒▒████▄ ▒██▀ ▀█ ▓██ ▒ ██▒▒██▒ ██▒
▓██ ▓██░ ▒██ ██░▓██ ░▄█ ▒▒██ ▀█▄ ▒ ▓██░ ▒░ ▓██ ░▄█ ▒▒██ ▀█▄ ▒▓█ ▄ ▓██ ░▄█ ▒▒██░ ██▒
▒██ ▒██ ░ ▐██▓░▒██▀▀█▄ ░██▄▄▄▄██░ ▓██▓ ░ ▒██▀▀█▄ ░██▄▄▄▄██ ▒▓▓▄ ▄██▒▒██▀▀█▄ ▒██ ██░
▒██▒ ░██▒ ░ ██▒▓░░██▓ ▒██▒ ▓█ ▓██▒ ▒██▒ ░ ░██▓ ▒██▒ ▓█ ▓██▒▒ ▓███▀ ░░██▓ ▒██▒░ ████▓▒░
░ ▒░ ░ ░ ██▒▒▒ ░ ▒▓ ░▒▓░ ▒▒ ▓▒█░ ▒ ░░ ░ ▒▓ ░▒▓░ ▒▒ ▓▒█░░ ░▒ ▒ ░░ ▒▓ ░▒▓░░ ▒░▒░▒░
░ ░ ░ ▓██ ░▒░ ░▒ ░ ▒░ ▒ ▒▒ ░ ░ ░▒ ░ ▒░ ▒ ▒▒ ░ ░ ▒ ░▒ ░ ▒░ ░ ▒ ▒░
░ ░ ▒ ▒ ░░ ░░ ░ ░ ▒ ░ ░░ ░ ░ ▒ ░ ░░ ░ ░ ░ ░ ▒
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ `);
console.log(gradient.vice.multiline(' Welcome to Racro V2 AOTV'));
const ssid = process.env.SSID;
try {
const { name, id } = await fetchUsernameFromMinecraftWebsite(ssid);
console.log(chalk.green(`Minecraft username: ${name}`));
console.log(chalk.green(`Client Token: ${id}`));
const bot = mineflayer.createBot({
host: 'hypixel.net',
port: 25565,
version: '1.8.9',
username: name,
session: {
accessToken: ssid,
clientToken: id,
selectedProfile: {
id: id,
name: name,
},
},
auth: 'mojang',
skipValidation: true,
});
bot.loadPlugin(pathfinder);
const sleep = ms => new Promise((resolve) => setTimeout(resolve, ms))
bot.on('messagestr', (message) => {
const messageString = message.toString();
// Exclude messages containing mana, defense, and health
if (
!messageString.includes('✎') &&
!messageString.includes('❈') &&
!messageString.includes('❤') &&
!messageString.includes('+400 Bits from Cookie Buff!')
) {
console.log(gradient.fruit.multiline(`${message.toString()}`));
}
});
bot.once('login', async () => {
console.log(chalk.yellow(`Logged in to Hypixel as ${bot.username}`));
// Perform actions after logging in
await sleep(2000); // Initial cooldown
// Send chat commands once
bot.chat('/language english');
await sleep(3000);
bot.chat('/play skyblock');
await sleep(3000);
bot.chat('/p leave');
await sleep(2000);
bot.chat('/warp dungeon_hub');
await sleep(3000);
bot.loadPlugin(pathfinder)
async function logToWebhook(embed) {
const webhookUrl = process.env.WEBHOOK_URL;
try {
const response = await axios.post(webhookUrl, { embeds: [embed] });
console.log('Log successfully sent to webhook.');
console.log('Response:', response.data);
} catch (error) {
console.error('Error sending log to webhook:', error);
}
}
bot.on('messagestr', async (message) => {
const messageString = message.toString();
if (messageString.includes('Party Finder > Your group has been removed from the party finder!')) {
bot.chat('/is');
await sleep(2000); // Wait for 2 seconds
bot.chat('/warp dungeon_hub');
await sleep(3000); // Wait for 2 seconds
sneakEquipAndHitMort();
}
});
bot.on('messagestr', async (message) => {
const messageString = message.toString();
if (messageString.includes('Your active Potion Effects have been paused and stored. They will be restored when you leave Dungeons! You are not allowed to use existing Potion Effects while in Dungeons.')) {
bot.chat('/hub');
console.log("Going to Hub.");
await sleep(2000); // Wait for 2 seconds
bot.chat('/warp dungeon_hub');
console.log("Warping to Dungeon Hub.");
await sleep(2000); // Wait for 2 seconds
bot.chat('/p leave');
console.log("Leaving Party.");
await sleep(3000); // Wait for 2 seconds
sneakEquipAndHitMort();
}
});
bot.on('messagestr', async (message) => {
const messageString = message.toString();
if (messageString.includes('joined the dungeon group!')) {
// Execute the actions hat commands
bot.chat('/is');
await sleep(2000); // Wait for 2 seconds
bot.chat('/p warp');
await sleep(2000); // Wait for 2 seconds
bot.chat('/warp dungeon_hub');
await sleep(2000); // Wait for 2 seconds
const embed = new EmbedBuilder()
.setTitle('Racro V2')
.setDescription('Someone has joined the Dungeon Queue.')
.setFooter({ text: 'Powered by MyRAT', iconURL: 'https://i.postimg.cc/2SrnZ4L9/my-Rat-Logo.png' });
// Send the embed to the webhook
await logToWebhook(embed);
await sleep(2000);
sneakEquipAndHitMort();
}
});
bot.on("kicked", async function(permissions, canCreateDiscussions) {
var p = JSON.parse(permissions);
var size = p.extra[0].text;
if (url) {
const embed = new EmbedBuilder()
.setTitle('Racro V2')
.setDescription('Bot has been kicked from the server.')
.addField('Reason', size)
.setFooter({ text: 'Powered by MyRAT', iconURL: 'https://i.postimg.cc/2SrnZ4L9/my-Rat-Logo.png' });
// Send the embed to the webhook
try {
await axios.post(url, {
embeds: [embed]
});
} catch (error) {
console.log("Invalid WEBHOOK.");
}
}
console.log("Bot has been kicked: " + permissions);
process.exit();
});
bot.on('messagestr', async (message) => {
const messageString = message.toString();
if (messageString.includes('You were kicked while joining that server!')) {
await sleep(2000);
bot.chat('/lobby');
await sleep(2000); // Wait for 2 seconds
bot.chat('/play skyblock');
await sleep(2000);
bot.chat('/warp dungeon_hub');
await sleep(3000);
}
});
async function sneakEquipAndHitMort() {
bot.setControlState('sneak', true);
await sleep(1000)
bot.setQuickBarSlot(0);
bot.activateItem(false);
bot.setControlState('sneak', false);
await sleep(1000)
bot.attack(bot.nearestEntity());
await sleep(500)
console.log(chalk.green("[MyRAT RacroV2] Clicked on Mort."));
await sleep(50)
}
async function StartQueue() {
let clickOrder = [11, 14, 45, 32];
let index = 0;
bot.on('windowOpen', async (window) => {
try {
const slot = clickOrder[index];
await sleep(500);
window.requiresConfirmation = false;
await bot.clickWindow(slot, 0, 0);
console.log(chalk.greenBright(`[MyRAT RacroV2] Clicked on Slot ${slot}`));
index++;
if (index >= clickOrder.length) {
index = 0;
}
} catch (error) {
console.error('An error occurred:', error);
index++;
if (index >= clickOrder.length) {
index = 0;
}
}
});
}
StartQueue();
sneakEquipAndHitMort();
});
rl.close();
} catch (error) {
console.error(chalk.red(error));
rl.close();
}
};
main();