Example #1
0
def main():
    parser = argparse.ArgumentParser(description=getDescription(), formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument(
        "account", metavar="ACCOUNT-ID", type=WorldOfWarcraftLogin.validateAccountId, nargs=1, help="Account ID"
    )
    parser.add_argument(
        "char", metavar="CHAR-ID", type=WorldOfWarcraftLogin.validateCharId, nargs=1, default=-1, help="Char ID"
    )
    parser.add_argument("--hidden", "-s", dest="hidden", action="store_true", default=False, help="hide online status?")
    parser.add_argument(
        "--lua-unlock", "-l", dest="luaUnlock", action="store_true", default=False, help="unlock protected lua?"
    )

    # group = parser.add_mutually_exclusive_group(required=True)
    # group.add_argument('account', metavar='ACCOUNT', type=WorldOfWarcraft.validateAccountId, nargs='?', help='Account ID')
    # group.add_argument('charname', metavar='CHARNAME', nargs='?', help='Account ID')

    args = parser.parse_args()
    accId = args.account
    args = parser.parse_args()

    wow = WorldOfWarcraftLogin(args.account[0], args.char[0])
    wow.login(hidden=args.hidden, loginDelay=0)
    if args.luaUnlock:
        wow.luaUnlock()
Example #2
0
def main():
    BattleNet.setActive()

    parser = argparse.ArgumentParser(description=getDescription(), formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('account', metavar='ACCOUNT', type=WorldOfWarcraftLogin.validateAccountId, help='Account ID')
    parser.add_argument('char', metavar='CHAR', type=WorldOfWarcraftLogin.validateCharId, help='Char ID')
    parser.add_argument('professions', metavar='PROFESSION-CD', nargs='+', type=int, choices=range(len(PROFESSION_CDS)), help='Profession Cooldown ID')
    parser.add_argument('--hidden', '-s', dest='hidden', action='store_true', default=False, help='hide online status?')


    args = parser.parse_args()
    accId = args.account
    args = parser.parse_args()

    wow = WorldOfWarcraftLogin(args.account, args.char)
    wow.login(hidden=args.hidden)
    for pIdx in args.professions:
        (profession,skillname,additionalCommands) = PROFESSION_CDS[pIdx]
        if profession:
            wow.craft(profession,skillname)
        for cmd in additionalCommands:
            wow.command(cmd)
            wow.delay("Waiting for " + cmd, WOW_ADDITIONAL_COMMAND_DELAY)
    wow.logout()