2 Created by: Joris Bontje <jbontje@suespammers.org>
4 This script implements the apply event for mailboxes. When a mailbox is
5 opened, check the player's mail and create objects if necessary.
11 activator = Crossfire.WhoIsActivator()
13 whoami = Crossfire.WhoAmI()
15 total = mail.countmail(activator.Name)
18 activator.Write(
"You have %d mail!" % total)
19 elements = mail.receive(activator.Name)
20 for element
in elements:
21 type, fromname, message = element
23 msgob = whoami.CreateObject(
'scroll')
24 msgob.Name =
"mail F: %s T: %s" % (fromname, activator.Name)
25 msgob.NamePl = msgob.Name
26 msgob.Message = message
29 msgob = whoami.CreateObject(
'note')
30 msgob.Name =
'newspaper D: '+fromname
31 msgob.NamePl =
'newspapers D: '+fromname
32 msgob.Message = message
35 msgob = whoami.CreateObject(
'diploma')
36 msgob.Name =
'warning F: '+fromname+
' T: '+activator.Name
37 msgob.NamePl =
'warnings F: '+fromname+
' T: '+activator.Name
38 msgob.Message = message
41 Crossfire.Log(Crossfire.LogError,
'ERROR: unknown mailtype\n')
43 activator.Write(
"You haven't got any mail.")