get_bot_eid - ryzom/ryzomcore GitHub Wiki


title: Get Bot Eid description: published: true date: 2023-03-12T20:01:52.309Z tags: editor: markdown dateCreated: 2023-03-12T20:01:49.122Z

getBotEid

The getBotEid native AI script function is used to get the bot entityId by its index in the group.

Syntax

(botEid: s)getBotEid(botIndex: f) // getBotEid_f_s

Arguments

  • botIndex (float): The position of the bot in the group.

Return values

  • botEid (string): The entityId given by the bot, or empty if the indexed bot is not from the group.

Examples

(index)getBotIndexByName("bot_toto");
($botEid)getBotEid(index);
if (index != -1)
{
    ()phrasePushValue("entity", $botEid);
    ()phraseEndEmoteMsg(index, "PHRASE_YOUR_ARE_CLICKING_ON_ME");
}

This example code gets the bot index by its name and then gets its entityId in the group using the getBotEid function. If the index is not -1 (meaning the bot is in the group), it pushes the entityId on the parameter stack and ends an emote message with the phraseEndEmoteMsg function.

⚠️ **GitHub.com Fallback** ⚠️