舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

用户:SegFault:修订间差异

来自舰R百科
跳转到导航 跳转到搜索
无编辑摘要
无编辑摘要
第1行: 第1行:
<tabber>
<pre><nowiki>
改造前 =
from urllib.request import urlopen
{{舰娘
import json
|战舰序号= 海军上将级1号舰
 
|战舰名=胡德
def getShipName(ship):
|图鉴编号= 1
    name = ship['title'].strip()
|所属=英国
    idx = int(ship['shipIndex'])
|星级= 5
    if idx < 1000 or name in [ '重庆', '奥希金斯', '信赖', '萝德尼' ]:
|战舰类型= 战列巡洋舰
        return name
|改造等级= 75
    elif idx < 2000:
|耐久= 75
        return name + '·改'
|火力= 68
    else:
|火力max= 93
        return name + '(特殊)'
|搭载= 12
 
|装甲= 65
def getShipAttr(ship, allShips, equipts):
|装甲max= 80
    st = ship['strengthenTop']
|鱼雷= 0
    exp = ship['strengthenLevelUpExp']
|鱼雷max= 0
 
|幸运= 5
    cap = [ 0 ] * 4
|回避= 27
    if ship['capacityInit']:
|回避max= 57
        for i in range(len(ship['capacityInit'])):
|对空= 40
            cap[i] = ship['capacityInit'][i]
|对空max= 70
 
|射程=
    eq = [ '不可装备' ] * 4
|索敌= 13
    n = len(ship['equipment'])
|索敌max= 38
    for i in range(n):
|对潜= 0
        eq[i] = [ e['title'] for e in equipts if e['cid'] == ship['equipment'][i] ][0]
|对潜max= 0
    for i in range(n, ship['equipmentNum']):
|航速= 31
        eq[i] = '无'
|燃料= 70
 
|弹药= 120
    t = [ '', '日本', '德国', '英国', '美国', '意大利', '法国', '苏联', '中国', '???' ]
|拆解油=40
    country = t[int(ship['country'])]
|拆解弹=50
    t = { '戈本':'土耳其', '德·鲁伊特':'荷兰', '苏赫巴托尔':'蒙古', '奥希金斯':'智利', '吸血鬼':'英国', '海达人':'加拿大', '奥丁':'冰岛' }
|拆解钢=40
    if ship['title'] in t:
|拆解铝=0
        country = t[ship['title']]
|强化加成={{舰娘/强化|火力=73|鱼雷=0|装甲=65|对空=24}}
 
|改造消耗={{舰娘/改造|燃油=0|弹药=0|钢材=200|铝材=0|核心=战列舰改造核心*20}}
    ret = "ships['%s'] = {\n    " % getShipName(ship)
|技能介绍=
 
|装备1={{装备背景|2|[[File:Equip L 30.png|80px|link=英国双联15英寸炮]]}}
    ret += "index=%s, " % int(ship['shipIndex'])
|装备2={{装备背景|2|[[File:Equip L 8.png|80px]]}}<!--(如果该位置没有装备,请留空)-->
    ret += "rarity=%s, " % ship['star']
|装备3={{装备背景|1|[[File:Equip L 77.png|80px]]}}<!--(如果该位置没有装备,请留空)-->
    t = [ '', '航空母舰', '轻型航空母舰', '装甲航母', '战列舰', 'BBV', '战列巡洋舰', '航空战列舰', \
|装备4=<!--(如果该位置没有装备,请留空)-->
            'CAV', 'CLT', '轻巡洋舰', '浅水重炮舰', '驱逐舰', 'SSV', '潜艇', '重炮潜艇', '补给舰' ]
|装备名1=英国双联15英寸炮
    ret += "type='%s', " % t[ship['type']]
|装备名2=英国双联4英寸炮
    ret += "country='%s', " % country
|装备名3=海象式
    ret += "class='%s', " % ship['classNo']
|装备名4=
 
|装备属性1=火力+17<br>命中+1
    ret = ret[:-1] + '\n    '
|装备属性2=火力+1<br>对空+3
 
|装备属性3=对空+1<br>轰炸+1<br>对潜+3<br>索敌+4<br>命中+1
    ret += "hp=%s, " % ship['hp']
|装备属性4=
    ret += "atk=%s, " % ship['atk']
|第1格容量=3
    ret += "tpd=%s, " % ship['torpedo']
|第2格容量=3
    ret += "def=%s, " % ship['def']
|第3格容量=3
    ret += "aa=%s, " % ship['airDef']
|第4格容量=3
    ret += "eva=%s, " % ship['miss']
|获得方式= 建造(4:30:00)、掉落(1-4,2-3~2-4,3-2~6-2,6-4)
    ret += "as=%s, " % ship['antisub']
|舰船简介=英国史上最著名的战列巡洋舰。在20至30年代,胡德号长期作为英国海军的象征,频繁出访世界各地。胡德号在40年参与了针对投降后法国舰队的抛石机行动,重创了法国海军。41年的海战中,胡德号同威尔士亲王号一同拦截俾斯麦号和欧根亲王号,在战斗中胡德号被击中之后迅速爆炸沉没。
    ret += "rec=%s, " % ship['radar']
}}
    ret += "speed=%s, " % ship['speed']
|-|
    ret += "luck=%s, " % ship['luck']
改造后 =  
    t = [ '', '短', '中', '长', '超长' ]
{{舰娘
    ret += "range='%s', " % t[ship['range']]
|战舰序号= 海军上将级1号舰
 
|战舰名=胡德·改
    ret = ret[:-1] + '\n    '
|图鉴编号= 1001
 
|所属=英国
    ret += "atkMax=%s, " % (int(ship['atk']) + st['atk'] // exp)
|星级= 6
    ret += "tpdMax=%s, " % (int(ship['torpedo']) + st['torpedo'] // exp)
|战舰类型= 战列巡洋舰
    ret += "defMax=%s, " % (ship['def'] + st['def'] // exp)
|改造等级= 75
    ret += "aaMax=%s, " % (int(ship['airDef']) + st['air_def'] // exp)
|耐久= 80
    ret += "evaMax=%s, " % ship['missMax']
|火力= 78
    ret += "asMax=%s, " % ship['antisubMax']
|火力max= 103
    ret += "recMax=%s, " % ship['radarMax']
|搭载= 12
 
|装甲= 72
    ret = ret[:-1] + '\n    '
|装甲max= 87
 
|鱼雷= 0/0
    ret += "cap1=%s, " % cap[0]
|幸运= 8
    ret += "cap2=%s, " % cap[1]
|回避= 33
    ret += "cap3=%s, " % cap[2]
|回避max= 65
    ret += "cap4=%s, " % cap[3]
|对空= 55
    ret += "eq1='%s', " % eq[0]
|对空max= 85
    ret += "eq2='%s', " % eq[1]
|射程=
    ret += "eq3='%s', " % eq[2]
|索敌= 18
    ret += "eq4='%s', " % eq[3]
|索敌max= 43
 
|对潜= 0
    ret = ret[:-1] + '\n    '
|对潜max= 0
 
|航速= 32
    ret += "sFuel=%s, " % ship['maxOil']
|燃料= 70
    ret += "sAmmo=%s, " % ship['maxAmmo']
|弹药= 120
    ret += "rFuel=%s, " % ship['repairOilModulus']
|拆解油=40
    ret += "rSteel=%s, " % ship['repairSteelModulus']
|拆解弹=50
    ret += "sAtk=%s, " % ship['strengthenSupplyExp']['atk']
|拆解钢=40
    ret += "sTpd=%s, " % ship['strengthenSupplyExp']['torpedo']
|拆解铝=0
    ret += "sDef=%s, " % ship['strengthenSupplyExp']['def']
|强化加成={{舰娘/强化|火力=83|鱼雷=0|装甲=72|对空=47}}
    ret += "sAa=%s, " % ship['strengthenSupplyExp']['air_def']
|改造消耗=
    ret += "dFuel=%s, " % ship['dismantle']['2']
|技能介绍={{舰娘/技能|技能名=皇家海军的荣耀|技能介绍=当胡德作为旗舰时<br>为队伍中所有舰船附加5/7.5/10%被暴击率<br>为队伍中英国舰船附加10/15/20%暴击率<br>其他国家的舰船增加5%/7.5%/10%的暴击率}}
    ret += "dAmmo=%s, " % ship['dismantle']['3']
|技能介绍2={{舰娘/技能|技能名=皇家巡游|技能介绍=当胡德作为旗舰时提升全队航速2/3/4点}}
    ret += "dSteel=%s, " % ship['dismantle']['4']
|装备1={{装备背景|5|[[File:Equip L 120.png|80px|link=英国双联15英寸炮()]]}}
    ret += "dBaux=%s, " % ship['dismantle']['9']
|装备2={{装备背景|4|[[File:Equip L 96.png|80px]]}}<!--(如果该位置没有装备,请留空)-->
 
|装备3={{装备背景|5|[[File:Equip L 121.png|80px|link=英国三联15英寸炮(试作型)]]}}
    t = [ s for s in allShips if int(s['shipIndex']) - int(ship['shipIndex']) == 1000 ]
|装备4={{装备背景|4|[[File:Equip L 183.png|80px|link="生姜&鱼饼"]]}}<!--(如果该位置没有装备,请留空)-->
    if len(t) != 0:
|装备名1= 英国双联15英寸炮()
        mod = { '2':0, '3':0, '4':0, '9':0 }
|装备名2=附加装甲(大型)
        for k,v in ship['evoNeedResource'].items():
|装备名3=英国三联15英寸炮(试作型)
            mod[k] = v
|装备名4="生姜&鱼饼"
 
|装备属性1=火力+19<br>命中+2
        ret = ret[:-1] + '\n    '
|装备属性2=装甲+9<br>命中+3
        ret += "mod='%s', " % getShipName(t[0])
|装备属性3=火力+21<br>命中+1
        ret += "modLv=%s, " % ship['evoLevel']
|装备属性4=装甲3<br>命中3
        t = { 10441:'驱逐', 10341:'巡洋', 10241:'战列', 10141:'航母', 10541:'潜艇' }
|第1格容量=3
        ret += "coreType='%s', " % t[ship['evoNeedItemCid']]
|第2格容量=3
        ret += "coreNum=%s, " % ship['evoNeedResource'][str(ship['evoNeedItemCid'])]
|第3格容量=3
        ret += "mFuel=%s, " % mod['2']
|第4格容量=3
        ret += "mAmmo=%s, " % mod['3']
|获得方式= 改造
        ret += "mSteel=%s, " % mod['4']
|舰船简介=英国史上最著名的战列巡洋舰。在20至30年代,胡德号长期作为英国海军的象征,频繁出访世界各地。胡德号在40年参与了针对投降后英国舰队的抛石机行动,重创了英国海军。41年的海战中,胡德号同威尔士亲王号一同拦截俾斯麦号和欧根亲王号,在战斗中胡德号被击中之后迅速爆炸沉没。
        ret += "mBaux=%s, " % mod['9']
}}
 
|-|
    return ret[:-2] + '\n}\n'
和谐立绘=
 
{{和谐立绘|图鉴编号=1001}}
 
</tabber>
def getDialogue(ship):
    name = getShipName(ship)
    ret = "text['" + name + "']= { }\n"
    ret += "text['" + name + "']['获得'] = '" + ship['getDialogue'].strip() + "'\n"
    if ship['mainDialogue'] and ship['mainDialogue'][0]:
        ret += "text['" + name + "']['白天1'] = '" + ship['mainDialogue'][0].strip() + "'\n"
        ret += "text['" + name + "']['白天2'] = '" + ship['mainDialogue'][1].strip() + "'\n"
        ret += "text['" + name + "']['白天3'] = '" + ship['mainDialogue'][2].strip() + "'\n"
    if ship['mainDialogue'] and ship['mainDialogue'][6]:
        ret += "text['" + name + "']['夜间1'] = '" + ship['mainDialogue'][6].strip() + "'\n"
        ret += "text['" + name + "']['夜间2'] = '" + ship['mainDialogue'][7].strip() + "'\n"
        ret += "text['" + name + "']['夜间3'] = '" + ship['mainDialogue'][8].strip() + "'\n"
    if ship['formationDialogue']:
        ret += "text['" + name + "']['阵型'] = '" + ship['formationDialogue'].strip() + "'\n"
    if ship['atkDialogue']:
        ret += "text['" + name + "']['攻击'] = '" + ship['atkDialogue'].strip() + "'\n"
    if ship['nightAtkDialogue']:
        ret += "text['" + name + "']['夜战'] = '" + ship['nightAtkDialogue'].strip() + "'\n"
    if ship['breakDialogue']:
        ret += "text['" + name + "']['中破'] = '" + ship['breakDialogue'].strip() + "'\n"
    ret += "text['" + name + "']['誓约'] = '" + ship['vow'].strip() + "'\n"
    ret += "text['" + name + "']['简介'] = '" + ship['desc'].strip() + "'\n"
 
    return ret + '\n'
 
def getEquiptAttr(e):
    ret = "equipts['%s'] = { " % e['title']
    ret += 'index=%s, rarity=%s' % (int(e['equipIndex']), e['star'])
    if int(e['atk']) != 0:          ret += ', atk=%s'  % e['atk']
    if int(e['def']) != 0:          ret += ', def=%s'  % e['def']
    if int(e['torpedo']) != 0:      ret += ', tpd=%s'  % e['torpedo']
    if int(e['antisub']) != 0:      ret += ', as=%s'    % e['antisub']
    if int(e['radar']) != 0:        ret += ', rec=%s'  % e['radar']
    if int(e['hit']) != 0:          ret += ', acc=%s'  % e['hit']
    if int(e['range']) != 0:        ret += ', range=%s' % e['range']
    if int(e['miss']) != 0:        ret += ', eva=%s'  % e['miss']
    if int(e['luck']) != 0:        ret += ', luck=%s'  % e['luck']
    if int(e['aircraftAtk']) != 0:  ret += ', bomb=%s'  % e['aircraftAtk']
    if int(e['airDef']) != 0:      ret += ', aa=%s'    % e['airDef']
    if float(e['airDefCorrect']) != 0: ret += ', aac=%d'  % (float(e['airDefCorrect']) * 100)
    if int(e['aluminiumUse']) != 0: ret += ', baux=%s'  % e['aluminiumUse']
    return ret + ' }'
 
def printShips(data):
    ships = [ s for s in data['shipCard'] if int(s['npc']) == 0 ]
 
    f = open('台词.txt', 'w')
    f.write('text = { }\n\n')
    for s in ships:
        f.write(getDialogue(s))
    f.write('return text')
    f.close()
 
    ships = [ s for s in data['shipCard'] if int(s['npc']) == 0 and int(s['shipIndex']) < 2000 ]
 
    f = open('属性.txt', 'w')
    f.write('ships = { }\n\n')
    for s in ships:
        f.write(getShipAttr(s, ships, data['shipEquipmnt']))
        f.write('\n')
    f.write('return ships')
    f.close()
 
    f = open('装备.txt', 'w')
    f.write('equipts = { }\n\n')
    for equipt in data['shipEquipmnt']:
        if equipt['picId'] == 998: continue
        if equipt['title'] == '喵': continue
        f.write(getEquiptAttr(equipt))
        f.write('\n')
    f.write('\nreturn equipts')
    f.close()
 
def download():
    j = urlopen('http://login.jianniang.com/index/getInitConfigs').read().decode('utf-8')
    return json.loads(j)
 
def run():
    data = download()
    printShips(data)
</nowiki></pre>

2016年10月3日 (一) 04:13的版本

from urllib.request import urlopen
import json

def getShipName(ship):
    name = ship['title'].strip()
    idx = int(ship['shipIndex'])
    if idx < 1000 or name in [ '重庆', '奥希金斯', '信赖', '萝德尼' ]:
        return name
    elif idx < 2000:
        return name + '·改'
    else:
        return name + '(特殊)'

def getShipAttr(ship, allShips, equipts):
    st = ship['strengthenTop']
    exp = ship['strengthenLevelUpExp']

    cap = [ 0 ] * 4
    if ship['capacityInit']:
        for i in range(len(ship['capacityInit'])):
            cap[i] = ship['capacityInit'][i]

    eq = [ '不可装备' ] * 4
    n = len(ship['equipment'])
    for i in range(n):
        eq[i] = [ e['title'] for e in equipts if e['cid'] == ship['equipment'][i] ][0]
    for i in range(n, ship['equipmentNum']):
        eq[i] = '无'

    t = [ '', '日本', '德国', '英国', '美国', '意大利', '法国', '苏联', '中国', '???' ]
    country = t[int(ship['country'])]
    t = { '戈本':'土耳其', '德·鲁伊特':'荷兰', '苏赫巴托尔':'蒙古', '奥希金斯':'智利', '吸血鬼':'英国', '海达人':'加拿大', '奥丁':'冰岛' }
    if ship['title'] in t:
        country = t[ship['title']]

    ret = "ships['%s'] = {\n    " % getShipName(ship)

    ret += "index=%s, " % int(ship['shipIndex'])
    ret += "rarity=%s, " % ship['star']
    t = [ '', '航空母舰', '轻型航空母舰', '装甲航母', '战列舰', 'BBV', '战列巡洋舰', '航空战列舰', \
            'CAV', 'CLT', '轻巡洋舰', '浅水重炮舰', '驱逐舰', 'SSV', '潜艇', '重炮潜艇', '补给舰' ]
    ret += "type='%s', " % t[ship['type']]
    ret += "country='%s', " % country
    ret += "class='%s', " % ship['classNo']

    ret = ret[:-1] + '\n    '

    ret += "hp=%s, " % ship['hp']
    ret += "atk=%s, " % ship['atk']
    ret += "tpd=%s, " % ship['torpedo']
    ret += "def=%s, " % ship['def']
    ret += "aa=%s, " % ship['airDef']
    ret += "eva=%s, " % ship['miss']
    ret += "as=%s, " % ship['antisub']
    ret += "rec=%s, " % ship['radar']
    ret += "speed=%s, " % ship['speed']
    ret += "luck=%s, " % ship['luck']
    t = [ '', '短', '中', '长', '超长' ]
    ret += "range='%s', " % t[ship['range']]

    ret = ret[:-1] + '\n    '

    ret += "atkMax=%s, " % (int(ship['atk']) + st['atk'] // exp)
    ret += "tpdMax=%s, " % (int(ship['torpedo']) + st['torpedo'] // exp)
    ret += "defMax=%s, " % (ship['def'] + st['def'] // exp)
    ret += "aaMax=%s, " % (int(ship['airDef']) + st['air_def'] // exp)
    ret += "evaMax=%s, " % ship['missMax']
    ret += "asMax=%s, " % ship['antisubMax']
    ret += "recMax=%s, " % ship['radarMax']

    ret = ret[:-1] + '\n    '

    ret += "cap1=%s, " % cap[0]
    ret += "cap2=%s, " % cap[1]
    ret += "cap3=%s, " % cap[2]
    ret += "cap4=%s, " % cap[3]
    ret += "eq1='%s', " % eq[0]
    ret += "eq2='%s', " % eq[1]
    ret += "eq3='%s', " % eq[2]
    ret += "eq4='%s', " % eq[3]

    ret = ret[:-1] + '\n    '

    ret += "sFuel=%s, " % ship['maxOil']
    ret += "sAmmo=%s, " % ship['maxAmmo']
    ret += "rFuel=%s, " % ship['repairOilModulus']
    ret += "rSteel=%s, " % ship['repairSteelModulus']
    ret += "sAtk=%s, " % ship['strengthenSupplyExp']['atk']
    ret += "sTpd=%s, " % ship['strengthenSupplyExp']['torpedo']
    ret += "sDef=%s, " % ship['strengthenSupplyExp']['def']
    ret += "sAa=%s, " % ship['strengthenSupplyExp']['air_def']
    ret += "dFuel=%s, " % ship['dismantle']['2']
    ret += "dAmmo=%s, " % ship['dismantle']['3']
    ret += "dSteel=%s, " % ship['dismantle']['4']
    ret += "dBaux=%s, " % ship['dismantle']['9']

    t = [ s for s in allShips if int(s['shipIndex']) - int(ship['shipIndex']) == 1000 ]
    if len(t) != 0:
        mod = { '2':0, '3':0, '4':0, '9':0 }
        for k,v in ship['evoNeedResource'].items():
            mod[k] = v

        ret = ret[:-1] + '\n    '
        ret += "mod='%s', " % getShipName(t[0])
        ret += "modLv=%s, " % ship['evoLevel']
        t = { 10441:'驱逐', 10341:'巡洋', 10241:'战列', 10141:'航母', 10541:'潜艇' }
        ret += "coreType='%s', " % t[ship['evoNeedItemCid']]
        ret += "coreNum=%s, " % ship['evoNeedResource'][str(ship['evoNeedItemCid'])]
        ret += "mFuel=%s, " % mod['2']
        ret += "mAmmo=%s, " % mod['3']
        ret += "mSteel=%s, " % mod['4']
        ret += "mBaux=%s, " % mod['9']

    return ret[:-2] + '\n}\n'


def getDialogue(ship):
    name = getShipName(ship)
    ret = "text['" + name + "']= { }\n"
    ret += "text['" + name + "']['获得'] = '" + ship['getDialogue'].strip() + "'\n"
    if ship['mainDialogue'] and ship['mainDialogue'][0]:
        ret += "text['" + name + "']['白天1'] = '" + ship['mainDialogue'][0].strip() + "'\n"
        ret += "text['" + name + "']['白天2'] = '" + ship['mainDialogue'][1].strip() + "'\n"
        ret += "text['" + name + "']['白天3'] = '" + ship['mainDialogue'][2].strip() + "'\n"
    if ship['mainDialogue'] and ship['mainDialogue'][6]:
        ret += "text['" + name + "']['夜间1'] = '" + ship['mainDialogue'][6].strip() + "'\n"
        ret += "text['" + name + "']['夜间2'] = '" + ship['mainDialogue'][7].strip() + "'\n"
        ret += "text['" + name + "']['夜间3'] = '" + ship['mainDialogue'][8].strip() + "'\n"
    if ship['formationDialogue']:
        ret += "text['" + name + "']['阵型'] = '" + ship['formationDialogue'].strip() + "'\n"
    if ship['atkDialogue']:
        ret += "text['" + name + "']['攻击'] = '" + ship['atkDialogue'].strip() + "'\n"
    if ship['nightAtkDialogue']:
        ret += "text['" + name + "']['夜战'] = '" + ship['nightAtkDialogue'].strip() + "'\n"
    if ship['breakDialogue']:
        ret += "text['" + name + "']['中破'] = '" + ship['breakDialogue'].strip() + "'\n"
    ret += "text['" + name + "']['誓约'] = '" + ship['vow'].strip() + "'\n"
    ret += "text['" + name + "']['简介'] = '" + ship['desc'].strip() + "'\n"

    return ret + '\n'

def getEquiptAttr(e):
    ret = "equipts['%s'] = { " % e['title']
    ret += 'index=%s, rarity=%s' % (int(e['equipIndex']), e['star'])
    if int(e['atk']) != 0:          ret += ', atk=%s'   % e['atk']
    if int(e['def']) != 0:          ret += ', def=%s'   % e['def']
    if int(e['torpedo']) != 0:      ret += ', tpd=%s'   % e['torpedo']
    if int(e['antisub']) != 0:      ret += ', as=%s'    % e['antisub']
    if int(e['radar']) != 0:        ret += ', rec=%s'   % e['radar']
    if int(e['hit']) != 0:          ret += ', acc=%s'   % e['hit']
    if int(e['range']) != 0:        ret += ', range=%s' % e['range']
    if int(e['miss']) != 0:         ret += ', eva=%s'   % e['miss']
    if int(e['luck']) != 0:         ret += ', luck=%s'  % e['luck']
    if int(e['aircraftAtk']) != 0:  ret += ', bomb=%s'  % e['aircraftAtk']
    if int(e['airDef']) != 0:       ret += ', aa=%s'    % e['airDef']
    if float(e['airDefCorrect']) != 0: ret += ', aac=%d'   % (float(e['airDefCorrect']) * 100)
    if int(e['aluminiumUse']) != 0: ret += ', baux=%s'  % e['aluminiumUse']
    return ret + ' }'

def printShips(data):
    ships = [ s for s in data['shipCard'] if int(s['npc']) == 0 ]

    f = open('台词.txt', 'w')
    f.write('text = { }\n\n')
    for s in ships:
        f.write(getDialogue(s))
    f.write('return text')
    f.close()

    ships = [ s for s in data['shipCard'] if int(s['npc']) == 0 and int(s['shipIndex']) < 2000 ]

    f = open('属性.txt', 'w')
    f.write('ships = { }\n\n')
    for s in ships:
        f.write(getShipAttr(s, ships, data['shipEquipmnt']))
        f.write('\n')
    f.write('return ships')
    f.close()

    f = open('装备.txt', 'w')
    f.write('equipts = { }\n\n')
    for equipt in data['shipEquipmnt']:
        if equipt['picId'] == 998: continue
        if equipt['title'] == '喵': continue
        f.write(getEquiptAttr(equipt))
        f.write('\n')
    f.write('\nreturn equipts')
    f.close()

def download():
    j = urlopen('http://login.jianniang.com/index/getInitConfigs').read().decode('utf-8')
    return json.loads(j)

def run():
    data = download()
    printShips(data)