"--level", default=1, help="Generate NPCs of particular level") parser.add_argument("--names", default="", help="File to draw NPC names from") parser.add_argument("-g", "--genprofs", default="", help="File to draw general profs from") args = parser.parse_args() classes = [] spells = [] names = [] profs = [] if len(args.classes) > 0: classes = libhenches.parseClasses(args.classes) if len(args.spells) > 0: spells = libspellbook.parseSpells(args.spells) if len(args.names) > 0: names = libhenches.parseNames(args.names) if args.treasure != "": tables.loadtables(args.treasure) if args.genprofs != "": profs = libhenches.parseProfs(args.genprofs) if args.filterclass: cl = [t[0] for t in classes] if args.filterclass not in cl: print "Class %s not found in class file (used same case?)" % args.filterclass sys.exit(1)
import libspellbook import tables from flask import render_template from flask import request import terrain app = Flask(__name__) classfile = './classes' spellsfile = './spells' profsfile = './genprofs' namefile = './germans' pcclassfile = './pcclasses' pcspellsfile = './pcspells' classes = libhenches.parseClasses(classfile) pcclasses = libhenches.parseClasses(pcclassfile) spells = libspellbook.parseSpells(spellsfile) pcspells = libspellbook.parseSpells(pcspellsfile) names = libhenches.parseNames(namefile) profs = libhenches.parseProfs(profsfile) marketvals = libhenches.marketClasses @app.route('/') def halp(): return "halp hao do wobsit" @app.route('/hench') @app.route('/hench/') def genhenches(market=None, pc=False): market = int(request.args.get('market',4))
parser.add_argument("-f", "--filterclass", default="", help="Generate characters only of this class") parser.add_argument("-m", "--market", type=int, default=10, help="Market class value to use") parser.add_argument("-a", "--alignment", action="store_true", help="Generate alignments") parser.add_argument("-s", "--spells", default="", help="File to draw arcane spell list from") parser.add_argument("-t", "--treasure", default="", help="File to draw magic loot from") parser.add_argument("-l", "--level", default=1, help="Generate NPCs of particular level") parser.add_argument("--names", default="", help="File to draw NPC names from") parser.add_argument("-g", "--genprofs", default="", help="File to draw general profs from") args = parser.parse_args() classes = [] spells = [] names = [] profs = [] if len(args.classes) > 0: classes = libhenches.parseClasses(args.classes) if len(args.spells) > 0: spells = libspellbook.parseSpells(args.spells) if len(args.names) > 0: names = libhenches.parseNames(args.names) if args.treasure != "": tables.loadtables(args.treasure) if args.genprofs != "": profs = libhenches.parseProfs(args.genprofs) if args.filterclass: cl = [t[0] for t in classes] if args.filterclass not in cl: print "Class %s not found in class file (used same case?)" % args.filterclass sys.exit(1)