Hi, i tried to convert this
SM extension into amxx module but my cpp skill are not so good. I just copy and paste a fun module as basis.
At this moment module compiled and can be run on windows server, but this chatter bot make hlds micro stutter about 0.2~0.3 second each time bot do reply function.
My problem:
Spoiler
PHP Code:
//native MH_Reply(const szText[])
static cell AMX_NATIVE_CALL MH_Reply(AMX *amx, cell *params)
{
char input[192];
int len;
strcpy(input, MF_GetAmxString(amx, params[1], 0, &len));
//Bad.. bad..: micro stutter about 0.2~0.3 second every reply function called.
megahal_do_reply(input, 0);
//Help.. help: How to parse replied output and add it into amxx?
return 1;
}
What cause micro stutter issue:
Spoiler
PHP Code:
char *megahal_do_reply(char *input, int log)
{
char *output = NULL;
if (log != 0)
write_input(input); /* log input if so desired */
upper(input);
make_words(input, words);
learn(model, words);
//Micro stutter start here..
output = generate_reply(model, words);
capitalize(output);
return output;
}
Module sources, MegaHAL files, .sma attached.