Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
beastksoepic committed Mar 23, 2021
0 parents commit 5f9457b
Show file tree
Hide file tree
Showing 1,516 changed files with 1,083,403 additions and 0 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
worker: node index.js
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Aternos AFKBot
This afk bot will keep your aternos server alive 24/7

You can deploy this AFKBot to your heroku application

# Setup
1. Fork this repository, or clone the repository and make it your own
2. Change the config file to your own aternos server
3. Go to https://dashboard.heroku.com/ and create a new application
4. Once you've created your application, simply go to the "Deploy" section and select the repository that you forked
5. Select master and click on "Deploy Branch"
6. Click on the "More" button at the top and click "Restart all Dynos"
7. Done! Enjoy your free 24/7 aternos server

# Keeping your application alive
We all know how awesome Heroku is. Simplicity in creating environments for your rails, java, python or php application is just unbelievable.
Create, deploy, BOOM! Your new app is ready, up and running! But if your site is powered by only 1 dyno, you will quickly notice that after a few hours of app's inactivity, it's first launch takes ages and ages... It is because your dyno was sleeping and now it has to be awakened.

To keep your application alive Please read the following steps
1. Go to https://wakemydyno.com
2. Submit your application (eg. APPLICATION_NAME.herokuapp.com)
3. All done!

# !! CAUTION !!
Aternos might detect your behavior and they might delete your account!

You are responsible for your own actions. I do not recommend doing this on your main aternos server!
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"ip":"YOUR_ATERNOS_SERVER_IP",
"port": "YOUR_ATERNOS_SERVER_PORT",
"name": "BOT_NAME"
}
57 changes: 57 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const mineflayer = require('mineflayer')
const fs = require('fs');
let rawdata = fs.readFileSync('config.json');
let data = JSON.parse(rawdata);
var lasttime = -1;
var moving = 0;
var connected = 0;
var actions = [ 'forward', 'back', 'left', 'right']
var lastaction;
var pi = 3.14159;
var moveinterval = 2; // 2 second movement interval
var maxrandom = 5; // 0-5 seconds added to movement interval (randomly)
var host = data["ip"];
var username = data["name"]
var bot = mineflayer.createBot({
host: host,
username: username
});
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;

}
bot.on('login',function(){
console.log("Logged In")
});
bot.on('time', function() {
if (connected <1) {
return;
}
if (lasttime<0) {
lasttime = bot.time.age;
} else {
var randomadd = Math.random() * maxrandom * 20;
var interval = moveinterval*20 + randomadd;
if (bot.time.age - lasttime > interval) {
if (moving == 1) {
bot.setControlState(lastaction,false);
moving = 0;
lasttime = bot.time.age;
} else {
var yaw = Math.random()*pi - (0.5*pi);
var pitch = Math.random()*pi - (0.5*pi);
bot.look(yaw,pitch,false);
lastaction = actions[Math.floor(Math.random() * actions.length)];
bot.setControlState(lastaction,true);
moving = 1;
lasttime = bot.time.age;
bot.activateItem();
}
}
}
});

bot.on('spawn',function() {
connected=1;
});

15 changes: 15 additions & 0 deletions node_modules/.bin/json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/json5.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/json5.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/nearley-railroad

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/nearley-railroad.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/nearley-railroad.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/nearley-test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/nearley-test.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/nearley-test.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/nearley-unparse

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/nearley-unparse.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/nearley-unparse.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/nearleyc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/nearleyc.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/nearleyc.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/protodef-validator

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/protodef-validator.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5f9457b

Please sign in to comment.