Lua functions

GetBotCount

Registered in this checkout as EQ2Emu_lua_GetBotCount; implementation found at WorldServer/Lua/LuaFunctions.cpp:7988.

Historical signature: GetBotCount(…) via current binding

Parameter and behavior details in the historical explanation are under review against the current implementation.

Function: GetBotCount(player, count_type)

Description: Returns the number of active companions or the saved companion count for the supplied Player.

Parameters: player: player spawn. Optional count_type: the exact string "active" selects active companions; omitted or other strings select the saved count from the database.

Returns: Integer count. Invalid or non-player spawns return zero.

Active companion identity: Active counting uses live, ready registrations of the original Bot allocations. Reservations still being initialized and retired or expired Bots are excluded. Reusing a runtime ID does not make a replacement Bot inherit an old registration. Saved counting uses the supplied Player’s character ID.

Bot admission during teardown: Closing the Player's Bot registry excludes closing, cancelled and older-generation registrations from the active count immediately, while existing actor loans can finish before physical retirement. A live connection handoff preserves ready Player-owned Bots when no teardown occurred. The saved-count query is unchanged.

Checked example

No checked example is published for this function yet. No active script call with the current C++ argument count was found.

Current registration: WorldServer/Lua/LuaInterface.cpp.