xbot/mods/lua/wrappers.c
2024-02-27 01:16:58 -06:00

23 lines
428 B
C
Executable File

#include "lua.h"
void lua_init_wrappers()
{
lua_register(lua.L, "raw", raw_wrapper);
lua_register(lua.L, "privmsg", privmsg_wrapper);
}
void raw_wrapper(lua_State *L)
{
char *text = (char *)lua_tostring(L, 1);
irc_raw(instance, text);
}
void privmsg_wrapper(lua_State *L)
{
char *where = (char *)lua_tostring(L, 1);
char *text = (char *)lua_tostring(L, 2);
irc_privmsg(instance, where, text);
}