// static class member initial definitions
Bot * Interp::bot = 0;
SCM Interp::bot_module = 0;
+
#ifdef MULTITHREAD
pthread_mutex_t Interp::mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
scm_c_define ("bot:user-trusted", scm_long2num (User::TRUSTED_USER));
scm_c_define ("bot:user-friend", scm_long2num (User::FRIEND));
scm_c_define ("bot:user-master", scm_long2num (User::MASTER));
+
+ // protection
+ scm_c_define ("bot:protection/none", scm_long2num (User::NO_PROT));
+ scm_c_define ("bot:protection/no-ban", scm_long2num (User::NO_BAN));
+ scm_c_define ("bot:protection/no-kick", scm_long2num (User::NO_KICK));
+ scm_c_define ("bot:protection/no-deop", scm_long2num (User::NO_DEOP));
+
+ // auto-op
+ scm_c_define ("bot:aop/yes", scm_long2num (true));
+ scm_c_define ("bot:aop/no", scm_long2num (false));
+
// sys-dir
scm_c_define ("bot:sys-scripts-dir",
scm_makfrom0str (String(PREFIX) +
scm_c_define_gsubr ("bot:addshit", 3, 2, 0,
(SCMFunc)ScriptCommands::AddShit);
bot_new_procedure ("bot:ban", (SCMFunc)ScriptCommands::Action, 2, 0, 0);
+ bot_new_procedure ("bot:change-command-level",
+ (SCMFunc)ScriptCommands::ChangeCommandLevel,
+ 2, 0, 0);
bot_new_procedure ("bot:cycle", (SCMFunc)ScriptCommands::Action, 1, 0, 0);
bot_new_procedure ("bot:deban", (SCMFunc)ScriptCommands::Deban, 2, 0, 0);
bot_new_procedure ("bot:delserver", (SCMFunc)ScriptCommands::DelServer,
bot_new_procedure ("bot:nextserver", (SCMFunc)ScriptCommands::NextServer,
0, 0, 0);
bot_new_procedure ("bot:nick", (SCMFunc)ScriptCommands::Nick, 1, 0, 0);
+
+ scm_c_define_gsubr ("bot:notice", 2, 0, 0,
+ (SCMFunc)ScriptCommands::sendNotice);
+
bot_new_procedure ("bot:op", (SCMFunc)ScriptCommands::Op, 2, 0, 0);
bot_new_procedure ("bot:part", (SCMFunc)ScriptCommands::Part, 1, 0, 0);
bot_new_procedure ("bot:reconnect", (SCMFunc)ScriptCommands::Reconnect,
SCM module = static_cast<SCM> (bot_module);
scm_c_define ("the-bot-module", module);
scm_c_export ("the-bot-module", 0);
+
// load bobot-utils
scm_primitive_load
(scm_makfrom0str (String(PREFIX) +
Interp::Startup()
{
bot_module = scm_c_define_module ("the-bot-module",
- interp_init_helper, 0);
+ interp_init_helper, 0);
+
scm_c_call_with_current_module (bot_module,
interp_post_startup_helper,
bot_module);
// We get the lock
pthread_mutex_lock(&mutex);
#endif
+
bot = b;
- gh_eval_str_with_catch(command, ErrorHandler);
+ gh_eval_str_with_catch (command, ErrorHandler);
+
#ifdef MULTITHREAD
// We release the lock
pthread_mutex_unlock(&mutex);