/* * Away system for TekNap * * Author: DaDo (performed by c1p8) * */ assign AWAY_LOG 1 assign AWAY_LOGFILE C:\awaylog.txt assign DEFAULT_AWAY_REASON lasciatemi un messaggio!! assign DEFAULT_BACK_REASON Sono tornata!! assign PUBLIC_AWAY 0 /* This will cause the script to send the public away msg only to certain channels. PUBLIC_AWAY must also be 1 of course. Uncomment this line or use /assign to set this variable and use this feature. */ #assign PUBLIC_AWAY_CHANNELS #Admins /* Notify people that msg you that you are away. */ assign SEND_AWAY_MSG 1 alias away (reason) { if (!A) { if (AWAY_LOG) { ^local fd @ fd = open($AWAY_LOGFILE w) @ write($fd [MsgLog Started $strftime(%B %d %Y %X)]) @ close($fd) } if (PUBLIC_AWAY) { if (PUBLIC_AWAY_CHANNELS) { fe ($PUBLIC_AWAY_CHANNELS) chan { if (match($chan $onchannels())) { raw 824 $chan \"is away: ${reason ? reason : DEFAULT_AWAY_REASON} [Log/${AWAY_LOG ? [ON] : [OFF]}]\" } } }{ fe ($onchannels()) chan { raw 824 $chan \"is away: ${reason ? reason : DEFAULT_AWAY_REASON} [Log/${AWAY_LOG ? [ON] : [OFF]}]\" } } } ^assign A $time() \"${reason ? reason : DEFAULT_AWAY_REASON}\" xecho -b 52hai attivato l'Away 55[LOG/ON] }{ xecho -b 52...sei gia' in Away! } } alias back (reason) { if (A) { if (AWAY_LOG) { ^local fd @ fd = open($AWAY_LOGFILE w) @ write($fd [MsgLog Stopped $strftime(%B %d %Y %X)]) @ close($fd) } if (PUBLIC_AWAY) { if (PUBLIC_AWAY_CHANNELS) { fe ($PUBLIC_AWAY_CHANNELS) chan { if (match($chan $onchannels())) { raw 824 $chan \"is back: ${reason ? reason : DEFAULT_BACK_REASON} [Gone since: $strftime($word(0 $A) %B %d %Y %X)]\" } } }{ fe ($onchannels()) chan { raw 824 $chan \"is back: ${reason ? reason : DEFAULT_BACK_REASON} [Gone since: $strftime($word(0 $A) %B %d %Y %X)]\" } } } ^assign -A @ delarray(sent_away) xecho -b 52Non sei piu' in Away. xecho -b 52Apri 53C:\awaylog.txt 52per leggere il log. xecho -b 52Digita 55/remlog 52per cancellare il log. }{ xecho -b 52Non sei in Away. } } /* This was taken from archon's 'more' script distributed with EPIC */ alias remlog (void) { if (fexist($AWAY_LOGFILE)) { @ unlink($AWAY_LOGFILE) xecho -b 52Logfile cancellato [$AWAY_LOGFILE] }{ xecho -b 52Il Logfile [$AWAY_LOGFILE] non esiste. } if (A && AWAY_LOG) { ^local fd @ fd = open($AWAY_LOGFILE w) @ write($fd [MsgLog Started $strftime(%B %d %Y %X)]) @ close($fd) } } on #^msg 420 "*" if (A) { if (AWAY_LOG) { ^local fd @ fd = open($AWAY_LOGFILE w) @ write($fd [$strftime($time() %X)] [$0\(*@*\)] $1-) @ close($fd) } if (SEND_AWAY_MSG && [$0] != [ChanServ] && [$0] != [OperServ]) { msg $0 Sono momentaneamente assente - I'm not here now. \($word(1 $A)\) [Via da: $strftime($word(0 $A) %B %d %Y %X)] [Log/${AWAY_LOG ? [ON] : [OFF]}] } } on #^timer 420 "12:00" if (A && AWAY_LOG) { ^local fd @ fd = open($AWAY_LOGFILE w) @ write($fd [TimeStamp $strftime(%B %d %Y %X)]) @ close($fd) }