コード例 #1
0
ファイル: main.py プロジェクト: kedean/SaltyBot
			commander.addBot(player, factor, amount, email, password, waitTime)

	if args.source:
		with open(args.source, "r") as playerHandle:
			players = json.load(playerHandle)
			for playerData in players:
				if "player" not in playerData or playerData["player"] not in [1,2]:
					print "Player number must be either 1 or 2."
					continue
				player = "player1" if playerData["player"] == 1 else "player2"

				if "amount" not in playerData:
					playerData["amount"] = 0
				if "factor" not in playerData:
					playerData["factor"] = 0
				if "email" not in playerData:
					print "Please give a valid email."
					continue
				if "password" not in playerData:
					print "Please give a valid password."
					continue
				if "waitTime" not in playerData:
					playerData["waitTime"] = 5

				commander.addBot(player, playerData["factor"], playerData["amount"], playerData["email"], playerData["password"], playerData["waitTime"])

	if commander.numSlaves == 0:
		print("No bots were spawned. Check your arguments or source file.")
	else:
		commander.run()