asobi_bot (asobi v0.84.0)

View Source

Generic bot process that runs a Lua AI script each tick.

The bot joins a match as a player, receives game state updates, and sends input decisions based on the Lua think(bot_id, state) function.

Also handles auto boon picking and auto voting.

A bot is tracked through asobi_presence:track_bot/2, so it is a delivery target for asobi_presence:send/2 like any player session but is never counted by asobi_presence:online_count/0. The messages it consumes are the public asobi_presence:message/0 contract, not an ad-hoc shape.

Both state strategies arrive as {match_state, map()}. Under state_strategy = "shared" the match server still encodes once for the whole roster, and asobi_presence:send_match_state/3 hands the bot the term behind that frame rather than the frame, so a bot decodes nothing per tick.

Summary

Functions

handle_call/3

-spec handle_call(term(), gen_server:from(), map()) -> {reply, ok, map()}.

handle_cast/2

-spec handle_cast(term(), map()) -> {noreply, map()}.

handle_info/2

-spec handle_info(term(), map()) -> {noreply, map()} | {stop, term(), map()}.

init/1

-spec init(map()) -> {ok, map()} | {stop, term()}.

start_link(MatchPid, BotId, LuaScript)

-spec start_link(pid(), binary(), binary() | undefined) -> gen_server:start_ret().

terminate/2

-spec terminate(term(), map()) -> ok.