Comments (9)
or how is it possible to get the x and y coordinate of my cell in the browser ?
can't find something usefull...
from agario-client.
I'm not sure i correctly understood your question. Don't know that is adding sth to the appear
and i want them to go into sb
but i will try.
nickname from the other balls around
If you want really "around" balls, lets count this like "balls on screen".
Balls objects have ball.visible
property, which shows is ball visible on screen, and ball.name
which have nickname of player, if he set his nickname.
So here is code for examples/basic.js
that will show all nicknames around you after 5 seconds.
setTimeout(function(){ //timer for 5 seconds
console.log('SEARCHING FOR BALLS AROUND ME!');
for(var ball_id in client.balls) {
if(!client.balls.hasOwnProperty(ball_id)) continue; //prototype can get in the way
var ball = client.balls[ball_id];
if(!ball.visible) continue; //this ball is not on the screen
if(!ball.name) continue; //this ball don't have a nickname
if(ball.mine) continue; //this is our ball
console.log('I see ball with nickname near me! ID ' + ball_id + ' and nickname ' + ball.name);
}
}, 5000);
You can find full list of properties in readme
how is it possible to get the x and y coordinate of my cell in the browser
Can't help with that. I code my own lib without using original code from browser. I don't know where and what stored there.
from agario-client.
@pulviscriptor that's exactly what i want, but don't know why it doesn't work for me (picture above)...and how can i add this to multiple ?
from agario-client.
Also here is code for ballAppear
event
client.on('ballAppear', function(ball_id) {
var ball = client.balls[ball_id];
if(ball.name) console.log('NEW BALL WITH NICKNAME APPEARED! ID ' + ball_id + ', nickname ' + ball.name);
});
agarioBotDev, i pasted code to end of the file basic.js
. Maybe you pasting it in wrong place. Show me your basic.js
where you pasted code.
how can i add this to multiple
Its up to you, i don't know where you want it.
from agario-client.
ok the timer works now, the ballAppear event not, don't know why...
i added this to the multiple.js:
bot.client.on('ballAppear', function (ball_id) {
var ball = client.balls[ball_id];
if (ball.name == "somone") console.log('NEW BALL WITH NICKNAME APPEARED! ID ' + ball_id + ', nickname ' + ball.name);
});
what i'm doing wrong ?
PS: thanks for your great help 👍
from agario-client.
Try to replace
var ball = client.balls[ball_id];
with
var ball = bot.client.balls[ball_id];
from agario-client.
thanks, works
from agario-client.
one last question...
do you have an idea why this doesn't work ?
bot.client.on('ballAppear', function (ball_id) {
var ball = bot.client.balls[ball_id];
if (ball.name == "[Dm] Master")
{
console.log('Master appeared !');
bot.interval_id = setInterval(function () { bot.recalculateTarget() }, 1000000000); // to give the bot enough time to move to me --> next line
bot.client.moveTo(ball.x, ball.y); // here the bot have to move to me, but it doens't work, he still search for this little pieces...?
}
});
PS: it displays the message, so the event work fine
from agario-client.
I don't know what is wrong there, but i see what you trying to do.
You can choose easier way to do this.
You can just modify recalculateTarget()
and add just one line to it
var ball = bot.client.balls[ball_id];
if(ball.virus) continue;
if(!ball.visible) continue;
if(ball.mine) continue;
if(ball.name == 'yourname') return bot.client.moveTo(ball.x, ball.y); //add this line here
if(ball.size/my_ball.size > 0.5) continue;
Didn't tested, but should work.
This is not most correct way to do it, but it will work for you i think.
from agario-client.
Related Issues (20)
- Where is the packet of the little pellets? HOT 3
- Facebook Tokens are not working no matter how. HOT 10
- Agario updated, bots no longer working. HOT 4
- Agario patched anyfix :( HOT 4
- agario-client fixed HOT 2
- THE END HOT 19
- Hey Pro pulviscriptor HOT 5
- HOW TO MAKE MY BOTS WORK HOT 6
- ITS NOT PATCHED! - Working FB, spawning, updating position, etc! HOT 27
- bots are back livestream proof HOT 2
- need help spawn packets instant disconnect HOT 3
- Bots are officially back!!!
- FAILED TO GET TOKEN help pls :) HOT 1
- deleted HOT 2
- I need help HOT 10
- cellcraft old agar.io HOT 1
- PROTOCOL 13 FINDED HOT 6
- Please give me any actual contact of Jaguar500070
- Run node ./node_modules/agario-client/examples/basic.js
- WRONG_HTTP_CODE error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agario-client.