#echo %%% Loading akilllog.irc... # Default file where to save autokill list if ([$akillfile]==[]) {^assign akillfile akill.list} alias akilllog { if ([$0]) {^assign akillfile $0} xecho -level crap ### Autokill log, logfile ${akillfile}. ^on ^notice "OperServ Autokill mask list:" { xecho -level crap ### Starting to log AKill list. ^assign -akill_log_list ^assign akill_log_count 0 } ^on ^notice "OperServ End of list" { xecho -level crap ### End of autokill list, $akill_log_count entries. ^assign -akill_log_count timer 1 save_akills } ^on ^notice "OperServ Sorry, only operators can use this service" { xecho -level crap ### Sorry, OperServ access denied. clear_akilllog } ^on ^notice "OperServ ? %!%@%.%" { @ akill_log_list[$akill_log_count] = [$1] @ akill_log_count = akill_log_count + 1 } ^msg OperServ autokill } alias clear_akilllog { ^on ^notice -"OperServ Autokill mask list:" ^on ^notice -"OperServ End of list" ^on ^notice -"OperServ Sorry, only operators can use this service" ^on ^notice -"OperServ ? %!%@%.%" ^on exec_exit -"iwakill *" ^on exec_exit -"wakill *" ^assign -akill_log_count ^assign -akill_log_curr ^assign -akill_log_list } alias save_akills { # make sure file exists and is empty exec -name iwakill cp /dev/null $akillfile ^on ^exec_exit "iwakill *" if ([$2]==[0]) { timer 1 write_akills } { xecho -level crap ### Failed to initialise ${akillfile}, exit code $2. } } alias write_akills { ^on exec_exit -"iwakill *" xecho -level crap ### Writing entries to ${akillfile}... # this needs the timer, as doing exec from exec_exit isn't allowed apparently ^on ^exec_exit "wakill *" timer 0 write_next_akill @ akill_log_curr = 0 write_next_akill } alias write_next_akill { if ([$akill_log_list[$akill_log_curr]]!=[]) { #xecho -level crap ??? Writing entry ${akill_log_curr}: $akill_log_list[$akill_log_curr] exec -name wakill echo "$akill_log_list[$akill_log_curr]" >> $akillfile ^assign -akill_log_list[$akill_log_curr] @ akill_log_curr = akill_log_curr + 1 } { clear_akilllog xecho -level crap ### Autokill list saved, akilllog finished. } } eval xecho -level crap ### AkillLog loaded, use /akilllog [filename] to save list, default file ${akillfile}.