-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
worker: node index.js |
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! |
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" | ||
} |
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; | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.