コード例 #1
0
ファイル: sarin.py プロジェクト: blakepell/bota
    def on_think(self):
      if self.state is walking:
        if 0: # not self.path:
          self.say("Whoops! I'm a bit lost now...")
          mud.log("Sarin: walking without a path")
          self.state = idle
        return

      if self.state is talking:
        pass

      if self.state is idle:
        if(self.location.vnum == sarins_room):
          if( random.randint(0, 10) == 1 ):
            if self.lastseen_healer + 10 < mud.ticks():
              self.setPath("ddwn")
            elif self.lastseen_priest + 10 < mud.ticks():
              self.setPath("ddwwn")
            
            if self.path:
                self.state = walking
                self.say("Hmm, I guess I should walk around now ...")

            
        elif(self.location.vnum == chamber):
          self.lastseen_priest = mud.ticks()

          if( random.randint(0, 5) == 1 ):
            self.say("Hmm, I guess I should leave now ...")
            self.state = walking
            if self.lastseen_healer + 4 < mud.ticks():
                self.setPath("sen")
            else:
                self.setPath("seeuu")

        elif(self.location.vnum == altar):
          self.lastseen_healer = mud.ticks()

          if( random.randint(0, 5) == 1 ):
            self.say("Hmm, I guess I should leave now ...")
            self.state = walking
            if self.lastseen_priest + 4 < mud.ticks():
                self.setPath("swn")
            else:
                self.setPath("seu")

        else:
          # whoops! okay, go back to my room
          self.state = walking
          self.setPath(sarins_room)
          self.say("Whoa, what was I doing?")
          self.say("I better head back to my room.")
コード例 #2
0
ファイル: utils.py プロジェクト: Stribog1/Bylins
def log_err(msg):
    mud.log(msg + "\n" + traceback.format_exc(), channel=constants.ERRLOG)
    
コード例 #3
0
ファイル: utils.py プロジェクト: Stribog1/mud-1
def log_sys(msg):
    s = msg + "\n"
    mud.log(s.encode("koi8-r"), channel=constants.SYSLOG)
コード例 #4
0
ファイル: logon.py プロジェクト: mysidia/circle31dgpy
def do_q(type, args) :
	mud.log("Player login (%s) detected (python event)" % args.actor.player.name)
	return 0