% Init script for SLirc. % No luser serviceable parts here. % You're welcome to change things if you're not a luser, though. %() = define_for_ifdef("ENEMIES"); define_case('[','{'); define_case(']','}'); define_case('\\','|'); variable progress = irc_create_pm("Init", 100); irc_log(sprintf("[%s-%s] loading init script.", ProgName, ProgVersion)); irc_update_display(); % change "." to something like /usr/local/lib/slirc if you use global set_import_module_path(slirc_home); import("utils"); import("vfile"); irc_log("vfile module loaded"); irc_update_display(); % Setup some defaults... Don't change these here... variable irc_server = NULL; %variable con_server = NullString; variable irc_fullname = getenv("IRCNAME"); if (irc_fullname == NULL) irc_fullname = irc_username; %autoload ("command_FTP", "slftp.sl"); () = evalfile("goodies.sl"); irc_set_pm(progress, 10); irc_update_display(); () = evalfile("LList.sl"); irc_set_pm(progress, 20); %irc_log(sprintf("assoc_key_exists=%d",is_defined("assoc_key_exists"))); irc_update_display(); %irc_exit("User Quit."); variable servers = make_list(); variable dcc_dir = sprintf("%s/dl/", getenv("HOME")); variable ftp_dir = sprintf("%s/dl/", getenv("HOME")); variable beep_on_msg = 1; % define the irc_send_string stuff. % This used to be an intrinsic, before I did the SLtcp stuff. define irc_send_string(st) { if (irc_server == NULL) { irc_Info("You aren't connected"); return; } variable w = vf_write(irc_server, st); if (w == strlen(st)) return; irc_Inff("incomplete server write: %d/%d",w,strlen(st)); % () = fflush(irc_server); } % Load the registry code here... () = evalfile("registry.sl"); irc_set_pm(progress, 30); irc_update_display(); % Load the luser config... () = evalfile("config.sl"); irc_set_pm(progress, 95); irc_update_display(); if(_stkdepth > 0) { irc_log(sprintf("[SLirc] Eeek. %d units of crap left on stack!", _stkdepth)); loop(_stkdepth) pop(); } irc_Info("[SLirc] Okay, initial config done."); irc_destroy_pm(progress); irc_update_display();