예제 #1
0
def outputExcel():
    wbk = xlwt.Workbook()
    sheet = wbk.add_sheet('sheet 1',cell_overwrite_ok=True)
    style = xlwt.XFStyle()
    font = xlwt.Font()
    font.name = u'宋体'
    font.height = 240
    style.font = font
    user_card_list = bot_IOfile.read_pkl_data('D:\Python POJ\lxybot_v2\data\data_card_game_list.pkl')
    sheet.col(0).width = 256*15
    sheet.col(1).width = 256*20
    sheet.col(2).width = 256*9
    sheet.col(3).width = 256*9
    sheet.col(4).width = 256*9
    sheet.col(5).width = 256*9
    sheet.col(6).width = 256*9
    sheet.col(7).width = 256*9
    sheet.col(8).width = 256*9
    sheet.col(9).width = 256*9
    sheet.col(10).width = 256*9
    sheet.col(11).width = 256*12
    sheet.col(12).width = 256*12
    sheet.col(13).width = 256*12
    sheet.col(14).width = 256*12
    sheet.write(0, 0, 'qq号', style)
    sheet.write(0, 1, 'osuid', style)
    sheet.write(0, 2, '总金币', style)
    sheet.write(0, 3, '总积分', style)
    sheet.write(0, 4, '爆炸费', style)
    sheet.write(0, 5, '解烟费', style)
    sheet.write(0, 6, 'MR总数', style)
    sheet.write(0, 7, 'UR总数', style)
    sheet.write(0, 8, 'SR总数', style)
    sheet.write(0, 9, 'R总数', style)
    sheet.write(0, 10, 'N总数', style)
    sheet.write(0, 11, '欧皇系数', style)
    sheet.write(0, 12, '金币排名', style)
    sheet.write(0, 13, '积分排名', style)
    sheet.write(0, 14, '欧洲排名', style)
    for i in range(len(user_card_list)):
        sheet.write(i+1, 0, '%s' % user_card_list[i]['qq'], style)
        sheet.write(i+1, 1, user_card_list[i]['name'], style)
        sheet.write(i+1, 2, user_card_list[i]['money_total'], style)
        sheet.write(i+1, 3, user_card_list[i]['pt_total'], style)
        sheet.write(i+1, 4, user_card_list[i]['money_boom_total'], style)
        sheet.write(i+1, 5, user_card_list[i]['money_smoke'], style)
        sheet.write(i+1, 6, eachCardNum(user_card_list[i]['card'], 0), style)
        sheet.write(i+1, 7, eachCardNum(user_card_list[i]['card'], 1), style)
        sheet.write(i+1, 8, eachCardNum(user_card_list[i]['card'], 2), style)
        sheet.write(i+1, 9, eachCardNum(user_card_list[i]['card'], 3), style)
        sheet.write(i+1, 10, eachCardNum(user_card_list[i]['card'], 4), style)
        if totalCardNum(user_card_list[i]['card']) > 0:
            sheet.write(i+1, 11, '%.3f' % user_card_list[i]['lucky_rate'], style)
        else:
            sheet.write(i+1, 11, 0, style)
    wbk.save('D:\Python POJ\lxybot_v2\offline\output.xls')
예제 #2
0
# -*- coding: utf-8 -*-
# 全局设置
import threading
from function import bot_IOfile

# BP监视开关
bp_watch = 1
# 恢复bp监视列表,用户当日是否被检查列表,用户将被超限踢出列表
user_bp_list = bot_IOfile.read_pkl_data('data/data_bp_care_list.pkl')
user_check_in_list = bot_IOfile.read_pkl_data('data/data_check_in_list.pkl')
user_check_out_list = bot_IOfile.read_pkl_data('data/data_check_out_list.pkl')
# 变量锁,对内容有改动的指令需要加锁以实现互斥(对只读指令则采取鸵鸟策略)
user_bp_list_lock = threading.Lock()
user_card_list_lock = threading.Lock()
health_list_lock = threading.Lock()
noise_list_lock = threading.Lock()
game_mie_lock = threading.Lock()
sql_action_lock = threading.Lock()
super_star_lock = threading.Lock()
check_out_lock = threading.Lock()


def getGroupList(list_g):
    for i in range(len(list_g)):
        if list_g[i] < len(group_total_list):
            list_g[i] = group_total_list[list_g[i]]
    return list_g


# 适用群列表: 0主群,1分群,2后花园,3避难所,4粉丝群,5队群,6娱乐群,7贫民窟,8管理群,9测试群
group_total_list = [
예제 #3
0
        if choose[i] == 'SD':  # SD删除
            total_mod = total_mod - 32
        if choose[i] == 'SO':  # SO删除,得分乘以1.05
            total_mod = total_mod - 4096
            pp = int(pp * 1.05)
        if choose[i] == 'NF':  # NF删除,得分乘以1.09
            total_mod = total_mod - 1
            pp = int(pp * 1.09)
        if choose[i] == 'HD':  # HD删除,得分除以1.10
            total_mod = total_mod - 8
            pp = int(pp / 1.09)
    return total_mod, pp


error_list = []
user_list = bot_IOfile.read_pkl_data(
    'D:\Python POJ\lxybot_v2\data\data_user_CN_list.pkl')
total_number = len(user_list)
user_number = 0
for user in user_list:
    user_number = user_number + 1
    uid = user['uid']
    user_pp = user['pp']
    result = bot_osu.getUserBp(uid, 0)
    if not result:
        error_list.append(user)
        print('%s. %s的成绩获取失败' % (user_number, uid))
    elif len(result) < 35:
        print('%s. %s的bp数少于35个' % (user_number, uid))
    else:
        bp_rank = 0
        for bp_msg in result:
예제 #4
0
from function import bot_msgcheck
from function import bot_card
from function import bot_miegame
from function import bot_IOfile
from function import bot_osu
from function import bot_chart
from function import bot_superstar

# 咩羊游戏初始值
game_content = [[1, 1], [1, 1]]
# 正在使用咩羊游戏的玩家qq号
game_member = 0
# 咩羊游戏难度
game_diff = 0
# 恢复活动列表和健康列表
user_card_list = bot_IOfile.read_pkl_data('data/data_card_game_list.pkl')
health_list = bot_IOfile.read_pkl_data('data/data_health_list.pkl')
egg_list = bot_IOfile.read_pkl_data('data/data_egg_list.pkl')


def MsgCenter(bot, context):
    global game_member
    global game_diff
    global game_content

    # 转义字符与指令字符处理
    content = context['message']
    content = content.replace('&#91;', '[')
    content = content.replace('&#93;', ']')
    content = content.replace('&#44;', ',')
    content = content.replace('&amp;', '&')
예제 #5
0
# -*- coding: utf-8 -*-
# 初始化玩家数据,一般用于月初更新
from function import bot_IOfile

list_card = bot_IOfile.read_pkl_data(
    'D:\Python POJ\lxybot_v2\data\data_card_game_list.pkl')
newlist = []
for i in range(len(list_card) - 1, -1, -1):
    if list_card[i]['pt_total'] < 1 and list_card[i]['money_total'] < 1000:
        del list_card[i]
    else:
        card_member = list_card[i]['qq']
        osu_id = list_card[i]['uid']
        name = list_card[i]['name']
        pc = list_card[i]['pc']
        tth = list_card[i]['tth']
        medal = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
        user_info = {
            'qq': card_member,
            'uid': osu_id,
            'name': name,
            'pc': pc,
            'tth': tth,
            'medal': medal,
            'card': [[], [], [], [], []],
            'money_now': 100,
            'money_total': 100,
            'money_boom_total': 0,
            'money_boom_cost': 30,
            'money_smoke': 0,
            'money_bonus': 0,