Beispiel #1
0
	def step( self, event ):
		if event:
			if event.type == "join":
				User.createUser(event.nick)
				return
			canal = event.nick
			if event.type == "channel":
				canal = False
			if commands.getMoney(event.msg, canal):
				self.getMoney(event, canal)
			elif commands.showMoney(event.msg, canal):
				self.showMoney(event, canal)
			elif commands.mine(event.msg, canal):
				self.mine(event, canal)
			elif commands.giveMoney(event.msg, canal):
				self.giveMoney(event, canal)
			elif commands.craftItem(event.msg, canal):
				self.craftItem(event, canal)
			elif commands.help(event.msg, canal):
				self.help(event, canal)

		else:
			# Auto mining
			if time() - self.lastPing>self.pingInterval:
				self.lastPing = time()
				for connected in self.bot.connected:
					if connected != self.bot.nick:
						User.createUser(connected)
						User.addMoney(connected, 1 / 86400 * self.pingInterval)

				self.bot.getChannelNames()