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.")
def log_err(msg): mud.log(msg + "\n" + traceback.format_exc(), channel=constants.ERRLOG)
def log_sys(msg): s = msg + "\n" mud.log(s.encode("koi8-r"), channel=constants.SYSLOG)
def do_q(type, args) : mud.log("Player login (%s) detected (python event)" % args.actor.player.name) return 0