Skip to content
This repository was archived by the owner on Nov 24, 2026. It is now read-only.
Darkbot-PluginsPublic archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AnotherPacketBot

Experimental, AI-assisted project — not maintained.

This project was built as an experiment with AI assistance. It is not actively maintained, receives no updates or support, and may not work with the current version of the game client. It is published as is, for reading and learning, and is used entirely at your own risk.

Released under the MIT License.

Desktop packet bot for the browser game that speaks its Unity client's TCP protocol without a browser. Java 21 + Swing/FlatLaf, username/password login, live map, cargo and session progress, a collect/combat loop and a packet-driven quest module, with station repair and kill-screen revive using the real packets.

What keeps usage simple

  • Username and password only: no need to paste a SID or hunt for cookies (a SID, if you prefer one, only needs the region where the account was created).
  • One screen to start: the Dashboard asks for the account, the module and Start. Everything else keeps a safe default.
  • Saved accounts: the account list keeps the username, region and — only if you tick Remember password — the password, so the next launch is one click. The Dashboard shows the saved accounts as tiles, with the active one marked, a Fill button and a one-click Sign in when the password was saved. The Accounts page is the full overview of every saved account, its session state and the Add account shortcut.
  • Named configuration profiles: save the current settings under a name in Settings → Profiles, then load, overwrite or delete it later. Profiles are stored as individual JSON files under config/profiles, survive a restart, and loading keeps the account username, region and portal of the current session. A missing or invalid profile leaves the active configuration alone.
  • HUD: the map draws the hero block (name, level, map, config/formation, ammunition) with HP, shield and cargo bars, plus the session counters (uptime, kills, deaths, boxes, credits, uridium) and an in-map game log of the latest events. Both overlays can be hidden in Settings → Display, which also hides the names per entity type (NPCs, players, boxes, portals).
  • Ore seller: opt-in module that flies to the nearest station once the cargo reaches the configured percentage, opens the trade window and sells the ores a station buys with the real sell packet. Cargo counts come from the server. Setup lives in Settings → Ore.
  • Group: opt-in module that answers group invitations from the players you allow (by name tag), rejects the rest and can leave a group that emptied out. While the bot leads it can also invite matching players on its map (tag plus interval, real GroupInvitationRequest) and let the members invite (InvitationModeRequest). Its settings live in Settings → Group and it uses the real invitation and leave packets.
  • Pet: opt-in module that launches the pet, keeps its behaviour gear (PASSIVE, GUARD, AUTO_LOOT, AUTO_RESOURCE_COLLECTION), refills its fuel, repairs it and keeps its own ship configuration and drone formation. Its state (airborne or in the hangar, hull and fuel) comes from the real pet commands and is drawn in the map HUD; Settings → Pet holds the limits.
  • Modules: Collector, NPC killer, Full auto and Gates apply the switches they describe; radii, thresholds and the account are left alone. Travel is shared by all of them: set a destination map (or a gate entry map) and every running module walks to the gate and jumps there by itself.
  • Equipment: equips the configured ammo after a revive or when the server reports the current ammunition empty (this game has no magazine to reload), can equip a rocket and fire it at the locked target on a cooldown, and can apply a drone formation. Formations are observed from the server (DroneFormationChangeCommand); the protocol map has no dedicated formation request, so the bot sends the same packet and only trusts the server echo.
  • Gates: builds and farms the gates enabled in Settings → Gates. A galaxy gate is built with the builder (spin for parts → place the gate), entered through its portal, farmed and left at the configured wave, when the server reports it complete, or when the map is empty. Each row has its own priority, minimum lives, exit wave and optional entry map/point; event gates (Voyagers, Trinity Trials, Eternal Blacklight, Fiesta, Dispatch) use their own request or portal. The legacy empty-map farmer remains for maps that only need a jump gate.
  • Zones: draw preferred areas and safety places on the map (Settings → Zones) and keep the bot inside them. With Only fight and collect inside the preferred areas the NPC and box searches ignore everything outside a preferred area of the current map (a map without preferred areas is never restricted); with Flee to the nearest safety place the safety module runs to the configured safety zone instead of straight away from the enemy. Each zone is a circle on one map (0 = every map), drawn over the world.
  • Combat options: SAB-50 swaps in while the own shield is low and the configured ammo returns afterwards, RSB-75 is used only against targets above a hull threshold, repair has a range (start at the lower bound, keep going to the upper one), the box search shrinks while an NPC is being fought, contested boxes can be skipped, and the preferred areas can be visited in order. The ship can roam along a fixed circle instead of at random (Settings → Collection), gives up on an NPC it cannot reach for a while (Settings → Combat), waits after a revive before acting again (Settings → Repair), and the in-map game log draws a per-kind icon and drops the kinds you uncheck (Settings → Display).
  • Stuck detector: when the ship stops closing the distance to the NPC or the box it is flying to for the configured seconds, it takes one sideways step and lets the task resume.
  • Map image and timed game log: a PNG or JPEG can be drawn behind the world with its own opacity, and the in-map game log expires its lines by time as well as by count. It is also appended to logs/<account>.game.log by default (Settings → Display).
  • MCP server: opt-in local JSON-RPC endpoint (loopback only, optional bearer token) with tools to read status/hero/entities/quests/config and to start or stop the bot, apply a module, move, jump, select ammo or formation and fire a rocket.
  • Quests: the bot asks for the daily quests, accepts the ones you allow and shows their objectives, rewards and progress without reading memory or the game window.
  • Automatic server: login detects the region, gets userID/pid/mapID from unityApi/login.php and resolves the map server through spacemap/xml/maps.php. No host, port or map to configure.
  • Real transport: TCP socket, first packet with byte 0, 3-byte big-endian length and payload. No WebSocket.

License

MIT. See LICENSE.

This project is not affiliated with, endorsed by or supported by the game's publisher. Using a bot may violate the game's terms of service and can lead to penalties or account suspension; use it only with your own accounts and at your own risk.

Requirements

  • JDK 21 (the Gradle wrapper uses toolchain 21)
  • Windows, Linux or macOS
  • Network access for the first build (Gradle and dependencies)

Build and run

./gradlew build          # compiles and runs every test
./gradlew run            # opens the interface
./gradlew run --args="--replay"   # demo without network or account

Check the HTTP login and the Unity identity without opening the interface:

./gradlew run --args="--login-check --credentials=config/account.properties"

Establish a full session and exit as soon as the hero and the map are decoded:

./gradlew run --args="--session-check --credentials=config/account.properties"

Live check of the circle roam and the post-revive wait on the configured account (writes traces/live-roam-*.log and exits non-zero on a regression):

./gradlew run --args="--live-roam-check --circle-seconds=70 --revive-wait=6 --credentials=config/account.properties"

Continuous headless mode (also starts the bot):

./gradlew run --args="--headless --credentials=config/account.properties"

Protocol maintenance when the game publishes a new client:

./gradlew run --args="--protocol-check"                    # bundled map
./gradlew run --args="--protocol-check --protocol=new.json"
./gradlew run --args="--protocol-diff=new.json"            # build/protocol-diff.md
./gradlew run --args="--protocol=new.json --session-check" # test without rebuilding

Decision architecture: module → behaviour → task

The decision logic is split in three levels:

  • Module (bot/module) groups the behaviours of one activity and owns the configuration slice that activates it: safety, revive, repair, travel, equipment, combat, collector, quests and gate. Module.isEnabled(config) decides whether the activity runs, and the user-facing profiles of BotModule (IDLE, COLLECTOR, PALLADIUM, NPC_KILLER, FULL_AUTO, GATES) are named combinations of those modules: Full auto turns on safety, equipment, combat and collector, for example, and Palladium turns on the collector together with the palladium seller. TRAVELLER is a module, not a profile, and is deliberately absent from BotModule.profiles(): every profile uses it when a destination map is configured, so moving to a farm map is not a separate step the user must remember.
  • Behaviour (bot/behaviors) is one decision: it receives the tick's BotContext, declares priority() and returns a Decision (a BotAction or "not applicable"). It never sends a packet; everything it needs arrives through the constructor or the context.
  • Task (bot/task) is a behaviour composed of steps with internal state: KillTargetTask (search → lock → fire → confirm the kill), CollectorTask (search → fly → request → wait for the confirmation → roam), TravelTask (walk → jump → wait for the map), LeaveEmptyMapTask (wait → walk → jump → probe) and QuestTask (refresh → accept).

DecisionEngine (bot/decision) is the coordinator: it collects the behaviours of the enabled modules, sorts them by priority (stable, so the module order breaks ties) and performs the first action the gateway accepts. Selection and preemption live there and in the modules, never inside a behaviour, and BotLoop is only the scheduler around it.

Priorities are declared once in Priorities: safety (100), revive (90), repair (80), travel (70), gate build/enter/exit (66), equipment (62), combat (60), collection (50), quests (35) and the legacy gate cycle (25). A behaviour returns its intent; it never sends a packet, so the coordinator stays the only place that decides what happens in a tick.

How it is composed

  • Modules.defaults(config) is the single registration point: it lists the modules in the order used to break priority ties. DecisionEngine.forConfig builds the coordinator from it, and BotLoop only schedules ticks around the engine. Adding a module means adding one class and one line there, not editing the coordinator or the loop.
  • A module receives the live BotConfig and builds its behaviours in its constructor; a behaviour receives the configuration or the shared helper it needs, never a global. BotContext carries only the state, the configuration and the tick number, and deliberately hides the action gateway.
  • Rules that several units share live in one helper: NpcTargets and BoxTargets own the "nearest allowed target" searches used by the combat, collector and gate units together with ShipTask.detect; RepairCondition owns both the repair trigger and whether repair is armed at all, so RepairModule and the ship-mode detection cannot drift apart.
  • Profiles are presets only: BotModule.apply(config) rewrites the activity switches and nothing else. BotModule.profiles() is the only list of selectable profiles; the UI, MCP and the migration of an old value all read it.

Adding a single-step decision: create a class under bot/behaviors that implements Behaviour (id, priority, decide, optionally settled) and add it to the behaviours list of its module. Adding a multi-step decision: do the same under bot/task, implementing Task; keep the step state in the instance and the shared step state in a small helper under the activity package (travel, gate, collect...). Adding an activity: create a bot/module/…Module implementing Module (its id, its isEnabled(config) slice and its behaviours) and register it in Modules.defaults. Adding a profile: add a BotModule value with its Preset; never add a second list of modules or a second switch of what a profile turns on.

Bootstrap is the composition root: it reads the command-line mode and wires the store, the configuration and the GUI. Each headless/development mode lives in its own class under cli (HeadlessRun, McpHost, LiveSmoke, LoginCheck, ProtocolCommands, ReplayDemo), sharing only Args for flag parsing, so the entry point does not grow into a second application.

Structure

src/main/java/com/anotherpacketbot/
  core/session   credentials, Unity identity, maps.php, TCP and session cycle
  core/net       real protocol map, codec, TCP framing, packet registry
  core/state     hero, map, hangar, state and packet-driven updates
  core/event     event bus
  core/mcp       loopback MCP JSON-RPC server for an AI client
  cli            command-line modes: headless, MCP host, live smoke, login and
                 protocol tools, replay demo, shared flag parsing
  Bootstrap      composition root: mode selection, store/config wiring, GUI
  bot            loop (scheduler only), action gateway and the tick context
  bot/action     BotAction and Decision: what a behaviour may ask for
  bot/decision   DecisionEngine: enabled modules, priority order, preemption
  bot/module     Module: one activity, its configuration slice and the
                 behaviours it groups (safety, revive, repair, travel,
                 equipment, combat, collector, quests, gate)
  bot/behaviors  single-step decisions (flee, hold, revive, repair, equipment)
  bot/task       composed behaviours with steps and internal state (kill,
                 collect, travel, leave the map, quest cycle)
  bot/npc, bot/collect, bot/repair, bot/revive, bot/travel, bot/gate, bot/quest
                 targeting rules (NpcTargets, BoxTargets), trigger conditions
                 and per-activity state shared by behaviours
  config         persistent configuration, saved accounts, named configuration profiles,
                 module presets and local credentials
  ui             MainView (dashboard, map, progress, modules, scheduler, quests,
                 settings, log), AppWindow
src/test/java    codec, framing, endpoint, state, configuration and login tests
src/main/resources/protocol.json  the included real packet map

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages