View/Edit #1627:manage_clock

Switch to edit mode.

Name(s): manage_clock
1:  last_time = time()
2:  rday = iday = {}
3:  for x in (players())
4:    time = ctime()[5..10]
5:    if (`x.first_connect_time <= $slacker.first_connect_time || x.first_connect_time >= time() ! E_PROPNF, E_PERM')
6:      "Do nothing."
7:      "Commented since Oblivion (#7951) is right, we might have been missing bday's because of this, probably his. -- changed by Quadir (#9780)"
8:      "  elseif (`(x.real_bday <= $slacker.first_connect_time) || (x.real_bday >= time()) ! E_PROPNF, E_PERM')"
9:      "    \"Do Nothing.\";"
10:   elseif (`time == ctime(x.real_bday)[5..10] ! E_PROPNF, E_TYPE, E_PERM')
11:     rday = setadd(rday, x)
12:   elseif (`time == ctime(x.first_Connect_time)[5..10] ! E_PROPNF, E_TYPE, E_PERM')
13:     iday = setadd(iday, x)
14:   endif
15:   $cmd_utils:suspend_if_needed(0)
16: endfor
17: bday = {rday, iday}
18: for x in ({@bday[1], @bday[2]})
19:   try
20:     time = $su:to_value(`x:ctime() ! ANY => ctime()'[21..24])[2]
21:     rday = `$su:to_value(`x:ctime(x.real_bday) ! ANY => ctime(x.real_bday)'[21..24])[2] ! ANY => 0'
22:     iday = `$su:to_value(`x:ctime(x.first_connect_time) ! ANY => ctime(x.first_connect_time)'[21..24])[2] ! ANY => 0'
23:     msg = "Wish a very happy "
24:     if (x == $slacker)
25:       subject = "Happy Bday MOO Canada!"
26:       age = time - iday
27:       msg = "birthday to MOO Canada, Eh? as it turns " + age + " years old!"
28:     else
29:       age = 0
30:       subject = tostr("Happy Bday ", $su:nn(x))
31:       if (x in bday[1])
32:         msg = msg + "IRL"
33:         age = time - rday
34:       else
35:         msg = msg + "Character"
36:         age = time - iday
37:       endif
38:       if (age == 0 || x:isa($project) || x:isa($guest) || x:isa($robot))
39:         continue
40:       endif
41:       msg = tostr(msg, " birthday to ", $su:nn(x), " as ", $cecil_utils:pronoun(x, "he"), " turns ", age, " years old.")
42:       lasttime = tostr("This user last connected: ", ctime(x.last_connect_time))
43:       if (time() == last_time)
44:         last_time = time()
45:         suspend(1)
46:       endif
47:     endif
48:     caller in {$clock, $scheduler} && $mail_agent:Send_message(this, this, subject, {msg, lasttime})
49:     $cmd_utils:suspend_if_needed(0)
50:   except (ANY)
51:     "BAH"
52:   endtry
53:   suspend(2)
54: endfor
55: return bday
56: "Last modified by Quadir (#9780) on Sat Jan 24 13:49:23 2004 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Quadir (#9780)

You are not logged in.

[home | help | who | search | setup | code]