version 1.3 | | version 1.4 |
---|
| | |
import CFPython | | import CFPython |
| | |
import sys | | import sys |
| | import string |
import os.path | | import os.path |
sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) | | sys.path.append(os.path.join(CFPython.GetDataDirectory(),CFPython.GetMapDirectory(),'python')) |
| | |
| | |
import CFLog | | import CFLog |
| | |
activator=CFPython.WhoIsActivator() | | activator=CFPython.WhoIsActivator() |
activatorname=CFPython.GetName(activator) | | activatorname=CFPython.GetName(activator) |
whoami=CFPython.WhoAmI() | | whoami=CFPython.WhoAmI() |
| | isDM=CFPython.IsDungeonMaster(activator) |
x=CFPython.GetXPosition(activator) | | x=CFPython.GetXPosition(activator) |
y=CFPython.GetYPosition(activator) | | y=CFPython.GetYPosition(activator) |
| | |
| | |
| | |
if text[0] == 'seen': | | if text[0] == 'seen': |
if len(text)==2: | | if len(text)==2: |
if log.exist(text[1]): | | record = log.info(text[1]) |
ip, date, count = log.info(text[1]) | | if record: |
if (CFPython.IsDungeonMaster(activator)): | | if isDM: |
CFPython.Say(whoami, "I have seen '%s' %d times.\nI saw them last coming from\nIP: %s\non %s." % (text[1], count, ip, date)) | | message = "I have seen '%s' %d times.\nI saw them last coming from\nIP: %s\non %s." % (text[1], int(record['Login_Count']), record['IP'], record['Last_Login_Date']) |
| | else: |
| | message = "I have seen '%s' %d times.\nI saw them last at %s." % (text[1], int(record['Login_Count']), record['Last_Login_Date']) |
else: | | else: |
CFPython.Say(whoami, "I have seen '%s' %d times.\nI saw them last at %s." % (text[1], count, date)) | | message = "I have never seen '%s'." % text[1] |
else: | | else: |
CFPython.Say(whoami, "I have never seen '%s'." % text[1]) | | message = 'Usage "seen <player>"' |
| | |
| | elif text[0] == 'help': |
| | if isDM: |
| | message = "How can I help you? Here is a quick list of commands:\nseen, muzzlestatus, muzzlecount, lastmuzzle, kickcount, lastkick" |
else: | | else: |
CFPython.Say(whoami, 'Usage "seen <friend>"') | | message = "I have seen just about everybody - go ahead and ask me." |
| | |
| | elif text[0] == 'muzzlecount' and isDM: |
| | if len(text)==2: |
| | record = log.info(text[1]) |
| | if record: |
| | message = "%s has been muzzled %d times" % (text[1],int(record['Muzzle_Count'])) |
| | else: |
| | message = "I have no knowledge of '%s'." % text[1] |
| | else: |
| | message = 'Usage "muzzlecount <player>"' |
| | |
| | elif text[0] == 'lastmuzzle' and isDM: |
| | if len(text)==2: |
| | record = log.info(text[1]) |
| | if record: |
| | message = "%s was last muzzled on %s" % (text[1],record['Last_Muzzle_Date']) |
| | else: |
| | message = "I have no knowledge of '%s'." % text[1] |
else: | | else: |
CFPython.Say(whoami, 'You looking for someone?') | | message = 'Usage "muzzlestatus <player>"' |
| | |
| | elif text[0] == 'kickcount' and isDM: |
| | if len(text)==2: |
| | record = log.info(text[1]) |
| | if record: |
| | message = "%s has been kicked %d times" % (text[1],int(record['Kick_Count'])) |
| | else: |
| | message = "I have no knowledge of '%s'." % text[1] |
| | else: |
| | message = 'Usage "kickcount <player>"' |
| | |
| | elif text[0] == 'lastkick' and isDM: |
| | if len(text)==2: |
| | record = log.info(text[1]) |
| | if record: |
| | message = "%s was last kicked out on %s" % (text[1],record['Last_Kick_Date']) |
| | else: |
| | message = "I have no knowledge of '%s'." % text[1] |
| | else: |
| | message = 'Usage "lastkick <player>"' |
| | |
| | else: |
| | message = "Do you need help?" |
| | |
| | CFPython.Say(whoami, message) |