File: away

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (39 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * AWAY script -- a minimalist faking of the /AWAY command for when they
 * take /AWAY away from us.  Only sends the message once per nick per time
 * you change it.
 * Requires ircII2.6 or later (Written for EPIC3.001)
 */

/*
 * This variable determines how often you send the away message to a 
 * person, even if theyve already seen it.
 */
@ away_recycle_time = 10000

on #-msg -633 * 
{
	if (away.msg && ((sentaway[$encode($0)] < away.time) || \
		(sentaway[$encode($0)] + away.recycle_time < time()))
	{
		ctcp $0 AWAY $away.msg $away.gonefor()
		@ sentaway[$encode($0)] = time()
	}
}

alias away 
{
	if (away.msg = [$*])
	{
		echo *** You are now away [$*]
	}
	{
		echo *** You are now back $away.gonefor()
	}
	@ away.time = time()
}

alias away.idle @ function_return = time() - away.time
alias away.gonefor @ function_return = [\(Away for $tdiff($away.idle())\)]

#hop'96