diff --git a/README.md b/README.md
index 6c451b1..6fe92b2 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,8 @@ TrafficerMC has a variety of features. Some of them are:
- Auto Reconnect
- and way more!
+#### Minecraft Version 1.8.x - 1.20
+
## Media
![](https://media.discordapp.net/attachments/1101173583956422736/1105880170751078400/image.png)
@@ -42,7 +44,7 @@ TrafficerMC v2.1
TrafficerMC v0.4
# Scripting
-Scripting can allow the bot to do things automatically without any user input. It can also help if you are making multiple bots do the same things. To make a script, you would need to go into a text file editor, and apon finishing the script, you save it as a `.txt` file. You can name it anything. Scripts will run after the bot has spawned in.
+Scripting can allow the bot to do things automatically without any user input. It can also help if you are making multiple bots do the same things.
## What a script would look like
```
@@ -142,7 +144,7 @@ delay 1200
chat Hello
```
# Account File
-Account filing connects the bots with certain names that aren't set in General tab. It can be useful if you want to bot a server with NameMC names, for example. To make a account file, you would need to go into a text file editor, and apon entering all the usernames, you save it as a `.txt` file. You can name it anything. **Please note that you will still need to set the Max Accounts in General Tab for the bots to join!**
+Account filing connects the bots with certain names that aren't set in General tab. It can be useful if you want to bot a server with NameMC names, for example. To make a account file, you would need to go into a text file editor, and apon entering all the usernames, you save it as a `.txt` file. You can name it anything. **Please note that you can set Max Accounts in General Tab or it will use all the names**
## What an account file would look like
```
vampers
diff --git a/assets/icons/app/clipboard.svg b/assets/icons/app/clipboard.svg
new file mode 100644
index 0000000..c19b44c
--- /dev/null
+++ b/assets/icons/app/clipboard.svg
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/assets/js/botMain.js b/assets/js/botMain.js
index 33101af..95eec57 100644
--- a/assets/js/botMain.js
+++ b/assets/js/botMain.js
@@ -1,5 +1,5 @@
const { ipcRenderer, shell } = require("electron")
-const { connectBot, delay, salt, addPlayer, rmPlayer, errBot, botApi, sendLog, exeAll, checkVer, startScript, mineflayer, loadTheme, createPopup, formatText } = require( __dirname + '/assets/js/cf.js')
+const { connectBot, delay, salt, addPlayer, rmPlayer, errBot, botApi, sendLog, exeAll, checkVer, startScript, mineflayer, loadTheme, createPopup, formatText, selectedList } = require( __dirname + '/assets/js/cf.js')
const antiafk = require( __dirname + '/assets/plugins/antiafk')
process.NODE_TLS_REJECT_UNAUTHORIZED = "0"
let currentTime = Date.now()
@@ -78,6 +78,10 @@ let idTmob = document.getElementById('kaTm')
let idTanimal = document.getElementById('kaTa')
let idKaToggle = document.getElementById('toggleka')
let idKaLook = document.getElementById('toggleKaLook')
+let idAutoSelect = document.getElementById('toggleAutoSelect')
+let idCheckOnRespawn = document.getElementById('scriptCheckOnRespawn')
+let idCheckOnDeath = document.getElementById('scriptCheckOnDeath')
+let idCheckIgnoreFriends = document.getElementById('checkKaIgnoreSelected')
//button listeners
window.addEventListener('DOMContentLoaded', () => {
@@ -98,7 +102,13 @@ window.addEventListener('DOMContentLoaded', () => {
idBtnLookAt.addEventListener('click', () => {exeAll("look", idLookValue.value)})
idCheckSprint.addEventListener('click', () => {exeAll("sprintcheck", idCheckSprint.checked)})
idBtnDrop.addEventListener('click', () => {exeAll("drop", idDropValue.value)})
- idBtnStartScript.addEventListener('click', () => {exeAll('startscript')})
+ idBtnStartScript.addEventListener('click', () => {
+ const list = selectedList()
+ if(list.length === 0) return createPopup("No bot selected")
+ list.forEach(name => {
+ startScript(name, idScriptPath.value)
+ });
+ })
idStartAfk.addEventListener('click', () => {exeAll('afkon')})
idStopAfk.addEventListener('click', () => {exeAll('afkoff')})
idBtnC.addEventListener('click', () => {saveData(); window.close()})
@@ -120,7 +130,7 @@ window.addEventListener('DOMContentLoaded', () => {
})
-async function newBot(options) {
+function newBot(options) {
const bot = mineflayer.createBot(options)
let afkLoaded = false
@@ -130,7 +140,7 @@ async function newBot(options) {
bot.once('spawn', ()=> {
botApi.emit("spawn", bot.username)
if(idJoinMessage) {bot.chat(idJoinMessage.value)}
- if(idScriptCheck.checked && idScriptPath.value) { startScript(bot.username, idScriptPath.files[0].path)}
+ if(idScriptCheck.checked && idScriptPath.value) { startScript(bot.username, idScriptPath.value)}
});
bot.once('kicked', (reason)=> {
botApi.emit("kicked", options.username, reason)
@@ -157,31 +167,18 @@ async function newBot(options) {
});
bot.on('windowOpen', (window) => {
- idWindow.innerHTML = ""
- idWindowTitle.innerHTML = formatText(JSON.parse(window.title))
- for (var i = 0; i < window.slots.length; i++) {
- const item = window.slots[i]
- let dname = ""
- if (item) {
- if (item.nbt.value.display.value.Name.value) {
- displayname = JSON.parse(item.nbt.value.display.value.Name.value)
-
- if (displayname.extra) {
- var ext = displayname.extra
- ext.forEach(e => {
- dname += formatText(e)
- });
- } else {
- dname += formatText(displayname)
- }
- }
- const b = document.createElement("li")
- b.innerHTML = `${i} ${dname} ${item.count}x`
- idWindow.appendChild(b)
- }
- }
sendLog(`[${bot.username}] Window opened`)
})
+ bot.on('death', function() {
+ botApi.emit('death', options.username)
+ bot.once('respawn', function() {
+ if(idCheckOnDeath.checked && idScriptPath.value) { startScript(bot.username, idScriptPath.value)}
+ })
+ })
+ bot.on('respawn', function() {
+ botApi.emit('respawn', options.username)
+ if(idCheckOnRespawn.checked && idScriptPath.value) { startScript(bot.username, idScriptPath.value)}
+ })
botApi.once(options.username+'disconnect', () => {bot.quit()})
botApi.once(options.username+'reconnect', () => {newBot(options)})
@@ -193,7 +190,7 @@ async function newBot(options) {
botApi.on(options.username+'stopcontrol', (o) => {bot.setControlState(o, false)})
botApi.on(options.username+'look', (o) => {bot.look(o, 0)})
botApi.on(options.username+'sprintcheck', (o) => {bot.setControlState('sprint', o)})
- botApi.on(options.username+'startscript', () => {startScript(bot.username, idScriptPath.files[0].path)})
+ botApi.on(options.username+'startscript', () => {startScript(bot.username, idScriptPath.value)})
botApi.on(options.username+'afkon', () => {
if(!afkLoaded) {
@@ -242,6 +239,7 @@ async function newBot(options) {
} else {
bot.attack(entity);
}
+ sendLog(`
[${botName}] First time signing in. Please authenticate now: To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code: ${data.user_code} to authenticate.
`)
+ const code = data.user_code
+ sendLog(`
[${botName}] First time signing in. Please authenticate now: To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code: ${code} to authenticate.
[${botName}] First time signing in. Please authenticate now: To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code: ${data.user_code} to authenticate.
`)
+ const code = data.user_code
+ sendLog(`
[${botName}] First time signing in. Please authenticate now: To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code: ${code} to authenticate.
`)
}
};
return options;
@@ -169,12 +171,14 @@ function addPlayer(name) {
idBotList.appendChild(b)
idBotList.scrollTop = idBotList.scrollHeight
updateBotCount()
+ if(idAutoSelect.checked) {selectAll()}
}
//remove player from list
function rmPlayer(name) {
if (document.getElementById("list" + name)) document.getElementById("list" + name).remove()
updateBotCount()
+ if(idAutoSelect.checked) {selectAll()}
}
//log error
@@ -194,23 +198,15 @@ function sendLog(log) {
//execute command all bots
async function exeAll(command, ...args) {
- var sels = document.getElementsByClassName("botSelected");
- if (sels.length === 0) return sendLog(`
- Name Randomizer
-
- Usage: put options in Username input
-
- options: (LEGIT), (SALT)
-
- (LEGIT) Generates legit names
-
- (SALT) Generates 4 random letters
-
- can be used multiple times in name
-
- or with other text
-
- for example: Text_(SALT)
-