Skip to content
プロジェクト

概要

Agar.io をプレイできるボットの作成を目指すプロジェクトです。

その他のプロジェクト

この数値の測り方

計測したスター増加

24時間
0
7日間
+1
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Agar.io-bot

A bot that plays Agar.io. It looks at the cells around it, works out which directions are dangerous, and steers somewhere it can eat without being eaten.

Installing

Install aposbot.user.js with Tampermonkey or Violentmonkey and open agar.io.

Playing

  • Press T if you want to use the manual controls.
  • Press B to switch to the next bot when more than one is installed.
  • Press R if you want to toggle the line and dot drawing.
  • Press D to toggle the dark mode.
  • Press P to toggle restarting after a death.
  • Press ESC for the option menu.

The console

window.AposBot does the same things without the keys.

AposBot.start()          // same as pressing T
AposBot.stop()
AposBot.status()         // mass, cells, state, how settled the steering is
AposBot.bots             // the names use() takes
AposBot.use('aposbot')   // switch to one of them
AposBot.bot              // the one that is running
AposBot.world            // the cells, the camera and the map
AposBot.backend          // the socket hook and the input path
AposBot.dump()           // the frames it has seen, as hex

AposBot.dump() is what to attach to an issue when the bot stops reading the game. agar.io moves its frame layout every so often, and the panel says PROTOCOL DESYNC with a hex window around the byte that stopped the parse in the console when it does.

Writing your own bot

A bot is a factory that takes the world API and returns mainLoop, keyAction and displayText. mainLoop returns where you want to go in absolute game coordinates:

AposBot.backend.useBot(function (api) {
    return {
        name: 'MyBot',
        keyAction: function (key) {},
        displayText: function () { return []; },
        mainLoop: function () {
            var me = api.getPlayer()[0];
            if (!me) return [];
            return [me.x + 100, me.y];
        },
    };
});

Paste that into the console and it takes over on the next frame. To install a bot rather than paste it, push the same factory onto window.aposBots from a userscript of your own, which works whichever of the two loads first. B goes to the next bot from there, so the built-in one is a keypress away and yours is another one back. You can read BOT-API.md for more information about what's available. Every accessor you can read the world through, what a cell carries, how the camera moves, and the debug drawing.

If you start working on a bot, make sure to start an issue and tell me about it so that I can add it to the bot list on Alternate Bots

Updates

Your userscript manager handles this. aposbot.user.js carries @updateURL and @downloadURL, so it updates itself on the manager's normal schedule. The bot also checks the GitHub releases API once an hour and mentions a new version in the console.

Sponsoring

You can sponsor the project on GitHub Sponsors if the bot is useful to you.

License

MIT. See LICENSE.

関連プロジェクトを探す

読み込み中…