diff --git a/test/aola.py b/test/aola.py index 12d96cd..77a38d6 100644 --- a/test/aola.py +++ b/test/aola.py @@ -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") diff --git a/test/aola.sqlite b/test/aola.sqlite index 429c932..db0c2d7 100644 Binary files a/test/aola.sqlite and b/test/aola.sqlite differ diff --git a/test/magic_sprit.py b/test/magic_sprit.py new file mode 100644 index 0000000..e69de29 diff --git a/test/outside_the_pole.py b/test/outside_the_pole.py new file mode 100644 index 0000000..a86a7de --- /dev/null +++ b/test/outside_the_pole.py @@ -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() \ No newline at end of file