{"data":{"version":"v2.81","locale":"vi","availableLocales":["en","vi","th","id","fil"],"updatedAt":"2026-09-30T09:58:59.584Z","contract":{"keywords":["if","else","for","while","def","class","return","global","pass","lambda","in","is","and","or","not","break","continue","True","False","None"],"allowedImports":["cognitab","random","math","time"],"builtinHelpers":["enumerate","zip","len","int","float","str","type","print","bool","abs","sum","min","max","sorted","round","sqrt","pow","floor","ceil","sin","cos","tan","log","clamp"],"functionAliases":{"sleep":"wait"}},"guides":{"concurrency":{"title":"Luồng chạy và thực thi","sections":[{"id":"overview","title":"Luồng chạy và thực thi","body":"Lời gọi thông thường chạy trong luồng hiện tại và có thể chờ chụp, xử lý, cử chỉ, chuyển UI hoặc nhập liệu. parallel của lần chạm và Flow.start là hai cơ chế khác nhau. Blocking là chờ trong luồng gọi, không đồng nghĩa UI Android bị treo.","example":null},{"id":"flows","title":"Luồng nền","body":"Flow.start(name, params=None) mở nhánh cô lập và trả số thứ tự Int. Mỗi lượt Run có tối đa hai nhánh nền. Không có Flow.stop(), pause(), resume(), join() hay API handle. Kết thúc luồng chính chờ các nhánh nền; lỗi ở một nhánh và System.stop() dừng toàn bộ lượt Run.","example":"# Cấu hình luồng macro tên watch_enemy trước khi chạy\nordinal = Flow.start(\"watch_enemy\", {\"task\": \"status\"})\nprint(ordinal)"},{"id":"shared-state","title":"Trạng thái dùng chung","body":"Dùng giá trị/builder có thể thay đổi riêng cho mỗi luồng. Storage được chủ động dùng chung và khóa từng thao tác, gồm chỉnh sửa lồng nhau được theo dõi. Storage.get() rồi Storage.set() không nguyên tử; dùng một luồng ghi cho việc đọc-sửa-ghi. Chụp màn hình và điều khiển cache cũng dùng chung; đổi thiết lập ảnh hưởng mọi nhánh.","example":null},{"id":"touches","title":"Lần chạm xếp hàng","body":"parallel=True xếp hàng lần chạm; ngoài collect, delay_before và delay_after vẫn chờ trong luồng gọi. Touch.collect() gom chạm để Touch.send(); Touch.wait() chờ hoàn tất. Cử chỉ dùng chung kênh nhập Android, không trở thành thiết bị độc lập. Hủy cử chỉ đang chạy cần Android 8 trở lên.","example":"# Thu thập các lần chạm chồng lấp rồi chờ hoàn tất\nTouch.collect()\nclick((300, 900), hold_ms=1500, parallel=True)\nclick((780, 900), delay_before=500, parallel=True)\nTouch.send()\nTouch.wait()"},{"id":"recognition-ui","title":"Nhận diện và chờ UI","body":"Region.find* tìm sự xuất hiện; Region.wait* chờ biến mất. Nhận diện một lượt vẫn tốn thời gian xử lý. Tốc độ kiểm tra giới hạn 1–60 Hz. Prompt MacroPanel có tương tác được tuần tự và chờ người dùng. OverlayText do từng luồng sở hữu; off_all() chỉ giải phóng overlay của luồng đó, còn UI đi qua Android Main.","example":null}]}},"entries":[{"key":"class-audio","kind":"CLASS","parentKey":null,"name":"Audio","signature":"Audio(name)","description":"Giá trị âm thanh chỉ đọc dùng để nhận diện tiếng động trong app hoặc game. Dùng Audio(name) để nạp mẫu đã lưu, hoặc Audio.recent(duration_ms) để lấy đoạn âm thanh vừa thu. Thu và so khớp trên thiết bị; bộ đệm nghe liên tục không được tải lên và script không truy cập âm thanh thô (PCM).","behavior":"Giá trị âm thanh chỉ đọc dùng để nhận diện tiếng động trong app hoặc game. Dùng Audio(name) để nạp mẫu đã lưu, hoặc Audio.recent(duration_ms) để lấy đoạn âm thanh vừa thu. Thu và so khớp trên thiết bị; bộ đệm nghe liên tục không được tải lên và script không truy cập âm thanh thô (PCM).","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["name","duration_ms","start_ms","end_ms"],"fieldDocs":[{"name":"name","type":"String | None","defaultValue":null,"description":"Tên mẫu đã lưu, hoặc None với snapshot gần nhất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"duration_ms","type":"Number","defaultValue":null,"description":"Độ dài snapshot tính bằng mili giây.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"start_ms","type":"Number","defaultValue":null,"description":"Thời điểm bắt đầu tính bằng mili giây; bằng 0 với mẫu có tên, tính từ đầu phiên nghe với snapshot gần nhất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"end_ms","type":"Number","defaultValue":null,"description":"Thời điểm kết thúc không bao gồm, tính bằng mili giây trên cùng mốc thời gian với start_ms.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"name","type":"String","defaultValue":null,"description":"Tên mẫu đã tạo trong Trình quản lý mẫu của macro hiện tại; bắt buộc, không được rỗng và không phải đường dẫn tệp. Nạp mẫu ngay khi gọi, kể cả mẫu đã khôi phục hoặc trong gói được bảo vệ bằng mã hóa; mẫu thiếu hoặc hỏng sẽ báo lỗi. Backup/Store lưu nguồn đã chọn cùng các mẫu của macro: tối đa 32 mẫu WAV PCM16 mono 48 kHz, mỗi mẫu tối đa 10 giây, tổng tối đa 4 MiB.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"fieldExample":null,"constructorExample":"# Nạp mẫu đã lưu trong macro này\naudio = Audio(\"alert\")","params":[],"returnType":null,"returnDescription":null,"example":"# Nhận diện mẫu âm thanh cục bộ sau khi bật nghe\nsample = Audio(\"alert\")\nAudio.start()\nwait(2000)\nclip = Audio.recent(duration_ms=2000)\nresult = clip.match(sample, threshold=0.85)\nif result.matched:\n    print(result.score, result.start_ms, result.end_ms)\nAudio.stop()","aliases":[],"group":null},{"key":"class-audio-static-method-start","kind":"STATIC_METHOD","parentKey":"class-audio","name":"start","signature":"Audio.start()","description":"Bắt đầu nghe âm thanh từ app đã chọn, không dùng microphone. Cần Android 10+, quyền ghi âm, đồng ý MediaProjection và app nguồn cho phép thu âm thanh. Gọi lại khi đang nghe giữ nguyên bộ đệm. Bắt đầu lại sau stop sẽ đặt lại mốc thời gian phiên; hãy đặt lại cả mốc phát hiện đã lưu. Pause xóa lịch sử, nhưng Resume giữ mốc bắt đầu của phiên cũ và tính cả khoảng thời gian tạm dừng. Thiếu quyền, cấu hình hoặc phiên thu sẽ báo lỗi.","behavior":"Bắt đầu nghe âm thanh từ app đã chọn, không dùng microphone. Cần Android 10+, quyền ghi âm, đồng ý MediaProjection và app nguồn cho phép thu âm thanh. Gọi lại khi đang nghe giữ nguyên bộ đệm. Bắt đầu lại sau stop sẽ đặt lại mốc thời gian phiên; hãy đặt lại cả mốc phát hiện đã lưu. Pause xóa lịch sử, nhưng Resume giữ mốc bắt đầu của phiên cũ và tính cả khoảng thời gian tạm dừng. Thiếu quyền, cấu hình hoặc phiên thu sẽ báo lỗi.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":null,"example":"# Bắt đầu thu âm thanh từ app đã cấu hình sau khi được cấp quyền và đồng ý\nAudio.start()","aliases":[],"group":"FLOW"},{"key":"class-audio-static-method-stop","kind":"STATIC_METHOD","parentKey":"class-audio","name":"stop","signature":"Audio.stop()","description":"Dừng thu âm thanh và xóa bộ đệm. Các giá trị âm thanh đã trả về vẫn dùng được; phiên chụp màn hình đang được nơi khác sử dụng vẫn chạy. Kết thúc macro cũng giải phóng phiên thu âm thanh.","behavior":"Dừng thu âm thanh và xóa bộ đệm. Các giá trị âm thanh đã trả về vẫn dùng được; phiên chụp màn hình đang được nơi khác sử dụng vẫn chạy. Kết thúc macro cũng giải phóng phiên thu âm thanh.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":null,"example":"# Giải phóng bộ thu âm thanh đã cấu hình\nAudio.stop()","aliases":[],"group":"FLOW"},{"key":"class-audio-static-method-recent","kind":"STATIC_METHOD","parentKey":"class-audio","name":"recent","signature":"Audio.recent(duration_ms)","description":"Lấy đoạn âm thanh vừa thu thành một bản sao độc lập, không chờ thu thêm. Chỉ lấy được trong 10 giây gần nhất; không thể lấy âm thanh đã phát trước khi bắt đầu nghe. Chưa đủ lịch sử hoặc bộ thu không sẵn sàng sẽ báo lỗi. Chỉ có im lặng chưa đủ để kết luận app nguồn chặn thu âm thanh.","behavior":"Lấy đoạn âm thanh vừa thu thành một bản sao độc lập, không chờ thu thêm. Chỉ lấy được trong 10 giây gần nhất; không thể lấy âm thanh đã phát trước khi bắt đầu nghe. Chưa đủ lịch sử hoặc bộ thu không sẵn sàng sẽ báo lỗi. Chỉ có im lặng chưa đủ để kết luận app nguồn chặn thu âm thanh.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"duration_ms","type":"Number (1..10000)","defaultValue":null,"description":"Thời lượng bắt buộc, là số nguyên từ 1 đến 10000 mili giây.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Audio","returnDescription":null,"example":"# App nguồn phải đang phát; cần có ít nhất 500 ms dữ liệu lịch sử\nAudio.start()\nwait(600)\nclip = Audio.recent(500)\nprint(clip.duration_ms)","aliases":[],"group":"FLOW"},{"key":"class-audio-method-match","kind":"METHOD","parentKey":"class-audio","name":"match","signature":"audio.match(sample, threshold)","description":"Trượt mẫu tham chiếu trên snapshot và trả mức tương đồng tốt nhất. Dùng 64 dải biên độ mel đã chuẩn hóa và lấy trung bình mức tương đồng qua các khung tham chiếu có tín hiệu; đoạn bị thiếu âm làm giảm điểm. Đoạn im lặng không được tính là khớp. Không nhận dạng lời nói hoặc hiệu chỉnh tốc độ, cao độ. Mẫu dài hơn clip là lỗi. Hiệu chỉnh lại ngưỡng sau khi cập nhật bộ so khớp bằng những lần thu độc lập.","behavior":"Trượt mẫu tham chiếu trên snapshot và trả mức tương đồng tốt nhất. Dùng 64 dải biên độ mel đã chuẩn hóa và lấy trung bình mức tương đồng qua các khung tham chiếu có tín hiệu; đoạn bị thiếu âm làm giảm điểm. Đoạn im lặng không được tính là khớp. Không nhận dạng lời nói hoặc hiệu chỉnh tốc độ, cao độ. Mẫu dài hơn clip là lỗi. Hiệu chỉnh lại ngưỡng sau khi cập nhật bộ so khớp bằng những lần thu độc lập.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sample","type":"Audio","defaultValue":null,"description":"Giá trị âm thanh tham chiếu cần tìm bên trong giá trị âm thanh này.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number (0..1)","defaultValue":null,"description":"Số hữu hạn bắt buộc từ 0 đến 1. Hiệu chỉnh bằng những lần thu độc lập; 0.85 chỉ là ví dụ, không phải ngưỡng khuyến nghị cho mọi âm thanh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"AudioMatch","returnDescription":null,"example":"# Lưu mẫu âm báo trong Trình quản lý mẫu trước khi chạy ví dụ này\nsample = Audio(\"alert\")\nAudio.start()\nwait(1500)\nclip = Audio.recent(1500)\nresult = clip.match(sample, 0.85)\nprint(result)\nAudio.stop()","aliases":[],"group":"FLOW"},{"key":"class-audio-method-find","kind":"METHOD","parentKey":"class-audio","name":"find","signature":"audio.find(timeout_ms, threshold)","description":"Nghe tìm mẫu tham chiếu này trong âm thanh mới suốt timeout_ms mili giây, trả AudioMatch đầu tiên hoặc None nếu không tìm thấy. Tự bật nguồn thu đã cấu hình nếu cần và giữ thu đến Audio.stop() hoặc khi macro kết thúc. Chỉ xét âm thanh nhận sau khi lời gọi đăng ký nghe. Quét các đoạn chồng lấn liên tục trên lưới 10 ms, tái sử dụng phổ qua ranh giới khối dữ liệu; tránh khoảng trống do kiểm tra định kỳ nhưng không bảo đảm nhận diện đúng. Với mẫu dài ít nhất 100 ms và có đủ tín hiệu, kết quả gần như khớp tuyệt đối (điểm từ 0,9999) sẽ trả ngay khi nhận đủ mẫu. Các kết quả khớp mạnh khác (điểm từ 0,98) có thể xét thêm tối đa 20 ms để xác định vị trí; kết quả yếu hơn dùng cửa sổ tối đa 50 ms. Nếu điểm lần đầu đạt mức khớp mạnh gần cuối cửa sổ này, hệ thống xét thêm một lần tối đa 20 ms. Mọi kết quả đều phải đạt ngưỡng đã đặt. Timeout giới hạn cửa sổ thu; xử lý dữ liệu hợp lệ có thể làm tăng độ trễ. Giá trị 0 trả None mà không bật thu. Pause macro bỏ dữ liệu chờ và tạm dừng timeout; Resume tìm trên đoạn mới. Mất phiên thu, tràn dữ liệu hoặc âm thanh hỏng là lỗi, không trả None.","behavior":"Nghe tìm mẫu tham chiếu này trong âm thanh mới suốt timeout_ms mili giây, trả AudioMatch đầu tiên hoặc None nếu không tìm thấy. Tự bật nguồn thu đã cấu hình nếu cần và giữ thu đến Audio.stop() hoặc khi macro kết thúc. Chỉ xét âm thanh nhận sau khi lời gọi đăng ký nghe. Quét các đoạn chồng lấn liên tục trên lưới 10 ms, tái sử dụng phổ qua ranh giới khối dữ liệu; tránh khoảng trống do kiểm tra định kỳ nhưng không bảo đảm nhận diện đúng. Với mẫu dài ít nhất 100 ms và có đủ tín hiệu, kết quả gần như khớp tuyệt đối (điểm từ 0,9999) sẽ trả ngay khi nhận đủ mẫu. Các kết quả khớp mạnh khác (điểm từ 0,98) có thể xét thêm tối đa 20 ms để xác định vị trí; kết quả yếu hơn dùng cửa sổ tối đa 50 ms. Nếu điểm lần đầu đạt mức khớp mạnh gần cuối cửa sổ này, hệ thống xét thêm một lần tối đa 20 ms. Mọi kết quả đều phải đạt ngưỡng đã đặt. Timeout giới hạn cửa sổ thu; xử lý dữ liệu hợp lệ có thể làm tăng độ trễ. Giá trị 0 trả None mà không bật thu. Pause macro bỏ dữ liệu chờ và tạm dừng timeout; Resume tìm trên đoạn mới. Mất phiên thu, tràn dữ liệu hoặc âm thanh hỏng là lỗi, không trả None.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"timeout_ms","type":"Number (0..2147483647)","defaultValue":null,"description":"Thời lượng cửa sổ thu bắt buộc, là số nguyên từ 0 đến 2147483647 mili giây. Không tính thời gian macro tạm dừng. Ranh giới cửa sổ được ước lượng từ lúc recorder đọc xong, không dùng timestamp phần cứng.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number (0..1)","defaultValue":null,"description":"Số hữu hạn bắt buộc từ 0 đến 1. Hiệu chỉnh bằng những lần thu độc lập; 0.85 chỉ là ví dụ, không phải ngưỡng khuyến nghị cho mọi âm thanh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"AudioMatch | None","returnDescription":null,"example":"# Chờ âm thanh mới và xử lý khi hết thời gian\naudio = Audio(\"alert\")\nresult = audio.find(timeout_ms=5000, threshold=0.85)\nif result is not None:\n    print(result.score, result.start_ms, result.end_ms)\nAudio.stop()","aliases":[],"group":"FLOW"},{"key":"class-audiomatch","kind":"READ_ONLY_CLASS","parentKey":null,"name":"AudioMatch","signature":"AudioMatch","description":"Kết quả so khớp âm thanh chỉ đọc. Điểm là mức tương đồng, không phải xác suất chính xác. Mốc thời gian của find() tính từ đầu phiên nghe; match() dùng mốc thời gian của giá trị âm thanh được tìm kiếm. So sánh mốc thời gian để tránh xử lý lặp cùng một âm thanh. Chỉ dùng mốc thời gian làm lần phát hiện khi matched là True.","behavior":"Kết quả so khớp âm thanh chỉ đọc. Điểm là mức tương đồng, không phải xác suất chính xác. Mốc thời gian của find() tính từ đầu phiên nghe; match() dùng mốc thời gian của giá trị âm thanh được tìm kiếm. So sánh mốc thời gian để tránh xử lý lặp cùng một âm thanh. Chỉ dùng mốc thời gian làm lần phát hiện khi matched là True.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":["matched","score","start_ms","end_ms"],"fieldDocs":[{"name":"matched","type":"Boolean","defaultValue":null,"description":"True khi có đoạn ứng viên không im lặng đạt ngưỡng.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"score","type":"Number","defaultValue":null,"description":"Mức tương đồng từ 0 đến 1, không phải xác suất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"start_ms","type":"Number","defaultValue":null,"description":"Thời điểm bắt đầu đoạn ứng viên, tính bằng mili giây theo mốc của âm thanh được tìm kiếm.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"end_ms","type":"Number","defaultValue":null,"description":"Thời điểm kết thúc không bao gồm, tính bằng mili giây trên cùng mốc thời gian với start_ms.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Lưu mẫu âm báo trong Trình quản lý mẫu trước khi chạy\nsample = Audio(\"alert\")\nAudio.start()\nwait(1500)\nclip = Audio.recent(1500)\nresult = clip.match(sample, 0.85)\nprint(result.matched, result.score, result.start_ms, result.end_ms)\nAudio.stop()","aliases":[],"group":null},{"key":"class-point","kind":"CLASS","parentKey":null,"name":"Point","signature":"Point(x, y, /, scale=\"fixed\", anchor=\"none\")","description":"Một điểm trên màn hình, đo bằng pixel. Scale/anchor điều khiển cách quy đổi tọa độ giữa các kích thước màn hình. Sau khi quy đổi và cộng offset, runtime sẽ clamp point cuối vào khoảng pixel hợp lệ của màn hình hiện tại. Point có thể bung giá trị thành x, y.","behavior":"Một điểm trên màn hình, đo bằng pixel. Scale/anchor điều khiển cách quy đổi tọa độ giữa các kích thước màn hình. Sau khi quy đổi và cộng offset, runtime sẽ clamp point cuối vào khoảng pixel hợp lệ của màn hình hiện tại. Point có thể bung giá trị thành x, y.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["x","y","scale","anchor"],"fieldDocs":[{"name":"x","type":"Number","defaultValue":null,"description":"Tọa độ ngang theo pixel.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"y","type":"Number","defaultValue":null,"description":"Tọa độ dọc theo pixel.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"scale","type":"String","defaultValue":"fixed","description":"Chế độ scale tọa độ. Giá trị: fixed, auto, width, height.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"Neo tọa độ. Giá trị: none, center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right, auto.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"x","type":"Number","defaultValue":null,"description":"Tọa độ X theo pixel","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"y","type":"Number","defaultValue":null,"description":"Tọa độ Y theo pixel","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"scale","type":"String","defaultValue":"fixed","description":"Chế độ scale tọa độ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"anchor","type":"String","defaultValue":"none","description":"Neo tọa độ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":"# Lấy các giá trị x, y của Point\np = Point(500, 900)\nx_value = p.x #500\ny_value = p.y #900\nscale_value = p.scale #FIXED_PIXEL\n\n# Bung Point thành tọa độ x, y\nx, y = p","constructorExample":"# Khởi tạo Point có scale/anchor và nhấn vào vị trí đó\np = Point(500, 900, scale=\"width\", anchor=\"center\")\nclick(p)","params":[],"returnType":null,"returnDescription":null,"example":"origin = Point(0, 0)\ntarget = Point(500, 900)\nswipe([\n    SwipePoint(origin, speed=\"NORMAL\"),\n    SwipePoint(target)\n])","aliases":[],"group":null},{"key":"class-point-method-offset","kind":"METHOD","parentKey":"class-point","name":"offset","signature":"point.offset(dx, dy, scale=None)","description":"Quy đổi Point này trên màn hình hiện tại, nhân dx/dy pixel nguyên với tỉ lệ chiều rộng hoặc chiều cao toàn màn hình đã chọn mà không xoay trục của delta, sau đó cộng kết quả và trả về Point pixel cố định mới với anchor none. Kích thước app viewport không được dùng. Khi bỏ qua scale, offset kế thừa scale của Point hiện tại. Point ban đầu không bị thay đổi.","behavior":"Quy đổi Point này trên màn hình hiện tại, nhân dx/dy pixel nguyên với tỉ lệ chiều rộng hoặc chiều cao toàn màn hình đã chọn mà không xoay trục của delta, sau đó cộng kết quả và trả về Point pixel cố định mới với anchor none. Kích thước app viewport không được dùng. Khi bỏ qua scale, offset kế thừa scale của Point hiện tại. Point ban đầu không bị thay đổi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"dx","type":"Int","defaultValue":null,"description":"Độ lệch pixel nguyên trên trục X của Point. Giá trị thập phân và normalized không được chấp nhận.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"dy","type":"Int","defaultValue":null,"description":"Độ lệch pixel nguyên trên trục Y của Point. Giá trị thập phân và normalized không được chấp nhận.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"scale","type":"String?","defaultValue":"None","description":"Chế độ scale của offset theo kích thước toàn màn hình. Mặc định kế thừa scale hiện tại của Point. Giá trị: fixed, auto, width, height.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Point","returnDescription":"Point pixel cố định đã được quy đổi và clamp vào màn hình hiện tại, có scale là FIXED_PIXEL và anchor là NONE.","example":"# Scale delta pixel theo chiều rộng toàn màn hình rồi cộng vào Point\ntarget = Point(500, 900, scale=\"width\", anchor=\"center\").offset(120, -80)\nprint(target)\ntarget.highlight()","aliases":[],"group":"FLOW"},{"key":"class-point-method-highlight","kind":"METHOD","parentKey":"class-point","name":"highlight","signature":"point.highlight(color=\"green\", line_width=2, region_width=36, auto_hide_ms=0)","description":"Vẽ một vùng highlight hình vuông lấy point này làm tâm. Nếu highlight lại cùng point instance thì sẽ thay highlight cũ.","behavior":"Vẽ một vùng highlight hình vuông lấy point này làm tâm. Nếu highlight lại cùng point instance thì sẽ thay highlight cũ.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"color","type":"Color | String | Number","defaultValue":"green","description":"Màu highlight.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"line_width","type":"Number","defaultValue":"2","description":"Độ dày viền theo dp.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region_width","type":"Number","defaultValue":"36","description":"Chiều rộng/cao hình vuông theo pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_hide_ms","type":"Number","defaultValue":"0","description":"Tự tắt sau N milliseconds. 0 là không tự tắt.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region hình vuông đã được highlight quanh point.","example":"p = Point(500, 900)\np.highlight()","aliases":[],"group":"FLOW"},{"key":"class-point-method-highlight-off","kind":"METHOD","parentKey":"class-point","name":"highlight_off","signature":"point.highlight_off()","description":"Tắt highlight cho point instance này.","behavior":"Tắt highlight cho point instance này.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Point","returnDescription":"Trả về chính point sau khi tắt highlight.","example":"p = Point(500, 900)\np.highlight(\"red\", 3)\nwait(1000)\np.highlight_off()","aliases":[],"group":"FLOW"},{"key":"class-swipepoint","kind":"CLASS","parentKey":null,"name":"SwipePoint","signature":"SwipePoint(point, speed=\"NORMAL\", delay_before=0, random=10, humanized=False, scale=\"fixed\", anchor=\"none\")","description":"Một điểm trong đường vuốt phẳng. Point phải là Point hoặc tuple (x, y). Truyền list có ít nhất hai SwipePoint vào swipe([...]) để một ngón đi qua nhiều điểm.","behavior":"Một điểm trong đường vuốt phẳng. Point phải là Point hoặc tuple (x, y). Truyền list có ít nhất hai SwipePoint vào swipe([...]) để một ngón đi qua nhiều điểm.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["point","speed","delay_before","random","humanized","scale","anchor"],"fieldDocs":[{"name":"point","type":"Point","defaultValue":null,"description":"Point tọa độ theo pixel. Point mang metadata scale/anchor.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"speed","type":"String","defaultValue":"NORMAL","description":"Preset tốc độ từ điểm này sang điểm kế tiếp. Giá trị: VERY_SLOW, SLOW, NORMAL, FAST, VERY_FAST.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"delay_before","type":"Number","defaultValue":"0","description":"Độ trễ trước điểm/đoạn này theo milliseconds.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"random","type":"Number","defaultValue":"10","description":"Bán kính lệch ngẫu nhiên theo pixel cho điểm này.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"humanized","type":"Boolean","defaultValue":"False","description":"Dùng đường cong giống thao tác người thật khi được hỗ trợ.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"scale","type":"String","defaultValue":"fixed","description":"Chế độ scale tọa độ.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"Neo tọa độ.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"point","type":"Point | tuple[Number, Number]","defaultValue":null,"description":"Tọa độ dạng Point hoặc tuple (x, y). Metadata scale/anchor của Point được copy trừ khi SwipePoint truyền scale/anchor riêng.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"speed","type":"String","defaultValue":"NORMAL","description":"Preset tốc độ từ điểm này sang điểm kế tiếp. Giá trị: VERY_SLOW, SLOW, NORMAL, FAST, VERY_FAST.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"delay_before","type":"Number","defaultValue":"0","description":"Độ trễ trước điểm/đoạn này theo milliseconds.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"random","type":"Number","defaultValue":"10","description":"Bán kính lệch ngẫu nhiên theo pixel cho điểm này.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"humanized","type":"Boolean","defaultValue":"False","description":"Dùng đường cong giống thao tác người thật khi được hỗ trợ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"scale","type":"String","defaultValue":"fixed","description":"Chế độ scale tọa độ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"anchor","type":"String","defaultValue":"none","description":"Neo tọa độ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":null,"constructorExample":"path = [\n    SwipePoint(Point(500, 1500), speed=\"FAST\"),\n    SwipePoint((560, 980), speed=\"NORMAL\", humanized=True),\n    SwipePoint(Point(500, 500))\n]\nswipe(path)","params":[],"returnType":null,"returnDescription":null,"example":"# Hai ngón vuốt song song, mỗi ngón là một path phẳng\nTouch.collect()\nleft = swipe([\n    SwipePoint(Point(300, 1500), speed=\"FAST\"),\n    SwipePoint(Point(300, 500))\n], parallel=True)\nright = swipe([\n    SwipePoint(Point(780, 1500), speed=\"FAST\"),\n    SwipePoint(Point(780, 500))\n], parallel=True)\nTouch.send()\nTouch.wait()","aliases":[],"group":null},{"key":"class-touch","kind":"CLASS","parentKey":null,"name":"Touch","signature":"Touch","description":"Helper tĩnh cho các click/swipe chạy song song được tạo bởi UI hoặc code click(..., parallel=True), swipe(..., parallel=True). Bạn có thể gom các click/swipe lại rồi gửi một lượt, hoặc lấy thông tin về các click/swipe đang nhấn/đang chờ. Helper cũng cung cấp khả năng huỷ click/swipe đang hoạt động (chỉ hoạt động đối với Android 8.0+).","behavior":"Helper tĩnh cho các click/swipe chạy song song được tạo bởi UI hoặc code click(..., parallel=True), swipe(..., parallel=True). Bạn có thể gom các click/swipe lại rồi gửi một lượt, hoặc lấy thông tin về các click/swipe đang nhấn/đang chờ. Helper cũng cung cấp khả năng huỷ click/swipe đang hoạt động (chỉ hoạt động đối với Android 8.0+).","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"Cử chỉ Android dùng chung thiết bị. parallel=True xếp hàng id chạm nhưng delay_before và delay_after vẫn chặn luồng gọi ngoài collect. Trong collect, các lần chạm được gom để Touch.send(); Touch.wait() chờ chúng hoàn tất."},"limitations":[],"relatedApis":["class-touch-static-method-collect","class-touch-static-method-send","class-touch-static-method-wait"],"isCallable":false,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"Touch.collect()\na = click(Point(300, 900), hold_ms=5000, parallel=True)\nb = click(Point(780, 900), hold_ms=1000, delay_before=1000, parallel=True)\nsent = Touch.send()\nTouch.cancel(a)\nTouch.wait()","aliases":[],"group":null},{"key":"class-touch-static-method-collect","kind":"STATIC_METHOD","parentKey":"class-touch","name":"collect","signature":"Touch.collect()","description":"Bật chế độ gom click/swipe có parallel = True. Khi bật, các click/swipe song song sẽ không được gửi đi luôn mà các click/swipe sẽ được gom lại, và chỉ gửi đi sau lệnh Touch.send(). Phương thức này hoạt động đối với cả UI/code. Nếu không bật Touch.collect() thì các click/swipe song song sẽ được gửi đi ngay lập tức, các click/swipe gửi sau sẽ phải chờ click/swipe trước đó chạy xong thì mới có thể hoạt động (tại vì nếu click/swipe gửi sau mà hoạt động luôn thì sẽ khiến click/swipe trước đó bị huỷ, bạn có thể chủ động huỷ click/swipe trước đó bằng Touch.cancel())","behavior":"Bật chế độ gom click/swipe có parallel = True. Khi bật, các click/swipe song song sẽ không được gửi đi luôn mà các click/swipe sẽ được gom lại, và chỉ gửi đi sau lệnh Touch.send(). Phương thức này hoạt động đối với cả UI/code. Nếu không bật Touch.collect() thì các click/swipe song song sẽ được gửi đi ngay lập tức, các click/swipe gửi sau sẽ phải chờ click/swipe trước đó chạy xong thì mới có thể hoạt động (tại vì nếu click/swipe gửi sau mà hoạt động luôn thì sẽ khiến click/swipe trước đó bị huỷ, bạn có thể chủ động huỷ click/swipe trước đó bằng Touch.cancel())","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"collect/send và truy vấn trạng thái chạm không chờ cử chỉ hoàn tất. Lệnh đã gom chỉ đến executor khi Touch.send(); snapshot hàng đợi có thể đổi ngay."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touch-static-method-send","kind":"STATIC_METHOD","parentKey":"class-touch","name":"send","signature":"Touch.send()","description":"Gửi tất cả các click/swipe đã được collect cùng một lúc, trả về các id dạng số tương ứng, rồi tắt chế độ gom của Touch.collect().","behavior":"Gửi tất cả các click/swipe đã được collect cùng một lúc, trả về các id dạng số tương ứng, rồi tắt chế độ gom của Touch.collect().","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"collect/send và truy vấn trạng thái chạm không chờ cử chỉ hoàn tất. Lệnh đã gom chỉ đến executor khi Touch.send(); snapshot hàng đợi có thể đổi ngay."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list[Number]","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touch-static-method-queued","kind":"STATIC_METHOD","parentKey":"class-touch","name":"queued","signature":"Touch.queued()","description":"Trả về trạng thái touch đang nằm trong hàng đợi.","behavior":"Trả về trạng thái touch đang nằm trong hàng đợi.","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"collect/send và truy vấn trạng thái chạm không chờ cử chỉ hoàn tất. Lệnh đã gom chỉ đến executor khi Touch.send(); snapshot hàng đợi có thể đổi ngay."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list[TouchState]","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\nprint(Touch.queued())\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touch-static-method-active","kind":"STATIC_METHOD","parentKey":"class-touch","name":"active","signature":"Touch.active()","description":"Trả về các touch đang chạy.","behavior":"Trả về các touch đang chạy.","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"collect/send và truy vấn trạng thái chạm không chờ cử chỉ hoàn tất. Lệnh đã gom chỉ đến executor khi Touch.send(); snapshot hàng đợi có thể đổi ngay."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list[TouchState]","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\nprint(Touch.active())\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touch-static-method-all","kind":"STATIC_METHOD","parentKey":"class-touch","name":"all","signature":"Touch.all()","description":"Trả về touch gần đây và touch đang nằm trong hàng đợi hoặc đang chạy.","behavior":"Trả về touch gần đây và touch đang nằm trong hàng đợi hoặc đang chạy.","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"collect/send và truy vấn trạng thái chạm không chờ cử chỉ hoàn tất. Lệnh đã gom chỉ đến executor khi Touch.send(); snapshot hàng đợi có thể đổi ngay."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list[TouchState]","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\nprint(Touch.all())\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touch-static-method-wait","kind":"STATIC_METHOD","parentKey":"class-touch","name":"wait","signature":"Touch.wait(id=None)","description":"Chờ một id dạng số, hoặc chờ mọi touch trong hàng đợi/đang chạy khi id là None.","behavior":"Chờ một id dạng số, hoặc chờ mọi touch trong hàng đợi/đang chạy khi id là None.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ trong luồng gọi đến hết thời gian yêu cầu hoặc hoàn tất chạm. Luồng khác có thể tiếp tục; pause và stop vẫn có hiệu lực."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"TouchState | list[TouchState]","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\nTouch.wait(first)\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touch-static-method-cancel","kind":"STATIC_METHOD","parentKey":"class-touch","name":"cancel","signature":"Touch.cancel(id=None)","description":"Hủy một touch đang queue hoặc active theo id dạng số. Khi id là None, hủy mọi touch đang queue/active và trả về số lệnh hủy đã nhận. Hủy touch active cần Android 8.0+; trên Android 7.x, script sẽ lỗi rõ ràng nếu nhắm tới touch đang active.","behavior":"Hủy một touch đang queue hoặc active theo id dạng số. Khi id là None, hủy mọi touch đang queue/active và trả về số lệnh hủy đã nhận. Hủy touch active cần Android 8.0+; trên Android 7.x, script sẽ lỗi rõ ràng nếu nhắm tới touch đang active.","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"Cử chỉ Android dùng chung thiết bị. parallel=True xếp hàng id chạm nhưng delay_before và delay_after vẫn chặn luồng gọi ngoài collect. Trong collect, các lần chạm được gom để Touch.send(); Touch.wait() chờ chúng hoàn tất."},"limitations":[],"relatedApis":["class-touch-static-method-collect","class-touch-static-method-send","class-touch-static-method-wait"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean | Int","returnDescription":null,"example":"# Kiểm tra hoặc điều khiển các lần chạm đã thu thập\nTouch.collect()\nfirst = click((300, 900), hold_ms=1000, parallel=True)\nsecond = click((780, 900), delay_before=300, parallel=True)\nTouch.send()\n# Hủy thao tác đang chạy cần Android 8 trở lên\nTouch.cancel(second)\nTouch.wait()","aliases":[],"group":"FLOW"},{"key":"class-touchstate","kind":"READ_ONLY_CLASS","parentKey":null,"name":"TouchState","signature":"TouchState(id, status, kind, action_order, remaining_repeats, completed_repeats)","description":"Ảnh chụp trạng thái của một touch script/UI trong hàng đợi gesture dùng chung.","behavior":"Ảnh chụp trạng thái của một touch script/UI trong hàng đợi gesture dùng chung.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":["id","status","kind","action_order","remaining_repeats","completed_repeats"],"fieldDocs":[{"name":"id","type":"Number","defaultValue":null,"description":"Id của touch đã gửi.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"status","type":"String","defaultValue":null,"description":"queued, active, completed, cancelled hoặc failed.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"kind","type":"String","defaultValue":null,"description":"Loại touch như click hoặc swipe.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"action_order","type":"Number","defaultValue":null,"description":"Thứ tự action sở hữu.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"remaining_repeats","type":"Number","defaultValue":"0","description":"Số repeat còn trong hàng đợi.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"completed_repeats","type":"Number","defaultValue":"0","description":"Số repeat đã hoàn tất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Giá trị TouchState lấy từ truy vấn trạng thái chạm; không tự tạo chúng\nTouch.collect()\nclick((300, 900), hold_ms=1000, parallel=True)\nTouch.send()\nfor state in Touch.all():\n    print(state.id, state.status, state.kind)\nTouch.wait()","aliases":[],"group":null},{"key":"class-scaleparam","kind":"CLASS","parentKey":null,"name":"ScaleParam","signature":"ScaleParam(grayscale=True, auto_scale=False, cache_scale=True, template_scale=\"SHORT_EDGE\", fast_matching=False)","description":"Các tham số so khớp template cho Region. fast_matching giảm kích thước cả ảnh Region và template.","behavior":"Các tham số so khớp template cho Region. fast_matching giảm kích thước cả ảnh Region và template.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["grayscale","auto_scale","cache_scale","template_scale","fast_matching"],"fieldDocs":[{"name":"grayscale","type":"Boolean","defaultValue":"True","description":"**Áp dụng cho template**. Chuyển screenshot/template sang ảnh xám trước khi so khớp template.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"auto_scale","type":"Boolean","defaultValue":"False","description":"Thử kích thước template quanh mức scale đã cấu hình bằng khoảng quét thích ứng: DPI/độ phân giải cao quét candidate nhỏ xuống 0.70x, còn DPI/độ phân giải thấp quét candidate lớn lên 1.30x.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"cache_scale","type":"Boolean","defaultValue":"True","description":"Cache mức auto-scale đầu tiên match thành công cho các lần chạy sau. Chỉ có tác dụng khi auto_scale là True.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"template_scale","type":"String","defaultValue":"SHORT_EDGE","description":"Mode scale template nền. Giá trị: SHORT_EDGE, LONG_EDGE, DPI, SMALLEST_WIDTH_DP, NONE.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"fast_matching","type":"Boolean","defaultValue":"False","description":"Giảm cả ảnh Region và template xuống 2/3 trước khi so khớp. Chế độ này nhanh hơn nhưng có thể giảm nhẹ độ chính xác, đặc biệt với icon nhỏ.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"grayscale","type":"Boolean","defaultValue":"True","description":"**Áp dụng cho template**. Chuyển so khớp template sang ảnh xám.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_scale","type":"Boolean","defaultValue":"False","description":"Thử kích thước template với khoảng rìa thích ứng 0.70x-1.30x sau khi scale theo cài đặt.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"cache_scale","type":"Boolean","defaultValue":"True","description":"Cache các mức auto-scale đã match thành công.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"template_scale","type":"String","defaultValue":"SHORT_EDGE","description":"Giá trị: SHORT_EDGE, LONG_EDGE, DPI, SMALLEST_WIDTH_DP, NONE.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"fast_matching","type":"Boolean","defaultValue":"False","description":"Giảm cả ảnh Region và template xuống 2/3 trước khi so khớp. Chế độ này nhanh hơn nhưng có thể giảm nhẹ độ chính xác, đặc biệt với icon nhỏ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":"param = ScaleParam(auto_scale=True, template_scale=\"LONG_EDGE\", fast_matching=True)\nparam.cache_scale = False\ntemplate_mode = param.template_scale","constructorExample":"param = ScaleParam(grayscale=True, auto_scale=True, cache_scale=True, template_scale=\"LONG_EDGE\", fast_matching=True)\nquick = ScaleParam(False, True, True, \"LONG_EDGE\", True)","params":[],"returnType":null,"returnDescription":null,"example":"# Cấu hình tiền xử lý so khớp cho Region này\nsettings = ScaleParam(grayscale=True, fast_matching=True)\nregion = Region(100, 200, 300, 400, scale_param=settings)\nprint(region.find(\"start\", timeout=0).found)","aliases":[],"group":null},{"key":"class-region","kind":"CLASS","parentKey":null,"name":"Region","signature":"Region(x, y, width, height, /, scale=\"fixed\", anchor=\"none\", scale_param=ScaleParam())","description":"Một vùng hình chữ nhật trên màn hình, đo bằng pixel theo trục màn hình hiện tại. Scale/anchor điều khiển cách quy đổi tọa độ theo kích thước toàn màn hình, không xoay qua hệ tọa độ portrait và không dùng app viewport; runtime sẽ clip region cuối vào màn hình hiện tại sau khi quy đổi và cộng offset. ScaleParam điều khiển nhận diện template trong region này. Region có thể bung giá trị thành x, y, width, height.","behavior":"Một vùng hình chữ nhật trên màn hình, đo bằng pixel theo trục màn hình hiện tại. Scale/anchor điều khiển cách quy đổi tọa độ theo kích thước toàn màn hình, không xoay qua hệ tọa độ portrait và không dùng app viewport; runtime sẽ clip region cuối vào màn hình hiện tại sau khi quy đổi và cộng offset. ScaleParam điều khiển nhận diện template trong region này. Region có thể bung giá trị thành x, y, width, height.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["x","y","width","height","scale","anchor","scale_param","middle_point"],"fieldDocs":[{"name":"x","type":"Number","defaultValue":null,"description":"Tọa độ ngang góc trên trái.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"y","type":"Number","defaultValue":null,"description":"Tọa độ dọc góc trên trái.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"width","type":"Number","defaultValue":null,"description":"Chiều rộng vùng theo pixel.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"height","type":"Number","defaultValue":null,"description":"Chiều cao vùng theo pixel.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"scale","type":"String","defaultValue":"fixed","description":"**Áp dụng cho toạ độ của region**. Chế độ scale tọa độ theo kích thước toàn màn hình trên trục X/Y hiện tại, không scale theo app viewport và không xoay qua portrait. Giá trị: \"fixed\" giữ nguyên pixel đã lưu; \"auto\" scale X theo tỉ lệ chiều rộng và Y theo tỉ lệ chiều cao; \"width\" scale cả hai trục theo chiều rộng màn hình; \"height\" scale cả hai trục theo chiều cao màn hình.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"**Áp dụng cho toạ độ của region**. Neo tọa độ. Giá trị: none, center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right, auto.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"scale_param","type":"ScaleParam","defaultValue":"ScaleParam()","description":"**Áp dụng cho template**. Tham số scale template dùng bởi các hàm find/wait trên region này.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"middle_point","type":"Point","defaultValue":null,"description":"Điểm chính giữa của region này.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"x","type":"Number","defaultValue":null,"description":"Tọa độ X góc trên trái","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"y","type":"Number","defaultValue":null,"description":"Tọa độ Y góc trên trái","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"width","type":"Number","defaultValue":null,"description":"Chiều rộng vùng","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"height","type":"Number","defaultValue":null,"description":"Chiều cao vùng","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"scale","type":"String","defaultValue":"fixed","description":"**Áp dụng cho toạ độ của region**. Chế độ scale toàn màn hình tùy chọn trên trục X/Y hiện tại. Giá trị: \"fixed\", \"auto\", \"width\", \"height\".","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"anchor","type":"String","defaultValue":"none","description":"**Áp dụng cho toạ độ của region**. Chế độ neo tùy chọn. Giá trị: none, center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right, auto.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"scale_param","type":"ScaleParam","defaultValue":"ScaleParam()","description":"**Áp dụng cho template**. Tham số scale template.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":"search_area = Region(120, 240, 360, 420)\nleft = search_area.x\ntop = search_area.y\nw = search_area.width\nh = search_area.height\nscale = search_area.scale\nanchor = search_area.anchor\nsearch_area.x = 300\nsearch_area.scale_param = ScaleParam(auto_scale=True, template_scale=\"LONG_EDGE\")\ncenter = search_area.middle_point\n\n# Bung Region thành x, y, width, height\nx, y, width, height = search_area","constructorExample":"search_region = Region(120, 240, 360, 420)\nfixed_center = Region(120, 240, 360, 420, \"fixed\", \"center\")\nleft_lane = Region(120, 240, 360, 420, scale=\"width\", anchor=\"left\", scale_param=ScaleParam(auto_scale=True, template_scale=\"LONG_EDGE\"))","params":[],"returnType":null,"returnDescription":null,"example":"region = Region(100, 200, 300, 400)\nhit = region.find(\"img\", 3000, threshold=0.8, rate=3.0)","aliases":[],"group":null},{"key":"class-region-static-method-highlighted","kind":"STATIC_METHOD","parentKey":"class-region","name":"highlighted","signature":"Region.highlighted()","description":"Lấy tất cả region đang được highlight bởi các script instance.","behavior":"Lấy tất cả region đang được highlight bởi các script instance.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list[Region]","returnDescription":"Danh sách các region highlight đang còn hiệu lực.","example":"active_regions = Region.highlighted()\nfor area in active_regions:\n    area.highlight(\"yellow\", auto_hide_ms=500)","aliases":[],"group":"FLOW"},{"key":"class-region-static-method-full-screen","kind":"STATIC_METHOD","parentKey":"class-region","name":"full_screen","signature":"Region.full_screen()","description":"Trả về region toàn màn hình hiện tại.","behavior":"Trả về region toàn màn hình hiện tại.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Region","returnDescription":"Region theo kích thước màn hình từ runtime host.","example":"scan = Region.full_screen()\nhit = scan.find(\"ok\", 2000)","aliases":[],"group":"FLOW"},{"key":"class-region-static-method-highlight-off","kind":"STATIC_METHOD","parentKey":"class-region","name":"highlight_off","signature":"Region.highlight_off()","description":"Tắt toàn bộ region highlight đang hoạt động.","behavior":"Tắt toàn bộ region highlight đang hoạt động.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không trả về giá trị.","example":"scan = Region(120, 260, 280, 160)\nscan.highlight(\"green\")\nwait(1000)\nRegion.highlight_off()","aliases":[],"group":"FLOW"},{"key":"class-region-static-method-macro-width","kind":"STATIC_METHOD","parentKey":"class-region","name":"macro_width","signature":"Region.macro_width()","description":"Trả về chiều rộng màn hình của thiết bị đã tạo macro này theo hướng xoay màn hình hiện tại, nếu có.","behavior":"Trả về chiều rộng màn hình của thiết bị đã tạo macro này theo hướng xoay màn hình hiện tại, nếu có.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number?","returnDescription":"Chiều rộng màn hình nguồn của macro, hoặc None nếu không có.","example":"macro_w = Region.macro_width()","aliases":[],"group":"FLOW"},{"key":"class-region-static-method-macro-height","kind":"STATIC_METHOD","parentKey":"class-region","name":"macro_height","signature":"Region.macro_height()","description":"Trả về chiều cao màn hình của thiết bị đã tạo macro này theo hướng xoay màn hình hiện tại, nếu có.","behavior":"Trả về chiều cao màn hình của thiết bị đã tạo macro này theo hướng xoay màn hình hiện tại, nếu có.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number?","returnDescription":"Chiều cao màn hình nguồn của macro, hoặc None nếu không có.","example":"macro_h = Region.macro_height()","aliases":[],"group":"FLOW"},{"key":"class-region-method-find","kind":"METHOD","parentKey":"class-region","name":"find","signature":"region.find(template, timeout=0, threshold=0.7, rate=3.0)","description":"Quét trong region này cho đến khi tìm được một kết quả khớp hoặc hết thời gian chờ. Nếu bỏ qua timeout, chỉ quét một lần. Dùng ScreenCapture.cache_on() để kiểm tra nhiều ảnh trên cùng frame được ghim, rồi cache_off() để bỏ ghim. Khi cần nhận diện liên tục với frame mới nhất hiện có, gọi thêm ScreenCapture.auto_cache_off(); nếu không, cache tự động vẫn dùng lại frame trong tối đa 100 ms. Tắt cache này làm tăng công việc chụp và không bảo đảm chạy nhanh hơn.","behavior":"Quét trong region này cho đến khi tìm được một kết quả khớp hoặc hết thời gian chờ. Nếu bỏ qua timeout, chỉ quét một lần. Dùng ScreenCapture.cache_on() để kiểm tra nhiều ảnh trên cùng frame được ghim, rồi cache_off() để bỏ ghim. Khi cần nhận diện liên tục với frame mới nhất hiện có, gọi thêm ScreenCapture.auto_cache_off(); nếu không, cache tự động vẫn dùng lại frame trong tối đa 100 ms. Tắt cache này làm tăng công việc chụp và không bảo đảm chạy nhanh hơn.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"template","type":"String | Template","defaultValue":null,"description":"Tên template, đường dẫn thư mục tương đối, hoặc đối tượng Template trong macro hiện tại.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Kết quả khớp đầu tiên thành công, hoặc found=false khi hết thời gian chờ.","example":"region = Region(80, 220, 420, 520)\nhit = region.find(\"ok\", 4000, 0.8, 4.0)\nMacroPanel.notify(str(hit))","aliases":[],"group":"FLOW"},{"key":"class-region-method-find-multi","kind":"METHOD","parentKey":"class-region","name":"find_multi","signature":"region.find_multi(template, timeout=0, threshold=0.7, rate=3.0)","description":"Quét trong region này và trả về tất cả kết quả khớp cho một template khi tìm thấy ít nhất một kết quả. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","behavior":"Quét trong region này và trả về tất cả kết quả khớp cho một template khi tìm thấy ít nhất một kết quả. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"template","type":"String | Template","defaultValue":null,"description":"Tên template, đường dẫn thư mục tương đối, hoặc đối tượng Template trong macro hiện tại.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Tất cả kết quả khớp cho template, hoặc danh sách rỗng khi hết thời gian chờ.","example":"region = Region(80, 220, 420, 520)\nmatches = region.find_multi(\"enemy\", 3000)\nMacroPanel.notify(str(matches))","aliases":[],"group":"FLOW"},{"key":"class-region-method-find-any","kind":"METHOD","parentKey":"class-region","name":"find_any","signature":"region.find_any(templates, timeout=0, threshold=0.7, rate=3.0)","description":"Quét region này và trả về khi bất kỳ template nào trong danh sách được tìm thấy. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","behavior":"Quét region này và trả về khi bất kỳ template nào trong danh sách được tìm thấy. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"templates","type":"list[String | Template]","defaultValue":null,"description":"Danh sách tên template hoặc đối tượng Template.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Kết quả batch khi tìm thấy ít nhất một template, hoặc danh sách rỗng khi hết thời gian chờ.","example":"region = Region(80, 220, 420, 520)\nmatches = region.find_any([\"enemy_a\", \"enemy_b\"], 2500)\nMacroPanel.notify(str(matches))","aliases":[],"group":"FLOW"},{"key":"class-region-method-find-all","kind":"METHOD","parentKey":"class-region","name":"find_all","signature":"region.find_all(templates, timeout=0, threshold=0.7, rate=3.0)","description":"Quét region này và chỉ trả về khi toàn bộ template trong danh sách đều được tìm thấy. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","behavior":"Quét region này và chỉ trả về khi toàn bộ template trong danh sách đều được tìm thấy. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"templates","type":"list[String | Template]","defaultValue":null,"description":"Danh sách tên template hoặc đối tượng Template.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Kết quả batch khi tất cả template đều được tìm thấy, hoặc danh sách rỗng khi hết thời gian chờ.","example":"region = Region(80, 220, 420, 520)\nmatches = region.find_all([\"hp\", \"mp\"], 5000)\nMacroPanel.notify(str(matches))","aliases":[],"group":"FLOW"},{"key":"class-region-method-find-color","kind":"METHOD","parentKey":"class-region","name":"find_color","signature":"region.find_color(color, timeout=0, tolerance=0, rate=3, interval=10)","description":"Quét vùng tìm kiếm này cho một màu mục tiêu bằng cùng quy tắc sai số RGB raw-frame như nhận diện màu trong UI. Điểm tốt nhất được chọn theo max delta kênh RGB nhỏ nhất.","behavior":"Quét vùng tìm kiếm này cho một màu mục tiêu bằng cùng quy tắc sai số RGB raw-frame như nhận diện màu trong UI. Điểm tốt nhất được chọn theo max delta kênh RGB nhỏ nhất.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"color","type":"Color | String | Number","defaultValue":null,"description":"Màu mục tiêu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa theo mili giây. 0 là quét một lượt.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"tolerance","type":"Number","defaultValue":"0","description":"Sai số RGB cho phép trên từng kênh từ 0 đến 255.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3","description":"Số lần quét mỗi giây khi đang chờ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"10","description":"Bước lấy mẫu theo pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match có point là list[Point]; find_color trả tối đa một point.","example":"scan = Region(80, 220, 420, 520)\nhit = scan.find_color(\"#FF4CAF50\", tolerance=8, interval=4)\nif hit.found:\n    click(hit.point[0], random=0)","aliases":[],"group":"FLOW"},{"key":"class-region-method-find-any-color","kind":"METHOD","parentKey":"class-region","name":"find_any_color","signature":"region.find_any_color(colors, timeout=0, tolerance=0, rate=3, interval=10)","description":"Quét vùng tìm kiếm này cho nhiều màu mục tiêu. Mỗi màu đầu vào trả tối đa một point tốt nhất, giữ thứ tự theo danh sách màu đầu vào.","behavior":"Quét vùng tìm kiếm này cho nhiều màu mục tiêu. Mỗi màu đầu vào trả tối đa một point tốt nhất, giữ thứ tự theo danh sách màu đầu vào.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"colors","type":"list[Color | String | Number] | tuple[Color | String | Number]","defaultValue":null,"description":"Danh sách màu mục tiêu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa theo mili giây. 0 là quét một lượt.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"tolerance","type":"Number","defaultValue":"0","description":"Sai số RGB cho phép trên từng kênh từ 0 đến 255.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3","description":"Số lần quét mỗi giây khi đang chờ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"10","description":"Bước lấy mẫu theo pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match có point là list[Point]; mỗi màu đầu vào tìm thấy có một point tốt nhất.","example":"colors = [\"#FF0000\", \"#00FF00\", \"#0000FF\"]\nhit = Region.full_screen().find_any_color(colors, tolerance=6)\nif hit.found:\n    click(hit, random=0)","aliases":[],"group":"FLOW"},{"key":"class-region-method-find-multi-color","kind":"METHOD","parentKey":"class-region","name":"find_multi_color","signature":"region.find_multi_color(color, timeout=0, tolerance=0, rate=3, interval=10)","description":"Quét vùng tìm kiếm này để lấy nhiều vị trí của đúng một màu mục tiêu. Truyền list hoặc tuple sẽ bị báo lỗi để không âm thầm biến thành tìm nhiều màu.","behavior":"Quét vùng tìm kiếm này để lấy nhiều vị trí của đúng một màu mục tiêu. Truyền list hoặc tuple sẽ bị báo lỗi để không âm thầm biến thành tìm nhiều màu.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"color","type":"Color | String | Number","defaultValue":null,"description":"Một màu mục tiêu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa theo mili giây. 0 là quét một lượt.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"tolerance","type":"Number","defaultValue":"0","description":"Sai số RGB cho phép trên từng kênh từ 0 đến 255.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3","description":"Số lần quét mỗi giây khi đang chờ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"10","description":"Bước lấy mẫu theo pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match có point là list[Point]; các point khớp được sắp xếp với màu gần nhất đứng trước.","example":"hit = Region(80, 220, 420, 520).find_multi_color(\"red\", tolerance=4, interval=3)\nif hit.found:\n    first = hit.point[0]\n    hit.highlight(color=\"yellow\", auto_hide_ms=800)","aliases":[],"group":"FLOW"},{"key":"class-region-method-wait","kind":"METHOD","parentKey":"class-region","name":"wait","signature":"region.wait(template, timeout=0, threshold=0.7, rate=3.0)","description":"Chờ cho đến khi template biến mất khỏi region này. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","behavior":"Chờ cho đến khi template biến mất khỏi region này. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"template","type":"String | Template","defaultValue":null,"description":"Tên template, đường dẫn thư mục tương đối, hoặc đối tượng Template trong macro hiện tại.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Trạng thái match mới nhất khi template biến mất hoặc khi hết thời gian chờ.","example":"region = Region(0, 0, 1080, 2400)\nresult = region.wait(\"loading\", 8000)\nMacroPanel.notify(str(result))","aliases":[],"group":"FLOW"},{"key":"class-region-method-wait-any","kind":"METHOD","parentKey":"class-region","name":"wait_any","signature":"region.wait_any(templates, timeout=0, threshold=0.7, rate=3.0)","description":"Chờ đến khi có ít nhất một template trong danh sách biến mất khỏi region này. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","behavior":"Chờ đến khi có ít nhất một template trong danh sách biến mất khỏi region này. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"templates","type":"list[String | Template]","defaultValue":null,"description":"Danh sách tên template hoặc đối tượng Template.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Trạng thái batch khi ít nhất một template không còn được tìm thấy.","example":"watch = [\"loading\", \"syncing\"]\nresult = region.wait_any(watch, 10000)\nMacroPanel.notify(str(result))","aliases":[],"group":"FLOW"},{"key":"class-region-method-wait-all","kind":"METHOD","parentKey":"class-region","name":"wait_all","signature":"region.wait_all(templates, timeout=0, threshold=0.7, rate=3.0)","description":"Chờ đến khi tất cả template trong danh sách đều biến mất khỏi region này. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","behavior":"Chờ đến khi tất cả template trong danh sách đều biến mất khỏi region này. Nếu bỏ qua timeout, hệ thống chỉ quét đúng một lần.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"templates","type":"list[String | Template]","defaultValue":null,"description":"Danh sách tên template hoặc đối tượng Template.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"timeout","type":"Number","defaultValue":"0","description":"Thời gian chờ tối đa (milliseconds). Nếu bỏ qua tham số này thì chỉ quét một lần.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"threshold","type":"Number","defaultValue":"0.7","description":"Ngưỡng khớp từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"rate","type":"Number","defaultValue":"3.0","description":"Số lần quét mỗi giây (1-60).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Trạng thái batch khi toàn bộ template đều không còn được tìm thấy.","example":"watch = [\"loading\", \"syncing\"]\nresult = region.wait_all(watch, 10000)\nMacroPanel.notify(str(result))","aliases":[],"group":"FLOW"},{"key":"class-region-method-capture","kind":"METHOD","parentKey":"class-region","name":"capture","signature":"region.capture(name=None)","description":"Chụp màn hình và cắt theo region hiện tại, sau đó trả về kết quả dưới dạng Template.","behavior":"Chụp màn hình và cắt theo region hiện tại, sau đó trả về kết quả dưới dạng Template.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Nhận diện chạy trong luồng gọi và dùng chụp màn hình chung. find tìm sự xuất hiện; wait chờ biến mất. Một lần quét vẫn tốn thời gian chụp và nhận diện; timeout hay tốc độ kiểm tra không làm lời gọi bất đồng bộ."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String?","defaultValue":"None","description":"Tên template tùy chọn để lưu ngay vào macro hiện tại.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Template","returnDescription":"Đối tượng template vừa capture.","example":"sample = Region(120, 280, 220, 120).capture()\nsaved = sample.save_as(\"buttons/top/enemy_slot\")","aliases":[],"group":"FLOW"},{"key":"class-region-method-left","kind":"METHOD","parentKey":"class-region","name":"left","signature":"region.left(value=0.5)","description":"Thu nhỏ region về phía trái. Cạnh phải sẽ dịch sang trái theo giá trị yêu cầu.","behavior":"Thu nhỏ region về phía trái. Cạnh phải sẽ dịch sang trái theo giá trị yêu cầu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Mức thu nhỏ: 0 -> 1 là tỉ lệ theo chiều rộng hiện tại, >1 là pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region mới được thu từ cạnh phải.","example":"full = Region(100, 200, 1000, 500)\nleft_focus = full.left(0.4)\nleft_focus_px = full.left(400)","aliases":[],"group":"FLOW"},{"key":"class-region-method-right","kind":"METHOD","parentKey":"class-region","name":"right","signature":"region.right(value=0.5)","description":"Thu nhỏ region về phía phải. Cạnh trái sẽ dịch sang phải theo giá trị yêu cầu.","behavior":"Thu nhỏ region về phía phải. Cạnh trái sẽ dịch sang phải theo giá trị yêu cầu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Mức thu nhỏ: 0 -> 1 là tỉ lệ theo chiều rộng hiện tại, >1 là pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region mới được thu từ cạnh trái.","example":"full = Region(100, 200, 1000, 500)\nright_focus = full.right(0.3)\nright_focus_px = full.right(240)","aliases":[],"group":"FLOW"},{"key":"class-region-method-top","kind":"METHOD","parentKey":"class-region","name":"top","signature":"region.top(value=0.5)","description":"Thu nhỏ region về phía trên. Cạnh dưới sẽ dịch lên theo giá trị yêu cầu.","behavior":"Thu nhỏ region về phía trên. Cạnh dưới sẽ dịch lên theo giá trị yêu cầu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Mức thu nhỏ: 0 -> 1 là tỉ lệ theo chiều cao hiện tại, >1 là pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region mới được thu từ cạnh dưới.","example":"full = Region(100, 200, 1000, 500)\ntop_focus = full.top(0.25)\ntop_focus_px = full.top(120)","aliases":[],"group":"FLOW"},{"key":"class-region-method-bottom","kind":"METHOD","parentKey":"class-region","name":"bottom","signature":"region.bottom(value=0.5)","description":"Thu nhỏ region về phía dưới. Cạnh trên sẽ dịch xuống theo giá trị yêu cầu.","behavior":"Thu nhỏ region về phía dưới. Cạnh trên sẽ dịch xuống theo giá trị yêu cầu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Mức thu nhỏ: 0 -> 1 là tỉ lệ theo chiều cao hiện tại, >1 là pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region mới được thu từ cạnh trên.","example":"full = Region(100, 200, 1000, 500)\nbottom_focus = full.bottom(0.25)\nbottom_focus_px = full.bottom(120)","aliases":[],"group":"FLOW"},{"key":"class-region-method-horizontal","kind":"METHOD","parentKey":"class-region","name":"horizontal","signature":"region.horizontal(value=0.5)","description":"Thu nhỏ theo trục ngang về phía giữa bằng cách dịch cả cạnh trái và cạnh phải vào trong.","behavior":"Thu nhỏ theo trục ngang về phía giữa bằng cách dịch cả cạnh trái và cạnh phải vào trong.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Tổng mức thu nhỏ ngang: 0 -> 1 là tỉ lệ theo chiều rộng hiện tại, >1 là pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region canh giữa với chiều rộng đã giảm.","example":"full = Region(100, 200, 1000, 500)\ncenter_lane = full.horizontal(0.5)\ncenter_lane_px = full.horizontal(300)","aliases":[],"group":"FLOW"},{"key":"class-region-method-vertical","kind":"METHOD","parentKey":"class-region","name":"vertical","signature":"region.vertical(value=0.5)","description":"Thu nhỏ theo trục dọc về phía giữa bằng cách dịch cả cạnh trên và cạnh dưới vào trong.","behavior":"Thu nhỏ theo trục dọc về phía giữa bằng cách dịch cả cạnh trên và cạnh dưới vào trong.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Tổng mức thu nhỏ dọc: 0 -> 1 là tỉ lệ theo chiều cao hiện tại, >1 là pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region canh giữa với chiều cao đã giảm.","example":"full = Region(100, 200, 1000, 500)\ncenter_band = full.vertical(0.5)\ncenter_band_px = full.vertical(200)","aliases":[],"group":"FLOW"},{"key":"class-region-method-middle","kind":"METHOD","parentKey":"class-region","name":"middle","signature":"region.middle(value=0.5)","description":"Thu nhỏ cả chiều rộng và chiều cao về phía giữa.","behavior":"Thu nhỏ cả chiều rộng và chiều cao về phía giữa.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc suy hình học trong luồng gọi, không chụp hay nhận diện. Giữ builder Region có thể thay đổi riêng cho mỗi luồng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Mức thu nhỏ cho cả hai trục: 0 -> 1 là tỉ lệ trên từng trục, >1 là pixel trên từng trục.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Region canh giữa đã giảm theo cả hai trục.","example":"full = Region(100, 200, 1000, 500)\nfocus = full.middle(0.4)\nfocus_px = full.middle(160)","aliases":[],"group":"FLOW"},{"key":"class-region-method-highlight","kind":"METHOD","parentKey":"class-region","name":"highlight","signature":"region.highlight(color=\"green\", line_width=2, auto_hide_ms=0, movable=False)","description":"Vẽ khung highlight cho region hiện tại. Với movable=True, người dùng có thể kéo region và chính Region này sẽ nhận lại toạ độ màn hình mới. Nếu highlight lại cùng region instance thì sẽ thay highlight cũ.","behavior":"Vẽ khung highlight cho region hiện tại. Với movable=True, người dùng có thể kéo region và chính Region này sẽ nhận lại toạ độ màn hình mới. Nếu highlight lại cùng region instance thì sẽ thay highlight cũ.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"color","type":"Color | String | Number","defaultValue":"green","description":"Màu highlight.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"line_width","type":"Number","defaultValue":"2","description":"Độ dày viền theo dp.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_hide_ms","type":"Number","defaultValue":"0","description":"Tự tắt sau N mili giây. 0 là không tự tắt.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"movable","type":"Boolean","defaultValue":"False","description":"Cho phép kéo region đang highlight và cập nhật ngược toạ độ mới vào chính Region này.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Trả về chính region sau khi vẽ highlight.","example":"scan = Region(120, 260, 280, 160)\nscan.highlight(\"#FF00BCD4\", line_width=3, auto_hide_ms=1500, movable=True)","aliases":[],"group":"FLOW"},{"key":"class-region-method-highlight-off","kind":"METHOD","parentKey":"class-region","name":"highlight_off","signature":"region.highlight_off()","description":"Tắt highlight cho region instance này.","behavior":"Tắt highlight cho region instance này.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Region","returnDescription":"Trả về chính region sau khi tắt highlight.","example":"scan = Region(120, 260, 280, 160)\nscan.highlight(\"green\")\nwait(1000)\nscan.highlight_off()","aliases":[],"group":"FLOW"},{"key":"class-template","kind":"CLASS","parentKey":null,"name":"Template","signature":"Template(name, /)","description":"Lớp bọc ảnh template. Bạn có thể scale/crop một template có sẵn, lưu thành tên mới, hoặc kiểm tra tồn tại.","behavior":"Lớp bọc ảnh template. Bạn có thể scale/crop một template có sẵn, lưu thành tên mới, hoặc kiểm tra tồn tại.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["name"],"fieldDocs":[{"name":"name","type":"String?","defaultValue":null,"description":"Tên template hoặc đường dẫn thư mục tương đối khi object này trỏ tới template đã đặt tên trong macro hiện tại.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"name","type":"String","defaultValue":null,"description":"Tên template trong macro hiện tại, có thể là đường dẫn thư mục tương đối như \"buttons/top/attack\".","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"fieldExample":null,"constructorExample":"base = Template(\"enemy_head\")","params":[],"returnType":null,"returnDescription":null,"example":"base = Template(\"enemy_head\")\nvariant = base.scale(0.9).crop(Region(0, 0, 64, 64)).save_as(\"enemy_head_small\")","aliases":[],"group":null},{"key":"class-template-static-method-exists","kind":"STATIC_METHOD","parentKey":"class-template","name":"exists","signature":"Template.exists(name)","description":"Kiểm tra một tên template có tồn tại trong macro hiện tại hay không.","behavior":"Kiểm tra một tên template có tồn tại trong macro hiện tại hay không.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên template hoặc đường dẫn thư mục tương đối cần kiểm tra.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true nếu template tồn tại.","example":"if Template.exists(\"enemy_head\"):\n    text(\"ready\")","aliases":[],"group":"FLOW"},{"key":"class-template-method-exists","kind":"METHOD","parentKey":"class-template","name":"exists","signature":"template.exists()","description":"Kiểm tra object Template này còn trỏ tới file tồn tại hay không.","behavior":"Kiểm tra object Template này còn trỏ tới file tồn tại hay không.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true nếu file template phía sau còn tồn tại.","example":"t = Template(\"enemy_head\")\nif t.exists():\n    text(\"ok\")","aliases":[],"group":"FLOW"},{"key":"class-template-method-scale","kind":"METHOD","parentKey":"class-template","name":"scale","signature":"template.scale(scale, scale_y=None)","description":"Tạo một bản sao template đã scale và trả về dưới dạng Template khác.","behavior":"Tạo một bản sao template đã scale và trả về dưới dạng Template khác.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"scale","type":"Number","defaultValue":null,"description":"Hệ số scale trục X (và cả trục Y nếu bỏ qua scale_y).","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"scale_y","type":"Number","defaultValue":"scale","description":"Hệ số scale trục Y tùy chọn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Template","returnDescription":"Đối tượng template đã scale.","example":"t = Template(\"enemy_head\")\nsmall = t.scale(0.8)\nhit = Region(0, 0, 1080, 2400).find(small, 3000)","aliases":[],"group":"FLOW"},{"key":"class-template-method-crop","kind":"METHOD","parentKey":"class-template","name":"crop","signature":"template.crop(region)","description":"Cắt template này theo một region theo pixel cục bộ của template và trả về Template mới.","behavior":"Cắt template này theo một region theo pixel cục bộ của template và trả về Template mới.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"region","type":"Region","defaultValue":null,"description":"Vùng cắt theo tọa độ cục bộ của template.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Template","returnDescription":"Đối tượng template đã cắt.","example":"t = Template(\"enemy_head\")\nface = t.crop(Region(10, 10, 60, 60))","aliases":[],"group":"FLOW"},{"key":"class-template-method-save-as","kind":"METHOD","parentKey":"class-template","name":"save_as","signature":"template.save_as(name)","description":"Lưu object template này vào bộ template của macro hiện tại bằng tên mới hoặc đường dẫn thư mục tương đối.","behavior":"Lưu object template này vào bộ template của macro hiện tại bằng tên mới hoặc đường dẫn thư mục tương đối.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên template mới, có thể kèm thư mục như \"buttons/top/attack\".","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Template","returnDescription":"Đối tượng template đã được lưu và đặt tên.","example":"captured = Region(200, 300, 120, 90).capture()\nsaved = captured.save_as(\"buttons/top/enemy_slot\")\nif saved.exists():\n    text(\"saved\")","aliases":[],"group":"FLOW"},{"key":"class-recognition","kind":"READ_ONLY_CLASS","parentKey":null,"name":"Recognition","signature":"Recognition","description":"Được dùng trong nhánh thành công của nhận diện trong UI. Recognition.result trả về Match khi có một mục tiêu nhận diện khớp hoặc MatchList khi nhiều mục tiêu cùng khớp.","behavior":"Được dùng trong nhánh thành công của nhận diện trong UI. Recognition.result trả về Match khi có một mục tiêu nhận diện khớp hoặc MatchList khi nhiều mục tiêu cùng khớp.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":["result"],"fieldDocs":[{"name":"result","type":"Match | MatchList","defaultValue":null,"description":"Kết quả nhận diện hiện tại của nhánh Thành công này.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":"current = Recognition.result\nif current.found:\n    click(current, random=0)","constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Recognition chỉ có sẵn trong Python của nhánh Thành công nhận diện.\na = Recognition.result\nif a.found:\n    a.highlight(color=\"yellow\", auto_hide_ms=800)","aliases":[],"group":null},{"key":"class-match","kind":"READ_ONLY_CLASS","parentKey":null,"name":"Match","signature":"Match","description":"Kết quả nhận diện dạng chỉ đọc, được trả về từ các hàm region.find*. Trong nhánh Thành công của nhận diện, Recognition.result trỏ tới Match hoặc MatchList nhận diện hiện tại.","behavior":"Kết quả nhận diện dạng chỉ đọc, được trả về từ các hàm region.find*. Trong nhánh Thành công của nhận diện, Recognition.result trỏ tới Match hoặc MatchList nhận diện hiện tại.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":["name","found","confidence","conf","point","bounds","region","inference_info"],"fieldDocs":[{"name":"name","type":"String?","defaultValue":null,"description":"Tên mục tiêu đã khớp. Nhận diện template dùng tên template không có đuôi file, OCR dùng chính văn bản mục tiêu đã khớp, còn nhận diện màu dùng Color.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"found","type":"Boolean","defaultValue":null,"description":"Có tìm thấy kết quả khớp hay không.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"confidence","type":"Number","defaultValue":null,"description":"Điểm độ tin cậy từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"conf","type":"Number","defaultValue":null,"description":"Bí danh của confidence; trả về cùng điểm độ tin cậy từ 0.0 đến 1.0.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"point","type":"Point? | list[Point]","defaultValue":null,"description":"Điểm của kết quả khớp. Nhận diện ảnh/OCR/object thường trả về Point; match ảnh dưới threshold vẫn có thể trả về point ứng viên tốt nhất khi có bounds. Nhận diện màu và nhận diện nhiều mục có thể trả về list[Point] để match.point[0].x/y đọc được điểm tốt nhất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"bounds","type":"Region?","defaultValue":null,"description":"Vùng bao (bounding box) của kết quả khớp. Match ảnh dưới threshold vẫn có thể cung cấp bounds ứng viên tốt nhất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"region","type":"Region?","defaultValue":null,"description":"Bí danh của bounds; trả về cùng Region đã khớp hoặc None.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"inference_info","type":"dict?","defaultValue":null,"description":"Metadata model hoặc màu khi có sẵn. Metadata TFLite gồm backend, class_id, class_name, preprocess_ms, inference_ms, postprocess_ms, total_ms, input_width, input_height, kích thước ảnh debug tùy chọn và telemetry chụp màn hình. Các dòng debug_result chi tiết chỉ hiển thị trong dialog debug inference. Metadata màu gồm backend=color, target_color, sampled_color, point, max_channel_delta, confidence, interval, match_count và matches.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":"m = Region(100, 200, 300, 400).find(\"btn\", 3000)\ntarget_name = m.name\nis_found = m.found\nscore = m.confidence\nshort_score = m.conf\ncenter = m.point\nbox = m.bounds\nsame_box = m.region\ninfo = m.inference_info\ninfo_class_id = info.class_id\ninfo_class_name = info.class_name\n\ncolor_hit = Region(0, 0, 1080, 1920).find_color(\"#FFFFFF\", tolerance=4)\ncolor_name = color_hit.name\nfirst_color_point = color_hit.point[0]\n\n# Trong nhánh Thành công của nhận diện:\ncurrent = Recognition.result\nif current.found:\n    text(current.name)\n    current.highlight(color=\"yellow\", auto_hide_ms=800)","constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"m = Region(100, 200, 300, 400).find(\"btn\", 3000)\nif m.found:\n    click(m)\n    conf = m.confidence\n\n# Recognition.result chỉ có sẵn trong Python của nhánh Thành công nhận diện.\nif Recognition.result.found:\n    click(Recognition.result, random=0)","aliases":[],"group":null},{"key":"class-match-method-highlight","kind":"METHOD","parentKey":"class-match","name":"highlight","signature":"match.highlight(color=\"green\", line_width=2, region_width=36, auto_hide_ms=0)","description":"Vẽ khung highlight cho match này khi found=true. Ưu tiên bounds; nếu thiếu bounds thì vẽ một hình vuông cho từng point trong point/list.","behavior":"Vẽ khung highlight cho match này khi found=true. Ưu tiên bounds; nếu thiếu bounds thì vẽ một hình vuông cho từng point trong point/list.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"color","type":"Color | String | Number","defaultValue":"green","description":"Màu highlight.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"line_width","type":"Number","defaultValue":"2","description":"Độ dày viền tính theo pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region_width","type":"Number","defaultValue":"36","description":"Độ rộng hình vuông dự phòng khi match chỉ có point.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_hide_ms","type":"Number","defaultValue":"0","description":"Thời gian tự ẩn theo mili giây. 0 sẽ giữ highlight hiển thị.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Trả về chính match sau khi vẽ highlight.","example":"m = Region(100, 200, 300, 400).find(\"start\", 3000)\nm.highlight(color=\"yellow\", line_width=3, auto_hide_ms=1200)","aliases":[],"group":"FLOW"},{"key":"class-match-method-highlight-off","kind":"METHOD","parentKey":"class-match","name":"highlight_off","signature":"match.highlight_off()","description":"Tắt highlight đang hoạt động được tạo từ match instance này.","behavior":"Tắt highlight đang hoạt động được tạo từ match instance này.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Match","returnDescription":"Trả về chính match sau khi tắt highlight.","example":"m = Region(100, 200, 300, 400).find(\"start\", 3000)\nm.highlight()\nm.highlight_off()","aliases":[],"group":"FLOW"},{"key":"class-matchlist","kind":"READ_ONLY_CLASS","parentKey":null,"name":"MatchList","signature":"MatchList","description":"Một list chỉ đọc gồm các giá trị Match, được trả về từ region.find_any/find_all/find_multi, wait_any/wait_all và Recognition.result khi nhiều mục tiêu nhận diện cùng khớp.","behavior":"Một list chỉ đọc gồm các giá trị Match, được trả về từ region.find_any/find_all/find_multi, wait_any/wait_all và Recognition.result khi nhiều mục tiêu nhận diện cùng khớp.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"hits = Region(100, 200, 300, 400).find_all([\"hp\", \"mp\"], 5000)\nif hits:\n    click(hits, offset=(0, 4), random=0)","aliases":[],"group":null},{"key":"class-matchlist-method-highlight","kind":"METHOD","parentKey":"class-matchlist","name":"highlight","signature":"matches.highlight(color=\"green\", line_width=2, region_width=36, auto_hide_ms=0)","description":"Vẽ khung highlight cho từng match đã tìm thấy trong list. Các phần tử không có point/bounds hợp lệ sẽ bị bỏ qua.","behavior":"Vẽ khung highlight cho từng match đã tìm thấy trong list. Các phần tử không có point/bounds hợp lệ sẽ bị bỏ qua.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"color","type":"Color | String | Number","defaultValue":"green","description":"Màu highlight.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"line_width","type":"Number","defaultValue":"2","description":"Độ dày viền tính theo pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region_width","type":"Number","defaultValue":"36","description":"Độ rộng hình vuông dự phòng khi match chỉ có point.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_hide_ms","type":"Number","defaultValue":"0","description":"Thời gian tự ẩn theo mili giây. 0 sẽ giữ highlight hiển thị.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Trả về chính match list sau khi vẽ highlight.","example":"hits = Region(100, 200, 300, 400).find_any([\"enemy_a\", \"enemy_b\"], 2500)\nhits.highlight(color=\"yellow\", line_width=3, auto_hide_ms=1200)","aliases":[],"group":"FLOW"},{"key":"class-matchlist-method-highlight-off","kind":"METHOD","parentKey":"class-matchlist","name":"highlight_off","signature":"matches.highlight_off()","description":"Tắt toàn bộ highlight đang hoạt động được tạo từ match list instance này.","behavior":"Tắt toàn bộ highlight đang hoạt động được tạo từ match list instance này.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"MatchList","returnDescription":"Trả về chính match list sau khi tắt highlight.","example":"hits = Region(100, 200, 300, 400).find_any([\"enemy_a\", \"enemy_b\"], 2500)\nhits.highlight()\nhits.highlight_off()","aliases":[],"group":"FLOW"},{"key":"class-color","kind":"CLASS","parentKey":null,"name":"Color","signature":"Color(value, /)","description":"Đại diện cho một màu ARGB và cung cấp helper lấy màu/so sánh màu.","behavior":"Đại diện cho một màu ARGB và cung cấp helper lấy màu/so sánh màu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["argb","a","r","g","b","hex"],"fieldDocs":[{"name":"argb","type":"Number","defaultValue":null,"description":"Giá trị ARGB dạng số nguyên.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"a","type":"Int","defaultValue":null,"description":"Kênh alpha 0-255.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"r","type":"Int","defaultValue":null,"description":"Kênh đỏ 0-255.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"g","type":"Int","defaultValue":null,"description":"Kênh xanh lá 0-255.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"b","type":"Int","defaultValue":null,"description":"Kênh xanh dương 0-255.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"hex","type":"String","defaultValue":null,"description":"Chuỗi hex `#AARRGGBB`.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"value","type":"String | Number","defaultValue":null,"description":"Chuỗi hex (`#AARRGGBB`/`#RRGGBB`) hoặc số ARGB.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"fieldExample":null,"constructorExample":"c1 = Color(\"#FFFFFFFF\")\nc2 = Color(4294967295)","params":[],"returnType":null,"returnDescription":null,"example":"cursor = Point(540, 920)\npicked = Color.get(cursor)\nif picked == \"#FFFFFFFF\":\n    click(cursor, random=6)","aliases":[],"group":null},{"key":"class-color-static-method-get","kind":"STATIC_METHOD","parentKey":"class-color","name":"get","signature":"Color.get(target, interval=3, default=\"#00000000\")","description":"Đọc màu trên màn hình: Point -> Color, Region -> mảng màu 2 chiều, list[Point] -> list màu. Đây là lần lấy mẫu tức thời, không retry; nếu chưa có frame hoặc thiếu mẫu màu thì trả về màu mặc định thay vì dừng script.","behavior":"Đọc màu trên màn hình: Point -> Color, Region -> mảng màu 2 chiều, list[Point] -> list màu. Đây là lần lấy mẫu tức thời, không retry; nếu chưa có frame hoặc thiếu mẫu màu thì trả về màu mặc định thay vì dừng script.","execution":{"blocking":"yes","threadSafety":"serialized","parallel":"conditional","details":"Lấy mẫu frame chụp chung trong luồng gọi; chụp và xử lý tốn thời gian. Luồng khác dùng chung chính sách chụp/cache."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"target","type":"Point | Region | list[Point]","defaultValue":null,"description":"Mục tiêu lấy mẫu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"3","description":"Bước lấy mẫu (pixel) khi target là Region.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"default","type":"Color | String | Number","defaultValue":"#00000000","description":"Màu mặc định trả về khi không chụp được màn hình hoặc không lấy được pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Color | list[list[Color]] | list[Color]","returnDescription":"Dữ liệu màu trả về theo kiểu target, các mẫu thiếu được bù bằng default.","example":"c = Color.get(Point(100, 200), default=\"#FF000000\")\ngrid = Color.get(Region(120, 240, 90, 60), interval=3, default=\"#00000000\")\nbatch = Color.get([Point(10, 10), Point(20, 20)])","aliases":[],"group":"FLOW"},{"key":"class-color-static-method-compare","kind":"STATIC_METHOD","parentKey":"class-color","name":"compare","signature":"Color.compare(a, b, tolerance=0)","description":"So sánh hai màu theo sai số từng kênh RGB. Chỉ true khi |R1-R2|, |G1-G2| và |B1-B2| đều <= tolerance.","behavior":"So sánh hai màu theo sai số từng kênh RGB. Chỉ true khi |R1-R2|, |G1-G2| và |B1-B2| đều <= tolerance.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"a","type":"Color | String | Number","defaultValue":null,"description":"Màu thứ nhất.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"b","type":"Color | String | Number","defaultValue":null,"description":"Màu thứ hai.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"tolerance","type":"Number","defaultValue":"0","description":"Sai số cho phép trên từng kênh (0-255). Nên bắt đầu 4-8 cho màu giao diện gần như giống nhau, 10-16 khi có anti-alias/nén ảnh.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true khi mọi kênh RGB đều nằm trong tolerance. Gợi ý nhanh: 0 = khớp tuyệt đối, 4-8 = gần như giống, 10-16 = so khớp mềm hơn, >24 = khá lỏng.","example":"base = Color(\\\"#FF4CAF50\\\")\nsample = Color.get(Point(620, 340))\nis_same = Color.compare(base, sample, tolerance=8)  # sắc độ UI gần giống","aliases":[],"group":"FLOW"},{"key":"class-color-static-method-distance-rgb","kind":"STATIC_METHOD","parentKey":"class-color","name":"distance_rgb","signature":"Color.distance_rgb(a, b)","description":"Tính khoảng cách Euclid trong không gian RGB giữa hai màu.","behavior":"Tính khoảng cách Euclid trong không gian RGB giữa hai màu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"a","type":"Color | String | Number","defaultValue":null,"description":"Màu thứ nhất.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"b","type":"Color | String | Number","defaultValue":null,"description":"Màu thứ hai.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Khoảng cách RGB trong khoảng 0 -> 441.67 (0 = khớp tuyệt đối). Gợi ý: <=8 gần như giống, 9-20 tương đối gần, 21-40 khác thấy rõ, >40 khác xa.","example":"actual = Color.get(Point(620, 340))\nrgb_gap = Color.distance_rgb(\\\"#FF4CAF50\\\", actual)\nif rgb_gap <= 15:\n    print(\\\"close in RGB\\\")","aliases":[],"group":"FLOW"},{"key":"class-color-static-method-delta-e","kind":"STATIC_METHOD","parentKey":"class-color","name":"delta_e","signature":"Color.delta_e(a, b)","description":"Tính Delta E (CIE76) giữa hai màu theo độ khác biệt cảm nhận.","behavior":"Tính Delta E (CIE76) giữa hai màu theo độ khác biệt cảm nhận.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"a","type":"Color | String | Number","defaultValue":null,"description":"Màu thứ nhất.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"b","type":"Color | String | Number","defaultValue":null,"description":"Màu thứ hai.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Điểm chênh lệch màu theo cảm nhận. Quy ước nhanh: <1 gần như không phân biệt, 1-2 khó nhận ra, 2-5 bắt đầu thấy khác, 5-10 khác rõ, >10 là màu khác nhau.","example":"actual = Color.get(Point(620, 340))\nd = Color.delta_e(\\\"#FF4CAF50\\\", actual)\nif d <= 3:\n    print(\\\"looks similar to human eye\\\")","aliases":[],"group":"FLOW"},{"key":"class-color-method-compare","kind":"METHOD","parentKey":"class-color","name":"compare","signature":"color.compare(other, tolerance=0)","description":"Bản instance của phép so sánh sai số RGB. Hữu ích khi đã lấy mẫu một màu và cần so với màu mục tiêu.","behavior":"Bản instance của phép so sánh sai số RGB. Hữu ích khi đã lấy mẫu một màu và cần so với màu mục tiêu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Color | String | Number","defaultValue":null,"description":"Màu cần so sánh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"tolerance","type":"Number","defaultValue":"0","description":"Sai số cho phép trên từng kênh (0-255). Mức same-ish thường dùng: 4-8; tăng 10-16 khi ảnh bị nhiễu/nén.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"Kết quả so sánh. 0 là khớp tuyệt đối; tolerance càng lớn thì so khớp càng dễ hơn.","example":"picked = Color.get(Point(540, 920))\nif picked.compare(\\\"#FFFFFFFF\\\", tolerance=5):\n    click(Point(540, 920))","aliases":[],"group":"FLOW"},{"key":"class-color-method-distance-rgb","kind":"METHOD","parentKey":"class-color","name":"distance_rgb","signature":"color.distance_rgb(other)","description":"Tính khoảng cách Euclid trong không gian RGB từ màu hiện tại sang màu khác.","behavior":"Tính khoảng cách Euclid trong không gian RGB từ màu hiện tại sang màu khác.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Color | String | Number","defaultValue":null,"description":"Màu cần so sánh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Khoảng cách RGB (0 -> 441.67). Đọc nhanh: <=8 gần như giống, 9-20 tương đối gần, 21-40 khác thấy rõ, >40 khác xa.","example":"base = Color(\\\"#FF4CAF50\\\")\nactual = Color.get(Point(620, 340))\nrgb_gap = base.distance_rgb(actual)\nif rgb_gap <= 20:\n    print(\\\"close enough in RGB\\\")","aliases":[],"group":"FLOW"},{"key":"class-color-method-delta-e","kind":"METHOD","parentKey":"class-color","name":"delta_e","signature":"color.delta_e(other)","description":"Tính Delta E (CIE76) từ màu hiện tại sang màu khác để so sánh theo cảm nhận.","behavior":"Tính Delta E (CIE76) từ màu hiện tại sang màu khác để so sánh theo cảm nhận.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Color | String | Number","defaultValue":null,"description":"Màu cần so sánh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Điểm chênh lệch màu theo cảm nhận. Gợi ý thực tế: <1 khó phân biệt, 1-2 rất nhẹ, 2-5 bắt đầu thấy khác, 5-10 khác rõ, >10 rất khác.","example":"base = Color(\\\"#FF4CAF50\\\")\nactual = Color.get(Point(620, 340))\nperceptual_gap = base.delta_e(actual)\nif perceptual_gap <= 2:\n    print(\\\"looks almost the same\\\")","aliases":[],"group":"FLOW"},{"key":"class-overlaytext","kind":"CLASS","parentKey":null,"name":"OverlayText","signature":"OverlayText(text=\"\", position=(0, 0), color=\"#FFFFFFFF\", size=16, background=None)","description":"Vẽ text đè lên màn hình với tùy chọn theo dõi tương tác (ấn/kéo/giữ). Các tên setter như text/background là method; đọc giá trị hiện tại qua state().","behavior":"Vẽ text đè lên màn hình với tùy chọn theo dõi tương tác (ấn/kéo/giữ). Các tên setter như text/background là method; đọc giá trị hiện tại qua state().","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":true,"fields":["x","y","scale","anchor","argb","size_sp"],"fieldDocs":[{"name":"x","type":"Number","defaultValue":"0","description":"Vị trí X góc trên-trái theo pixel. Có thể gán trước show().","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"y","type":"Number","defaultValue":"0","description":"Vị trí Y góc trên-trái theo pixel. Có thể gán trước show().","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"scale","type":"String","defaultValue":"fixed","description":"Chế độ scale tọa độ được copy từ Point vị trí.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"Neo tọa độ được copy từ Point vị trí.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"argb","type":"Color","defaultValue":"white","description":"Màu chữ. Có thể gán bằng Color/chuỗi màu/số. Dùng overlay.color(value) nếu muốn chain method.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"size_sp","type":"Number","defaultValue":"16","description":"Cỡ chữ theo sp. Dùng overlay.size(sp) nếu muốn chain method.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"text","type":"String","defaultValue":"\"\"","description":"Nội dung text ban đầu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"position","type":"Point | tuple[Number, Number]","defaultValue":"(0, 0)","description":"Vị trí ban đầu dạng Point hoặc tuple/list (x, y). Point mang metadata scale/anchor.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"color","type":"Color | String | Number","defaultValue":"white","description":"Màu chữ ban đầu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"size","type":"Number","defaultValue":"16","description":"Cỡ chữ ban đầu (sp).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"background","type":"Color | String | Number | None","defaultValue":"None","description":"Màu nền ban đầu. None nghĩa là trong suốt/không có nền.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":null,"constructorExample":"badge = OverlayText(\"Ready\", Point(420, 220, scale=\"width\", anchor=\"top\"), background=None)","params":[],"returnType":null,"returnDescription":null,"example":"badge = OverlayText(\"Running...\", Point(320, 160, scale=\"width\", anchor=\"top\"), background=None)\nbadge.color(\"#FF00E676\").background(\"#66000000\").size(18).track(press=True, move=True, hold=True, hold_ms=700)\nbadge.show()\n\nstate = badge.state()\nif state[\"status\"] == 2:\n    MacroPanel.notify(\"Badge is moving\")\n\np = badge.get_point()\nr = badge.get_region()\nif r is not None:\n    r.highlight(\"yellow\", auto_hide_ms=600)\n\nbadge.hide()   # ẩn nhanh\nbadge.show()   # hiện lại nhanh\nbadge.off()    # giải phóng hoàn toàn","aliases":[],"group":null},{"key":"class-overlaytext-static-method-off-all","kind":"STATIC_METHOD","parentKey":"class-overlaytext","name":"off_all","signature":"OverlayText.off_all()","description":"Tắt và giải phóng toàn bộ overlay text do luồng hiện tại tạo, không ảnh hưởng các luồng chạy song song.","behavior":"Tắt và giải phóng toàn bộ overlay text do luồng hiện tại tạo, không ảnh hưởng các luồng chạy song song.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Giải phóng các overlay thuộc luồng này\na = OverlayText(\"Running\", (24, 120))\na.show()\nOverlayText.off_all()","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-text","kind":"METHOD","parentKey":"class-overlaytext","name":"text","signature":"overlay.text(value)","description":"Cập nhật nội dung text hiển thị.","behavior":"Cập nhật nội dung text hiển thị.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"String","defaultValue":null,"description":"Nội dung text.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính builder overlay text.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.text(\"Running\")\nbadge.show()","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-color","kind":"METHOD","parentKey":"class-overlaytext","name":"color","signature":"overlay.color(value)","description":"Cập nhật màu chữ.","behavior":"Cập nhật màu chữ.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Color | String | Number","defaultValue":null,"description":"Giá trị màu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính builder overlay text.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.color(\"#FF00E676\")\nbadge.show()","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-background","kind":"METHOD","parentKey":"class-overlaytext","name":"background","signature":"overlay.background(value=None)","description":"Cập nhật màu nền. Truyền None để bỏ nền.","behavior":"Cập nhật màu nền. Truyền None để bỏ nền.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Color | String | Number | None","defaultValue":"None","description":"Màu nền, hoặc None để trong suốt/không có nền.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính builder overlay text.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.background(\"#66000000\")\nbadge.show()\nbadge.background(None)","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-size","kind":"METHOD","parentKey":"class-overlaytext","name":"size","signature":"overlay.size(sp)","description":"Cập nhật cỡ chữ (sp).","behavior":"Cập nhật cỡ chữ (sp).","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sp","type":"Number","defaultValue":null,"description":"Cỡ chữ theo đơn vị sp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính builder overlay text.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.size(20)\nbadge.show()","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-position","kind":"METHOD","parentKey":"class-overlaytext","name":"position","signature":"overlay.position(position)","description":"Cập nhật vị trí vẽ bằng Point hoặc tuple/list (x, y). Point mang metadata scale/anchor.","behavior":"Cập nhật vị trí vẽ bằng Point hoặc tuple/list (x, y). Point mang metadata scale/anchor.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"position","type":"Point | tuple[Number, Number]","defaultValue":null,"description":"Vị trí mới.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính builder overlay text.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.position((80, 160))\nbadge.show()","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-track","kind":"METHOD","parentKey":"class-overlaytext","name":"track","signature":"overlay.track(press=False, move=False, hold=False, hold_ms=600)","description":"Cấu hình theo dõi tương tác. Nếu tất cả cờ đều False thì text đứng yên ở vị trí khai báo.","behavior":"Cấu hình theo dõi tương tác. Nếu tất cả cờ đều False thì text đứng yên ở vị trí khai báo.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"press","type":"Boolean","defaultValue":"False","description":"Theo dõi trạng thái ấn/thả.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"move","type":"Boolean","defaultValue":"False","description":"Cho phép người dùng kéo để di chuyển text.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"hold","type":"Boolean","defaultValue":"False","description":"Theo dõi trạng thái giữ lâu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"hold_ms","type":"Number","defaultValue":"600","description":"Ngưỡng thời gian để coi tương tác là đang giữ lâu, tính theo milliseconds.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính builder overlay text.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.track(press=True, move=True, hold=True, hold_ms=700)\nbadge.show()\nprint(badge.state())","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-get-point","kind":"METHOD","parentKey":"class-overlaytext","name":"get_point","signature":"overlay.get_point()","description":"Lấy point góc trên-trái hiện tại của overlay text. Vị trí này sẽ được cập nhật sau khi người dùng kéo di chuyển.","behavior":"Lấy point góc trên-trái hiện tại của overlay text. Vị trí này sẽ được cập nhật sau khi người dùng kéo di chuyển.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Point","returnDescription":"Vị trí overlay hiện tại theo pixel màn hình.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.show()\npoint = badge.get_point()\nprint(point.x, point.y)","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-get-region","kind":"METHOD","parentKey":"class-overlaytext","name":"get_region","signature":"overlay.get_region()","description":"Lấy region bao quanh kích thước overlay text hiện tại. Trả về None khi overlay chưa hiển thị hoặc chưa đo xong kích thước.","behavior":"Lấy region bao quanh kích thước overlay text hiện tại. Trả về None khi overlay chưa hiển thị hoặc chưa đo xong kích thước.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Region?","returnDescription":"Region bao quanh overlay text, hoặc None. Luôn kiểm tra None trước khi dùng region.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.show()\nbounds = badge.get_region()\nif bounds is not None:\n    print(bounds.width, bounds.height)","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-show","kind":"METHOD","parentKey":"class-overlaytext","name":"show","signature":"overlay.show()","description":"Hiển thị text overlay (hoặc hiện lại sau hide()).","behavior":"Hiển thị text overlay (hoặc hiện lại sau hide()).","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict trạng thái hiện tại của overlay.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nprint(badge.show())","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-hide","kind":"METHOD","parentKey":"class-overlaytext","name":"hide","signature":"overlay.hide()","description":"Ẩn overlay text nhưng giữ view đã cache để show() lại nhanh hơn.","behavior":"Ẩn overlay text nhưng giữ view đã cache để show() lại nhanh hơn.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict trạng thái hiện tại của overlay.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.show()\nbadge.hide()\nbadge.show()","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-off","kind":"METHOD","parentKey":"class-overlaytext","name":"off","signature":"overlay.off()","description":"Tắt overlay text và giải phóng tài nguyên.","behavior":"Tắt overlay text và giải phóng tài nguyên.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict trạng thái hiện tại của overlay.","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.show()\nprint(badge.off())","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-state","kind":"METHOD","parentKey":"class-overlaytext","name":"state","signature":"overlay.state()","description":"Trả về trạng thái tương tác hiện tại. Bản đồ mã: 0=IDLE, 1=PRESSED, 2=MOVING, 3=HOLDING, 4=RELEASED, 5=HIDDEN, 6=OFF. Khi gọi state(), PRESSED và RELEASED sẽ tự reset về IDLE cho lần đọc kế tiếp; MOVING và HOLDING thì không tự reset.","behavior":"Trả về trạng thái tương tác hiện tại. Bản đồ mã: 0=IDLE, 1=PRESSED, 2=MOVING, 3=HOLDING, 4=RELEASED, 5=HIDDEN, 6=OFF. Khi gọi state(), PRESSED và RELEASED sẽ tự reset về IDLE cho lần đọc kế tiếp; MOVING và HOLDING thì không tự reset.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Mỗi luồng sở hữu id overlay riêng; off_all() chỉ giải phóng overlay của luồng đó. Công việc UI chuyển qua Android Main và có thể tạm chờ luồng gọi. Giữ builder overlay có thể thay đổi trong luồng sở hữu."},"limitations":[],"relatedApis":["class-overlaytext-static-method-off-all","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict trạng thái gồm status/status_label, cờ tracking, và width/height của overlay theo pixel (nếu có).","example":"# Cấu hình hoặc kiểm tra overlay thuộc luồng này\nbadge = OverlayText(\"Ready\", (24, 120))\nbadge.track(press=True, move=True)\nbadge.show()\nstate = badge.state()\nprint(state[\"status_label\"])","aliases":[],"group":"FLOW"},{"key":"class-timer","kind":"CLASS","parentKey":null,"name":"Timer","signature":"Timer(auto_start=True)","description":"Đồng hồ bấm giờ theo millisecond dùng để kiểm tra thời lượng và chờ có điều kiện trong script.","behavior":"Đồng hồ bấm giờ theo millisecond dùng để kiểm tra thời lượng và chờ có điều kiện trong script.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["auto_start"],"fieldDocs":[{"name":"auto_start","type":"Boolean","defaultValue":"True","description":"Timer có bắt đầu đếm ngay sau khi tạo hay không. Gán True để bắt đầu; gán False để tạm dừng.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"auto_start","type":"Boolean","defaultValue":"True","description":"Bắt đầu đếm ngay sau khi tạo timer.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":null,"constructorExample":"timer = Timer()\nif timer.is_elapsed(500):\n    text(\"half-second passed\")","params":[],"returnType":null,"returnDescription":null,"example":"timer = Timer(auto_start=False)\ntimer.start()\nwhile not timer.is_elapsed(2000):\n    wait(50)\ntimer.stop()","aliases":[],"group":null},{"key":"class-timer-method-start","kind":"METHOD","parentKey":"class-timer","name":"start","signature":"timer.start()","description":"Bắt đầu đếm nếu timer hiện đang dừng.","behavior":"Bắt đầu đếm nếu timer hiện đang dừng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer để chain.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer(auto_start=False)\ntimer.start()\nwait(100)\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-pause","kind":"METHOD","parentKey":"class-timer","name":"pause","signature":"timer.pause()","description":"Tạm dừng đếm nhưng vẫn giữ phần thời gian đã trôi qua.","behavior":"Tạm dừng đếm nhưng vẫn giữ phần thời gian đã trôi qua.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer để chain.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\nwait(100)\ntimer.pause()\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-resume","kind":"METHOD","parentKey":"class-timer","name":"resume","signature":"timer.resume()","description":"Tiếp tục đếm từ trạng thái tạm dừng.","behavior":"Tiếp tục đếm từ trạng thái tạm dừng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer để chain.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\ntimer.pause()\ntimer.resume()\nwait(100)\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-stop","kind":"METHOD","parentKey":"class-timer","name":"stop","signature":"timer.stop()","description":"Dừng đếm và giữ nguyên số millisecond đã trôi qua.","behavior":"Dừng đếm và giữ nguyên số millisecond đã trôi qua.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer để chain.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\nwait(100)\ntimer.stop()\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-reset","kind":"METHOD","parentKey":"class-timer","name":"reset","signature":"timer.reset()","description":"Đặt thời gian đã trôi qua về 0 và giữ nguyên trạng thái đang chạy hay tạm dừng.","behavior":"Đặt thời gian đã trôi qua về 0 và giữ nguyên trạng thái đang chạy hay tạm dừng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer để chain.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\nwait(100)\ntimer.reset()\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-restart","kind":"METHOD","parentKey":"class-timer","name":"restart","signature":"timer.restart()","description":"Đặt về 0 và bắt đầu đếm lại ngay lập tức.","behavior":"Đặt về 0 và bắt đầu đếm lại ngay lập tức.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer để chain.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer(auto_start=False)\ntimer.restart()\nwait(100)\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-elapsed-ms","kind":"METHOD","parentKey":"class-timer","name":"elapsed_ms","signature":"timer.elapsed_ms()","description":"Lấy tổng số millisecond đã trôi qua.","behavior":"Lấy tổng số millisecond đã trôi qua.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number","returnDescription":"Số millisecond đã trôi qua.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\nwait(100)\nprint(timer.elapsed_ms())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-is-elapsed","kind":"METHOD","parentKey":"class-timer","name":"is_elapsed","signature":"timer.is_elapsed(time)","description":"Kiểm tra xem thời gian đã trôi qua có lớn hơn hoặc bằng số millisecond truyền vào hay chưa.","behavior":"Kiểm tra xem thời gian đã trôi qua có lớn hơn hoặc bằng số millisecond truyền vào hay chưa.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"time","type":"Number","defaultValue":null,"description":"Ngưỡng thời gian theo millisecond cần so sánh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true khi thời gian đã đạt hoặc vượt ngưỡng.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\nwait(500)\nif timer.is_elapsed(500):\n    print(\"Elapsed\")","aliases":[],"group":"FLOW"},{"key":"class-timer-method-is-running","kind":"METHOD","parentKey":"class-timer","name":"is_running","signature":"timer.is_running()","description":"Kiểm tra timer hiện có đang đếm hay không.","behavior":"Kiểm tra timer hiện có đang đếm hay không.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true khi timer đang đếm.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\nprint(timer.is_running())","aliases":[],"group":"FLOW"},{"key":"class-timer-method-is-paused","kind":"METHOD","parentKey":"class-timer","name":"is_paused","signature":"timer.is_paused()","description":"Kiểm tra timer có đang tạm dừng sau khi đã bắt đầu hay không.","behavior":"Kiểm tra timer có đang tạm dừng sau khi đã bắt đầu hay không.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true khi timer đang tạm dừng.","example":"# Đo thời gian trong luồng đang gọi\ntimer = Timer()\ntimer.pause()\nprint(timer.is_paused())","aliases":[],"group":"FLOW"},{"key":"class-tflitemodel","kind":"CLASS","parentKey":null,"name":"TfliteModel","signature":"TfliteModel(model)","description":"Đối tượng model TFLite để dùng trong script. Kiểu model phải được chọn trong metadata của Template Manager. Các đầu ra đang hỗ trợ gồm YOLOv8/YOLO11 object detection [1,N,4+C]/[1,4+C,N], YOLO26 end-to-end detection [1,N,6]/[N,6], YOLO11/YOLO26 image classification [1,C], và MobileNetV3 image classification [1,C]. Runtime tự đọc precision FLOAT32, INT8 hoặc UINT8 từ model và giải lượng tử output detection/classification trước khi áp dụng threshold. Kết quả classification trả confidence và metadata theo class, không dựng point hoặc bounds giả. Các hàm inference yêu cầu file model cục bộ; nếu thiếu file local và runtime tải lại thất bại thì script sẽ báo lỗi runtime.","behavior":"Đối tượng model TFLite để dùng trong script. Kiểu model phải được chọn trong metadata của Template Manager. Các đầu ra đang hỗ trợ gồm YOLOv8/YOLO11 object detection [1,N,4+C]/[1,4+C,N], YOLO26 end-to-end detection [1,N,6]/[N,6], YOLO11/YOLO26 image classification [1,C], và MobileNetV3 image classification [1,C]. Runtime tự đọc precision FLOAT32, INT8 hoặc UINT8 từ model và giải lượng tử output detection/classification trước khi áp dụng threshold. Kết quả classification trả confidence và metadata theo class, không dựng point hoặc bounds giả. Các hàm inference yêu cầu file model cục bộ; nếu thiếu file local và runtime tải lại thất bại thì script sẽ báo lỗi runtime.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["model","resize_mode","color_mode","norm_mode","padding_color"],"fieldDocs":[{"name":"model","type":"String","defaultValue":null,"description":"Tham chiếu model trong macro hiện tại (ưu tiên tên model trong Template; vẫn hỗ trợ model id cũ).","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"resize_mode","type":"String","defaultValue":"LETTERBOX","description":"Chế độ resize preprocessing đã resolve: LETTERBOX, STRETCH, hoặc CROP_CENTER.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"color_mode","type":"String","defaultValue":"RGB","description":"Chế độ màu preprocessing đã resolve: RGB, BGR, hoặc GRAYSCALE.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"norm_mode","type":"String","defaultValue":"ZERO_ONE","description":"Chuẩn hóa preprocessing đã resolve: ZERO_ONE, MINUS_ONE_ONE, IMAGENET, hoặc CUSTOM.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"padding_color","type":"Int","defaultValue":"114","description":"Giá trị padding (0 -> 255) dùng cho chế độ LETTERBOX.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"model","type":"String","defaultValue":null,"description":"Tham chiếu model dùng để inference (ưu tiên tên model trong Template).","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"fieldExample":null,"constructorExample":"# Nhập mô hình TFLite được hỗ trợ và chọn loại đầu ra trong Template Manager.\n# Tạo model handle gắn với một tên mô hình TFLite trong Template Manager.\nmodel = TfliteModel(\"enemy_model\")","params":[],"returnType":null,"returnDescription":null,"example":"# Kiểm tra mô hình sẵn sàng trước khi chạy nhận diện\nif TfliteModel.exists(\"enemy_model\"):\n    detector = TfliteModel(\"enemy_model\")\n    hits = detector.inference()\n    if len(hits) > 0:\n        click(hits[0])","aliases":[],"group":null},{"key":"class-tflitemodel-static-method-exists","kind":"STATIC_METHOD","parentKey":"class-tflitemodel","name":"exists","signature":"TfliteModel.exists(model)","description":"Kiểm tra file model TFLite cục bộ (resolve theo tên model hoặc id cũ) hiện có sẵn trong macro này hay không.","behavior":"Kiểm tra file model TFLite cục bộ (resolve theo tên model hoặc id cũ) hiện có sẵn trong macro này hay không.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"model","type":"String","defaultValue":null,"description":"Tham chiếu model cần kiểm tra.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true nếu file model cục bộ đã sẵn sàng để dùng.","example":"# Kiểm tra mô hình đã nhập trong Trình quản lý mẫu\nif TfliteModel.exists(\"enemy_detector\"):\n    print(\"Model available\")","aliases":[],"group":"FLOW"},{"key":"class-tflitemodel-static-method-list","kind":"STATIC_METHOD","parentKey":"class-tflitemodel","name":"list","signature":"TfliteModel.list()","description":"Liệt kê các tham chiếu model cục bộ hiện có cho macro (ưu tiên tên hiển thị).","behavior":"Liệt kê các tham chiếu model cục bộ hiện có cho macro (ưu tiên tên hiển thị).","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list[String]","returnDescription":"Danh sách tham chiếu model.","example":"# Liệt kê các mô hình macro này có thể dùng\nprint(TfliteModel.list())","aliases":[],"group":"FLOW"},{"key":"class-tflitemodel-method-exists","kind":"METHOD","parentKey":"class-tflitemodel","name":"exists","signature":"model.exists()","description":"Kiểm tra file model cục bộ của detector hiện tại có sẵn hay không.","behavior":"Kiểm tra file model cục bộ của detector hiện tại có sẵn hay không.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true nếu file model cục bộ có thể dùng ngay.","example":"# Chỉ tạo đối tượng sau khi xác nhận mô hình đã nhập tồn tại\nif TfliteModel.exists(\"enemy_detector\"):\n    model = TfliteModel(\"enemy_detector\")\n    print(model.exists())","aliases":[],"group":"FLOW"},{"key":"class-tflitemodel-method-inference","kind":"METHOD","parentKey":"class-tflitemodel","name":"inference","signature":"model.inference(threshold=0.5, region=None, max_results=8, debug=False)","description":"Chạy model TFLite đã chọn mà không lọc theo class và trả về toàn bộ match. Khi truyền region, ảnh màn hình trong vùng đó được cắt trước khi preprocessing và inference; độ chính xác có thể giảm nếu model không được train trên các ảnh đã cắt tương tự. Match classification không có point hoặc bounds.","behavior":"Chạy model TFLite đã chọn mà không lọc theo class và trả về toàn bộ match. Khi truyền region, ảnh màn hình trong vùng đó được cắt trước khi preprocessing và inference; độ chính xác có thể giảm nếu model không được train trên các ảnh đã cắt tương tự. Match classification không có point hoặc bounds.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"threshold","type":"Number","defaultValue":"0.5","description":"Ngưỡng confidence trong 0 -> 1.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region","type":"Region?","defaultValue":"None","description":"Vùng màn hình tùy chọn. Ảnh trong vùng này được cắt trước khi preprocessing và inference; độ chính xác có thể giảm nếu model không được train trên các ảnh đã cắt tương tự.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"max_results","type":"Int","defaultValue":"8","description":"Số lượng detection tối đa được trả về.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"debug","type":"Boolean","defaultValue":"False","description":"Trong chế độ Chỉnh sửa, true sẽ lưu ảnh preview sau preprocess và mở dialog debug runtime. Chế độ Run-only bỏ qua đầu ra debug và vẫn inference bình thường mà không mở dialog. Các dòng kết quả model chi tiết và config preprocess chỉ nằm trong dialog; Match trả về không chứa debug_result. Preview detection có vẽ bbox/class label; preview classification hiển thị ảnh đầu vào sau preprocess cùng điểm số class.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Danh sách match inference trên tất cả class.","example":"# Chạy inference thô của mô hình và xem debug preprocess\ndetector = TfliteModel(\"enemy_model\")\nsearch = Region(100, 200, 300, 400)\nhits = detector.inference(threshold=0.55, region=search, max_results=12, debug=True)\ntext(str(len(hits)))","aliases":[],"group":"FLOW"},{"key":"class-flow","kind":"READ_ONLY_CLASS","parentKey":null,"name":"Flow","signature":"Flow","description":"Bộ điều khiển static để khởi chạy song song các luồng chạy có tên của macro. Tối đa hai luồng chạy nền có thể chạy cùng luồng chạy chính và mỗi tên chỉ được có một lượt gọi còn sống, kể cả khi đang tạm dừng hoặc đang dừng. Flow.start() trả về ngay sau khi bộ điều phối chấp nhận nhánh; luồng chạy nền có thể khởi chạy luồng ngang hàng. Biến được tách riêng theo từng nhánh và không bao giờ hợp nhất về nhánh gọi. Luồng chạy chính chờ mọi luồng chạy nền trước khi lượt Run hoàn tất. Tên không hợp lệ hoặc trùng, hết chỗ chạy nền, lỗi ở bất kỳ nhánh nào, System.stop() hoặc nút Stop của Main đều kết thúc toàn bộ macro. Mỗi điều khiển dock có số của luồng chạy nền chỉ có thể tạm Pause hoặc Resume riêng nhánh đó; không có Stop riêng từng nhánh. Pause hoặc Resume của Main áp dụng cho mọi nhánh, và Resume toàn cục cũng xóa cờ pause cục bộ của nhánh. Cử chỉ chạm từ các nhánh khác nhau có thể hủy lẫn nhau. Chính sách ScreenCapture và audio capture được dùng chung toàn cục. Storage dùng chung các key bền vững giữa các nhánh và không phải kênh nhắn tin liên tiến trình.","behavior":"Bộ điều khiển static để khởi chạy song song các luồng chạy có tên của macro. Tối đa hai luồng chạy nền có thể chạy cùng luồng chạy chính và mỗi tên chỉ được có một lượt gọi còn sống, kể cả khi đang tạm dừng hoặc đang dừng. Flow.start() trả về ngay sau khi bộ điều phối chấp nhận nhánh; luồng chạy nền có thể khởi chạy luồng ngang hàng. Biến được tách riêng theo từng nhánh và không bao giờ hợp nhất về nhánh gọi. Luồng chạy chính chờ mọi luồng chạy nền trước khi lượt Run hoàn tất. Tên không hợp lệ hoặc trùng, hết chỗ chạy nền, lỗi ở bất kỳ nhánh nào, System.stop() hoặc nút Stop của Main đều kết thúc toàn bộ macro. Mỗi điều khiển dock có số của luồng chạy nền chỉ có thể tạm Pause hoặc Resume riêng nhánh đó; không có Stop riêng từng nhánh. Pause hoặc Resume của Main áp dụng cho mọi nhánh, và Resume toàn cục cũng xóa cờ pause cục bộ của nhánh. Cử chỉ chạm từ các nhánh khác nhau có thể hủy lẫn nhau. Chính sách ScreenCapture và audio capture được dùng chung toàn cục. Storage dùng chung các key bền vững giữa các nhánh và không phải kênh nhắn tin liên tiến trình.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"yes","details":"Flow.start tạo executor nền cô lập và trả số thứ tự Int, không phải handle. Tối đa hai luồng nền chạy cùng luồng chính. Luồng chính chờ nền kết thúc; lỗi ở bất kỳ luồng nào hoặc System.stop() dừng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-storage","class-screencapture"],"isCallable":false,"fields":[],"fieldDocs":[{"name":"params","type":"dict","defaultValue":null,"description":"Input chỉ đọc đã được sao chép cho nhánh hiện tại. Luồng chạy chính nhận dict rỗng. Mỗi lần đọc trả về dữ liệu an toàn đã tách khỏi bộ điều phối và collection của VM cha.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Khởi chạy worker đã cấu hình trong khi main flow vẫn chạy\nworker_no = Flow.start(\"watch_enemy\", {\"labels\": [\"boss\", \"guard\"]})\nMacroPanel.notify(\"Background flow #\" + str(worker_no) + \" started\")","aliases":[],"group":null},{"key":"class-flow-static-method-start","kind":"STATIC_METHOD","parentKey":"class-flow","name":"start","signature":"Flow.start(name, params=None)","description":"Khởi chạy một luồng chạy có tên đã cấu hình mà không chặn nhánh gọi. Tên được bộ điều phối macro đối chiếu. Params được sao chép trước khi gửi và chỉ được chứa None, Boolean, số hữu hạn, String, list, tuple và dict có key String trong giới hạn độ sâu/kích thước của runtime; callable, giá trị domain/tài nguyên và collection có chu kỳ sẽ bị từ chối.","behavior":"Khởi chạy một luồng chạy có tên đã cấu hình mà không chặn nhánh gọi. Tên được bộ điều phối macro đối chiếu. Params được sao chép trước khi gửi và chỉ được chứa None, Boolean, số hữu hạn, String, list, tuple và dict có key String trong giới hạn độ sâu/kích thước của runtime; callable, giá trị domain/tài nguyên và collection có chu kỳ sẽ bị từ chối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Trả về sau khi bộ điều phối chấp nhận luồng có tên, không chờ luồng đó kết thúc. Input được sao chép trước khi gửi."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên luồng chạy đã cấu hình chính xác để bộ điều phối macro phân giải.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"params","type":"dict?","defaultValue":"None","description":"Input tùy chọn được sao chép an toàn và hiển thị qua Flow.params trong nhánh được khởi chạy.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Int","returnDescription":"Số thứ tự instance nhánh dương, tăng đơn điệu để hiển thị trạng thái dock và log; đây không phải handle điều khiển.","example":"# Khởi chạy nhận diện và telemetry cùng main flow\nrecognition_no = Flow.start(\"recognition\", {\"region\": \"arena\", \"threshold\": 0.86})\ntelemetry_no = Flow.start(\"telemetry\")\n\n# Trong flow nhận diện đã cấu hình, đọc input đã sao chép của nhánh này\nregion_name = Flow.params.get(\"region\", \"full_screen\")\nthreshold = Flow.params.get(\"threshold\", 0.8)","aliases":[],"group":"FLOW"},{"key":"class-list","kind":"COLLECTION","parentKey":null,"name":"list","signature":"list(iterable=(), /)","description":"Danh sách có thứ tự. Dùng khi bạn cần các giá trị có thể đếm, đọc theo vị trí, bung giá trị, hoặc lặp qua theo đúng thứ tự.","behavior":"Danh sách có thứ tự. Dùng khi bạn cần các giá trị có thể đếm, đọc theo vị trí, bung giá trị, hoặc lặp qua theo đúng thứ tự.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"numbers = list()\nnumbers.append(2)\nnumbers.extend([0, 3])\nfirst = numbers[0]        # trả về 2\ncount = len(numbers)      # trả về 3\n\nfor value in numbers:\n    wait(50)              # trả về None","aliases":[],"group":null},{"key":"class-list-creation-method-constructor","kind":"CREATION_METHOD","parentKey":"class-list","name":"constructor","signature":"list()\nlist(iterable, /)","description":"Tạo list rỗng hoặc copy các phần tử từ một iterable vào list mới có thể cập nhật.","behavior":"Tạo list rỗng hoặc copy các phần tử từ một iterable vào list mới có thể cập nhật.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":"()","description":"Nguồn giá trị cần copy vào list mới.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"list","returnDescription":"Một list mới có thể cập nhật.","example":"numbers = list()\nnumbers.append(2)\nnumbers.append(3)\n\ncopied = list(numbers)","aliases":[],"group":"FLOW"},{"key":"class-list-creation-method-literal","kind":"CREATION_METHOD","parentKey":"class-list","name":"literal","signature":"[1, 2, 3]","description":"Tạo list literal ngay trong dòng. Đây là cách ngắn nhất khi bạn đã biết sẵn các phần tử.","behavior":"Tạo list literal ngay trong dòng. Đây là cách ngắn nhất khi bạn đã biết sẵn các phần tử.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"item","type":"Any?","defaultValue":null,"description":"Mỗi phần tử được viết bên trong cặp ngoặc vuông.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"list","returnDescription":"Một list mới có thể cập nhật và giữ nguyên thứ tự literal.","example":"numbers = [2, 0, 3]\nfirst = numbers[0]       # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-list-creation-method-comprehension","kind":"CREATION_METHOD","parentKey":"class-list","name":"comprehension","signature":"[expr for target in iterable if condition]","description":"Tạo list bằng cách lặp qua iterable khác. Có thể dùng nhiều mệnh đề for/if, và biến vòng lặp chỉ tồn tại bên trong comprehension.","behavior":"Tạo list bằng cách lặp qua iterable khác. Có thể dùng nhiều mệnh đề for/if, và biến vòng lặp chỉ tồn tại bên trong comprehension.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"expr","type":"Any?","defaultValue":null,"description":"Giá trị được thêm vào cho mỗi phần tử đạt điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"target","type":"Name | destructuring target","defaultValue":null,"description":"Target nhận phần tử hiện tại. Chưa hỗ trợ starred target.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn giá trị cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"condition","type":"Boolean","defaultValue":"True","description":"Bộ lọc tùy chọn, được kiểm tra trước khi thêm phần tử.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"}],"returnType":"list","returnDescription":"Một list mới có thể cập nhật, giữ các phần tử phù hợp theo thứ tự lặp.","example":"values = [1, 2, 3, 4]\nevens = [x for x in values if x % 2 == 0]","aliases":[],"group":"FLOW"},{"key":"class-list-creation-method-range-source","kind":"CREATION_METHOD","parentKey":"class-list","name":"range_source","signature":"range(stop, /) | range(start, stop, step=1, /)","description":"Tạo một list số nguyên mới cho vòng lặp, bộ đếm, và dải số.","behavior":"Tạo một list số nguyên mới cho vòng lặp, bộ đếm, và dải số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"start","type":"Number","defaultValue":"0","description":"Giá trị bắt đầu (bao gồm).","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"},{"name":"stop","type":"Number","defaultValue":null,"description":"Giá trị kết thúc (không bao gồm).","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"step","type":"Number","defaultValue":"1","description":"Bước nhảy giữa các phần tử. Không được bằng 0.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"list[Int]","returnDescription":"Một list số nguyên mới.","example":"numbers = range(5)         # trả về [0, 1, 2, 3, 4]\nevens = range(0, 10, 2)   # trả về [0, 2, 4, 6, 8]","aliases":[],"group":"FLOW"},{"key":"class-list-method-length","kind":"METHOD","parentKey":"class-list","name":"length","signature":"len(list, /)","description":"Đếm xem list có bao nhiêu phần tử.","behavior":"Đếm xem list có bao nhiêu phần tử.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"list","type":"list","defaultValue":null,"description":"list cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số phần tử có trong list.","example":"numbers = range(3, 8)     # trả về [3, 4, 5, 6, 7]\ncount = len(numbers)      # trả về 5","aliases":[],"group":"FLOW"},{"key":"class-list-method-index-access","kind":"METHOD","parentKey":"class-list","name":"index_access","signature":"list[index]","description":"Đọc một phần tử theo chỉ số. Chỉ số âm sẽ đếm từ cuối list.","behavior":"Đọc một phần tử theo chỉ số. Chỉ số âm sẽ đếm từ cuối list.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"list","type":"list","defaultValue":null,"description":"list nguồn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"index","type":"Int","defaultValue":null,"description":"Chỉ số phần tử. Dùng -1 để lấy phần tử cuối.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Phần tử ở vị trí đó. Báo IndexError nếu chỉ số nằm ngoài list.","example":"numbers = range(10, 15)   # trả về [10, 11, 12, 13, 14]\nfirst = numbers[0]        # trả về 10\nthird = numbers[2]        # trả về 12\nlast = numbers[-1]        # trả về 14","aliases":[],"group":"FLOW"},{"key":"class-list-method-slice","kind":"METHOD","parentKey":"class-list","name":"slice","signature":"list[start:end[:step]]","description":"Sao chép một phần list bằng slicing kiểu Python. Bỏ trống biên sẽ dùng đầu hoặc cuối list; chỉ số âm đếm từ cuối list.","behavior":"Sao chép một phần list bằng slicing kiểu Python. Bỏ trống biên sẽ dùng đầu hoặc cuối list; chỉ số âm đếm từ cuối list.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"start","type":"Int","defaultValue":"start of list","description":"Chỉ số phần tử đầu tiên được lấy.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"},{"name":"end","type":"Int","defaultValue":"end of list","description":"Dừng trước chỉ số phần tử này.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"},{"name":"step","type":"Int","defaultValue":"1","description":"Khoảng cách giữa các phần tử. Không được bằng 0; giá trị âm đọc ngược.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"}],"returnType":"list","returnDescription":"Một list mới có thể cập nhật, được giới hạn trong phạm vi hiện có.","example":"numbers = [0, 1, 2, 3, 4]\nmiddle = numbers[1:4]     # trả về [1, 2, 3]\ntail = numbers[-2:]       # trả về [3, 4]\nreverse = numbers[::-1]   # trả về [4, 3, 2, 1, 0]","aliases":[],"group":"FLOW"},{"key":"class-list-method-index-assignment","kind":"METHOD","parentKey":"class-list","name":"index_assignment","signature":"list[index] = value","description":"Thay thế một phần tử đang có theo chỉ số. Chỉ số âm sẽ đếm từ cuối list. Chỉ số phải nằm trong phạm vi list.","behavior":"Thay thế một phần tử đang có theo chỉ số. Chỉ số âm sẽ đếm từ cuối list. Chỉ số phải nằm trong phạm vi list.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"list","type":"list","defaultValue":null,"description":"list có thể cập nhật.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"index","type":"Int","defaultValue":null,"description":"Chỉ số phần tử đang tồn tại. Dùng -1 để sửa phần tử cuối.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"},{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị mới cần lưu ở vị trí đó.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. list được cập nhật ngay tại chỗ.","example":"numbers = [12, 12, 21, 3, 2, 1]\nnumbers[4] = 3            # numbers trở thành [12, 12, 21, 3, 3, 1]","aliases":[],"group":"FLOW"},{"key":"class-list-method-destructuring-assignment","kind":"METHOD","parentKey":"class-list","name":"destructuring_assignment","signature":"a, b = list","description":"Bung các phần tử list vào số target tương ứng. Hỗ trợ target lồng nhau, nhưng chưa hỗ trợ starred target như *rest.","behavior":"Bung các phần tử list vào số target tương ứng. Hỗ trợ target lồng nhau, nhưng chưa hỗ trợ starred target như *rest.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"a, b","type":"Targets","defaultValue":null,"description":"Các target nhận giá trị, số lượng phải khớp số phần tử list.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"list","type":"list","defaultValue":null,"description":"list nguồn cần bung giá trị.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Các target nhận phần tử list từ trái sang phải.","example":"point = [500, 900]\nx, y = point","aliases":[],"group":"FLOW"},{"key":"class-list-method-append","kind":"METHOD","parentKey":"class-list","name":"append","signature":"list.append(value, /)","description":"Thêm một phần tử mới vào cuối list.","behavior":"Thêm một phần tử mới vào cuối list.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần thêm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. list sẽ được cập nhật ngay tại chỗ.","example":"numbers = [2, 0]\nnumbers.append(3)\nlast = numbers[-1]        # trả về 3","aliases":[],"group":"FLOW"},{"key":"class-list-method-extend","kind":"METHOD","parentKey":"class-list","name":"extend","signature":"list.extend(iterable, /)","description":"Nối từng phần tử từ iterable khác vào cuối list hiện tại.","behavior":"Nối từng phần tử từ iterable khác vào cuối list hiện tại.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn giá trị có các phần tử sẽ được nối thêm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. list sẽ được nối dài ngay tại chỗ.","example":"numbers = [1]\nnumbers.extend([2, 3])\ncount = len(numbers)      # trả về 3","aliases":[],"group":"FLOW"},{"key":"class-list-method-insert","kind":"METHOD","parentKey":"class-list","name":"insert","signature":"list.insert(index, value, /)","description":"Chèn một phần tử vào trước chỉ số đã cho. Chỉ số âm hoặc vượt phạm vi được giới hạn giống Python.","behavior":"Chèn một phần tử vào trước chỉ số đã cho. Chỉ số âm hoặc vượt phạm vi được giới hạn giống Python.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"index","type":"Int","defaultValue":null,"description":"Vị trí mà giá trị sẽ được chèn vào trước đó.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần chèn.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. list được cập nhật ngay tại chỗ.","example":"numbers = [1, 3]\nnumbers.insert(1, 2)      # numbers trở thành [1, 2, 3]","aliases":[],"group":"FLOW"},{"key":"class-list-method-remove","kind":"METHOD","parentKey":"class-list","name":"remove","signature":"list.remove(value, /)","description":"Xóa phần tử đầu tiên có giá trị khớp với giá trị đã cho.","behavior":"Xóa phần tử đầu tiên có giá trị khớp với giá trị đã cho.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần tìm và xóa khỏi list.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Báo ValueError nếu không tìm thấy giá trị.","example":"numbers = [1, 2, 2, 3]\nnumbers.remove(2)         # numbers trở thành [1, 2, 3]","aliases":[],"group":"FLOW"},{"key":"class-list-method-pop","kind":"METHOD","parentKey":"class-list","name":"pop","signature":"list.pop(index=-1, /)","description":"Xóa một phần tử khỏi list rồi trả lại phần tử đó. Nếu bỏ qua chỉ số thì xóa phần tử cuối.","behavior":"Xóa một phần tử khỏi list rồi trả lại phần tử đó. Nếu bỏ qua chỉ số thì xóa phần tử cuối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"index","type":"Int","defaultValue":"-1","description":"Chỉ số tùy chọn cần xóa. Chỉ số âm đếm từ cuối list.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Phần tử đã bị xóa. Báo IndexError nếu list rỗng hoặc chỉ số nằm ngoài list.","example":"numbers = [2, 0, 3]\nremoved = numbers.pop()   # trả về 3\nfirst = numbers.pop(0)    # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-list-method-clear","kind":"METHOD","parentKey":"class-list","name":"clear","signature":"list.clear()","description":"Xóa toàn bộ phần tử trong list.","behavior":"Xóa toàn bộ phần tử trong list.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không trả về trực tiếp. list sẽ trở thành rỗng.","example":"numbers = [2, 0, 3]\nnumbers.clear()\ntext(str(len(numbers)))   # trả về 0","aliases":[],"group":"FLOW"},{"key":"class-list-method-index","kind":"METHOD","parentKey":"class-list","name":"index","signature":"list.index(value, start=0, stop=len(list), /)","description":"Trả về chỉ số đầu tiên có phần tử bằng value trong phạm vi start và stop tùy chọn.","behavior":"Trả về chỉ số đầu tiên có phần tử bằng value trong phạm vi start và stop tùy chọn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần tìm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Biên bắt đầu tùy chọn. Giá trị âm đếm từ cuối list.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(list)","description":"Biên kết thúc tùy chọn. Phần tử tại chỉ số này không được tính.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Chỉ số khớp. Báo ValueError nếu không tìm thấy giá trị.","example":"numbers = [1, 2, 1, 3]\nfirst_one = numbers.index(1)       # trả về 0\nlater_one = numbers.index(1, 1)    # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-list-method-count","kind":"METHOD","parentKey":"class-list","name":"count","signature":"list.count(value, /)","description":"Đếm số phần tử bằng giá trị đã cho.","behavior":"Đếm số phần tử bằng giá trị đã cho.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số phần tử khớp.","example":"numbers = [1, 2, 1, 3]\nones = numbers.count(1)   # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-list-method-sort","kind":"METHOD","parentKey":"class-list","name":"sort","signature":"list.sort(*, key=None, reverse=False)","description":"Sắp xếp list ngay tại chỗ bằng cùng quy tắc sắp xếp ổn định như sorted().","behavior":"Sắp xếp list ngay tại chỗ bằng cùng quy tắc sắp xếp ổn định như sorted().","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Thao tác xử lý giá trị trong luồng gọi. Callable key cũng chạy tại đó và có thể chờ hoặc tạo tác dụng phụ; không có hàm ý thực thi bất đồng bộ."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Callable?","defaultValue":"None","description":"Hàm tùy chọn trả về khóa so sánh cho từng phần tử.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"reverse","type":"Boolean","defaultValue":"False","description":"Khi true, sắp xếp từ lớn đến nhỏ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. list được sắp xếp lại ngay tại chỗ.","example":"numbers = [3, 1, 2]\nnumbers.sort()\ntext(str(numbers))        # trả về [1, 2, 3]","aliases":[],"group":"FLOW"},{"key":"class-list-method-reverse","kind":"METHOD","parentKey":"class-list","name":"reverse","signature":"list.reverse()","description":"Đảo ngược list ngay tại chỗ.","behavior":"Đảo ngược list ngay tại chỗ.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không trả về trực tiếp. Thứ tự list được đảo ngược ngay tại chỗ.","example":"numbers = [1, 2, 3]\nnumbers.reverse()         # numbers trở thành [3, 2, 1]","aliases":[],"group":"FLOW"},{"key":"class-list-method-copy","kind":"METHOD","parentKey":"class-list","name":"copy","signature":"list.copy()","description":"Tạo một bản copy nông của list và bản copy đó vẫn có thể cập nhật.","behavior":"Tạo một bản copy nông của list và bản copy đó vẫn có thể cập nhật.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"Một list mới có thể cập nhật, giữ cùng tham chiếu phần tử.","example":"numbers = [1, 2]\ncopied = numbers.copy()\ncopied.append(3)\ncount = len(numbers)      # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-list-method-for-loop","kind":"METHOD","parentKey":"class-list","name":"for_loop","signature":"for item in list:","description":"Lặp qua từng phần tử theo thứ tự từ trái sang phải.","behavior":"Lặp qua từng phần tử theo thứ tự từ trái sang phải.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"item","type":"Any","defaultValue":null,"description":"Phần tử hiện tại trong vòng lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"list","type":"list","defaultValue":null,"description":"list cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Vòng lặp sẽ chạy phần thân một lần cho mỗi phần tử.","example":"steps = range(1, 4)      # trả về [1, 2, 3]\nfor step in steps:\n    wait(step * 100)      # trả về None","aliases":[],"group":"FLOW"},{"key":"class-list-method-truthy-check","kind":"METHOD","parentKey":"class-list","name":"truthy_check","signature":"if list | if not list","description":"Kiểm tra xem list có ít nhất một phần tử hay không. list rỗng sẽ được xem là false.","behavior":"Kiểm tra xem list có ít nhất một phần tử hay không. list rỗng sẽ được xem là false.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"list","type":"list","defaultValue":null,"description":"list được dùng trong điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean condition","returnDescription":"true khi list không rỗng, false khi list rỗng.","example":"numbers = range(0)        # trả về []\nif not numbers:\n    text(\"No items\")      # trả về None","aliases":[],"group":"FLOW"},{"key":"class-tuple","kind":"COLLECTION","parentKey":null,"name":"tuple","signature":"tuple(iterable=(), /)\n(value1, value2, ...)","description":"Collection có thứ tự và chỉ đọc. Dùng tuple literal khi dữ liệu không cần thay đổi sau khi tạo hoặc khi gom giá trị để bung vào nhiều biến.","behavior":"Collection có thứ tự và chỉ đọc. Dùng tuple literal khi dữ liệu không cần thay đổi sau khi tạo hoặc khi gom giá trị để bung vào nhiều biến.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"offset = (0, 1)\nx = offset[0]\ny = offset[1]\nif 1 in offset:\n    text(\"offset ready\")","aliases":[],"group":null},{"key":"class-tuple-creation-method-constructor","kind":"CREATION_METHOD","parentKey":"class-tuple","name":"constructor","signature":"tuple()\ntuple(iterable, /)","description":"Tạo tuple rỗng hoặc sao chép iterable khác thành tuple. Dùng tuple literal cho nhiều giá trị viết trực tiếp.","behavior":"Tạo tuple rỗng hoặc sao chép iterable khác thành tuple. Dùng tuple literal cho nhiều giá trị viết trực tiếp.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":"None","description":"Iterable tùy chọn để sao chép thành tuple.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"tuple","returnDescription":"Một tuple chỉ đọc mới.","example":"coords = (120, 340)\ncopy = tuple(coords)","aliases":[],"group":"FLOW"},{"key":"class-tuple-creation-method-literal","kind":"CREATION_METHOD","parentKey":"class-tuple","name":"literal","signature":"(value1, value2, ...)","description":"Tạo tuple trực tiếp bằng ngoặc tròn và dấu phẩy.","behavior":"Tạo tuple trực tiếp bằng ngoặc tròn và dấu phẩy.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Mỗi phần tử được viết trong ngoặc tuple.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"tuple","returnDescription":"tuple mới giữ nguyên thứ tự literal.","example":"offset = (0, 1)\nclick(Point(500, 900), offset=offset)","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-length","kind":"METHOD","parentKey":"class-tuple","name":"length","signature":"len(tuple, /)","description":"Đếm số phần tử trong tuple.","behavior":"Đếm số phần tử trong tuple.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"tuple","type":"tuple","defaultValue":null,"description":"tuple cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số phần tử trong tuple.","example":"offset = (0, 1)\ncount = len(offset)      # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-index-access","kind":"METHOD","parentKey":"class-tuple","name":"index_access","signature":"tuple[index]","description":"Đọc phần tử tuple theo chỉ số. Chỉ số âm sẽ đếm từ cuối tuple.","behavior":"Đọc phần tử tuple theo chỉ số. Chỉ số âm sẽ đếm từ cuối tuple.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"tuple","type":"tuple","defaultValue":null,"description":"tuple nguồn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"index","type":"Int","defaultValue":null,"description":"Chỉ số phần tử. Dùng -1 để lấy phần tử cuối.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Phần tử tuple tại chỉ số, hoặc None nếu vượt phạm vi.","example":"pair = (10, 20)\nx = pair[0]              # trả về 10\ny = pair[-1]             # trả về 20","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-slice","kind":"METHOD","parentKey":"class-tuple","name":"slice","signature":"tuple[start:end[:step]]","description":"Sao chép một phần tuple bằng slicing kiểu Python. Bỏ trống biên sẽ dùng đầu hoặc cuối tuple; chỉ số âm đếm từ cuối tuple.","behavior":"Sao chép một phần tuple bằng slicing kiểu Python. Bỏ trống biên sẽ dùng đầu hoặc cuối tuple; chỉ số âm đếm từ cuối tuple.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"start","type":"Int","defaultValue":"start of tuple","description":"Chỉ số phần tử đầu tiên được lấy.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"},{"name":"end","type":"Int","defaultValue":"end of tuple","description":"Dừng trước chỉ số phần tử này.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"},{"name":"step","type":"Int","defaultValue":"1","description":"Khoảng cách giữa các phần tử. Không được bằng 0; giá trị âm đọc ngược.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"}],"returnType":"tuple","returnDescription":"Một tuple mới, được giới hạn trong phạm vi hiện có.","example":"values = (0, 1, 2, 3, 4)\nmiddle = values[1:4]     # trả về (1, 2, 3)\nreverse = values[::-1]   # trả về (4, 3, 2, 1, 0)","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-destructuring-assignment","kind":"METHOD","parentKey":"class-tuple","name":"destructuring_assignment","signature":"x, y = tuple","description":"Bung các phần tử tuple vào số target tương ứng. Hỗ trợ target lồng nhau, nhưng chưa hỗ trợ starred target như *rest.","behavior":"Bung các phần tử tuple vào số target tương ứng. Hỗ trợ target lồng nhau, nhưng chưa hỗ trợ starred target như *rest.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"x, y","type":"Targets","defaultValue":null,"description":"Các target nhận giá trị, số lượng phải khớp số phần tử tuple.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"tuple","type":"tuple","defaultValue":null,"description":"tuple nguồn cần bung giá trị.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Các target nhận phần tử tuple từ trái sang phải.","example":"label, (x, y) = (\"target\", (500, 900))","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-index-method","kind":"METHOD","parentKey":"class-tuple","name":"index_method","signature":"tuple.index(value, start=0, stop=len(tuple), /)","description":"Tìm chỉ số phần tử khớp đầu tiên và báo lỗi rõ nếu không có.","behavior":"Tìm chỉ số phần tử khớp đầu tiên và báo lỗi rõ nếu không có.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị bắt buộc phải có trong tuple.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Chỉ số bắt đầu tìm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(tuple)","description":"Chỉ số dừng tìm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Chỉ số phần tử khớp đầu tiên.","example":"pair = (\"farm\", \"pvp\")\nindex = pair.index(\"pvp\")","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-count-method","kind":"METHOD","parentKey":"class-tuple","name":"count_method","signature":"tuple.count(value, /)","description":"Đếm số phần tử tuple khớp giá trị.","behavior":"Đếm số phần tử tuple khớp giá trị.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số lần khớp.","example":"pair = (\"farm\", \"farm\", \"pvp\")\ncount = pair.count(\"farm\")","aliases":[],"group":"FLOW"},{"key":"class-tuple-method-for-loop","kind":"METHOD","parentKey":"class-tuple","name":"for_loop","signature":"for item in tuple:","description":"Lặp qua từng phần tử tuple từ trái sang phải.","behavior":"Lặp qua từng phần tử tuple từ trái sang phải.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"item","type":"Any","defaultValue":null,"description":"Phần tử tuple hiện tại trong vòng lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"tuple","type":"tuple","defaultValue":null,"description":"tuple cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về trực tiếp.","example":"offset = (0, 1)\nfor item in offset:\n    text(str(item))","aliases":[],"group":"FLOW"},{"key":"class-set","kind":"COLLECTION","parentKey":null,"name":"set","signature":"set(iterable=None, /)","description":"Collection có thể cập nhật và chỉ giữ các giá trị không trùng nhau. CogniTab giữ thứ tự lặp ổn định để output script dễ đọc.","behavior":"Collection có thể cập nhật và chỉ giữ các giá trị không trùng nhau. CogniTab giữ thứ tự lặp ổn định để output script dễ đọc.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"seen = {1, 2, 2}\nseen.add(3)\n\nif 2 in seen:\n    text(str(seen))","aliases":[],"group":null},{"key":"class-set-creation-method-constructor","kind":"CREATION_METHOD","parentKey":"class-set","name":"constructor","signature":"set()\nset(iterable, /)","description":"Tạo set rỗng hoặc gom các giá trị không trùng từ iterable khác, bao gồm generator expression.","behavior":"Tạo set rỗng hoặc gom các giá trị không trùng từ iterable khác, bao gồm generator expression.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":"None","description":"Nguồn giá trị tùy chọn để gom vào set mới và loại phần tử trùng.","suggestAsNamedArg":true,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"set","returnDescription":"Một set mới có thể cập nhật.","example":"seen = set()\nunique = set([1, 2, 2, 3])","aliases":[],"group":"FLOW"},{"key":"class-set-creation-method-literal","kind":"CREATION_METHOD","parentKey":"class-set","name":"literal","signature":"{1, 2, 3}","description":"Tạo set literal ngay trong dòng. Dùng dict() hoặc {} cho dictionary rỗng; dùng set() cho set rỗng.","behavior":"Tạo set literal ngay trong dòng. Dùng dict() hoặc {} cho dictionary rỗng; dùng set() cho set rỗng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Mỗi giá trị được viết bên trong cặp ngoặc nhọn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"set","returnDescription":"Một set mới có thể cập nhật và chỉ giữ một bản của mỗi giá trị.","example":"unique = {1, 2, 2, 3}\ntext(str(unique))        # trả về {1, 2, 3}","aliases":[],"group":"FLOW"},{"key":"class-set-creation-method-comprehension","kind":"CREATION_METHOD","parentKey":"class-set","name":"comprehension","signature":"{expr for target in iterable if condition}","description":"Tạo set bằng cách lặp qua iterable và giữ các giá trị đã tính không trùng nhau. Có thể dùng nhiều mệnh đề for/if.","behavior":"Tạo set bằng cách lặp qua iterable và giữ các giá trị đã tính không trùng nhau. Có thể dùng nhiều mệnh đề for/if.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"expr","type":"Any?","defaultValue":null,"description":"Giá trị được tính cho mỗi phần tử đạt điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"target","type":"Name | destructuring target","defaultValue":null,"description":"Target nhận phần tử hiện tại. Chưa hỗ trợ starred target.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn giá trị cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"condition","type":"Boolean","defaultValue":"True","description":"Bộ lọc tùy chọn, được kiểm tra trước khi thêm giá trị.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"}],"returnType":"set","returnDescription":"Một set mới có thể cập nhật.","example":"values = [1, 2, 3, 4, 5]\nremainders = {x % 3 for x in values}","aliases":[],"group":"FLOW"},{"key":"class-set-method-length","kind":"METHOD","parentKey":"class-set","name":"length","signature":"len(set, /)","description":"Đếm số giá trị không trùng đang có trong set.","behavior":"Đếm số giá trị không trùng đang có trong set.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"set","type":"set","defaultValue":null,"description":"set cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số giá trị trong set.","example":"values = {1, 2, 2}\ncount = len(values)      # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-set-method-membership-operator","kind":"METHOD","parentKey":"class-set","name":"membership_operator","signature":"value in set","description":"Kiểm tra một giá trị có tồn tại trong set hay không.","behavior":"Kiểm tra một giá trị có tồn tại trong set hay không.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần kiểm tra.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"set","type":"set","defaultValue":null,"description":"set dùng để kiểm tra membership.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true khi giá trị tồn tại, ngược lại false.","example":"values = {1, 2, 3}\nif 2 in values:\n    text(\"ready\")","aliases":[],"group":"FLOW"},{"key":"class-set-method-add-method","kind":"METHOD","parentKey":"class-set","name":"add_method","signature":"set.add(value, /)","description":"Thêm một giá trị vào set. Giá trị đã có sẵn chỉ được giữ một lần.","behavior":"Thêm một giá trị vào set. Giá trị đã có sẵn chỉ được giữ một lần.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần thêm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. set được cập nhật ngay tại chỗ.","example":"seen = set()\nseen.add(\"home\")","aliases":[],"group":"FLOW"},{"key":"class-set-method-discard-method","kind":"METHOD","parentKey":"class-set","name":"discard_method","signature":"set.discard(value, /)","description":"Xóa giá trị nếu đang tồn tại. Giá trị không có trong set sẽ được bỏ qua.","behavior":"Xóa giá trị nếu đang tồn tại. Giá trị không có trong set sẽ được bỏ qua.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần xóa nếu đang có.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. set có thể được cập nhật ngay tại chỗ.","example":"seen = {\"home\", \"shop\"}\nseen.discard(\"shop\")","aliases":[],"group":"FLOW"},{"key":"class-set-method-remove-method","kind":"METHOD","parentKey":"class-set","name":"remove_method","signature":"set.remove(value, /)","description":"Xóa một giá trị đang tồn tại. Nếu thiếu giá trị, runtime sẽ báo lỗi để lỗi script không bị ẩn.","behavior":"Xóa một giá trị đang tồn tại. Nếu thiếu giá trị, runtime sẽ báo lỗi để lỗi script không bị ẩn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị bắt buộc phải tồn tại trong set.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. set được cập nhật ngay tại chỗ.","example":"seen = {\"home\", \"shop\"}\nseen.remove(\"home\")","aliases":[],"group":"FLOW"},{"key":"class-set-method-pop-method","kind":"METHOD","parentKey":"class-set","name":"pop_method","signature":"set.pop()","description":"Xóa và trả về một giá trị trong set. Set rỗng sẽ báo lỗi runtime.","behavior":"Xóa và trả về một giá trị trong set. Set rỗng sẽ báo lỗi runtime.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Any?","returnDescription":"Giá trị đã bị xóa.","example":"seen = {\"home\", \"shop\"}\nvalue = seen.pop()","aliases":[],"group":"FLOW"},{"key":"class-set-method-update-method","kind":"METHOD","parentKey":"class-set","name":"update_method","signature":"set.update(*iterables)","description":"Thêm giá trị từ một hoặc nhiều iterable vào set.","behavior":"Thêm giá trị từ một hoặc nhiều iterable vào set.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterables","type":"Iterable","defaultValue":null,"description":"Các nguồn cần thêm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. set được cập nhật ngay tại chỗ.","example":"seen = {\"home\"}\nseen.update([\"shop\", \"home\"])","aliases":[],"group":"FLOW"},{"key":"class-set-method-union-method","kind":"METHOD","parentKey":"class-set","name":"union_method","signature":"set.union(*iterables)","description":"Trả về set mới gồm giá trị từ set này và các iterable đã truyền.","behavior":"Trả về set mới gồm giá trị từ set này và các iterable đã truyền.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterables","type":"Iterable","defaultValue":null,"description":"Các nguồn cần gộp.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"}],"returnType":"set","returnDescription":"Bản sao set đã gộp.","example":"a = {\"home\"}\nb = a.union([\"shop\"])","aliases":[],"group":"FLOW"},{"key":"class-set-method-intersection-method","kind":"METHOD","parentKey":"class-set","name":"intersection_method","signature":"set.intersection(*iterables)","description":"Trả về set mới gồm các giá trị cũng có trong mọi iterable đã truyền.","behavior":"Trả về set mới gồm các giá trị cũng có trong mọi iterable đã truyền.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterables","type":"Iterable","defaultValue":null,"description":"Các nguồn cần so sánh.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"}],"returnType":"set","returnDescription":"Bản sao set phần giao.","example":"a = {\"home\", \"shop\"}\nb = a.intersection([\"shop\"])","aliases":[],"group":"FLOW"},{"key":"class-set-method-difference-method","kind":"METHOD","parentKey":"class-set","name":"difference_method","signature":"set.difference(*iterables)","description":"Trả về set mới sau khi loại các giá trị có trong iterable đã truyền.","behavior":"Trả về set mới sau khi loại các giá trị có trong iterable đã truyền.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterables","type":"Iterable","defaultValue":null,"description":"Các nguồn cần trừ.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"}],"returnType":"set","returnDescription":"Bản sao set sau khi trừ.","example":"a = {\"home\", \"shop\"}\nb = a.difference([\"home\"])","aliases":[],"group":"FLOW"},{"key":"class-set-method-copy-method","kind":"METHOD","parentKey":"class-set","name":"copy_method","signature":"set.copy()","description":"Sao chép set thành một set mới có thể cập nhật.","behavior":"Sao chép set thành một set mới có thể cập nhật.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"set","returnDescription":"Một set mới có cùng các giá trị.","example":"seen = {1, 2}\ncopied = seen.copy()","aliases":[],"group":"FLOW"},{"key":"class-set-method-clear-method","kind":"METHOD","parentKey":"class-set","name":"clear_method","signature":"set.clear()","description":"Xóa toàn bộ giá trị trong set.","behavior":"Xóa toàn bộ giá trị trong set.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không trả về trực tiếp. set sẽ trở thành rỗng.","example":"seen = {1, 2}\nseen.clear()","aliases":[],"group":"FLOW"},{"key":"class-set-method-for-loop","kind":"METHOD","parentKey":"class-set","name":"for_loop","signature":"for value in set:","description":"Lặp qua các giá trị theo thứ tự thêm vào ổn định.","behavior":"Lặp qua các giá trị theo thứ tự thêm vào ổn định.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị set hiện tại trong vòng lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"set","type":"set","defaultValue":null,"description":"set cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Vòng lặp chạy một lần cho mỗi giá trị.","example":"values = {\"home\", \"shop\"}\nfor value in values:\n    text(value)","aliases":[],"group":"FLOW"},{"key":"class-set-method-truthy-check","kind":"METHOD","parentKey":"class-set","name":"truthy_check","signature":"if set | if not set","description":"Kiểm tra set có ít nhất một giá trị hay không. set rỗng được xem là false.","behavior":"Kiểm tra set có ít nhất một giá trị hay không. set rỗng được xem là false.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"set","type":"set","defaultValue":null,"description":"set được dùng trong điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean condition","returnDescription":"true khi set không rỗng, false khi set rỗng.","example":"seen = set()\nif not seen:\n    text(\"empty\")","aliases":[],"group":"FLOW"},{"key":"class-dict","kind":"COLLECTION","parentKey":null,"name":"dict","signature":"dict(mapping_or_pairs=(), /, **items)","description":"Tập hợp key/value giữ thứ tự thêm vào và có thể đọc hoặc cập nhật khi kịch bản đang chạy.","behavior":"Tập hợp key/value giữ thứ tự thêm vào và có thể đọc hoặc cập nhật khi kịch bản đang chạy.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"settings = dict(mode=\"farm\", retries=3)\nmode = settings.get(\"mode\")   # trả về farm\nkeys = settings.keys()\n\nfor key in settings:\n    text(str(settings[key]))   # trả về None","aliases":[],"group":null},{"key":"class-dict-creation-method-constructor","kind":"CREATION_METHOD","parentKey":"class-dict","name":"constructor","signature":"dict()\ndict(mapping_or_pairs, /)\ndict(key=value, ...)","description":"Tạo dictionary rỗng, copy mapping hoặc iterable các cặp, hoặc tạo entry từ keyword argument.","behavior":"Tạo dictionary rỗng, copy mapping hoặc iterable các cặp, hoặc tạo entry từ keyword argument.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"mapping_or_pairs","type":"dict | Iterable","defaultValue":"None","description":"Mapping hoặc iterable các cặp hai phần tử để copy.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"},{"name":"key=value","type":"Any?","defaultValue":null,"description":"Các entry keyword được thêm sau mapping nguồn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"variadic"}],"returnType":"dict","returnDescription":"Một dictionary mới có thể cập nhật.","example":"settings = dict(mode=\"farm\", retries=3)\ncopied = dict(settings)\nfrom_pairs = dict([(\"mode\", \"pvp\")])","aliases":[],"group":"FLOW"},{"key":"class-dict-creation-method-literal","kind":"CREATION_METHOD","parentKey":"class-dict","name":"literal","signature":"{\"mode\": \"farm\", \"retries\": 3}","description":"Tạo dictionary với giá trị kiểu chuỗi, số, boolean, hoặc object.","behavior":"Tạo dictionary với giá trị kiểu chuỗi, số, boolean, hoặc object.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"String","defaultValue":null,"description":"Key của dict.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị được lưu cho key đó.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"dict","returnDescription":"dict mới giữ nguyên thứ tự các cặp key/value trong literal.","example":"settings = {\n    \"mode\": \"farm\",\n    \"retries\": 3,\n    \"enabled\": True\n}","aliases":[],"group":"FLOW"},{"key":"class-dict-creation-method-comprehension","kind":"CREATION_METHOD","parentKey":"class-dict","name":"comprehension","signature":"{key: value for target in iterable if condition}","description":"Tạo dictionary từ iterable và giữ thứ tự thêm key. Có thể dùng nhiều mệnh đề for/if.","behavior":"Tạo dictionary từ iterable và giữ thứ tự thêm key. Có thể dùng nhiều mệnh đề for/if.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key được tính cho mỗi phần tử đạt điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị được lưu cho key đó.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"target","type":"Name | destructuring target","defaultValue":null,"description":"Target nhận phần tử hiện tại. Chưa hỗ trợ starred target.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn giá trị cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"condition","type":"Boolean","defaultValue":"True","description":"Bộ lọc tùy chọn, được kiểm tra trước khi lưu entry.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"}],"returnType":"dict","returnDescription":"Một dictionary mới có thể cập nhật.","example":"pairs = [(\"mode\", \"farm\"), (\"retries\", 3)]\nsettings = {key: value for key, value in pairs}","aliases":[],"group":"FLOW"},{"key":"class-dict-method-key-access","kind":"METHOD","parentKey":"class-dict","name":"key_access","signature":"dictionary[\"key\"]","description":"Đọc một giá trị theo key. Nếu thiếu key thì trả về None.","behavior":"Đọc một giá trị theo key. Nếu thiếu key thì trả về None.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"dictionary","type":"dict","defaultValue":null,"description":"dict nguồn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"key","type":"Any","defaultValue":null,"description":"Key cần tra cứu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Any?","returnDescription":"Giá trị đã lưu cho key đó, hoặc None nếu không có key.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nmode = settings[\"mode\"]        # trả về farm\nmissing = settings[\"unknown\"]  # trả về None","aliases":[],"group":"FLOW"},{"key":"class-dict-method-key-assignment","kind":"METHOD","parentKey":"class-dict","name":"key_assignment","signature":"dictionary[key] = value","description":"Ghi mới hoặc thay thế một cặp key/value bằng cú pháp gán trong ngoặc vuông.","behavior":"Ghi mới hoặc thay thế một cặp key/value bằng cú pháp gán trong ngoặc vuông.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"dictionary","type":"dict","defaultValue":null,"description":"dict có thể cập nhật.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"key","type":"Any","defaultValue":null,"description":"Key cần ghi mới hoặc thay thế.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"},{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần lưu cho key đó.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. dict được cập nhật ngay tại chỗ.","example":"settings = {\"mode\": \"farm\"}\nsettings[\"mode\"] = \"pvp","aliases":[],"group":"FLOW"},{"key":"class-dict-method-length","kind":"METHOD","parentKey":"class-dict","name":"length","signature":"len(dictionary, /)","description":"Đếm xem dictionary có bao nhiêu cặp key/value.","behavior":"Đếm xem dictionary có bao nhiêu cặp key/value.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"dictionary","type":"dict","defaultValue":null,"description":"dict cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số phần tử có trong dictionary.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\ncount = len(settings)          # trả về 2","aliases":[],"group":"FLOW"},{"key":"class-dict-method-get-method","kind":"METHOD","parentKey":"class-dict","name":"get_method","signature":"dictionary.get(key, default=None, /)","description":"Đọc giá trị theo key và có thể dùng giá trị mặc định nếu thiếu key.","behavior":"Đọc giá trị theo key và có thể dùng giá trị mặc định nếu thiếu key.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần tra cứu.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"default","type":"Any?","defaultValue":"None","description":"Giá trị dự phòng được trả về khi thiếu key.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Giá trị đã lưu cho key đó, hoặc giá trị mặc định đã truyền vào.","example":"settings = {\"mode\": \"farm\"}\nmode = settings.get(\"mode\")           # trả về farm\nretry = settings.get(\"retries\", 0)    # trả về 0","aliases":[],"group":"FLOW"},{"key":"class-dict-method-items-method","kind":"METHOD","parentKey":"class-dict","name":"items_method","signature":"dictionary.items()","description":"Lấy các cặp key/value thành list tuple hai phần tử theo thứ tự thêm.","behavior":"Lấy các cặp key/value thành list tuple hai phần tử theo thứ tự thêm.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"List các tuple (key, value).","example":"settings = {\"mode\": \"farm\"}\npairs = settings.items()","aliases":[],"group":"FLOW"},{"key":"class-dict-method-pop-method","kind":"METHOD","parentKey":"class-dict","name":"pop_method","signature":"dictionary.pop(key, default=None, /)","description":"Xóa một key và trả về value của key đó, hoặc trả về default khi thiếu.","behavior":"Xóa một key và trả về value của key đó, hoặc trả về default khi thiếu.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần xóa.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"default","type":"Any?","defaultValue":"None","description":"Giá trị dự phòng trả về khi thiếu key.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Giá trị đã xóa hoặc default dự phòng.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nremoved = settings.pop(\"retries\")","aliases":[],"group":"FLOW"},{"key":"class-dict-method-copy-method","kind":"METHOD","parentKey":"class-dict","name":"copy_method","signature":"dictionary.copy()","description":"Sao chép dictionary thành một dict mới có thể cập nhật.","behavior":"Sao chép dictionary thành một dict mới có thể cập nhật.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict mới có cùng các entry.","example":"settings = {\"mode\": \"farm\"}\ncopied = settings.copy()","aliases":[],"group":"FLOW"},{"key":"class-dict-method-update-method","kind":"METHOD","parentKey":"class-dict","name":"update_method","signature":"dictionary.update(other=(), /, **items)","description":"Cập nhật dict này từ mapping khác, iterable các cặp, và keyword entry.","behavior":"Cập nhật dict này từ mapping khác, iterable các cặp, và keyword entry.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"dict | Iterable","defaultValue":"None","description":"Mapping hoặc các cặp cần gộp.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"items","type":"Any?","defaultValue":null,"description":"Các entry keyword cần ghi.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. dict được cập nhật ngay tại chỗ.","example":"settings = {\"mode\": \"farm\"}\nsettings.update([(\"retries\", 3)], mode=\"pvp\")","aliases":[],"group":"FLOW"},{"key":"class-dict-method-setdefault-method","kind":"METHOD","parentKey":"class-dict","name":"setdefault_method","signature":"dictionary.setdefault(key, default=None, /)","description":"Trả về value đang có, hoặc lưu rồi trả về default khi thiếu key.","behavior":"Trả về value đang có, hoặc lưu rồi trả về default khi thiếu key.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần đọc hoặc tạo.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"default","type":"Any?","defaultValue":"None","description":"Giá trị được lưu khi chưa có key.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Value đang có hoặc default vừa thêm.","example":"settings = dict()\nmode = settings.setdefault(\"mode\", \"farm\")","aliases":[],"group":"FLOW"},{"key":"class-dict-method-keys-method","kind":"METHOD","parentKey":"class-dict","name":"keys_method","signature":"dictionary.keys()","description":"Lấy các key của dictionary thành một list theo đúng thứ tự đã thêm.","behavior":"Lấy các key của dictionary thành một list theo đúng thứ tự đã thêm.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"Một list các key.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nkeys = settings.keys()\nfirst_key = keys[0]                 # trả về mode","aliases":[],"group":"FLOW"},{"key":"class-dict-method-values-method","kind":"METHOD","parentKey":"class-dict","name":"values_method","signature":"dictionary.values()","description":"Lấy các value của dictionary thành một list theo đúng thứ tự đã thêm.","behavior":"Lấy các value của dictionary thành một list theo đúng thứ tự đã thêm.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"Một list các value.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nvalues = settings.values()\nlast_value = values[-1]             # trả về 3","aliases":[],"group":"FLOW"},{"key":"class-dict-method-clear-method","kind":"METHOD","parentKey":"class-dict","name":"clear_method","signature":"dictionary.clear()","description":"Xóa toàn bộ cặp key/value trong dictionary.","behavior":"Xóa toàn bộ cặp key/value trong dictionary.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không trả về trực tiếp. dict sẽ trở thành rỗng.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nsettings.clear()\ntext(str(len(settings)))   # trả về 0","aliases":[],"group":"FLOW"},{"key":"class-dict-method-for-loop","kind":"METHOD","parentKey":"class-dict","name":"for_loop","signature":"for key in dictionary:","description":"Lặp qua các key của dictionary theo đúng thứ tự đã viết trong literal.","behavior":"Lặp qua các key của dictionary theo đúng thứ tự đã viết trong literal.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key hiện tại trong vòng lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"dictionary","type":"dict","defaultValue":null,"description":"dict cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Vòng lặp chạy một lần cho mỗi key.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nfor key in settings:\n    text(str(settings[key]))   # trả về None","aliases":[],"group":"FLOW"},{"key":"class-dict-method-truthy-check","kind":"METHOD","parentKey":"class-dict","name":"truthy_check","signature":"if dictionary | if not dictionary","description":"Kiểm tra xem dictionary có ít nhất một phần tử hay không. dict rỗng sẽ được xem là false.","behavior":"Kiểm tra xem dictionary có ít nhất một phần tử hay không. dict rỗng sẽ được xem là false.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"dictionary","type":"dict","defaultValue":null,"description":"dict được dùng trong điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean condition","returnDescription":"true khi dictionary không rỗng, false khi dictionary rỗng.","example":"settings = {}\nif not settings:\n    text(\"No settings\")       # trả về None","aliases":[],"group":"FLOW"},{"key":"class-string","kind":"COLLECTION","parentKey":null,"name":"String","signature":"String","description":"Collection kiểu văn bản. Tạo bằng string literal hoặc str(value), rồi đọc bằng len/index/vòng lặp.","behavior":"Collection kiểu văn bản. Tạo bằng string literal hoặc str(value), rồi đọc bằng len/index/vòng lặp.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"name = \"Start\"\nif name:\n    first_char = name[0]\n    text(first_char)","aliases":[],"group":null},{"key":"class-string-creation-method-literal","kind":"CREATION_METHOD","parentKey":"class-string","name":"literal","signature":"\"hello\"","description":"Tạo chuỗi trực tiếp bằng dấu nháy đơn hoặc nháy kép.","behavior":"Tạo chuỗi trực tiếp bằng dấu nháy đơn hoặc nháy kép.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"text","type":"String","defaultValue":null,"description":"Nội dung chuỗi đặt trong dấu nháy.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"String","returnDescription":"Một giá trị chuỗi mới.","example":"label = \"Start\"\ntext(label)","aliases":[],"group":"FLOW"},{"key":"class-string-creation-method-cast","kind":"CREATION_METHOD","parentKey":"class-string","name":"cast","signature":"str(value, /)","description":"Chuyển số, boolean, hoặc giá trị khác thành chuỗi. Giá trị có cấu trúc quá lớn hoặc lồng quá sâu dùng preview hữu hạn với marker báo phần bị lược, còn chuỗi truyền trực tiếp vẫn được giữ nguyên.","behavior":"Chuyển số, boolean, hoặc giá trị khác thành chuỗi. Giá trị có cấu trúc quá lớn hoặc lồng quá sâu dùng preview hữu hạn với marker báo phần bị lược, còn chuỗi truyền trực tiếp vẫn được giữ nguyên.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần chuyển sang chuỗi.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Giá trị chuỗi sau khi chuyển đổi.","example":"attempt = 3\nline = str(attempt)","aliases":[],"group":"FLOW"},{"key":"class-string-method-length","kind":"METHOD","parentKey":"class-string","name":"length","signature":"len(string, /)","description":"Đếm số ký tự đang có trong chuỗi.","behavior":"Đếm số ký tự đang có trong chuỗi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"string","type":"String","defaultValue":null,"description":"Giá trị chuỗi cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số lượng ký tự.","example":"label = \"Play\"\ncount = len(label)        # trả về 4","aliases":[],"group":"FLOW"},{"key":"class-string-method-index-access","kind":"METHOD","parentKey":"class-string","name":"index_access","signature":"string[index]","description":"Đọc một ký tự theo chỉ số. Chỉ số âm sẽ đếm từ cuối chuỗi.","behavior":"Đọc một ký tự theo chỉ số. Chỉ số âm sẽ đếm từ cuối chuỗi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"string","type":"String","defaultValue":null,"description":"Chuỗi nguồn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"index","type":"Int","defaultValue":null,"description":"Chỉ số ký tự. Dùng -1 để lấy ký tự cuối.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"String?","returnDescription":"Chuỗi 1 ký tự, hoặc None nếu vượt phạm vi.","example":"label = \"Play\"\nfirst = label[0]          # trả về 'P'\nlast = label[-1]          # trả về 'y'","aliases":[],"group":"FLOW"},{"key":"class-string-method-slice","kind":"METHOD","parentKey":"class-string","name":"slice","signature":"string[start:end[:step]]","description":"Sao chép một đoạn chuỗi bằng slicing kiểu Python. Bỏ trống biên sẽ dùng đầu hoặc cuối chuỗi; chỉ số âm đếm từ cuối chuỗi.","behavior":"Sao chép một đoạn chuỗi bằng slicing kiểu Python. Bỏ trống biên sẽ dùng đầu hoặc cuối chuỗi; chỉ số âm đếm từ cuối chuỗi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"start","type":"Int","defaultValue":"start of string","description":"Chỉ số ký tự đầu tiên được lấy.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"},{"name":"end","type":"Int","defaultValue":"end of string","description":"Dừng trước chỉ số ký tự này.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"},{"name":"step","type":"Int","defaultValue":"1","description":"Khoảng cách giữa các ký tự. Không được bằng 0; giá trị âm đọc ngược.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Một đoạn chuỗi mới, được giới hạn trong phạm vi hiện có.","example":"label = \"abcdef\"\nmiddle = label[1:4]       # trả về 'bcd'\ntail = label[-3:]         # trả về 'def'\nreverse = label[::-1]     # trả về 'fedcba'","aliases":[],"group":"FLOW"},{"key":"class-string-method-lower-method","kind":"METHOD","parentKey":"class-string","name":"lower_method","signature":"string.lower()","description":"Trả về bản sao chuỗi viết thường.","behavior":"Trả về bản sao chuỗi viết thường.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"String","returnDescription":"Chuỗi viết thường.","example":"label = \"PLAY\"\ntext(label.lower())","aliases":[],"group":"FLOW"},{"key":"class-string-method-upper-method","kind":"METHOD","parentKey":"class-string","name":"upper_method","signature":"string.upper()","description":"Trả về bản sao chuỗi viết hoa.","behavior":"Trả về bản sao chuỗi viết hoa.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"String","returnDescription":"Chuỗi viết hoa.","example":"label = \"play\"\ntext(label.upper())","aliases":[],"group":"FLOW"},{"key":"class-string-method-strip-method","kind":"METHOD","parentKey":"class-string","name":"strip_method","signature":"string.strip(chars=None, /)","description":"Cắt khoảng trắng, hoặc các ký tự đã truyền, ở hai đầu chuỗi.","behavior":"Cắt khoảng trắng, hoặc các ký tự đã truyền, ở hai đầu chuỗi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"chars","type":"String?","defaultValue":"None","description":"Các ký tự cần cắt thay cho khoảng trắng.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Chuỗi sau khi cắt.","example":"label = \"  Play  \"\nclean = label.strip()","aliases":[],"group":"FLOW"},{"key":"class-string-method-lstrip-method","kind":"METHOD","parentKey":"class-string","name":"lstrip_method","signature":"string.lstrip(chars=None, /)","description":"Cắt khoảng trắng, hoặc các ký tự đã truyền, ở đầu bên trái.","behavior":"Cắt khoảng trắng, hoặc các ký tự đã truyền, ở đầu bên trái.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"chars","type":"String?","defaultValue":"None","description":"Các ký tự cần cắt thay cho khoảng trắng.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Chuỗi sau khi cắt bên trái.","example":"label = \"...Play\"\nclean = label.lstrip(\".\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-rstrip-method","kind":"METHOD","parentKey":"class-string","name":"rstrip_method","signature":"string.rstrip(chars=None, /)","description":"Cắt khoảng trắng, hoặc các ký tự đã truyền, ở đầu bên phải.","behavior":"Cắt khoảng trắng, hoặc các ký tự đã truyền, ở đầu bên phải.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"chars","type":"String?","defaultValue":"None","description":"Các ký tự cần cắt thay cho khoảng trắng.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Chuỗi sau khi cắt bên phải.","example":"label = \"Play...\"\nclean = label.rstrip(\".\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-startswith-method","kind":"METHOD","parentKey":"class-string","name":"startswith_method","signature":"string.startswith(prefix, start=0, stop=len(string), /)","description":"Kiểm tra đoạn chuỗi đã chọn có bắt đầu bằng tiền tố hay không.","behavior":"Kiểm tra đoạn chuỗi đã chọn có bắt đầu bằng tiền tố hay không.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"prefix","type":"String","defaultValue":null,"description":"Tiền tố cần kiểm tra.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Chỉ số bắt đầu để kiểm tra.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(string)","description":"Chỉ số dừng để kiểm tra.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"true khi tiền tố khớp.","example":"label = \"Play\"\nready = label.startswith(\"Pl\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-endswith-method","kind":"METHOD","parentKey":"class-string","name":"endswith_method","signature":"string.endswith(suffix, start=0, stop=len(string), /)","description":"Kiểm tra đoạn chuỗi đã chọn có kết thúc bằng hậu tố hay không.","behavior":"Kiểm tra đoạn chuỗi đã chọn có kết thúc bằng hậu tố hay không.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"suffix","type":"String","defaultValue":null,"description":"Hậu tố cần kiểm tra.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Chỉ số bắt đầu để kiểm tra.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(string)","description":"Chỉ số dừng để kiểm tra.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"true khi hậu tố khớp.","example":"label = \"Play\"\nready = label.endswith(\"ay\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-find-method","kind":"METHOD","parentKey":"class-string","name":"find_method","signature":"string.find(sub, start=0, stop=len(string), /)","description":"Tìm chỉ số xuất hiện đầu tiên của chuỗi con, hoặc trả về -1 nếu không có.","behavior":"Tìm chỉ số xuất hiện đầu tiên của chuỗi con, hoặc trả về -1 nếu không có.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sub","type":"String","defaultValue":null,"description":"Chuỗi con cần tìm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Chỉ số bắt đầu tìm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(string)","description":"Chỉ số dừng tìm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Chỉ số khớp đầu tiên, hoặc -1.","example":"label = \"start button\"\nindex = label.find(\"button\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-index-method","kind":"METHOD","parentKey":"class-string","name":"index_method","signature":"string.index(sub, start=0, stop=len(string), /)","description":"Tìm chỉ số xuất hiện đầu tiên của chuỗi con và báo lỗi rõ nếu không có.","behavior":"Tìm chỉ số xuất hiện đầu tiên của chuỗi con và báo lỗi rõ nếu không có.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sub","type":"String","defaultValue":null,"description":"Chuỗi con bắt buộc phải tồn tại.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Chỉ số bắt đầu tìm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(string)","description":"Chỉ số dừng tìm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Chỉ số khớp đầu tiên.","example":"label = \"start button\"\nindex = label.index(\"button\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-replace-method","kind":"METHOD","parentKey":"class-string","name":"replace_method","signature":"string.replace(old, new, count=-1, /)","description":"Trả về bản sao với các lần xuất hiện của chuỗi cũ được thay thế.","behavior":"Trả về bản sao với các lần xuất hiện của chuỗi cũ được thay thế.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"old","type":"String","defaultValue":null,"description":"Chuỗi cần thay.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"new","type":"String","defaultValue":null,"description":"Chuỗi thay thế.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"count","type":"Int","defaultValue":"-1","description":"Số lần thay tối đa; số âm nghĩa là tất cả.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Bản sao chuỗi sau khi thay.","example":"label = \"start start\"\nonce = label.replace(\"start\", \"play\", 1)","aliases":[],"group":"FLOW"},{"key":"class-string-method-split-method","kind":"METHOD","parentKey":"class-string","name":"split_method","signature":"string.split(sep=None, maxsplit=-1, /)","description":"Tách chuỗi thành list các phần văn bản.","behavior":"Tách chuỗi thành list các phần văn bản.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sep","type":"String?","defaultValue":"None","description":"Chuỗi phân tách. None sẽ tách theo khoảng trắng.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"maxsplit","type":"Int","defaultValue":"-1","description":"Số lần tách tối đa; số âm nghĩa là tất cả.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"list","returnDescription":"List các phần chuỗi.","example":"raw = \"a,b,c\"\nparts = raw.split(\",\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-join-method","kind":"METHOD","parentKey":"class-string","name":"join_method","signature":"string.join(iterable, /)","description":"Nối một iterable các chuỗi bằng chính chuỗi này làm dấu phân tách.","behavior":"Nối một iterable các chuỗi bằng chính chuỗi này làm dấu phân tách.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable<String>","defaultValue":null,"description":"Các chuỗi cần nối.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Chuỗi sau khi nối.","example":"parts = [\"a\", \"b\", \"c\"]\nline = \",\".join(parts)","aliases":[],"group":"FLOW"},{"key":"class-string-method-count-method","kind":"METHOD","parentKey":"class-string","name":"count_method","signature":"string.count(sub, start=0, stop=len(string), /)","description":"Đếm số lần xuất hiện không chồng lấn của chuỗi con.","behavior":"Đếm số lần xuất hiện không chồng lấn của chuỗi con.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sub","type":"String","defaultValue":null,"description":"Chuỗi con cần đếm.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int","defaultValue":"0","description":"Chỉ số bắt đầu đếm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(string)","description":"Chỉ số dừng đếm.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số lần xuất hiện.","example":"label = \"banana\"\ncount = label.count(\"an\")","aliases":[],"group":"FLOW"},{"key":"class-string-method-isalpha-method","kind":"METHOD","parentKey":"class-string","name":"isalpha_method","signature":"string.isalpha()","description":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ cái.","behavior":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ cái.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true khi chỉ có chữ cái.","example":"label = \"Play\"\nok = label.isalpha()","aliases":[],"group":"FLOW"},{"key":"class-string-method-isdigit-method","kind":"METHOD","parentKey":"class-string","name":"isdigit_method","signature":"string.isdigit()","description":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ số.","behavior":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true khi chỉ có chữ số.","example":"value = \"123\"\nok = value.isdigit()","aliases":[],"group":"FLOW"},{"key":"class-string-method-isalnum-method","kind":"METHOD","parentKey":"class-string","name":"isalnum_method","signature":"string.isalnum()","description":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ cái hoặc chữ số.","behavior":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ cái hoặc chữ số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true khi chỉ có chữ cái hoặc chữ số.","example":"value = \"A123\"\nok = value.isalnum()","aliases":[],"group":"FLOW"},{"key":"class-string-method-isspace-method","kind":"METHOD","parentKey":"class-string","name":"isspace_method","signature":"string.isspace()","description":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là khoảng trắng.","behavior":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là khoảng trắng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"true khi chỉ có khoảng trắng.","example":"value = \"   \"\nok = value.isspace()","aliases":[],"group":"FLOW"},{"key":"class-string-method-for-loop","kind":"METHOD","parentKey":"class-string","name":"for_loop","signature":"for ch in string:","description":"Lặp từng ký tự từ trái sang phải.","behavior":"Lặp từng ký tự từ trái sang phải.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"ch","type":"String","defaultValue":null,"description":"Ký tự hiện tại trong vòng lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"string","type":"String","defaultValue":null,"description":"Chuỗi cần lặp.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Chạy một lần cho mỗi ký tự.","example":"word = \"Go\"\nfor ch in word:\n    text(ch)","aliases":[],"group":"FLOW"},{"key":"class-string-method-truthy-check","kind":"METHOD","parentKey":"class-string","name":"truthy_check","signature":"if string | if not string","description":"Kiểm tra chuỗi đang rỗng hay có nội dung.","behavior":"Kiểm tra chuỗi đang rỗng hay có nội dung.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"string","type":"String","defaultValue":null,"description":"Chuỗi được dùng trong điều kiện.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean condition","returnDescription":"true khi không rỗng, false khi rỗng.","example":"value = \"\"\nif not value:\n    text(\"empty\")","aliases":[],"group":"FLOW"},{"key":"class-macropanel","kind":"CLASS","parentKey":null,"name":"MacroPanel","signature":"MacroPanel(title=\"\", subtitle=\"\", confirm_text=\"Run\", cancel_text=\"Cancel\", *, version=\"\")","description":"Tạo và hiển thị panel nhập liệu runtime cho tham số macro trong script.","behavior":"Tạo và hiển thị panel nhập liệu runtime cho tham số macro trong script.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":true,"fields":["title","subtitle","version","confirm_text","cancel_text"],"fieldDocs":[{"name":"title","type":"String","defaultValue":"\"\"","description":"Tiêu đề panel. Có thể gán lại sau khi khởi tạo.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"subtitle","type":"String","defaultValue":"\"\"","description":"Phụ đề hoặc mô tả ngắn. Có thể gán lại sau khi khởi tạo.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"version","type":"String","defaultValue":"\"\"","description":"Nhãn version tùy chọn được giữ để tương thích; giá trị nhập của MacroPanel được khôi phục từ Storage và lưu vào Storage theo tên biến, không theo version. Có thể gán lại sau khi khởi tạo.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"confirm_text","type":"String","defaultValue":"\"Run\"","description":"Nhãn nút xác nhận.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"cancel_text","type":"String","defaultValue":"\"Cancel\"","description":"Nhãn nút hủy.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"title","type":"String","defaultValue":"\"\"","description":"Tiêu đề panel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"subtitle","type":"String","defaultValue":"\"\"","description":"Phụ đề hoặc mô tả ngắn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"confirm_text","type":"String","defaultValue":"\"Run\"","description":"Nhãn nút xác nhận.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"cancel_text","type":"String","defaultValue":"\"Cancel\"","description":"Nhãn nút hủy.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"version","type":"String","defaultValue":"\"\"","description":"Nhãn version tùy chọn được giữ để tương thích; giá trị nhập của MacroPanel được khôi phục từ Storage và lưu vào Storage theo tên biến, không theo version.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"panel = MacroPanel(\"Run config\", \"Pick options before run\", confirm_text=\"Start\", cancel_text=\"Back\")\npanel.text(\"<b>Ready?</b>\")\npanel.checkbox(\"safe_mode\", \"Safe mode\", checked=True)\npanel.toggle_switch(\"retry\", \"Auto retry\", checked=False)\npanel.edit_text(\"username\", default=\"player01\", desc=\"Shown below the field\")\npanel.edit_text(\"runs\", \"Runs\", default=\"3\", desc=\"Numbers only\", input_type=\"number\")\npanel.radio_group(\"mode\", [\"farm\", \"pvp\"], default=\"farm\")\npanel.radio_group(\"target\", [\"boss\", \"minion\"], default=\"boss\", dropdown=True)\npanel.slider(\"speed\", min=0, max=100, step=5, default=60)\npanel.stepper(\"retry_count\", min=0, max=10, step=1, default=2)\nvalues = panel.show()","aliases":[],"group":null},{"key":"class-macropanel-static-method-notify","kind":"STATIC_METHOD","parentKey":"class-macropanel","name":"notify","signature":"MacroPanel.notify(text)","description":"Hiển thị hộp thoại thông tin có chặn trong overlay runtime và tiếp tục sau khi người dùng xác nhận. Chuỗi được giữ nguyên; giá trị có cấu trúc dùng cùng formatter dễ đọc như str(value), bao gồm mở rộng nhiều dòng cho dữ liệu lồng nhau.","behavior":"Hiển thị hộp thoại thông tin có chặn trong overlay runtime và tiếp tục sau khi người dùng xác nhận. Chuỗi được giữ nguyên; giá trị có cấu trúc dùng cùng formatter dễ đọc như str(value), bao gồm mở rộng nhiều dòng cho dữ liệu lồng nhau.","execution":{"blocking":"yes","threadSafety":"serialized","parallel":"conditional","details":"Chờ người dùng xác nhận qua khóa prompt chung của runtime. Prompt đồng thời được xử lý tuần tự."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"text","type":"Any","defaultValue":null,"description":"Chuỗi thông báo hoặc giá trị có cấu trúc cần hiển thị.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không có giá trị trả về sau khi người dùng xác nhận.","example":"# Chờ người dùng xác nhận đã đọc thông báo này\nMacroPanel.notify(\"Macro is ready\")","aliases":[],"group":"FLOW"},{"key":"class-macropanel-static-method-error","kind":"STATIC_METHOD","parentKey":"class-macropanel","name":"error","signature":"MacroPanel.error(text)","description":"Dừng script bằng cách ném lỗi runtime. Khi chạy macro, overlay hiển thị một lỗi script chuẩn kèm đường dẫn luồng/action; giá trị có cấu trúc dùng cùng formatter dễ đọc như str(value).","behavior":"Dừng script bằng cách ném lỗi runtime. Khi chạy macro, overlay hiển thị một lỗi script chuẩn kèm đường dẫn luồng/action; giá trị có cấu trúc dùng cùng formatter dễ đọc như str(value).","execution":{"blocking":"no","threadSafety":"serialized","parallel":"no","details":"Phát sinh lỗi script kết thúc; mọi nhánh của lượt Run dừng. Đây không phải prompt chờ xác nhận."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"text","type":"Any","defaultValue":null,"description":"Chuỗi lỗi hoặc giá trị có cấu trúc cần hiển thị.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về; ném lỗi runtime.","example":"# Điều kiện tiên quyết không đạt sẽ kết thúc toàn bộ lượt Run\nif not TfliteModel.exists(\"enemy_detector\"):\n    MacroPanel.error(\"Import enemy_detector in Template Manager\")","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-edit-text","kind":"METHOD","parentKey":"class-macropanel","name":"edit_text","signature":"panel.edit_text(name, label=None, default=\"\", desc=None, input_type=\"text\")","description":"Thêm ô nhập văn bản. Dùng desc để hiện mô tả nhỏ bên dưới ô nhập, và input_type=\"number\" để nhập số trong khi giá trị trả về vẫn là String.","behavior":"Thêm ô nhập văn bản. Dùng desc để hiện mô tả nhỏ bên dưới ô nhập, và input_type=\"number\" để nhập số trong khi giá trị trả về vẫn là String.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên biến trả về trong kết quả panel.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"label","type":"String?","defaultValue":"None","description":"Nhãn hiển thị. Để trống nếu muốn ẩn nhãn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"default","type":"String","defaultValue":"\"\"","description":"Giá trị mặc định.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"desc","type":"String?","defaultValue":"None","description":"Mô tả nhỏ hiển thị bên dưới ô nhập này.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"input_type","type":"String","defaultValue":"\"text\"","description":"Dùng \"text\" để nhập chữ thông thường hoặc \"number\" để nhập số. Giá trị trả về vẫn là String.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.edit_text(\"player\", label=\"Player\", default=\"Guest\")\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-checkbox","kind":"METHOD","parentKey":"class-macropanel","name":"checkbox","signature":"panel.checkbox(name, label=None, checked=False)","description":"Thêm input checkbox.","behavior":"Thêm input checkbox.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên biến.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"label","type":"String?","defaultValue":"None","description":"Nhãn hiển thị. Để trống nếu muốn ẩn nhãn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"checked","type":"Boolean","defaultValue":"False","description":"Trạng thái mặc định.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.checkbox(\"sound\", label=\"Sound\", checked=True)\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-toggle-switch","kind":"METHOD","parentKey":"class-macropanel","name":"toggle_switch","signature":"panel.toggle_switch(name, label=None, checked=False)","description":"Thêm input công tắc bật/tắt.","behavior":"Thêm input công tắc bật/tắt.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên biến.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"label","type":"String?","defaultValue":"None","description":"Nhãn hiển thị. Để trống nếu muốn ẩn nhãn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"checked","type":"Boolean","defaultValue":"False","description":"Trạng thái bật/tắt mặc định.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.toggle_switch(\"enabled\", label=\"Enabled\", checked=True)\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-radio-group","kind":"METHOD","parentKey":"class-macropanel","name":"radio_group","signature":"panel.radio_group(name, options, label=None, default=None, dropdown=False)","description":"Thêm bộ chọn radio-group, hoặc hiển thị dạng dropdown khi dropdown=True.","behavior":"Thêm bộ chọn radio-group, hoặc hiển thị dạng dropdown khi dropdown=True.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên biến.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"options","type":"list[String]","defaultValue":null,"description":"Danh sách lựa chọn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"label","type":"String?","defaultValue":"None","description":"Nhãn hiển thị. Để trống nếu muốn ẩn nhãn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"default","type":"String|Int|None","defaultValue":"None","description":"Nhãn lựa chọn mặc định hoặc chỉ số lựa chọn 0-based; None chọn lựa chọn đầu tiên.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"dropdown","type":"Boolean","defaultValue":"False","description":"Hiển thị bộ chọn này dạng dropdown thay vì các lựa chọn radio.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.radio_group(\"mode\", [\"slow\", \"fast\"], label=\"Mode\", default=\"slow\")\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-slider","kind":"METHOD","parentKey":"class-macropanel","name":"slider","signature":"panel.slider(name, min=0, max=100, step=1, label=None, default=None)","description":"Thêm thanh trượt số.","behavior":"Thêm thanh trượt số.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên biến.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"min","type":"Number","defaultValue":"0","description":"Giá trị nhỏ nhất.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"max","type":"Number","defaultValue":"100","description":"Giá trị lớn nhất.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"step","type":"Number","defaultValue":"1","description":"Bước nhảy giữa các giá trị.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"label","type":"String?","defaultValue":"None","description":"Nhãn hiển thị. Để trống nếu muốn ẩn nhãn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"default","type":"Number?","defaultValue":"min","description":"Giá trị mặc định, được giới hạn theo min/max.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.slider(\"speed\", min=1, max=10, step=1, default=5)\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-stepper","kind":"METHOD","parentKey":"class-macropanel","name":"stepper","signature":"panel.stepper(name, min=0, max=100, step=1, label=None, default=None)","description":"Thêm bộ tăng/giảm số với nút +/-.","behavior":"Thêm bộ tăng/giảm số với nút +/-.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên biến.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"min","type":"Number","defaultValue":"0","description":"Giá trị nguyên nhỏ nhất.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"max","type":"Number","defaultValue":"100","description":"Giá trị nguyên lớn nhất.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"step","type":"Number","defaultValue":"1","description":"Bước nhảy.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"label","type":"String?","defaultValue":"None","description":"Nhãn hiển thị. Để trống nếu muốn ẩn nhãn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"default","type":"Number?","defaultValue":"min","description":"Giá trị mặc định, được giới hạn theo min/max.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.stepper(\"count\", min=1, max=20, step=1, default=3)\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-text","kind":"METHOD","parentKey":"class-macropanel","name":"text","signature":"panel.text(html)","description":"Thêm khối text HTML. Các thẻ cơ bản hiển thị inline, còn đoạn có CSS như thẻ hướng dẫn, vùng màu, hàng flex, gradient và bo góc sẽ hiển thị bằng WebView đã khóa JavaScript và chặn điều hướng ra ngoài.","behavior":"Thêm khối text HTML. Các thẻ cơ bản hiển thị inline, còn đoạn có CSS như thẻ hướng dẫn, vùng màu, hàng flex, gradient và bo góc sẽ hiển thị bằng WebView đã khóa JavaScript và chặn điều hướng ra ngoài.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Giữ builder panel trong từng luồng. show() và notify() có tương tác được tuần tự qua khóa prompt của runtime và chờ người dùng. error() kết thúc bằng lỗi, ảnh hưởng toàn bộ lượt Run."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"html","type":"String","defaultValue":null,"description":"Nội dung HTML cần hiển thị.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Trả về chính panel để chain.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.text(\"<b>Ready</b>\")\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-show","kind":"METHOD","parentKey":"class-macropanel","name":"show","signature":"panel.show()","description":"Hiển thị panel và trả về giá trị người dùng đã nhập với đúng kiểu. Giá trị Storage có cùng tên biến sẽ được dùng làm mặc định của ô nhập, và giá trị đã xác nhận được lưu lại vào Storage theo tên biến: checkbox/công tắc là Boolean, slider là Number, stepper là Int, radio/dropdown là chỉ số lựa chọn Int 0-based, còn edit text là String cho văn bản thông thường (hoặc kiểu số / dữ liệu tương ứng tùy cấu hình hoặc giá trị lưu). Nếu cùng lệnh panel.show() bật lại liên tục mà không có thao tác runtime khác, runtime sẽ dừng script để tránh vòng lặp panel vô hạn.","behavior":"Hiển thị panel và trả về giá trị người dùng đã nhập với đúng kiểu. Giá trị Storage có cùng tên biến sẽ được dùng làm mặc định của ô nhập, và giá trị đã xác nhận được lưu lại vào Storage theo tên biến: checkbox/công tắc là Boolean, slider là Number, stepper là Int, radio/dropdown là chỉ số lựa chọn Int 0-based, còn edit text là String cho văn bản thông thường (hoặc kiểu số / dữ liệu tương ứng tùy cấu hình hoặc giá trị lưu). Nếu cùng lệnh panel.show() bật lại liên tục mà không có thao tác runtime khác, runtime sẽ dừng script để tránh vòng lặp panel vô hạn.","execution":{"blocking":"yes","threadSafety":"serialized","parallel":"conditional","details":"Chờ người dùng xác nhận qua khóa prompt chung của runtime. Prompt đồng thời được xử lý tuần tự."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict dạng variableName -> giá trị đúng kiểu.","example":"# Tạo bảng điều khiển và chờ người dùng xác nhận\npanel = MacroPanel(\"Settings\")\npanel.checkbox(\"enabled\", checked=True)\nresult = panel.show()\nprint(result)","aliases":[],"group":"FLOW"},{"key":"class-system","kind":"CLASS","parentKey":null,"name":"System","signature":"System()","description":"Truy cập thông tin hệ thống/thiết bị và gọi hành động hệ thống từ script.","behavior":"Truy cập thông tin hệ thống/thiết bị và gọi hành động hệ thống từ script.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["dev","battery","screen","memory"],"fieldDocs":[{"name":"dev","type":"dict","defaultValue":null,"description":"Thông tin khả năng thiết bị (`isEmulator`, `sdk`, `language`, `darkmode`, `touch`, `capture`).","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"battery","type":"dict","defaultValue":null,"description":"Thông tin pin (`percent`, `charging`, `temperature`, `health`).","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"screen","type":"dict","defaultValue":null,"description":"Thông tin màn hình (`width`, `height`, `orientation`, `density`, `dpi`); `orientation` là góc xoay màn hình theo độ: `0`, `90`, `180` hoặc `270`.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"memory","type":"dict","defaultValue":null,"description":"Thông tin bộ nhớ (`avail`, `total`, `threshold`, `low`).","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"sys = System()\nprint(\"sdk=\", sys.sdk())\nbattery = System.battery()\nprint(\"battery=\", battery.percent, battery.charging)\nSystem.toast(\"Macro started\")\nSystem.play_noti()\nSystem.home()","aliases":[],"group":null},{"key":"class-system-static-method-time-ms","kind":"STATIC_METHOD","parentKey":"class-system","name":"time_ms","signature":"System.time_ms()","description":"Lấy timestamp hiện tại theo mili giây.","behavior":"Lấy timestamp hiện tại theo mili giây.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number","returnDescription":"Epoch mili giây.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nstarted = System.time_ms()\nwait(100)\nprint(System.time_ms() - started)","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-app-version","kind":"STATIC_METHOD","parentKey":"class-system","name":"app_version","signature":"System.app_version()","description":"Lấy version name của app.","behavior":"Lấy version name của app.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"String","returnDescription":"Version name của app.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.app_version())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-variant","kind":"STATIC_METHOD","parentKey":"class-system","name":"variant","signature":"System.variant()","description":"Lấy mã ổn định của biến thể macro được chọn cho lần chạy này.","behavior":"Lấy mã ổn định của biến thể macro được chọn cho lần chạy này.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"String","returnDescription":"Mã biến thể, ví dụ `default` hoặc `pro_plus`.","example":"# Rẽ nhánh theo biến thể macro hiện tại\nif System.variant() == \"pro_plus\":\n    print(\"Pro Plus\")","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-open","kind":"STATIC_METHOD","parentKey":"class-system","name":"open","signature":"System.open(package_name)","description":"Mở activity khởi chạy của một ứng dụng Android đã cài đặt. CogniTab tự tìm launcher activity thông thường hoặc Android TV từ package name nên không cần truyền tên lớp activity.","behavior":"Mở activity khởi chạy của một ứng dụng Android đã cài đặt. CogniTab tự tìm launcher activity thông thường hoặc Android TV từ package name nên không cần truyền tên lớp activity.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"package_name","type":"String","defaultValue":null,"description":"Package name của ứng dụng Android, ví dụ `com.android.settings`.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"`True` khi Android chấp nhận intent mở ứng dụng; `False` khi ứng dụng không có sẵn, không có activity có thể khởi chạy hoặc không thể mở.","example":"# Mở Cài đặt Android và xử lý khi ứng dụng không khả dụng\nopened = System.open(\"com.android.settings\")\nif not opened:\n    System.toast(\"App is unavailable\")","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-sdk","kind":"STATIC_METHOD","parentKey":"class-system","name":"sdk","signature":"System.sdk()","description":"Lấy Android SDK int.","behavior":"Lấy Android SDK int.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number","returnDescription":"Số nguyên phiên bản Android SDK.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.sdk())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-language","kind":"STATIC_METHOD","parentKey":"class-system","name":"language","signature":"System.language()","description":"Lấy mã ngôn ngữ hiện tại.","behavior":"Lấy mã ngôn ngữ hiện tại.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"String","returnDescription":"Mã ngôn ngữ locale (ví dụ `en`, `vi`).","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.language())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-dpi","kind":"STATIC_METHOD","parentKey":"class-system","name":"dpi","signature":"System.dpi()","description":"Lấy DPI hiện tại của màn hình.","behavior":"Lấy DPI hiện tại của màn hình.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number","returnDescription":"Mật độ hiển thị DPI.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.dpi())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-darkmode","kind":"STATIC_METHOD","parentKey":"class-system","name":"darkmode","signature":"System.darkmode()","description":"Kiểm tra dark mode có đang bật hay không.","behavior":"Kiểm tra dark mode có đang bật hay không.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` khi dark mode đang bật.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nif System.darkmode():\n    print(\"Dark mode\")","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-play-noti","kind":"STATIC_METHOD","parentKey":"class-system","name":"play_noti","signature":"System.play_noti()","description":"Phát âm thanh thông báo hệ thống.","behavior":"Phát âm thanh thông báo hệ thống.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nSystem.play_noti()","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-toast","kind":"STATIC_METHOD","parentKey":"class-system","name":"toast","signature":"System.toast(text)","description":"Hiển thị toast hệ thống. Giá trị có cấu trúc sẽ được render bằng formatter DSL bản gọn để toast vẫn ngắn và dễ đọc.","behavior":"Hiển thị toast hệ thống. Giá trị có cấu trúc sẽ được render bằng formatter DSL bản gọn để toast vẫn ngắn và dễ đọc.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"text","type":"Any","defaultValue":null,"description":"Chuỗi toast hoặc giá trị có cấu trúc cần hiển thị ở dạng gọn.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nSystem.toast(\"Macro started\")","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-stop","kind":"STATIC_METHOD","parentKey":"class-system","name":"stop","signature":"System.stop()","description":"Dừng macro hiện tại ngay từ script.","behavior":"Dừng macro hiện tại ngay từ script.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"no","details":"Dừng toàn bộ lượt Run của macro, gồm luồng nền. Không tiếp tục thực thi sau lời gọi; đây không phải API hủy riêng một luồng."},"limitations":[],"relatedApis":["class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Dừng thực thi; không có giá trị trả về được quan sát.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nif Storage.get(\"stop_requested\", False):\n    System.stop()\nprint(\"Still running\")","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-minimized-dock","kind":"STATIC_METHOD","parentKey":"class-system","name":"minimized_dock","signature":"System.minimized_dock(point=None, *, width=None, height=None, alpha=None, mode=None)","description":"Xem hoặc điều chỉnh dock thu nhỏ của lớp phủ. Point dùng cùng quy tắc scale và neo toạ độ với các điểm click dạng Point; width và height là pixel trên màn hình hiện tại.","behavior":"Xem hoặc điều chỉnh dock thu nhỏ của lớp phủ. Point dùng cùng quy tắc scale và neo toạ độ với các điểm click dạng Point; width và height là pixel trên màn hình hiện tại.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"point","type":"Point?","defaultValue":"None","description":"Vị trí góc trên trái tuỳ chọn của dock.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"width","type":"Number?","defaultValue":"None","description":"Độ rộng vùng dock thu nhỏ tuỳ chọn, tính bằng pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"height","type":"Number?","defaultValue":"None","description":"Độ cao vùng dock thu nhỏ tuỳ chọn, tính bằng pixel.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"alpha","type":"Number?","defaultValue":"None","description":"Độ mờ tuỳ chọn của dock từ 0.2 đến 1.0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"mode","type":"String?","defaultValue":"None","description":"Kiểu hiển thị dock tuỳ chọn. Giá trị: icon hoặc row.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"dict","returnDescription":"Trạng thái đã áp dụng gồm `applied`, `x`, `y`, `width`, `height`, `alpha`, `mode`, và `reason` nếu có.","example":"# Di chuyển, đổi kích thước và thu dock thu nhỏ thành một icon cho lượt chạy này\nSystem.minimized_dock(Point(24, 120), width=72, height=36, alpha=0.85, mode=\"icon\")","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-back","kind":"STATIC_METHOD","parentKey":"class-system","name":"back","signature":"System.back()","description":"Thực hiện global action Back.","behavior":"Thực hiện global action Back.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.back())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-home","kind":"STATIC_METHOD","parentKey":"class-system","name":"home","signature":"System.home()","description":"Thực hiện global action Home.","behavior":"Thực hiện global action Home.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.home())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-recent","kind":"STATIC_METHOD","parentKey":"class-system","name":"recent","signature":"System.recent()","description":"Mở màn hình ứng dụng gần đây.","behavior":"Mở màn hình ứng dụng gần đây.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.recent())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-noti","kind":"STATIC_METHOD","parentKey":"class-system","name":"noti","signature":"System.noti()","description":"Mở vùng thông báo.","behavior":"Mở vùng thông báo.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.noti())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-lockscreen","kind":"STATIC_METHOD","parentKey":"class-system","name":"lockscreen","signature":"System.lockscreen()","description":"Khóa màn hình hiện tại.","behavior":"Khóa màn hình hiện tại.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.lockscreen())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-powerdialog","kind":"STATIC_METHOD","parentKey":"class-system","name":"powerdialog","signature":"System.powerdialog()","description":"Mở hộp thoại nguồn.","behavior":"Mở hộp thoại nguồn.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.powerdialog())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-quicksetting","kind":"STATIC_METHOD","parentKey":"class-system","name":"quicksetting","signature":"System.quicksetting()","description":"Mở panel quick settings.","behavior":"Mở panel quick settings.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.quicksetting())","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-screenshot","kind":"STATIC_METHOD","parentKey":"class-system","name":"screenshot","signature":"System.screenshot()","description":"Kích hoạt global action chụp màn hình.","behavior":"Kích hoạt global action chụp màn hình.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu action được gửi.","example":"# Đọc thông tin Android hoặc yêu cầu một thao tác hệ thống đã được hỗ trợ\nprint(System.screenshot())","aliases":[],"group":"FLOW"},{"key":"class-screencapture","kind":"CLASS","parentKey":null,"name":"ScreenCapture","signature":"ScreenCapture","description":"Bộ điều khiển tĩnh cho chụp màn hình dùng chung trong lần chạy macro hiện tại. Cache tự động thường dùng lại frame trong tối đa 100 ms để giảm công việc chụp. Khi cần nhận diện liên tục với frame mới nhất hiện có, dùng auto_cache_off(); việc này tăng xử lý và hao pin, không bảo đảm chạy nhanh hơn hoặc có pixel vừa được vẽ mới. cache_on() ghim riêng một frame và được ưu tiên hơn thiết lập cache tự động.","behavior":"Bộ điều khiển tĩnh cho chụp màn hình dùng chung trong lần chạy macro hiện tại. Cache tự động thường dùng lại frame trong tối đa 100 ms để giảm công việc chụp. Khi cần nhận diện liên tục với frame mới nhất hiện có, dùng auto_cache_off(); việc này tăng xử lý và hao pin, không bảo đảm chạy nhanh hơn hoặc có pixel vừa được vẽ mới. cache_on() ghim riêng một frame và được ưu tiên hơn thiết lập cache tự động.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Điều khiển cache cập nhật chính sách chung, không chờ frame hay hết thời lượng đã đặt. Lần chụp kế tiếp dùng chính sách đó. Đổi cache ảnh hưởng mọi luồng trong lượt Run; các hàm này không xin quyền chụp."},"limitations":[],"relatedApis":["class-region","class-flow"],"isCallable":false,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Dùng lại một khung hình đã chụp cho nhiều lần kiểm tra màn hình\nScreenCapture.cache_on()\ncolor = Color.get(Point(500, 900))\nhit = Region.full_screen().find(\"enemy\", timeout=0)\nScreenCapture.cache_off()\n\n# Ưu tiên frame mới nhất hiện có cho một đợt nhận diện ngắn\nScreenCapture.auto_cache_off(duration_ms=1000)\nhit = Region.full_screen().find(\"enemy\", timeout=800, rate=30)\n\n# Tắt không hẹn giờ, sau đó chủ động bật lại cache tự động\nScreenCapture.auto_cache_off()\nhit = Region.full_screen().find(\"enemy\", timeout=2000, rate=30)\nScreenCapture.auto_cache_on()","aliases":[],"group":null},{"key":"class-screencapture-static-method-cache-on","kind":"STATIC_METHOD","parentKey":"class-screencapture","name":"cache_on","signature":"ScreenCapture.cache_on()","description":"Pin frame chụp màn hình thật tiếp theo và dùng lại frame đó cho đến khi gọi ScreenCapture.cache_off(). Nếu chưa có buffer mới trong hàng đợi, frame hợp lệ gần nhất của capture reader hiện tại sẽ được pin thay thế. Hàm này không xin quyền chụp màn hình.","behavior":"Pin frame chụp màn hình thật tiếp theo và dùng lại frame đó cho đến khi gọi ScreenCapture.cache_off(). Nếu chưa có buffer mới trong hàng đợi, frame hợp lệ gần nhất của capture reader hiện tại sẽ được pin thay thế. Hàm này không xin quyền chụp màn hình.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Điều khiển cache cập nhật chính sách chung, không chờ frame hay hết thời lượng đã đặt. Lần chụp kế tiếp dùng chính sách đó. Đổi cache ảnh hưởng mọi luồng trong lượt Run; các hàm này không xin quyền chụp."},"limitations":[],"relatedApis":["class-region","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Ghim một khung hình dùng chung cho hai lượt nhận diện\nScreenCapture.cache_on()\nregion = Region(100, 200, 300, 400)\nfirst = region.find(\"start\", 0)\nsecond = region.find(\"confirm\", 0)\nScreenCapture.cache_off()\nprint(first.found, second.found)","aliases":[],"group":"FLOW"},{"key":"class-screencapture-static-method-cache-off","kind":"STATIC_METHOD","parentKey":"class-screencapture","name":"cache_off","signature":"ScreenCapture.cache_off()","description":"Bỏ ghim frame chụp màn hình mà không thay đổi thiết lập cache tự động. Frame còn mới vẫn có thể được dùng lại nếu cache tự động đang bật. Gọi thêm auto_cache_off() khi nhận diện cần frame mới nhất hiện có.","behavior":"Bỏ ghim frame chụp màn hình mà không thay đổi thiết lập cache tự động. Frame còn mới vẫn có thể được dùng lại nếu cache tự động đang bật. Gọi thêm auto_cache_off() khi nhận diện cần frame mới nhất hiện có.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Điều khiển cache cập nhật chính sách chung, không chờ frame hay hết thời lượng đã đặt. Lần chụp kế tiếp dùng chính sách đó. Đổi cache ảnh hưởng mọi luồng trong lượt Run; các hàm này không xin quyền chụp."},"limitations":[],"relatedApis":["class-region","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Bỏ ghim thủ công trước lần quét tiếp theo\nScreenCapture.cache_off()\nregion = Region(100, 200, 300, 400)\nprint(region.find(\"start\", 0).found)","aliases":[],"group":"FLOW"},{"key":"class-screencapture-static-method-auto-cache-off","kind":"STATIC_METHOD","parentKey":"class-screencapture","name":"auto_cache_off","signature":"ScreenCapture.auto_cache_off(duration_ms=None)","description":"Tắt việc chủ động dùng lại frame từ cache tự động trong duration_ms mili giây tính từ lệnh gọi này; nếu bỏ qua hoặc truyền None thì tắt đến khi gọi auto_cache_on() hoặc kết thúc lần chạy macro. Gọi lại sẽ thay thế thời hạn trước đó. Áp dụng cho chụp bitmap, frame thô, TFLite và pixel dùng chung; bỏ qua việc dùng lại frame theo TTL nhưng thời gian lấy frame vẫn có giới hạn và không thể buộc Android vẽ pixel mới. Không bỏ ghim cache_on(), không xin quyền chụp và không chờ hết khoảng thời gian đã đặt.","behavior":"Tắt việc chủ động dùng lại frame từ cache tự động trong duration_ms mili giây tính từ lệnh gọi này; nếu bỏ qua hoặc truyền None thì tắt đến khi gọi auto_cache_on() hoặc kết thúc lần chạy macro. Gọi lại sẽ thay thế thời hạn trước đó. Áp dụng cho chụp bitmap, frame thô, TFLite và pixel dùng chung; bỏ qua việc dùng lại frame theo TTL nhưng thời gian lấy frame vẫn có giới hạn và không thể buộc Android vẽ pixel mới. Không bỏ ghim cache_on(), không xin quyền chụp và không chờ hết khoảng thời gian đã đặt.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Điều khiển cache cập nhật chính sách chung, không chờ frame hay hết thời lượng đã đặt. Lần chụp kế tiếp dùng chính sách đó. Đổi cache ảnh hưởng mọi luồng trong lượt Run; các hàm này không xin quyền chụp."},"limitations":[],"relatedApis":["class-region","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"duration_ms","type":"Number | None","defaultValue":"None","description":"Số mili giây nguyên dương (100 và 100.0 đều hợp lệ), hoặc None để không giới hạn thời gian trong lần chạy macro này. Không chấp nhận số 0, số âm, số có phần lẻ, chuỗi, boolean hoặc giá trị vượt giới hạn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Tạm bỏ qua cache tự động; ghim thủ công là thiết lập riêng\nScreenCapture.cache_off()\nScreenCapture.auto_cache_off(1000)\nregion = Region(100, 200, 300, 400)\nprint(region.find(\"start\", 500).found)\nScreenCapture.auto_cache_on()","aliases":[],"group":"FLOW"},{"key":"class-screencapture-static-method-auto-cache-on","kind":"STATIC_METHOD","parentKey":"class-screencapture","name":"auto_cache_on","signature":"ScreenCapture.auto_cache_on()","description":"Bật lại cache frame tự động bình thường ngay lập tức và hủy thời hạn tắt, kể cả khi đã tắt không giới hạn. Không bỏ ghim cache_on(), không xin quyền chụp và không chờ. Cache tự động cũng được khôi phục khi lần chạy macro kết thúc.","behavior":"Bật lại cache frame tự động bình thường ngay lập tức và hủy thời hạn tắt, kể cả khi đã tắt không giới hạn. Không bỏ ghim cache_on(), không xin quyền chụp và không chờ. Cache tự động cũng được khôi phục khi lần chạy macro kết thúc.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Điều khiển cache cập nhật chính sách chung, không chờ frame hay hết thời lượng đã đặt. Lần chụp kế tiếp dùng chính sách đó. Đổi cache ảnh hưởng mọi luồng trong lượt Run; các hàm này không xin quyền chụp."},"limitations":[],"relatedApis":["class-region","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Khôi phục việc tự động dùng lại khung hình như bình thường\nScreenCapture.auto_cache_on()\nregion = Region(100, 200, 300, 400)\nprint(region.find(\"start\", 0).found)","aliases":[],"group":"FLOW"},{"key":"class-storage","kind":"CLASS","parentKey":null,"name":"Storage","signature":"Storage","description":"Kho key/value bền vững dạng static cho macro hiện tại. Biến thường chỉ được dùng chung giữa các action PYTHON_CODE chạy tuần tự trong cùng một luồng chạy, kể cả action bên trong nhóm GROUP; các luồng chạy song song có vùng biến riêng. Key của Storage được dùng chung giữa mọi luồng chạy, vì vậy chỉ dùng Storage khi giá trị cần tồn tại sang lần chạy macro tiếp theo, không dùng như kênh nhắn tin liên tiến trình. Các thay đổi được tự lưu sau 2 giây không có lượt ghi mới và được commit lại sau khi toàn bộ lượt Run cùng mọi luồng chạy nền kết thúc.","behavior":"Kho key/value bền vững dạng static cho macro hiện tại. Biến thường chỉ được dùng chung giữa các action PYTHON_CODE chạy tuần tự trong cùng một luồng chạy, kể cả action bên trong nhóm GROUP; các luồng chạy song song có vùng biến riêng. Key của Storage được dùng chung giữa mọi luồng chạy, vì vậy chỉ dùng Storage khi giá trị cần tồn tại sang lần chạy macro tiếp theo, không dùng như kênh nhắn tin liên tiến trình. Các thay đổi được tự lưu sau 2 giây không có lượt ghi mới và được commit lại sau khi toàn bộ lượt Run cùng mọi luồng chạy nền kết thúc.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":false,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Lưu giá trị xuyên qua nhiều lượt chạy macro riêng biệt\nrun_count = Storage.get(\"run_count\", 0)\nrun_count = run_count + 1\nStorage.set(\"run_count\", run_count)\nStorage.set(\"last_point\", Point(500, 900))\nMacroPanel.notify(\"Run #\" + str(run_count))","aliases":[],"group":null},{"key":"class-storage-static-method-get","kind":"STATIC_METHOD","parentKey":"class-storage","name":"get","signature":"Storage.get(key, default=None)","description":"Đọc một giá trị đã lưu theo key và có thể dùng giá trị mặc định nếu thiếu key.","behavior":"Đọc một giá trị đã lưu theo key và có thể dùng giá trị mặc định nếu thiếu key.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần tra cứu.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"default","type":"Any?","defaultValue":"None","description":"Giá trị dự phòng được trả về khi thiếu key.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Any?","returnDescription":"Giá trị đã lưu cho key đó, hoặc giá trị mặc định đã truyền vào.","example":"# Khôi phục bộ đếm đã lưu với giá trị mặc định dự phòng\nrun_count = Storage.get(\"run_count\", 0)","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-set","kind":"STATIC_METHOD","parentKey":"class-storage","name":"set","signature":"Storage.set(key, value)","description":"Ghi mới hoặc thay thế một phần tử trong kho lưu trữ bền vững. Các giá trị được hỗ trợ giữ nguyên kiểu thân thiện với script như Number, String, Boolean, Point, Region, list, tuple, dict, set và None, kể cả giá trị lồng trong collection.","behavior":"Ghi mới hoặc thay thế một phần tử trong kho lưu trữ bền vững. Các giá trị được hỗ trợ giữ nguyên kiểu thân thiện với script như Number, String, Boolean, Point, Region, list, tuple, dict, set và None, kể cả giá trị lồng trong collection.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần ghi.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"value","type":"Any?","defaultValue":null,"description":"Giá trị cần lưu bền vững cho key đó.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không trả về trực tiếp. Storage được cập nhật ngay tại chỗ, tự lưu sau 2 giây không có lượt ghi mới và được commit lại sau khi toàn bộ lượt Run cùng mọi luồng chạy nền kết thúc.","example":"# Lưu giá trị cho lượt chạy macro tiếp theo\nStorage.set(\"run_count\", 3)\nStorage.set(\"last_point\", Point(500, 900))","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-remove","kind":"STATIC_METHOD","parentKey":"class-storage","name":"remove","signature":"Storage.remove(key)","description":"Xóa một phần tử đã lưu và trả về giá trị cũ.","behavior":"Xóa một phần tử đã lưu và trả về giá trị cũ.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần xóa.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Any?","returnDescription":"Giá trị đã bị xóa, hoặc None nếu key không tồn tại.","example":"# Xóa flag đã lưu khi không còn cần nữa\nold_flag = Storage.remove(\"boost_enabled\")","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-contains","kind":"STATIC_METHOD","parentKey":"class-storage","name":"contains","signature":"Storage.contains(key)","description":"Kiểm tra xem một key đã lưu hiện có tồn tại hay không.","behavior":"Kiểm tra xem một key đã lưu hiện có tồn tại hay không.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Key cần kiểm tra.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"`True` khi key tồn tại, ngược lại là `False`.","example":"# Chặn/cho chạy logic dựa trên trạng thái đã lưu\nif Storage.contains(\"last_point\"):\n    MacroPanel.notify(\"Saved point is ready\")","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-keys","kind":"STATIC_METHOD","parentKey":"class-storage","name":"keys","signature":"Storage.keys()","description":"Lấy toàn bộ key đã lưu thành một list theo đúng thứ tự đã thêm.","behavior":"Lấy toàn bộ key đã lưu thành một list theo đúng thứ tự đã thêm.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"Một list các key đã lưu.","example":"# Kiểm tra các giá trị đang được lưu cho macro này\nsaved_keys = Storage.keys()","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-values","kind":"STATIC_METHOD","parentKey":"class-storage","name":"values","signature":"Storage.values()","description":"Lấy toàn bộ value đã lưu thành một list theo đúng thứ tự đã thêm.","behavior":"Lấy toàn bộ value đã lưu thành một list theo đúng thứ tự đã thêm.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"Một list các giá trị đã lưu.","example":"# Đọc mọi giá trị đã lưu để kiểm tra nhanh\nsaved_values = Storage.values()","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-clear","kind":"STATIC_METHOD","parentKey":"class-storage","name":"clear","signature":"Storage.clear()","description":"Xóa toàn bộ phần tử đã lưu cho macro hiện tại.","behavior":"Xóa toàn bộ phần tử đã lưu cho macro hiện tại.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow","class-storage-static-method-to-dict"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không trả về trực tiếp. Kho lưu trữ sẽ trở thành rỗng.","example":"# Đặt lại toàn bộ giá trị Storage đã lưu\nStorage.clear()","aliases":[],"group":"FLOW"},{"key":"class-storage-static-method-to-dict","kind":"STATIC_METHOD","parentKey":"class-storage","name":"to_dict","signature":"Storage.to_dict()","description":"Trả về toàn bộ Storage hiện tại dưới dạng dict live được mọi luồng chạy trong lượt Run dùng chung. Các chỉnh sửa trực tiếp trên phần tử của dict trả về đi theo cơ chế tự lưu, và snapshot live mới nhất được commit sau khi toàn bộ lượt Run cùng mọi luồng chạy nền kết thúc.","behavior":"Trả về toàn bộ Storage hiện tại dưới dạng dict live được mọi luồng chạy trong lượt Run dùng chung. Các chỉnh sửa trực tiếp trên phần tử của dict trả về đi theo cơ chế tự lưu, và snapshot live mới nhất được commit sau khi toàn bộ lượt Run cùng mọi luồng chạy nền kết thúc.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Mọi luồng trong một lượt Run dùng chung phiên Storage. Từng thao tác và thay đổi lồng nhau được theo dõi có khóa bảo vệ. get rồi set không phải giao dịch nguyên tử; dùng một luồng ghi khi cập nhật phụ thuộc lần đọc trước."},"limitations":[],"relatedApis":["class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"Một dict live chứa toàn bộ phần tử đang được lưu bền vững.","example":"# Đọc và cập nhật toàn bộ dictionary storage đã lưu\nstate = Storage.to_dict()\nstate[\"bonus\"] = 5\nMacroPanel.notify(str(state))","aliases":[],"group":"FLOW"},{"key":"function-click","kind":"FUNCTION","parentKey":null,"name":"click","signature":"click(target, hold_ms=0, offset=(0, 0), random=0, delay_before=0, delay_after=0, parallel=False)","description":"Nhấn vào Point, tuple (x, y), Match hoặc MatchList. Mọi tham số đều hỗ trợ truyền theo vị trí hoặc theo tên theo đúng thứ tự trong chữ ký. Dùng Point(x, y) khi cần thông tin scale/anchor; dùng (x, y) cho tọa độ pixel cố định. Dùng parallel=True để đưa touch vào hàng đợi và nhận id dạng số; gọi Touch.cancel(id) hoặc Touch.cancel() để hủy touch đang queue/active.","behavior":"Nhấn vào Point, tuple (x, y), Match hoặc MatchList. Mọi tham số đều hỗ trợ truyền theo vị trí hoặc theo tên theo đúng thứ tự trong chữ ký. Dùng Point(x, y) khi cần thông tin scale/anchor; dùng (x, y) cho tọa độ pixel cố định. Dùng parallel=True để đưa touch vào hàng đợi và nhận id dạng số; gọi Touch.cancel(id) hoặc Touch.cancel() để hủy touch đang queue/active.","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"Cử chỉ Android dùng chung thiết bị. parallel=True xếp hàng id chạm nhưng delay_before và delay_after vẫn chặn luồng gọi ngoài collect. Trong collect, các lần chạm được gom để Touch.send(); Touch.wait() chờ chúng hoàn tất."},"limitations":[],"relatedApis":["class-touch-static-method-collect","class-touch-static-method-send","class-touch-static-method-wait"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"target","type":"Point | tuple[Number, Number] | Match | MatchList","defaultValue":null,"description":"Point, tuple tọa độ, Match hoặc MatchList đích. Match/MatchList có nhiều point sẽ nhấn từng point tìm thấy.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"hold_ms","type":"Int","defaultValue":"0","description":"Thời gian giữ (milliseconds)","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"offset","type":"tuple[Number, Number]","defaultValue":"(0, 0)","description":"Cộng khoảng lệch pixel sau khi đã resolve điểm đích.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"random","type":"Number | tuple[Number, Number]","defaultValue":"0","description":"Cộng độ lệch pixel ngẫu nhiên sau khi đã resolve điểm đích.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"delay_before","type":"Number","defaultValue":"0","description":"Độ trễ trước khi nhấn (milliseconds).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"delay_after","type":"Number","defaultValue":"0","description":"Độ trễ sau khi nhấn (milliseconds).","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"parallel","type":"Boolean","defaultValue":"False","description":"Khi True, trả về id touch dạng số. Trong chế độ gom, touch chờ Touch.send(); các touch đã gom và còn overlap có thể bắt đầu ở các delay_before khác nhau mà không hủy nhau.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Number | list[Number] | None","returnDescription":"Trả về một id dạng số cho một lần nhấn song song được queue, list[Number] khi Match hoặc MatchList nhiều point queue nhiều lần nhấn song song, còn lại trả về None.","example":"# Nhấn tọa độ màn hình bằng Point hoặc tuple\nclick(Point(500, 900))\nclick((500, 900))\nclick((500, 900), hold_ms=200)\nclick(Point(500, 900), 0, (0, 0), 10, 0, 500)\n\nmatch = Region(100, 200, 300, 400).find(\"start\", 3000)\nif match.found:\n    click(match, offset=(0, 6))\n\nhits = Region(100, 200, 300, 400).find_any([\"a\", \"b\"], 3000)\nif hits:\n    click(hits, random=0)\n\n# Gom hai thao tác chạm song song, gửi cùng lúc rồi chờ hàng đợi\nTouch.collect()\na = click(Point(300, 900), parallel=True)\nb = click(Point(780, 900), parallel=True)\nTouch.send()\nTouch.wait()\n\n# Giữ p1, rồi nhấn p2 sau 1 giây mà không nhả p1\nTouch.collect()\np1 = click(Point(300, 900), hold_ms=5000, parallel=True)\np2 = click(Point(780, 900), hold_ms=1000, delay_before=1000, parallel=True)\nTouch.send()\nTouch.cancel(p1)\nTouch.wait()","aliases":[],"group":"GESTURE"},{"key":"function-swipe","kind":"FUNCTION","parentKey":null,"name":"swipe","signature":"swipe(points, *, parallel=False)","description":"Thực hiện thao tác vuốt từ một list SwipePoint phẳng. Mỗi list tạo một đường vuốt nhiều điểm cho một ngón.","behavior":"Thực hiện thao tác vuốt từ một list SwipePoint phẳng. Mỗi list tạo một đường vuốt nhiều điểm cho một ngón.","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"Cử chỉ Android dùng chung thiết bị. parallel=True xếp hàng id chạm nhưng delay_before và delay_after vẫn chặn luồng gọi ngoài collect. Trong collect, các lần chạm được gom để Touch.send(); Touch.wait() chờ chúng hoàn tất."},"limitations":[],"relatedApis":["class-touch-static-method-collect","class-touch-static-method-send","class-touch-static-method-wait"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"points","type":"list[SwipePoint]","defaultValue":null,"description":"Đường vuốt phẳng cho một ngón. Cần tối thiểu 2 điểm.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"parallel","type":"Boolean","defaultValue":"False","description":"Khi True, trả về id touch dạng số. Trong chế độ gom, thao tác vuốt chờ Touch.send(); ngoài chế độ gom thì vào hàng đợi ngay. Dùng Touch.cancel(id) hoặc Touch.cancel() để hủy touch đang queue/active.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"Number | None","returnDescription":"Chỉ trả về id dạng số khi parallel=True; các lệnh đồng bộ trả về None.","example":"path = [\n    SwipePoint(Point(500, 1500), speed=\"FAST\"),\n    SwipePoint((560, 980), speed=\"NORMAL\", humanized=True),\n    SwipePoint(Point(500, 500))\n]\nswipe(path)\n\nTouch.collect()\nleft = swipe(path, parallel=True)\nright = swipe([\n    SwipePoint(Point(780, 1500), speed=\"FAST\"),\n    SwipePoint(Point(780, 500))\n], parallel=True)\nTouch.send()\nTouch.wait()","aliases":[],"group":"GESTURE"},{"key":"function-wait","kind":"FUNCTION","parentKey":null,"name":"wait","signature":"wait(ms, /)","description":"Tạm dừng thực thi script trong một khoảng thời gian (milliseconds).","behavior":"Tạm dừng thực thi script trong một khoảng thời gian (milliseconds).","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ trong luồng gọi đến hết thời gian yêu cầu hoặc hoàn tất chạm. Luồng khác có thể tiếp tục; pause và stop vẫn có hiệu lực."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"ms","type":"Int","defaultValue":null,"description":"Thời gian tạm dừng (milliseconds)","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"None","returnDescription":"Không có giá trị trả về","example":"click(Point(500, 900))\nwait(1000)  # Chờ 1 giây\nclick(Point(500, 900))","aliases":["sleep"],"group":"FLOW"},{"key":"function-text","kind":"FUNCTION","parentKey":null,"name":"text","signature":"text(value, /, focus_index=0)","description":"Nhập văn bản. focus_index=0 giữ focus hiện tại, 1 focus EditText đầu tiên, 2 focus EditText thứ hai, v.v.","behavior":"Nhập văn bản. focus_index=0 giữ focus hiện tại, 1 focus EditText đầu tiên, 2 focus EditText thứ hai, v.v.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"String","defaultValue":null,"description":"Văn bản cần nhập","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"focus_index","type":"Int","defaultValue":"0","description":"0: giữ focus hiện tại, N>=1: focus EditText thứ N trước khi nhập","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"Không có giá trị trả về","example":"click(Point(300, 500))  # Nhấn vào ô nhập\nwait(200)\ntext(\"Hello World\", 1)","aliases":[],"group":"INPUT"},{"key":"function-range","kind":"FUNCTION","parentKey":null,"name":"range","signature":"range(stop, /) | range(start, stop, step=1, /)","description":"Tạo dãy số nguyên để sử dụng trong vòng lặp for.","behavior":"Tạo dãy số nguyên để sử dụng trong vòng lặp for.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"start","type":"Int","defaultValue":"0","description":"Giá trị bắt đầu (bao gồm)","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":null,"description":"Giá trị kết thúc (không bao gồm)","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"step","type":"Int","defaultValue":"1","description":"Bước nhảy","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"list[Int]","returnDescription":"Danh sách số nguyên từ start đến stop","example":"numbers = range(5)          # trả về [0, 1, 2, 3, 4]\nevens = range(0, 10, 2)   # trả về [0, 2, 4, 6, 8]\n\nfor i in numbers:\n    click(Point(100 + i * 50, 500))  # trả về None","aliases":[],"group":"FLOW"},{"key":"function-enumerate","kind":"FUNCTION","parentKey":null,"name":"enumerate","signature":"enumerate(iterable, start=0)","description":"Trả về list gồm các tuple(index, item) cho mọi giá trị có thể lặp.","behavior":"Trả về list gồm các tuple(index, item) cho mọi giá trị có thể lặp.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"String | list | tuple | dict","defaultValue":null,"description":"Giá trị cần đánh số. dict sẽ đánh số theo key.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"start","type":"Int","defaultValue":"0","description":"Giá trị index đầu tiên.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"list[tuple]","returnDescription":"Danh sách tuple hai phần tử: index trước, phần tử gốc sau.","example":"# Đánh số item trước khi dùng\nnames = [\"alpha\", \"beta\"]\nfor pair in enumerate(names, start=1):\n    text(str(pair[0]) + \": \" + pair[1])","aliases":[],"group":"COLLECTION"},{"key":"function-zip","kind":"FUNCTION","parentKey":null,"name":"zip","signature":"zip(*iterables)","description":"Ghép nhiều iterable thành list các tuple và dừng ở input ngắn nhất.","behavior":"Ghép nhiều iterable thành list các tuple và dừng ở input ngắn nhất.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterables","type":"String | list | tuple | dict","defaultValue":null,"description":"Các giá trị cần ghép. dict đóng góp key.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"}],"returnType":"list[tuple]","returnDescription":"Danh sách tuple, mỗi tuple chứa một phần tử từ từng input.","example":"# Ghép nhãn với điểm nhấn\nlabels = [\"left\", \"right\"]\npoints = [Point(100, 500), Point(900, 500)]\nfor pair in zip(labels, points):\n    text(pair[0])\n    click(pair[1])","aliases":[],"group":"COLLECTION"},{"key":"function-random","kind":"FUNCTION","parentKey":null,"name":"random","signature":"random()","description":"Trả về một số thực ngẫu nhiên trong khoảng 0 -> 1.","behavior":"Trả về một số thực ngẫu nhiên trong khoảng 0 -> 1.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Float","returnDescription":"Giá trị số thực ngẫu nhiên trong 0 -> 1 (không bao gồm 1).","example":"chance = random()\nif chance < 0.25:\n    text(\"lucky\")","aliases":[],"group":"FLOW"},{"key":"function-random-int","kind":"FUNCTION","parentKey":null,"name":"random_int","signature":"random_int(min, max, /)","description":"Trả về số nguyên ngẫu nhiên trong khoảng bao gồm cả hai đầu min -> max.","behavior":"Trả về số nguyên ngẫu nhiên trong khoảng bao gồm cả hai đầu min -> max.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"min","type":"Int","defaultValue":null,"description":"Cận dưới của khoảng.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"max","type":"Int","defaultValue":null,"description":"Cận trên của khoảng.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số nguyên ngẫu nhiên giữa min và max (bao gồm cả hai đầu).","example":"delay_steps = random_int(1, 4)\nwait(delay_steps * 100)","aliases":[],"group":"FLOW"},{"key":"function-len","kind":"FUNCTION","parentKey":null,"name":"len","signature":"len(value, /)","description":"Lấy độ dài của String, list/tuple hoặc dict.","behavior":"Lấy độ dài của String, list/tuple hoặc dict.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"String | list | tuple | dict","defaultValue":null,"description":"Giá trị cần đo độ dài","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Số phần tử/ký tự.","example":"name = \"CogniTab\"\ncount = len(name)\ntext(str(count))","aliases":[],"group":"COLLECTION"},{"key":"function-int","kind":"FUNCTION","parentKey":null,"name":"int","signature":"int(value, /)","description":"Ép kiểu giá trị về số nguyên (cắt phần thập phân).","behavior":"Ép kiểu giá trị về số nguyên (cắt phần thập phân).","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float | Boolean | String","defaultValue":null,"description":"Giá trị cần ép kiểu","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Giá trị số nguyên sau khi chuyển.","example":"threshold = int(3.9)\ntext(str(threshold))","aliases":[],"group":"TYPE_CAST"},{"key":"function-float","kind":"FUNCTION","parentKey":null,"name":"float","signature":"float(value, /)","description":"Ép kiểu giá trị về số thực dấu chấm động.","behavior":"Ép kiểu giá trị về số thực dấu chấm động.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float | Boolean | String","defaultValue":null,"description":"Giá trị cần ép kiểu","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị số thực sau khi chuyển.","example":"score = float(\"0.85\")\nif score > 0.8:\n    text(\"ok\")","aliases":[],"group":"TYPE_CAST"},{"key":"function-str","kind":"FUNCTION","parentKey":null,"name":"str","signature":"str(value, /)","description":"Chuyển giá trị thành chuỗi theo format hiển thị DSL. Point/Region giữ dạng gọn, list hai chiều hiển thị mỗi row list trên một dòng, và chỉ row quá dài hoặc phức tạp mới tự bung thành nhiều dòng dọc. Giá trị có cấu trúc quá lớn hoặc lồng quá sâu dùng preview hữu hạn với marker báo phần bị lược/ngân sách đã hết; giá trị chuỗi truyền trực tiếp vẫn được giữ nguyên.","behavior":"Chuyển giá trị thành chuỗi theo format hiển thị DSL. Point/Region giữ dạng gọn, list hai chiều hiển thị mỗi row list trên một dòng, và chỉ row quá dài hoặc phức tạp mới tự bung thành nhiều dòng dọc. Giá trị có cấu trúc quá lớn hoặc lồng quá sâu dùng preview hữu hạn với marker báo phần bị lược/ngân sách đã hết; giá trị chuỗi truyền trực tiếp vẫn được giữ nguyên.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any","defaultValue":null,"description":"Giá trị cần chuyển","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Dạng chuỗi của giá trị.","example":"total = 12\ntext(\"Total: \" + str(total))","aliases":[],"group":"TYPE_CAST"},{"key":"function-type","kind":"FUNCTION","parentKey":null,"name":"type","signature":"type(value, /)","description":"Trả về chuỗi mô tả kiểu theo phong cách Python cho một giá trị, ví dụ <class 'int'>.","behavior":"Trả về chuỗi mô tả kiểu theo phong cách Python cho một giá trị, ví dụ <class 'int'>.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any","defaultValue":null,"description":"Giá trị cần kiểm tra kiểu","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Chuỗi mô tả kiểu theo phong cách Python.","example":"value = 42\nprint(type(value))","aliases":[],"group":"TYPE_CAST"},{"key":"function-print","kind":"FUNCTION","parentKey":null,"name":"print","signature":"print(*values, sep=\" \", end=\"\\n\")","description":"In giá trị ra console script của overlay mà không chặn tiến trình chạy. Giá trị có cấu trúc dùng cùng formatter hữu hạn với str(value), gồm pretty output theo từng row cho list hai chiều, output nhiều dòng khi dữ liệu lồng nhau phức tạp và marker rõ ràng khi nội dung bị lược.","behavior":"In giá trị ra console script của overlay mà không chặn tiến trình chạy. Giá trị có cấu trúc dùng cùng formatter hữu hạn với str(value), gồm pretty output theo từng row cho list hai chiều, output nhiều dòng khi dữ liệu lồng nhau phức tạp và marker rõ ràng khi nội dung bị lược.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Chi phí thực thi và thời gian chờ tùy thao tác được mô tả. Giữ giá trị có thể thay đổi trong luồng sở hữu; việc chia sẻ đối tượng tùy ý giữa các luồng không có bảo đảm an toàn chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"values","type":"Any","defaultValue":null,"description":"Các giá trị cần in","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"},{"name":"sep","type":"String","defaultValue":"\" \"","description":"Chuỗi phân tách giữa các giá trị","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"end","type":"String","defaultValue":"\"\\n\"","description":"Hậu tố thêm sau mỗi lần gọi print","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"count = 3\nprint(\"remaining\", count, sep=\": \")\nprint(\"done\", end=\"\")","aliases":[],"group":"FLOW"},{"key":"function-bool","kind":"FUNCTION","parentKey":null,"name":"bool","signature":"bool(value, /)","description":"Chuyển giá trị thành boolean theo quy tắc truthy/falsy của script.","behavior":"Chuyển giá trị thành boolean theo quy tắc truthy/falsy của script.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any","defaultValue":null,"description":"Giá trị cần chuyển","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"false với None/0/rỗng; ngược lại là true.","example":"enabled = bool(1)\nif enabled:\n    text(\"enabled\")","aliases":[],"group":"TYPE_CAST"},{"key":"function-abs","kind":"FUNCTION","parentKey":null,"name":"abs","signature":"abs(value, /)","description":"Trả về giá trị tuyệt đối.","behavior":"Trả về giá trị tuyệt đối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Số đầu vào","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị tuyệt đối.","example":"delta = abs(-12.5)\ntext(str(delta))","aliases":[],"group":"MATH"},{"key":"function-sum","kind":"FUNCTION","parentKey":null,"name":"sum","signature":"sum(iterable, /, start=0)","description":"Trả về tổng số học của một iterable, có thể bắt đầu từ giá trị start. Generator expression chỉ được bỏ cặp ngoặc riêng khi là đối số duy nhất của lời gọi hàm hoặc phương thức; nếu có đối số khác hoặc dấu phẩy cuối thì phải bọc generator trong ngoặc.","behavior":"Trả về tổng số học của một iterable, có thể bắt đầu từ giá trị start. Generator expression chỉ được bỏ cặp ngoặc riêng khi là đối số duy nhất của lời gọi hàm hoặc phương thức; nếu có đối số khác hoặc dấu phẩy cuối thì phải bọc generator trong ngoặc.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"list | tuple | set | generator","defaultValue":null,"description":"Iterable chứa các giá trị số.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Number","defaultValue":"0","description":"Giá trị ban đầu được cộng trước các phần tử trong iterable.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Tổng giá trị số.","example":"# Tính tổng các giá trị do generator tạo ra\nvalues = [1, 2, 3]\ntotal = sum(value * 2 for value in values)\nwith_start = sum((value * 2 for value in values), start=10)\ntext(str(total))\ntext(str(with_start))","aliases":[],"group":"MATH"},{"key":"function-min","kind":"FUNCTION","parentKey":null,"name":"min","signature":"min(iterable, /, *, key=None) | min(iterable, /, *, default, key=None) | min(arg1, arg2, /, *args, key=None)","description":"Trả về phần tử nhỏ nhất từ một iterable hoặc giá trị nhỏ nhất trong hai hay nhiều đối số. key có thể tính giá trị dùng để sắp thứ tự; nếu hòa thì giữ phần tử gặp đầu tiên.","behavior":"Trả về phần tử nhỏ nhất từ một iterable hoặc giá trị nhỏ nhất trong hai hay nhiều đối số. key có thể tính giá trị dùng để sắp thứ tự; nếu hòa thì giữ phần tử gặp đầu tiên.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Thao tác xử lý giá trị trong luồng gọi. Callable key cũng chạy tại đó và có thể chờ hoặc tạo tác dụng phụ; không có hàm ý thực thi bất đồng bộ."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"String | list | tuple | dict","defaultValue":null,"description":"Một iterable đầu vào. dict sẽ so sánh theo key.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"},{"name":"args","type":"Any","defaultValue":null,"description":"Các giá trị positional bổ sung khi truyền hai đối số trở lên.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"variadic"},{"name":"default","type":"Any","defaultValue":"-","description":"Giá trị trả về khi iterable duy nhất rỗng. Chỉ hợp lệ với dạng một iterable.","suggestAsNamedArg":true,"requirement":"overload-dependent","callingMode":"keyword-only"},{"name":"key","type":"Callable?","defaultValue":"None","description":"Callable một tham số dùng để tính khóa so sánh.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"Any","returnDescription":"Phần tử gốc nhỏ nhất, hoặc default khi truyền iterable rỗng kèm default=.","example":"# Chọn điểm thấp nhất, có giá trị dự phòng an toàn khi list rỗng\nbest = min([0.9, 0.7, 0.85])\nfallback = min([], default=\"none\")\nclosest = min([12, -5, 7], key=lambda value: abs(value))\ntext(str(closest))","aliases":[],"group":"MATH"},{"key":"function-max","kind":"FUNCTION","parentKey":null,"name":"max","signature":"max(iterable, /, *, key=None) | max(iterable, /, *, default, key=None) | max(arg1, arg2, /, *args, key=None)","description":"Trả về phần tử lớn nhất từ một iterable hoặc giá trị lớn nhất trong hai hay nhiều đối số. key có thể tính giá trị dùng để sắp thứ tự; nếu hòa thì giữ phần tử gặp đầu tiên.","behavior":"Trả về phần tử lớn nhất từ một iterable hoặc giá trị lớn nhất trong hai hay nhiều đối số. key có thể tính giá trị dùng để sắp thứ tự; nếu hòa thì giữ phần tử gặp đầu tiên.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Thao tác xử lý giá trị trong luồng gọi. Callable key cũng chạy tại đó và có thể chờ hoặc tạo tác dụng phụ; không có hàm ý thực thi bất đồng bộ."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"String | list | tuple | dict","defaultValue":null,"description":"Một iterable đầu vào. dict sẽ so sánh theo key.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"},{"name":"args","type":"Any","defaultValue":null,"description":"Các giá trị positional bổ sung khi truyền hai đối số trở lên.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"variadic"},{"name":"default","type":"Any","defaultValue":"-","description":"Giá trị trả về khi iterable duy nhất rỗng. Chỉ hợp lệ với dạng một iterable.","suggestAsNamedArg":true,"requirement":"overload-dependent","callingMode":"keyword-only"},{"name":"key","type":"Callable?","defaultValue":"None","description":"Callable một tham số dùng để tính khóa so sánh.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"Any","returnDescription":"Phần tử gốc lớn nhất, hoặc default khi truyền iterable rỗng kèm default=.","example":"# Chọn điểm cao nhất, có giá trị dự phòng an toàn khi list rỗng\npeak = max([0.9, 0.7, 0.85])\nfallback = max([], default=\"none\")\nlongest = max([\"a\", \"team\", \"go\"], key=lambda value: len(value))\ntext(longest)","aliases":[],"group":"MATH"},{"key":"function-sorted","kind":"FUNCTION","parentKey":null,"name":"sorted","signature":"sorted(iterable, /, *, key=None, reverse=False)","description":"Trả về list mới chứa mọi phần tử từ iterable theo thứ tự đã sắp xếp. key có thể tính khóa so sánh; reverse=True sắp xếp giảm dần và vẫn giữ ổn định các phần tử có khóa bằng nhau.","behavior":"Trả về list mới chứa mọi phần tử từ iterable theo thứ tự đã sắp xếp. key có thể tính khóa so sánh; reverse=True sắp xếp giảm dần và vẫn giữ ổn định các phần tử có khóa bằng nhau.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Thao tác xử lý giá trị trong luồng gọi. Callable key cũng chạy tại đó và có thể chờ hoặc tạo tác dụng phụ; không có hàm ý thực thi bất đồng bộ."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"String | list | tuple | dict | set","defaultValue":null,"description":"Iterable đầu vào. dict sẽ sắp xếp theo key.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"key","type":"Callable?","defaultValue":"None","description":"Callable một tham số dùng để tính khóa so sánh.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"reverse","type":"Boolean","defaultValue":"False","description":"Sắp xếp giảm dần khi là True.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"list","returnDescription":"Một list mới đã sắp xếp. Giá trị đầu vào không bị thay đổi.","example":"values = sorted([3, 1, 2])\ntext(str(values))","aliases":[],"group":"COLLECTION"},{"key":"function-round","kind":"FUNCTION","parentKey":null,"name":"round","signature":"round(value, digits=0, /)","description":"Làm tròn giá trị theo số chữ số thập phân chỉ định.","behavior":"Làm tròn giá trị theo số chữ số thập phân chỉ định.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Số đầu vào","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"digits","type":"Int","defaultValue":"0","description":"Số chữ số thập phân cần giữ","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị số đã làm tròn.","example":"ratio = round(0.87654, 2)\ntext(str(ratio))","aliases":[],"group":"MATH"},{"key":"function-sqrt","kind":"FUNCTION","parentKey":null,"name":"sqrt","signature":"sqrt(value, /)","description":"Trả về căn bậc hai của giá trị không âm.","behavior":"Trả về căn bậc hai của giá trị không âm.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Số đầu vào (>= 0)","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị căn bậc hai.","example":"distance = sqrt(144)\ntext(str(distance))","aliases":[],"group":"MATH"},{"key":"function-pow","kind":"FUNCTION","parentKey":null,"name":"pow","signature":"pow(base, exponent, /)","description":"Lũy thừa base với số mũ exponent.","behavior":"Lũy thừa base với số mũ exponent.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"base","type":"Int | Float","defaultValue":null,"description":"Giá trị cơ số","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"exponent","type":"Int | Float","defaultValue":null,"description":"Giá trị số mũ","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Kết quả lũy thừa.","example":"boost = pow(1.2, 3)\ntext(str(boost))","aliases":[],"group":"MATH"},{"key":"function-floor","kind":"FUNCTION","parentKey":null,"name":"floor","signature":"floor(value, /)","description":"Trả về số nguyên lớn nhất không vượt quá value.","behavior":"Trả về số nguyên lớn nhất không vượt quá value.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Số đầu vào","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị làm tròn xuống.","example":"bucket = floor(9.99)\ntext(str(bucket))","aliases":[],"group":"MATH"},{"key":"function-ceil","kind":"FUNCTION","parentKey":null,"name":"ceil","signature":"ceil(value, /)","description":"Trả về số nguyên nhỏ nhất không nhỏ hơn value.","behavior":"Trả về số nguyên nhỏ nhất không nhỏ hơn value.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Số đầu vào","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị làm tròn lên.","example":"bucket = ceil(9.01)\ntext(str(bucket))","aliases":[],"group":"MATH"},{"key":"function-sin","kind":"FUNCTION","parentKey":null,"name":"sin","signature":"sin(value, /)","description":"Trả về sin của value (đơn vị radian).","behavior":"Trả về sin của value (đơn vị radian).","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Góc theo radian","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị sin.","example":"wave = sin(0)\ntext(str(wave))","aliases":[],"group":"MATH"},{"key":"function-cos","kind":"FUNCTION","parentKey":null,"name":"cos","signature":"cos(value, /)","description":"Trả về cos của value (đơn vị radian).","behavior":"Trả về cos của value (đơn vị radian).","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Góc theo radian","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị cos.","example":"wave = cos(0)\ntext(str(wave))","aliases":[],"group":"MATH"},{"key":"function-tan","kind":"FUNCTION","parentKey":null,"name":"tan","signature":"tan(value, /)","description":"Trả về tan của value (đơn vị radian).","behavior":"Trả về tan của value (đơn vị radian).","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Góc theo radian","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị tan.","example":"wave = tan(0)\ntext(str(wave))","aliases":[],"group":"MATH"},{"key":"function-log","kind":"FUNCTION","parentKey":null,"name":"log","signature":"log(value, base=None, /)","description":"Trả về logarit của value. Nếu không truyền base thì dùng log tự nhiên.","behavior":"Trả về logarit của value. Nếu không truyền base thì dùng log tự nhiên.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Giá trị đầu vào (> 0)","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"base","type":"Int | Float","defaultValue":null,"description":"Cơ số tùy chọn (> 0 và != 1)","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Kết quả logarit.","example":"bits = log(8, 2)\ntext(str(bits))","aliases":[],"group":"MATH"},{"key":"function-clamp","kind":"FUNCTION","parentKey":null,"name":"clamp","signature":"clamp(value, min, max, /)","description":"Giới hạn value trong khoảng min -> max.","behavior":"Giới hạn value trong khoảng min -> max.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Thao tác giá trị chạy trong luồng gọi, không chủ động chờ chụp màn hình, hoàn tất cử chỉ hoặc nhập liệu. Tạo container/builder có thể thay đổi riêng cho từng luồng; đây là sự cô lập, không bảo đảm đồng bộ đối tượng dùng chung."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float","defaultValue":null,"description":"Giá trị đầu vào","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"min","type":"Int | Float","defaultValue":null,"description":"Cận dưới","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"max","type":"Int | Float","defaultValue":null,"description":"Cận trên","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Float","returnDescription":"Giá trị số sau khi giới hạn.","example":"safe = clamp(135, 0, 100)\ntext(str(safe))","aliases":[],"group":"MATH"}]}}