-
Notifications
You must be signed in to change notification settings - Fork 94
get_bot_eid
Ryzom Core Wiki edited this page Jul 8, 2024
·
3 revisions
title: Get Bot Eid description: published: true date: 2023-03-16T23:06:57.187Z tags: editor: markdown dateCreated: 2023-03-16T22:23:28.163Z
The getBotEid native AI script function is used to get the bot entityId by its index in the group.
(botEid: s)getBotEid(botIndex: f) // getBotEid_f_s
- botIndex (float): The position of the bot in the group.
- botEid (string): The entityId given by the bot, or empty if the indexed bot is not from the group.
(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.