version 1.4 | | version 1.5 |
---|
| | |
# | | # |
#Updated to use new path functions in CFPython -Todd Mitchell | | #Updated to use new path functions in CFPython -Todd Mitchell |
| | |
import CFPython | | import Crossfire |
import CFMail | | import CFMail |
import string | | import string |
| | |
activator=CFPython.WhoIsActivator() | | activator=Crossfire.WhoIsActivator() |
activatorname=CFPython.GetName(activator) | | activatorname=activator.Name |
whoami=CFPython.WhoAmI() | | whoami=Crossfire.WhoAmI() |
| | |
mail = CFMail.CFMail() | | mail = CFMail.CFMail() |
total = mail.countmail(activatorname) | | total = mail.countmail(activatorname) |
| | |
for element in elements: | | for element in elements: |
type, fromname, message = element | | type, fromname, message = element |
if type==1: | | if type==1: |
msgob = CFPython.CreateObjectInside('scroll', whoami) | | msgob = whoami.CreateObject('scroll') |
CFPython.SetName(msgob,'mailscroll F: '+fromname+' T: '+activatorname) | | msgob.Name='mailscroll F: '+fromname+' T: '+activatorname |
CFPython.SetMessage(msgob, message) | | msgob.Message=message |
CFPython.SetValue(msgob, 0) | | msgob.Value=0 |
elif type==2: | | elif type==2: |
msgob = CFPython.CreateObjectInside('note', whoami) | | msgob = whoami.CreateObject('note') |
CFPython.SetName(msgob,'newspaper D: '+fromname) | | msgob.Name='newspaper D: '+fromname |
CFPython.SetMessage(msgob, message) | | msgob.Message=message |
CFPython.SetValue(msgob, 0) | | msgob.Value=0 |
elif type==3: | | elif type==3: |
msgob = CFPython.CreateObjectInside('diploma', whoami) | | msgob = whoami.CreateObject('diploma') |
CFPython.SetName(msgob,'mailwarning F: '+fromname+' T: '+activatorname) | | msgob.Name='mailwarning F: '+fromname+' T: '+activatorname |
CFPython.SetMessage(msgob, message) | | msgob.Message=message |
CFPython.SetValue(msgob, 0) | | msgob.Value=0 |
else: | | else: |
print 'ERROR: unknown mailtype\n' | | print 'ERROR: unknown mailtype\n' |
| | |
if total == 1: | | if total == 1: |
CFPython.Write('You got 1 mail.', activator) | | activator.Write('You got 1 mail.') |
elif total > 1: | | elif total > 1: |
CFPython.Write('You got %s mails.'%total, activator) | | activator.Write('You got %s mails.'%total) |
else: | | else: |
CFPython.Write('You haven\'t got any mail.', activator) | | activator.Write('You haven\'t got any mail.') |