This commit is contained in:
Pi 2025-05-11 09:22:33 +08:00
parent b16c4fa9c8
commit 141295b480
4 changed files with 75 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class TeamSwitchPacketGenerator:
# 创建按钮框架,包含“刷新”和“生成封包”按钮
button_frame = tk.Frame(self.root)
button_frame.pack(pady=5)
tk.Button(button_frame, text="Set1", command=self.set_1).pack(side=tk.LEFT, padx=5)
tk.Button(button_frame, text="刷新", command=self.refresh_dropdown).pack(side=tk.LEFT, padx=5)
tk.Button(button_frame, text="生成封包(第一次生成请先解锁二级密码)", command=self.generate_packets).pack(side=tk.LEFT, padx=5)
@ -67,6 +68,16 @@ class TeamSwitchPacketGenerator:
self.info_text = tk.Text(self.root, height=5, width=80, fg="red")
self.info_text.pack(pady=5)
def set_1(self):
try:
self.cursor.execute("UPDATE aolaer_id SET is_set = 1")
self.conn.commit()
self.info_text.insert(tk.END, f"set1 ok\n")
return
except sqlite3.Error:
self.info_text.insert(tk.END, f"set1失败\n")
return
def get_team_data(self):
try:
self.cursor.execute("SELECT team_name, spell_code FROM aolaer_team ORDER BY team_name")

Binary file not shown.

0
test/magic_sprit.py Normal file
View File

64
test/outside_the_pole.py Normal file
View File

@ -0,0 +1,64 @@
import json
def generate_packet(floor):
"""生成指定层的封包序列,每条指令占一行"""
packets = []
# 命令 54_22
packet_54_22 = {
"id": 15,
"param": {
"fmt": 0,
"st": 1,
"handler": "MB240906",
"type": 99,
"floor": floor
},
"cmd": "54_22"
}
packets.append(f"|#send={json.dumps(packet_54_22)}|")
# 时间延迟 1000ms
packets.append("|#time=1000|")
# 自动化标志
packets.append("|#auto=true|")
# 等待指令
packets.append("|#wait|")
# 命令 1212
packet_1212 = {
"id": 13,
"param": {},
"cmd": "1212"
}
packets.append(f"|#send={json.dumps(packet_1212)}|")
# 时间延迟 3000ms
packets.append("|#time=1000|")
return packets
def main():
# 生成 60 到 99 层的封包
all_packets = []
for floor in range(351, 450):
packets = generate_packet(floor)
all_packets.extend(packets)
all_packets.append("") # 每层后加空行分隔
# 输出到控制台
for packet in all_packets:
print(packet)
# 保存到文件
with open("packets_60_to_99.txt", "w", encoding="utf-8") as f:
for packet in all_packets:
f.write(packet + "\n")
if __name__ == "__main__":
main()