How to remove a BOT automatically triggered by an event with LUA script?
Kick BOT by LUA script
So Omnibot 0.80 and Nq 1.2.9.b6 can not solve that BOTs xp is not saved, so it must be solved differently.
In noquarter.cfg not works the folloving line:
omnibot_flags “1”
(I can not link this page because the forum censored this)
I thought when the game ends I would like to kick all BOTs with a lua script. This command (kickallbots) is defined in the shrubbot.cfg .
Like this:
if text == "Exit. Time Limit hit \ n" or text == "Exit. EndRound Wolf \ n" then
et.EXEC_NOW
or
et_SetPlayerSkill( cno, skill )
When next map loading BOTs will automatically connect with 0 xp again.
According to the wiki, et_SetPlayerSkill( cno, skill ) is a callback function, so you can’t use it to set players’ skill. What about this code? It resets all bots’ xp at the beginning of each round.
function et_InitGame( levelTime, randomSeed, restart )
for local i=0, tonumber(et.trap_Cvar_Get("sv_maxclients"))-1 do
if et.gentity_get(i, "pers.localClient") == 1 then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "!resetxp " .. i .. ";")
end
end
end
Well I tried it.
I think You can put this script into your collection.
It works very well!
Thank You!
Hi Guys,
When I look et_console.log I found this message:
Setting MOTD…
Lua API: Loading resetxpforbots.lua
Lua API: syntax error during pre-compilation: [string “resetxpforbots.lua”]:4: ‘<name>’ expected near ‘local’
I would like to know it does not interfere with other modules?
Hi,
Something happened because the script does not work now. Something nq setting can disturb it and is important which lua version is running on the server?
In the xp folder of NQ folder have not files for BOTs but BOTs have xp and not loose it.
The bots xp will only be done after the server is restarted.