# -*- coding: GBK -*- # ÔÚÏßËæ»ú˵»° # author: ifo # Date: 2011.9.9 # history: 2011.9.9 Created from AI.AIBase import * from Protocol.PacketsSend import tagCTalkQing import logging import random #ÔÚÏߺ°»°¼ä¸ô(Second) OnlineReplyPeriod = 10 randomTalkList = ["ÄãºÃ°¡","ÄãÔÚ¸ÉÂï","ÄãÊÇË­"] class AIRandomTalk(AIBase): #ËùÓÐAI±ØÐë²ÉÓÃÕâÖй̶¨µÄ³õʼ»¯Ô­ÐÍ£¬ÒÔ±ãAIMgr×Ô¶¯¼ÓÔØ def __init__(self, robot ): AIBase.__init__(self, robot, OnlineReplyPeriod, True, True ) def _Process( self ): if self.robot.GetIsLoginOK() == False: return curTalkContent = randomTalkList[random.randint(0,len(randomTalkList)-1)] talkGong = tagCTalkQing() talkGong.Clear() talkGong.Len = len(curTalkContent) talkGong.Content = curTalkContent self.robot.Send( talkGong ) #logging.debug( "Player%s Talk %s"%(self.robot.GetPlayerInfo().GetPlayerName(),curTalkContent) )