{"data":{"version":"v2.107","locale":"vi","availableLocales":["en","vi","th","id","fil"],"updatedAt":"2026-11-13T08:53:59.804Z","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","any","all","globals","len","int","float","str","type","isinstance","hasattr","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":"Một luồng chạy các dòng theo thứ tự. “Blocking” nghĩa là dòng sau phải chờ, không phải app bị treo. Flow.start() chạy thêm luồng song song; parallel=True chỉ xếp hàng chạm.","example":null},{"id":"flows","title":"Luồng nền","body":"Flow.start() trả Int dương khi luồng có tên nhận được tin; tối đa hai luồng nền chạy cùng nhau. send() sao chép tin theo thứ tự; receive() chờ, poll() kiểm tra ngay. Tạm dừng giữ tin; dừng/kết thúc bỏ tin. running() tính cả luồng tạm dừng. Flow.stop(name) dừng luồng nền sở hữu; luồng khác tiếp tục, tên được giữ đến hết dọn dẹp. Nhóm lồng có tên dùng tin và đích dừng của luồng sở hữu; không thể dừng luồng chính bằng cách này, và nó không có tên tự tạo. Macro chờ luồng nền: hãy dừng luồng chạy mãi. Pause/Resume chính áp dụng mọi luồng; Resume toàn cục bỏ cả tạm dừng riêng. Điều khiển luồng nền có Pause/Resume, không có Stop. Start sai/trùng tên, lỗi luồng, Stop chính hoặc System.stop() dừng toàn bộ macro.","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":"Mỗi luồng dùng đối tượng có thể sửa riêng. Storage bảo vệ từng thao tác, kể cả sửa trong tập hợp, nhưng luồng khác có thể ghi giữa get() và set(). Dùng một luồng ghi để tránh ghi đè cập nhật. Chụp màn hình, dùng lại ảnh và thiết lập âm thanh dùng chung. Trao đổi bản sao tin qua Flow.send(), receive() và poll().","example":null},{"id":"touches","title":"Lần chạm xếp hàng","body":"parallel=True xếp hàng chạm, không chờ hoàn tất; delay_before, delay_after vẫn chờ ngoài chế độ collect. Touch.collect() gom, Touch.send() gửi và Touch.wait() chờ. Cử chỉ từ nhiều luồng có thể hủy nhau trên cùng màn hình. 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. Một lần kiểm tra vẫn mất thời gian; tốc độ lặp là 1–60 lần/giây. Hộp thoại MacroPanel hiện lần lượt và chờ. show(mode=\"floating\") cho chạy tiếp với một bảng nổi mỗi lượt chạy; values() đọc ô nhập, close() đóng bảng. OverlayText.off_all() chỉ xóa chữ nổi của luồng này; cập nhật hiển thị có thể chờ.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Tìm đoạn giống sample nhất trong âm thanh này và trả điểm tương đồng. Im lặng không được tính là khớp; thiếu một phần âm thanh sẽ làm giảm điểm. Mẫu dài hơn âm thanh này sẽ báo lỗi. Không nhận dạng lời nói hay hiệu chỉnh tốc độ, cao độ. Chọn ngưỡng bằng các lần thu riêng và kiểm tra lại sau khi cập nhật bộ so khớp.","behavior":"Tìm đoạn giống sample nhất trong âm thanh này và trả điểm tương đồng. Im lặng không được tính là khớp; thiếu một phần âm thanh sẽ làm giảm điểm. Mẫu dài hơn âm thanh này sẽ báo lỗi. Không nhận dạng lời nói hay hiệu chỉnh tốc độ, cao độ. Chọn ngưỡng bằng các lần thu riêng và kiểm tra lại sau khi cập nhật bộ so khớp.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Chờ mẫu này trong âm thanh mới và trả AudioMatch đạt ngưỡng, hoặc None nếu hết cửa sổ thu mà không tìm thấy. Chỉ tìm trong âm thanh nhận sau khi bắt đầu gọi; không bảo đảm nhận diện đúng.\nTự bắt đầu nghe nếu cần, với cùng điều kiện như Audio.start(), và tiếp tục nghe đến Audio.stop() hoặc khi macro kết thúc. Xử lý có thể xong sau timeout_ms. Giá trị 0 trả None mà không bật thu.\nPause macro bỏ âm thanh đang chờ và tạm dừng thời gian chờ; Resume tìm trong âm thanh mới. Mất phiên thu, tràn dữ liệu hoặc âm thanh hỏng sẽ báo lỗi, không trả None.","behavior":"Chờ mẫu này trong âm thanh mới và trả AudioMatch đạt ngưỡng, hoặc None nếu hết cửa sổ thu mà không tìm thấy. Chỉ tìm trong âm thanh nhận sau khi bắt đầu gọi; không bảo đảm nhận diện đúng.\nTự bắt đầu nghe nếu cần, với cùng điều kiện như Audio.start(), và tiếp tục nghe đến Audio.stop() hoặc khi macro kết thúc. Xử lý có thể xong sau timeout_ms. Giá trị 0 trả None mà không bật thu.\nPause macro bỏ âm thanh đang chờ và tạm dừng thời gian chờ; Resume tìm trong âm thanh mới. Mất phiên thu, tràn dữ liệu hoặc âm thanh hỏng sẽ báo lỗi, không trả None.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 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. Cửa sổ thu là gần đúng; xử lý có thể kết thúc muộn hơn.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 vị trí theo pixel trên màn hình, dùng để nhấn, vuốt và đánh dấu. Scale và anchor giúp điều chỉnh vị trí khi kích thước màn hình thay đổi; vị trí cuối được giới hạn trong màn hình. Đọc hai tọa độ bằng x, y = point.","behavior":"Một vị trí theo pixel trên màn hình, dùng để nhấn, vuốt và đánh dấu. Scale và anchor giúp điều chỉnh vị trí khi kích thước màn hình thay đổi; vị trí cuối được giới hạn trong màn hình. Đọc hai tọa độ bằng x, y = point.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Cách điều chỉnh tọa độ từ màn hình nguồn của macro: fixed giữ pixel; auto đổi X theo tỉ lệ chiều rộng, Y theo tỉ lệ chiều cao; width hoặc height đổi cả hai trục theo kích thước đó. Tọa độ không cố định hoặc có anchor còn được quy đổi theo hướng xoay và vùng app của macro.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"Vị trí làm mốc khi điều chỉnh tọa độ: none (góc trên trái), center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right. auto chọn cạnh hoặc tâm gần nhất.","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":"Cách điều chỉnh tọa độ từ màn hình nguồn của macro: fixed giữ pixel; auto đổi X theo tỉ lệ chiều rộng, Y theo tỉ lệ chiều cao; width hoặc height đổi cả hai trục theo kích thước đó. Tọa độ không cố định hoặc có anchor còn được quy đổi theo hướng xoay và vùng app của macro.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"anchor","type":"String","defaultValue":"none","description":"Vị trí làm mốc khi điều chỉnh tọa độ: none (góc trên trái), center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right. auto chọn cạnh hoặc tâm gần nhất.","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-distance-to","kind":"METHOD","parentKey":"class-point","name":"distance_to","signature":"point.distance_to(other)","description":"Trả khoảng cách Euclid giữa tọa độ hữu hạn được lưu của hai Point. Cần dùng cùng hệ tọa độ; không đổi tỉ lệ hoặc cắt theo màn hình.","behavior":"Trả khoảng cách Euclid giữa tọa độ hữu hạn được lưu của hai Point. Cần dùng cùng hệ tọa độ; không đổi tỉ lệ hoặc cắt theo màn hình.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Point","defaultValue":null,"description":"Điểm còn lại.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Khoảng cách hữu hạn; tọa độ hoặc khoảng cách không hữu hạn gây lỗi.","example":"# Đo khoảng cách giữa hai điểm\nprint(Point(0, 0).distance_to(Point(3, 4)))","aliases":[],"group":"FLOW"},{"key":"class-point-method-offset","kind":"METHOD","parentKey":"class-point","name":"offset","signature":"point.offset(dx, dy, scale=None)","description":"Trả về Point mới dịch theo dx và dy sau khi quy đổi điểm này sang màn hình hiện tại. Độ dịch được điều chỉnh theo kích thước toàn màn hình, giữ X là trục ngang và Y là trục dọc. Point ban đầu không thay đổi.","behavior":"Trả về Point mới dịch theo dx và dy sau khi quy đổi điểm này sang màn hình hiện tại. Độ dịch được điều chỉnh theo kích thước toàn màn hình, giữ X là trục ngang và Y là trục dọc. Point ban đầu không thay đổi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"dx","type":"Int","defaultValue":null,"description":"Độ dịch ngang theo pixel nguyên: số dương dịch sang phải, số âm dịch sang trái. Không chấp nhận phần lẻ.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"dy","type":"Int","defaultValue":null,"description":"Độ dịch dọc theo pixel nguyên: số dương dịch xuống, số âm dịch lên. Không chấp nhận phần lẻ.","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 mới nằm trong 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":"Đánh dấu điểm này bằng khung vuông. Gọi lại trên cùng Point sẽ thay khung cũ. Hàm trả về trước khi vẽ xong; chỉ cập nhật mới nhất trước lần làm mới màn hình kế tiếp được hiển thị.","behavior":"Đánh dấu điểm này bằng khung vuông. Gọi lại trên cùng Point sẽ thay khung cũ. Hàm trả về trước khi vẽ xong; chỉ cập nhật mới nhất trước lần làm mới màn hình kế tiếp được hiển thị.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 khung theo dp; giá trị dưới 1 được đổi thành 1.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region_width","type":"Number","defaultValue":"36","description":"Chiều rộng và cao khung vuông theo pixel; giá trị dưới 1 được đổi thành 1.","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":"Xóa khung đánh dấu do Point này tạo ra.","behavior":"Xóa khung đánh dấu do Point này tạo ra.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 vị trí kèm cài đặt di chuyển cho một bước vuốt. Truyền danh sách ít nhất hai đối tượng SwipePoint vào swipe([...]) để một ngón tay đi qua các vị trí đó.","behavior":"Một vị trí kèm cài đặt di chuyển cho một bước vuốt. Truyền danh sách ít nhất hai đối tượng SwipePoint vào swipe([...]) để một ngón tay đi qua các vị trí đó.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["point","speed","delay_before","random","humanized","scale","anchor"],"fieldDocs":[{"name":"point","type":"Point","defaultValue":null,"description":"Vị trí vuốt theo pixel, kèm cài đặt scale và anchor.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"speed","type":"String","defaultValue":"NORMAL","description":"Tốc độ di chuyển từ điểm này đến điểm kế tiếp: VERY_SLOW, SLOW, NORMAL, FAST, VERY_FAST.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"delay_before","type":"Number","defaultValue":"0","description":"Thời gian chờ theo mili giây; giá trị âm được đổi thành 0. Với parallel=False, chờ trước khi bắt đầu ở điểm đầu hoặc sau khi đến điểm tiếp theo. Vuốt song song chỉ dùng thời gian chờ của điểm đầu.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"random","type":"Number","defaultValue":"10","description":"Độ lệch ngẫu nhiên tối đa theo pixel trên mỗi trục; 0 dùng đúng vị trí. Giá trị âm được đổi thành 0.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"humanized","type":"Boolean","defaultValue":"False","description":"Dùng đường cong cho toàn bộ lần vuốt nếu có bất kỳ SwipePoint nào có humanized=True.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"scale","type":"String","defaultValue":"fixed","description":"Cách điều chỉnh tọa độ như Point: fixed, auto, width, height. Kế thừa từ point nếu không truyền.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"Vị trí làm mốc như Point. Kế thừa từ point nếu không truyền; tuple ban đầu dùng none.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"point","type":"Point | tuple[Number, Number]","defaultValue":null,"description":"Point hoặc tuple (x, y) theo pixel. Giữ scale và anchor của Point, trừ khi truyền giá trị thay thế tại đây.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"speed","type":"String","defaultValue":"NORMAL","description":"Tốc độ di chuyển từ điểm này đến điểm kế tiếp: VERY_SLOW, SLOW, NORMAL, FAST, VERY_FAST.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"delay_before","type":"Number","defaultValue":"0","description":"Thời gian chờ theo mili giây; giá trị âm được đổi thành 0. Với parallel=False, chờ trước khi bắt đầu ở điểm đầu hoặc sau khi đến điểm tiếp theo. Vuốt song song chỉ dùng thời gian chờ của điểm đầu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"random","type":"Number","defaultValue":"10","description":"Độ lệch ngẫu nhiên tối đa theo pixel trên mỗi trục; 0 dùng đúng vị trí. Giá trị âm được đổi thành 0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"humanized","type":"Boolean","defaultValue":"False","description":"Dùng đường cong cho toàn bộ lần vuốt nếu có bất kỳ SwipePoint nào có humanized=True.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"scale","type":"String","defaultValue":"fixed","description":"Cách điều chỉnh tọa độ như Point: fixed, auto, width, height. Kế thừa từ point nếu không truyền.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"anchor","type":"String","defaultValue":"none","description":"Vị trí làm mốc như Point. Kế thừa từ point nếu không truyền; tuple ban đầu dùng none.","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":"Quản lý các lần nhấn và vuốt song song từ script hoặc action của macro: gom nhóm, xem tiến độ, chờ hoặc hủy. Trong script, dùng click(..., parallel=True) hoặc swipe(..., parallel=True). Gửi thao tác cần bật dịch vụ Trợ năng của CogniTab.","behavior":"Quản lý các lần nhấn và vuốt song song từ script hoặc action của macro: gom nhóm, xem tiến độ, chờ hoặc hủy. Trong script, dùng click(..., parallel=True) hoặc swipe(..., parallel=True). Gửi thao tác cần bật dịch vụ Trợ năng của CogniTab.","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"parallel=True xếp hàng chạm; delay_before, delay_after vẫn chờ ngoài chế độ collect. Touch.collect() gom, send() gửi và wait() chờ hoàn tất. Các luồng chạm có thể ảnh hưởng nhau."},"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":"Giữ các lệnh nhấn/vuốt tiếp theo trong script có parallel=True đến khi gọi Touch.send() để chúng có thể chạy cùng nhau. Các lời gọi khác không bị ảnh hưởng. Nếu không gom, lệnh song song được gửi ngay. Phải gọi Touch.send() trước khi script kết thúc, nếu còn thao tác chưa gửi thì script báo lỗi.","behavior":"Giữ các lệnh nhấn/vuốt tiếp theo trong script có parallel=True đến khi gọi Touch.send() để chúng có thể chạy cùng nhau. Các lời gọi khác không bị ảnh hưởng. Nếu không gom, lệnh song song được gửi ngay. Phải gọi Touch.send() trước khi script kết thúc, nếu còn thao tác chưa gửi thì script báo lỗi.","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"Trả về trước khi cử chỉ hoàn tất. Chạm đã gom chỉ chạy sau Touch.send(). Trạng thái mô tả lúc kiểm tra và có thể đổi ngay sau đó."},"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 các thao tác đã gom cùng nhau rồi tắt chế độ gom. Trả về ID dạng số theo thứ tự gom, hoặc danh sách rỗng nếu chưa gom thao tác nào. Quá 10 thao tác sẽ báo lỗi. Hàm không chờ chạy xong; dùng Touch.wait() để chờ.","behavior":"Gửi các thao tác đã gom cùng nhau rồi tắt chế độ gom. Trả về ID dạng số theo thứ tự gom, hoặc danh sách rỗng nếu chưa gom thao tác nào. Quá 10 thao tác sẽ báo lỗi. Hàm không chờ chạy xong; dùng Touch.wait() để chờ.","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"Trả về trước khi cử chỉ hoàn tất. Chạm đã gom chỉ chạy sau Touch.send(). Trạng thái mô tả lúc kiểm tra và có thể đổi ngay sau đó."},"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 các thao tác đã gửi đang chờ chạy. Thao tác được giữ bởi Touch.collect() chỉ xuất hiện sau Touch.send().","behavior":"Trả về trạng thái các thao tác đã gửi đang chờ chạy. Thao tác được giữ bởi Touch.collect() chỉ xuất hiện sau Touch.send().","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"Trả về trước khi cử chỉ hoàn tất. Chạm đã gom chỉ chạy sau Touch.send(). Trạng thái mô tả lúc kiểm tra và có thể đổi ngay sau đó."},"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ề trạng thái các thao tác đang chạy.","behavior":"Trả về trạng thái các thao tác đang chạy.","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"Trả về trước khi cử chỉ hoàn tất. Chạm đã gom chỉ chạy sau Touch.send(). Trạng thái mô tả lúc kiểm tra và có thể đổi ngay sau đó."},"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ề trạng thái thao tác đang chờ, đang chạy và tối đa 64 trạng thái vừa kết thúc. Không gồm thao tác chưa gửi bằng Touch.send().","behavior":"Trả về trạng thái thao tác đang chờ, đang chạy và tối đa 64 trạng thái vừa kết thúc. Không gồm thao tác chưa gửi bằng Touch.send().","execution":{"blocking":"no","threadSafety":"limited","parallel":"conditional","details":"Trả về trước khi cử chỉ hoàn tất. Chạm đã gom chỉ chạy sau Touch.send(). Trạng thái mô tả lúc kiểm tra và có thể đổi ngay sau đó."},"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ờ thao tác đã gửi có ID dạng số này và trả về TouchState, hoặc None nếu không có hoặc không còn lưu ID đó. Với id=None, chờ mọi thao tác đang chờ/đang chạy rồi trả về các trạng thái còn lưu, gồm cả thao tác vừa kết thúc. Cần gửi các thao tác đã gom trước khi chờ.","behavior":"Chờ thao tác đã gửi có ID dạng số này và trả về TouchState, hoặc None nếu không có hoặc không còn lưu ID đó. Với id=None, chờ mọi thao tác đang chờ/đang chạy rồi trả về các trạng thái còn lưu, gồm cả thao tác vừa kết thúc. Cần gửi các thao tác đã gom trước khi chờ.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ hết thời lượng hoặc chạm hoàn tất. Luồng khác có thể tiếp tục; tạm dừng và dừng vẫn có hiệu lực."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"TouchState | list[TouchState] | 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(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 thao tác đã gửi đang chờ/đang chạy theo ID dạng số; trả True nếu nhận lệnh hủy, ngược lại trả False. Với id=None, hủy mọi thao tác đang chờ/đang chạy và trả về số lệnh hủy đã nhận. Hủy thao tác đang chạy cần Android 8.0+ và báo lỗi trên Android 7.x. Không hủy thao tác còn được giữ bởi Touch.collect().","behavior":"Hủy thao tác đã gửi đang chờ/đang chạy theo ID dạng số; trả True nếu nhận lệnh hủy, ngược lại trả False. Với id=None, hủy mọi thao tác đang chờ/đang chạy và trả về số lệnh hủy đã nhận. Hủy thao tác đang chạy cần Android 8.0+ và báo lỗi trên Android 7.x. Không hủy thao tác còn được giữ bởi Touch.collect().","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"parallel=True xếp hàng chạm; delay_before, delay_after vẫn chờ ngoài chế độ collect. Touch.collect() gom, send() gửi và wait() chờ hoàn tất. Các luồng chạm có thể ảnh hưởng nhau."},"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":"Trạng thái của một lần nhấn hoặc vuốt song song tại thời điểm truy vấn. Lấy đối tượng này qua các hàm Touch; trạng thái không tự cập nhật.","behavior":"Trạng thái của một lần nhấn hoặc vuốt song song tại thời điểm truy vấn. Lấy đối tượng này qua các hàm Touch; trạng thái không tự cập nhật.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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: đang chờ; active: đang chạy; completed: đã hoàn tất thành công; cancelled: đã hủy; failed: không thể hoàn tất.","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 trong macro đã gửi thao tác này.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"remaining_repeats","type":"Number","defaultValue":"0","description":"Số lần lặp chưa hoàn tất.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"completed_repeats","type":"Number","defaultValue":"0","description":"Số lần lặp đã 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ài đặt tìm ảnh mẫu trong Region. Truyền đối tượng này vào scale_param của Region; các cài đặt này không thay đổi tọa độ vùng.","behavior":"Cài đặt tìm ảnh mẫu trong Region. Truyền đối tượng này vào scale_param của Region; các cài đặt này không thay đổi tọa độ vùng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ử các kích thước ảnh mẫu lân cận sau khi áp dụng template_scale. Khoảng thử tùy kích thước/mật độ màn hình và có thể mở rộng từ 0.70x đến 1.30x. Không có tác dụng khi template_scale=\"NONE\".","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"cache_scale","type":"Boolean","defaultValue":"True","description":"Ghi nhớ kích thước auto_scale tìm thành công để dùng khi tìm lại với cùng cài đặt. Chỉ áp dụng khi auto_scale=True.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"template_scale","type":"String","defaultValue":"SHORT_EDGE","description":"Cách đổi kích thước ảnh mẫu cho thiết bị này: SHORT_EDGE theo cạnh màn hình ngắn; LONG_EDGE theo cạnh dài; DPI theo mật độ pixel; SMALLEST_WIDTH_DP theo cạnh ngắn tính bằng dp. NONE giữ nguyên kích thước ảnh.","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ử các kích thước ảnh mẫu lân cận sau khi áp dụng template_scale. Khoảng thử tùy kích thước/mật độ màn hình và có thể mở rộng từ 0.70x đến 1.30x. Không có tác dụng khi template_scale=\"NONE\".","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"cache_scale","type":"Boolean","defaultValue":"True","description":"Ghi nhớ kích thước auto_scale tìm thành công để dùng khi tìm lại với cùng cài đặt. Chỉ áp dụng khi auto_scale=True.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"template_scale","type":"String","defaultValue":"SHORT_EDGE","description":"Cách đổi kích thước ảnh mẫu cho thiết bị này: SHORT_EDGE theo cạnh màn hình ngắn; LONG_EDGE theo cạnh dài; DPI theo mật độ pixel; SMALLEST_WIDTH_DP theo cạnh ngắn tính bằng dp. NONE giữ nguyên kích thước ảnh.","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 chữ nhật trên màn hình để tìm ảnh hoặc màu, chụp ảnh hoặc vẽ khung đánh dấu. Tọa độ dùng pixel theo trục ngang/dọc hiện tại; sau khi điều chỉnh kích thước và độ lệch, chỉ phần trong màn hình được sử dụng. Đọc kích thước bằng x, y, width, height = region.","behavior":"Một vùng chữ nhật trên màn hình để tìm ảnh hoặc màu, chụp ảnh hoặc vẽ khung đánh dấu. Tọa độ dùng pixel theo trục ngang/dọc hiện tại; sau khi điều chỉnh kích thước và độ lệch, chỉ phần trong màn hình được sử dụng. Đọc kích thước bằng x, y, width, height = region.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tạo hoặc tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riê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":"Cách điều chỉnh tọa độ giữa các màn hình: fixed giữ pixel; auto đổi X theo tỉ lệ chiều rộng, Y theo tỉ lệ chiều cao; width hoặc height đổi cả hai trục theo kích thước đó. Dùng kích thước màn hình nguồn của macro, không xoay trục và không dùng kích thước cửa sổ app.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"anchor","type":"String","defaultValue":"none","description":"Vị trí làm mốc khi điều chỉnh tọa độ: none (góc trên trái), center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right. auto chọn cạnh hoặc tâm gần nhất.","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":"Cách điều chỉnh tọa độ giữa các màn hình: fixed giữ pixel; auto đổi X theo tỉ lệ chiều rộng, Y theo tỉ lệ chiều cao; width hoặc height đổi cả hai trục theo kích thước đó. Dùng kích thước màn hình nguồn của macro, không xoay trục và không dùng kích thước cửa sổ app.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"anchor","type":"String","defaultValue":"none","description":"Vị trí làm mốc khi điều chỉnh tọa độ: none (góc trên trái), center, top, bottom, left, right, top_left, top_right, bottom_left, bottom_right. auto chọn cạnh hoặc tâm gần nhất.","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-from-center","kind":"STATIC_METHOD","parentKey":"class-region","name":"from_center","signature":"Region.from_center(cx, cy, width, height)","description":"Tạo Region cố định, không anchor từ tọa độ tâm hữu hạn và kích thước hữu hạn dương. Giữ nguyên tọa độ lẻ.","behavior":"Tạo Region cố định, không anchor từ tọa độ tâm hữu hạn và kích thước hữu hạn dương. Giữ nguyên tọa độ lẻ.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính từ các giá trị đã lưu, không chụp màn hình. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"cx","type":"Number","defaultValue":null,"description":"Tọa độ X của tâm.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"cy","type":"Number","defaultValue":null,"description":"Tọa độ Y của tâm.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"width","type":"Number","defaultValue":null,"description":"Chiều rộng dương.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"height","type":"Number","defaultValue":null,"description":"Chiều cao dương.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Region","returnDescription":"Tọa độ và các cạnh sau tính toán phải hữu hạn; nếu không sẽ báo lỗi.","example":"# Tạo vùng quanh một tâm\narea = Region.from_center(100, 200, 50, 30)","aliases":[],"group":"FLOW"},{"key":"class-region-static-method-highlighted","kind":"STATIC_METHOD","parentKey":"class-region","name":"highlighted","signature":"Region.highlighted()","description":"Trả về các vùng màn hình đang được script đánh dấu, gồm cả khung vuông tạo bởi Point.highlight().","behavior":"Trả về các vùng màn hình đang được script đánh dấu, gồm cả khung vuông tạo bởi Point.highlight().","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Region","returnDescription":"Region phủ toàn màn hình hiện tại từ (0, 0).","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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-intersection","kind":"METHOD","parentKey":"class-region","name":"intersection","signature":"region.intersection(other)","description":"Trả Region mới là phần giao có diện tích dương, hoặc None. Hai cạnh chỉ chạm nhau không giao nhau. Dùng tọa độ đã lưu trong cùng hệ tọa độ, không chụp, đổi tỉ lệ hay cắt; giữ scale, anchor và scale_param của Region này, không thay đổi đối tượng gốc.","behavior":"Trả Region mới là phần giao có diện tích dương, hoặc None. Hai cạnh chỉ chạm nhau không giao nhau. Dùng tọa độ đã lưu trong cùng hệ tọa độ, không chụp, đổi tỉ lệ hay cắt; giữ scale, anchor và scale_param của Region này, không thay đổi đối tượng gốc.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính từ các giá trị đã lưu, không chụp màn hình. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Region","defaultValue":null,"description":"Vùng còn lại.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Region?","returnDescription":"Tọa độ và các cạnh sau tính toán phải hữu hạn; nếu không sẽ báo lỗi.","example":"# Tìm vùng giao nhau\noverlap = Region(0, 0, 100, 100).intersection(Region(50, 50, 100, 100))","aliases":[],"group":"FLOW"},{"key":"class-region-method-intersects","kind":"METHOD","parentKey":"class-region","name":"intersects","signature":"region.intersects(other)","description":"Kiểm tra phần giao có diện tích dương bằng tọa độ đã lưu trong cùng hệ tọa độ. Hai cạnh chỉ chạm nhau không giao; không chụp, đổi tỉ lệ hay cắt.","behavior":"Kiểm tra phần giao có diện tích dương bằng tọa độ đã lưu trong cùng hệ tọa độ. Hai cạnh chỉ chạm nhau không giao; không chụp, đổi tỉ lệ hay cắt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính từ các giá trị đã lưu, không chụp màn hình. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Region","defaultValue":null,"description":"Vùng còn lại.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"Tọa độ và các cạnh sau tính toán phải hữu hạn; nếu không sẽ báo lỗi.","example":"# Kiểm tra hai vùng có giao nhau\nprint(Region(0, 0, 100, 100).intersects(Region(50, 50, 20, 20)))","aliases":[],"group":"FLOW"},{"key":"class-region-method-contains","kind":"METHOD","parentKey":"class-region","name":"contains","signature":"region.contains(point_or_region)","description":"Kiểm tra bao chứa bằng tọa độ đã lưu trong cùng hệ tọa độ, không chụp, đổi tỉ lệ hay cắt. Point được tính ở cạnh trái và trên, không tính ở cạnh phải và dưới. Region có thể trùng cạnh; kích thước rỗng hoặc âm trả False.","behavior":"Kiểm tra bao chứa bằng tọa độ đã lưu trong cùng hệ tọa độ, không chụp, đổi tỉ lệ hay cắt. Point được tính ở cạnh trái và trên, không tính ở cạnh phải và dưới. Region có thể trùng cạnh; kích thước rỗng hoặc âm trả False.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính từ các giá trị đã lưu, không chụp màn hình. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"point_or_region","type":"Point | Region","defaultValue":null,"description":"Điểm hoặc vùng cần kiểm tra.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"Tọa độ và các cạnh sau tính toán phải hữu hạn; nếu không sẽ báo lỗi.","example":"# Kiểm tra điểm có nằm trong vùng\nprint(Region(0, 0, 100, 100).contains(Point(10, 10)))","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":"Tìm một vị trí khớp ảnh mẫu trong vùng này. Thử lại đến khi tìm thấy hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình. ScreenCapture.cache_on() cho các lần tìm dùng lại một ảnh chụp đến khi gọi cache_off(); nếu không, ảnh vẫn được tự động dùng lại tối đa 100 ms. Dùng auto_cache_off() để lấy ảnh mới nhất hiện có, nhưng sẽ cần chụp nhiều hơn.","behavior":"Tìm một vị trí khớp ảnh mẫu trong vùng này. Thử lại đến khi tìm thấy hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình. ScreenCapture.cache_on() cho các lần tìm dùng lại một ảnh chụp đến khi gọi cache_off(); nếu không, ảnh vẫn được tự động dùng lại tối đa 100 ms. Dùng auto_cache_off() để lấy ảnh mới nhất hiện có, nhưng sẽ cần chụp nhiều hơn.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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 ảnh mẫu hoặc đường dẫn thư mục tương đối không kèm đuôi ảnh trong macro hiện tại, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match có found=True khi tìm thấy; nếu không, found=False sau lượt quét hoặc khi hết thời gian. Không trả None.","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":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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 ảnh mẫu hoặc đường dẫn thư mục tương đối không kèm đuôi ảnh trong macro hiện tại, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","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":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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":"Tên ảnh mẫu/đường dẫn thư mục tương đối không kèm đuôi ảnh, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Một Match cho mỗi ảnh mẫu theo thứ tự đầu vào khi tìm thấy ít nhất một ảnh; một số mục có thể có found=False. MatchList rỗng nếu không tìm thấy ảnh nào trước khi hết thời gian.","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":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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":"Tên ảnh mẫu/đường dẫn thư mục tương đối không kèm đuôi ảnh, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Một Match tìm thấy cho mỗi ảnh mẫu theo thứ tự đầu vào, hoặc MatchList rỗng nếu không có lượt quét nào tìm đủ trước khi hết thời gian.","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":"Tìm một pixel được kiểm tra có màu gần mục tiêu nhất trong vùng này. Sai lệch của từng kênh đỏ, xanh lá và xanh dương không được vượt tolerance; chọn điểm có sai lệch lớn nhất giữa các kênh nhỏ nhất. Thử lại đến khi tìm thấy hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình.","behavior":"Tìm một pixel được kiểm tra có màu gần mục tiêu nhất trong vùng này. Sai lệch của từng kênh đỏ, xanh lá và xanh dương không được vượt tolerance; chọn điểm có sai lệch lớn nhất giữa các kênh nhỏ nhất. Thử lại đến khi tìm thấy hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"10","description":"Khoảng cách yêu cầu theo pixel giữa các vị trí được kiểm tra; tối thiểu 1. Giá trị nhỏ kiểm tra nhiều pixel hơn và có thể lâu hơn. Khoảng cách có thể tự tăng khi vùng lớn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match có tối đa một Point trong point, hoặc found=False và danh sách point rỗng nếu không có pixel được kiểm tra nào khớp hoặc không thể chụp.","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":"Tìm bất kỳ màu mục tiêu nào trong vùng này theo quy tắc sai số RGB của find_color. Mỗi màu tìm thấy trả tối đa một điểm được kiểm tra tốt nhất, theo thứ tự đầu vào. Thử lại đến khi tìm thấy ít nhất một màu hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình.","behavior":"Tìm bất kỳ màu mục tiêu nào trong vùng này theo quy tắc sai số RGB của find_color. Mỗi màu tìm thấy trả tối đa một điểm được kiểm tra tốt nhất, theo thứ tự đầu vào. Thử lại đến khi tìm thấy ít nhất một màu hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"10","description":"Khoảng cách yêu cầu theo pixel giữa các vị trí được kiểm tra; tối thiểu 1. Giá trị nhỏ kiểm tra nhiều pixel hơn và có thể lâu hơn. Khoảng cách có thể tự tăng khi vùng lớn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match có một Point tốt nhất cho mỗi màu tìm thấy trong point, theo thứ tự đầu vào. found=False và danh sách point rỗng nếu không có màu khớp hoặc không thể chụp.","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":"Tìm mọi pixel được kiểm tra khớp một màu mục tiêu theo quy tắc sai số RGB của find_color. Danh sách hoặc tuple màu sẽ gây lỗi. Thử lại đến khi tìm thấy ít nhất một điểm hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình.","behavior":"Tìm mọi pixel được kiểm tra khớp một màu mục tiêu theo quy tắc sai số RGB của find_color. Danh sách hoặc tuple màu sẽ gây lỗi. Thử lại đến khi tìm thấy ít nhất một điểm hoặc hết thời gian; timeout=0 quét một lần. Cần sẵn sàng chụp màn hình.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"interval","type":"Number","defaultValue":"10","description":"Khoảng cách yêu cầu theo pixel giữa các vị trí được kiểm tra; tối thiểu 1. Giá trị nhỏ kiểm tra nhiều pixel hơn và có thể lâu hơn. Khoảng cách có thể tự tăng khi vùng lớn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match chứa các Point được kiểm tra khớp màu trong point, màu gần nhất đứng trước. found=False và danh sách point rỗng nếu không có điểm khớp hoặc không thể chụp.","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":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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 ảnh mẫu hoặc đường dẫn thư mục tương đối không kèm đuôi ảnh trong macro hiện tại, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Match mới nhất: found=False nghĩa là không thấy ảnh; found=True nghĩa là vẫn thấy ảnh khi kết thúc chờ. Không trả None. Cần sẵn sàng chụp màn hình; không thể chụp cũng có thể trả found=False.","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":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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":"Tên ảnh mẫu/đường dẫn thư mục tương đối không kèm đuôi ảnh, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Match mới nhất của mỗi ảnh mẫu theo thứ tự đầu vào khi có ảnh biến mất hoặc hết thời gian. Kiểm tra found của từng mục; False nghĩa là không thấy ảnh đó. Cần sẵn sàng chụp màn hình; không thể chụp cũng có thể trả found=False.","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":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"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":"Tên ảnh mẫu/đường dẫn thư mục tương đối không kèm đuôi ảnh, hoặc đối tượng Template. Tên không tồn tại sẽ gây lỗi.","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. Bỏ qua, 0 hoặc số âm thì quét một lần. Lượt quét đang chạy có thể kết thúc sau thời gian này.","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ượt quét yêu cầu mỗi giây khi chờ, giới hạn từ 1 đến 60. Tốc độ thực tế phụ thuộc thời gian nhận diện.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Match mới nhất của mỗi ảnh mẫu theo thứ tự đầu vào khi ảnh biến mất hoặc hết thời gian. Mọi giá trị found đều False chỉ khi không thấy ảnh nào. Cần sẵn sàng chụp màn hình; không thể chụp cũng có thể trả found=False.","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 vùng màn hình này thành Template. Cần phiên chụp màn hình đang hoạt động đã được người dùng cho phép. Báo lỗi nếu không thể chụp hoặc vùng nằm hoàn toàn ngoài màn hình.","behavior":"Chụp vùng màn hình này thành Template. Cần phiên chụp màn hình đang hoạt động đã được người dùng cho phép. Báo lỗi nếu không thể chụp hoặc vùng nằm hoàn toàn ngoài màn hình.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ chụp màn hình chung và nhận diện. find* tìm sự xuất hiện; wait* chờ biến mất. Một lần kiểm tra vẫn mất thời gian; timeout/rate không bỏ việc chờ này."},"limitations":[],"relatedApis":["class-screencapture","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String?","defaultValue":"None","description":"Truyền tên để lưu ảnh ngay vào macro hiện tại; None tạo ảnh tạm. Không được lưu ảnh có tên trong macro được bảo vệ.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Template","returnDescription":"Template chứa ảnh vừa chụp.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Chiều rộng cần bỏ: 0-1 là tỉ lệ chiều rộng hiện tại; trên 1 là pixel, tối đa bằng toàn bộ chiều rộng. Giá trị âm gây lỗi.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Chiều rộng cần bỏ: 0-1 là tỉ lệ chiều rộng hiện tại; trên 1 là pixel, tối đa bằng toàn bộ chiều rộng. Giá trị âm gây lỗi.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Chiều cao cần bỏ: 0-1 là tỉ lệ chiều cao hiện tại; trên 1 là pixel, tối đa bằng toàn bộ chiều cao. Giá trị âm gây lỗi.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Chiều cao cần bỏ: 0-1 là tỉ lệ chiều cao hiện tại; trên 1 là pixel, tối đa bằng toàn bộ chiều cao. Giá trị âm gây lỗi.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Tổng chiều rộng cần bỏ, chia đều hai bên: 0-1 là tỉ lệ, trên 1 là pixel. Tối đa bằng toàn bộ chiều rộng; giá trị âm gây lỗi.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Tổng chiều cao cần bỏ, chia đều hai bên: 0-1 là tỉ lệ, trên 1 là pixel. Tối đa bằng toàn bộ chiều cao; giá trị âm gây lỗi.","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 tính vùng màn hình, không chụp hay nhận diện. Mỗi luồng dùng đối tượng Region có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Number","defaultValue":"0.5","description":"Mức bỏ trên mỗi chiều: 0-1 là tỉ lệ của chiều đó; trên 1 là pixel. Chia đều hai cạnh đối diện, tối đa bằng kích thước mỗi chiều. Giá trị âm gây lỗi.","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 chữ nhật quanh vùng này. Gọi lại trên cùng Region sẽ thay khung cũ. Hàm trả về trước khi vẽ xong; chỉ cập nhật mới nhất trước lần làm mới màn hình kế tiếp được hiển thị.","behavior":"Vẽ khung chữ nhật quanh vùng này. Gọi lại trên cùng Region sẽ thay khung cũ. Hàm trả về trước khi vẽ xong; chỉ cập nhật mới nhất trước lần làm mới màn hình kế tiếp được hiển thị.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 khung theo dp; giá trị dưới 1 được đổi thành 1.","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":"Xóa khung đánh dấu do Region này tạo ra.","behavior":"Xóa khung đánh dấu do Region này tạo ra.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Dùng ảnh đã lưu làm mẫu nhận diện. Bạn có thể đổi kích thước hoặc cắt ảnh thành Template riêng, rồi lưu kết quả bằng save_as().","behavior":"Dùng ảnh đã lưu làm mẫu nhận diện. Bạn có thể đổi kích thước hoặc cắt ảnh thành Template riêng, rồi lưu kết quả bằng save_as().","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["name"],"fieldDocs":[{"name":"name","type":"String?","defaultValue":null,"description":"Tên mẫu hoặc đường dẫn thư mục tương đối trong macro hiện tại; None nếu ảnh chưa có tên.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"name":"name","type":"String","defaultValue":null,"description":"Mẫu đã lưu trong macro hiện tại, ví dụ \"buttons/top/attack\". Tên rỗng, không tìm thấy hoặc trùng nhiều mẫu sẽ báo lỗi; lời gọi này không chụp ảnh mới.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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-similarity","kind":"METHOD","parentKey":"class-template","name":"similarity","signature":"template.similarity(other)","description":"So sánh bố cục sáng tối tổng thể của hai ảnh. Ảnh không đọc được hoặc khác kích thước sẽ báo lỗi. Phép so sánh bỏ qua độ trong suốt và có thể bỏ sót thay đổi màu, độ sáng hoặc chi tiết nhỏ; điểm 100 không có nghĩa là giống từng pixel.","behavior":"So sánh bố cục sáng tối tổng thể của hai ảnh. Ảnh không đọc được hoặc khác kích thước sẽ báo lỗi. Phép so sánh bỏ qua độ trong suốt và có thể bỏ sót thay đổi màu, độ sáng hoặc chi tiết nhỏ; điểm 100 không có nghĩa là giống từng pixel.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"Template","defaultValue":null,"description":"Template cần so sánh, bắt buộc cùng chiều rộng và chiều cao của ảnh.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Number","returnDescription":"Độ giống từ 0 đến 100, mỗi mức cách nhau 1.5625; điểm càng cao thì bố cục sáng tối càng giống nhau.","example":"# So sánh hai template đã lưu có cùng kích thước.\nbefore = Template(\"before\")\nafter = Template(\"after\")\nscore = before.similarity(after)\nprint(score)","aliases":[],"group":"FLOW"},{"key":"class-template-method-exists","kind":"METHOD","parentKey":"class-template","name":"exists","signature":"template.exists()","description":"Kiểm tra file ảnh của Template này còn tồn tại hay không. Phép kiểm tra này không xác nhận ảnh có đọc được hay không.","behavior":"Kiểm tra file ảnh của Template này còn tồn tại hay không. Phép kiểm tra này không xác nhận ảnh có đọc được hay không.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Đổi kích thước ảnh và trả về Template riêng, giữ nguyên ảnh gốc. Dùng save_as() để lưu ảnh với tên bạn chọn.","behavior":"Đổi kích thước ảnh và trả về Template riêng, giữ nguyên ảnh gốc. Dùng save_as() để lưu ảnh với tên bạn chọn.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"scale","type":"Number","defaultValue":null,"description":"Hệ số nhân chiều rộng: 1 giữ nguyên, 0.5 giảm một nửa, 2 tăng gấp đôi. Giá trị dưới 0.01 được nâng lên 0.01. Cũng áp dụng cho chiều cao nếu bỏ qua scale_y.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"scale_y","type":"Number","defaultValue":"scale","description":"Hệ số nhân chiều cao, tối thiểu 0.01. Bỏ qua để giữ nguyên tỉ lệ ảnh.","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 một phần ảnh và trả về Template riêng, giữ nguyên ảnh gốc. Dùng save_as() để lưu ảnh với tên bạn chọn.","behavior":"Cắt một phần ảnh và trả về Template riêng, giữ nguyên ảnh gốc. Dùng save_as() để lưu ảnh với tên bạn chọn.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"region","type":"Region","defaultValue":null,"description":"Vùng cắt tính bằng pixel ảnh, lấy góc trên bên trái ảnh làm gốc, không dùng tọa độ màn hình. Tọa độ được bỏ phần thập phân và giới hạn trong biên ảnh.","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 ảnh vào macro hiện tại và trả về Template đã lưu. Macro được bảo vệ không thể lưu mẫu; file ảnh gốc không còn tồn tại sẽ gây lỗi.","behavior":"Lưu ảnh vào macro hiện tại và trả về Template đã lưu. Macro được bảo vệ không thể lưu mẫu; file ảnh gốc không còn tồn tại sẽ gây lỗi.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên không rỗng hoặc đường dẫn thư mục tương đối, ví dụ \"buttons/top/attack\". Ảnh đã có tại đường dẫn đó sẽ bị thay thế.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Đọc kết quả của một lần tìm kiếm nhận diện. Kiểm tra found trước khi nhấn hoặc dùng vị trí; lần tìm ảnh thất bại vẫn có thể chứa vị trí ứng viên giống nhất.","behavior":"Đọc kết quả của một lần tìm kiếm nhận diện. Kiểm tra found trước khi nhấn hoặc dùng vị trí; lần tìm ảnh thất bại vẫn có thể chứa vị trí ứng viên giống nhất.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Vị trí kết quả: Point, list các Point hoặc None. Tìm màu trả về list, có thể rỗng. Kiểm tra found và dạng giá trị trước khi đọc tọa độ hoặc lấy phần tử list.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"bounds","type":"Region?","defaultValue":null,"description":"Hình chữ nhật bao quanh kết quả, hoặc None nếu không có. Tìm ảnh thất bại vẫn có thể cung cấp vùng của ứng viên giống nhất; hãy kiểm tra found trước.","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":"Thông tin bổ sung của kết quả, hoặc None. Kết quả mô hình có thể gồm class_id, class_name, thời gian ở các trường kết thúc bằng _ms (mili giây), input_width/input_height (pixel). Kết quả màu có thể gồm target_color, sampled_color, max_channel_delta, match_count và matches. Các khóa tùy theo phép tìm; kiểm tra khóa tồn tại trước khi đọc.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":"# Đọc an toàn thông tin tùy chọn và các điểm màu.\nm = 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\nif info is not None:\n    info_class_id = info.get(\"class_id\")\n    info_class_name = info.get(\"class_name\")\n\ncolor_hit = Region(0, 0, 1080, 1920).find_color(\"#FFFFFF\", tolerance=4)\ncolor_name = color_hit.name\nif color_hit.found and color_hit.point:\n    first_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":"Đánh dấu kết quả tìm thấy trên màn hình. Vẽ bounds nếu có, nếu không thì vẽ hình vuông quanh từng điểm; không vẽ khi found=false. Khung được lên lịch vẽ nên lời gọi có thể trả về trước khi khung xuất hiện. Với cùng một đối tượng, chỉ cập nhật đang chờ mới nhất được vẽ ở khung hình màn hình kế tiếp.","behavior":"Đánh dấu kết quả tìm thấy trên màn hình. Vẽ bounds nếu có, nếu không thì vẽ hình vuông quanh từng điểm; không vẽ khi found=false. Khung được lên lịch vẽ nên lời gọi có thể trả về trước khi khung xuất hiện. Với cùng một đối tượng, chỉ cập nhật đang chờ mới nhất được vẽ ở khung hình màn hình kế tiếp.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 bằng pixel, tối thiểu 1.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region_width","type":"Number","defaultValue":"36","description":"Độ rộng hình vuông tính bằng pixel khi chỉ có điểm, tối thiểu 1.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_hide_ms","type":"Number","defaultValue":"0","description":"Thời gian trước khi ẩn, tính bằng mili giây. 0 hoặc giá trị âm giữ khung hiển thị cho đến khi gọi highlight_off().","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Match","returnDescription":"Chính Match này để bạn có thể gọi tiếp phương thức của nó.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Đọc nhiều kết quả nhận diện dưới dạng list các Match. Dùng len(matches), matches[index] hoặc vòng lặp for. List có phần tử vẫn có thể chứa kết quả không tìm thấy, nhất là sau wait_any()/wait_all(); hãy kiểm tra found của từng phần tử.","behavior":"Đọc nhiều kết quả nhận diện dưới dạng list các Match. Dùng len(matches), matches[index] hoặc vòng lặp for. List có phần tử vẫn có thể chứa kết quả không tìm thấy, nhất là sau wait_any()/wait_all(); hãy kiểm tra found của từng phần tử.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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-unique","kind":"METHOD","parentKey":"class-matchlist","name":"unique","signature":"matches.unique(iou_threshold=0.5)","description":"Trả MatchList mới, loại kết quả trùng theo từng tên bằng cách duyệt tham lam khi IoU vượt ngưỡng. Match tìm thấy có bounds diện tích dương được duyệt theo confidence giảm dần, giữ thứ tự khi bằng nhau. Match thất bại, thiếu bounds hoặc diện tích không dương được giữ ở cuối theo thứ tự ban đầu. Bounds hoặc confidence không hữu hạn tham gia xử lý gây lỗi. Giữ nguyên đối tượng Match và metadata, không sửa dữ liệu gốc.","behavior":"Trả MatchList mới, loại kết quả trùng theo từng tên bằng cách duyệt tham lam khi IoU vượt ngưỡng. Match tìm thấy có bounds diện tích dương được duyệt theo confidence giảm dần, giữ thứ tự khi bằng nhau. Match thất bại, thiếu bounds hoặc diện tích không dương được giữ ở cuối theo thứ tự ban đầu. Bounds hoặc confidence không hữu hạn tham gia xử lý gây lỗi. Giữ nguyên đối tượng Match và metadata, không sửa dữ liệu gốc.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính từ các giá trị đã lưu, không chụp màn hình. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iou_threshold","type":"Number","defaultValue":"0.5","description":"Ngưỡng IoU hữu hạn từ 0 đến 1, tính cả hai đầu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Match tìm thấy có bounds phải có tọa độ và các cạnh sau tính toán hữu hạn, kể cả khi diện tích không dương.","example":"# Loại kết quả trùng cùng tên\nhits = Region.full_screen().find_all([\"enemy\", \"enemy\"], 1000)\nfiltered = hits.unique(iou_threshold=0.5)","aliases":[],"group":"FLOW"},{"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":"Đánh dấu từng kết quả tìm thấy bằng bounds hoặc hình vuông quanh các điểm. Bỏ qua kết quả không có vị trí. Khung được lên lịch vẽ nên lời gọi có thể trả về trước khi khung xuất hiện. Với cùng một đối tượng, chỉ cập nhật đang chờ mới nhất được vẽ ở khung hình màn hình kế tiếp.","behavior":"Đánh dấu từng kết quả tìm thấy bằng bounds hoặc hình vuông quanh các điểm. Bỏ qua kết quả không có vị trí. Khung được lên lịch vẽ nên lời gọi có thể trả về trước khi khung xuất hiện. Với cùng một đối tượng, chỉ cập nhật đang chờ mới nhất được vẽ ở khung hình màn hình kế tiếp.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 bằng pixel, tối thiểu 1.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"region_width","type":"Number","defaultValue":"36","description":"Độ rộng hình vuông tính bằng pixel khi chỉ có điểm, tối thiểu 1.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"auto_hide_ms","type":"Number","defaultValue":"0","description":"Thời gian trước khi ẩn, tính bằng mili giây. 0 hoặc giá trị âm giữ khung hiển thị cho đến khi gọi highlight_off().","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MatchList","returnDescription":"Chính MatchList này để bạn có thể gọi tiếp phương thức của nó.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Lưu một màu, lấy màu trên màn hình hoặc so sánh các màu. ARGB gồm độ đục (A), đỏ (R), xanh lá (G) và xanh dương (B); compare(), distance_rgb() và delta_e() bỏ qua độ đục.","behavior":"Lưu một màu, lấy màu trên màn hình hoặc so sánh các màu. ARGB gồm độ đục (A), đỏ (R), xanh lá (G) và xanh dương (B); compare(), distance_rgb() và delta_e() bỏ qua độ đục.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Độ đục từ 0 (trong suốt) đến 255 (hoàn toàn không trong suốt).","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":"Lấy màu màn hình một lần: Point trả về một Color, Region trả về các hàng màu, list[Point] trả về list màu theo đúng thứ tự. Các điểm dùng cùng một ảnh màn hình. Khi chưa thể chụp màn hình hoặc thiếu mẫu, trả về default mà không thử lại; nên chọn default phân biệt được với màu cần tìm.","behavior":"Lấy màu màn hình một lần: Point trả về một Color, Region trả về các hàng màu, list[Point] trả về list màu theo đúng thứ tự. Các điểm dùng cùng một ảnh màn hình. Khi chưa thể chụp màn hình hoặc thiếu mẫu, trả về default mà không thử lại; nên chọn default phân biệt được với màu cần tìm.","execution":{"blocking":"yes","threadSafety":"serialized","parallel":"conditional","details":"Chờ chụp màn hình và lấy màu. Mọi luồng dùng chung thiết lập chụp và dùng lại ảnh."},"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":"Khoảng cách giữa các điểm lấy màu theo đơn vị tọa độ của Region; giá trị dưới 1 được nâng lên 1. Giá trị nhỏ hơn trả về nhiều màu hơn. Không dùng cho Point và list[Point].","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":"Các màu theo cấu trúc target, thay mẫu không lấy được bằng default. Với Region, đọc grid[hàng][cột], từ trên xuống dưới và trái sang phải. List điểm rỗng trả về list rỗng.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Chênh lệch tối đa cho phép trên từng kênh RGB. 0 yêu cầu các kênh bằng nhau; 255 chấp nhận mọi màu RGB. Giá trị âm được đưa về 0. Tăng dần dựa trên mẫu màu màn hình thật.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true nếu cả ba kênh RGB đều nằm trong tolerance; ngược lại là false.","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":"Đo chênh lệch tổng hợp của ba kênh đỏ, xanh lá và xanh dương giữa hai màu. Giá trị nhỏ hơn nghĩa là các kênh RGB gần nhau hơn; bỏ qua độ trong suốt.","behavior":"Đo chênh lệch tổng hợp của ba kênh đỏ, xanh lá và xanh dương giữa hai màu. Giá trị nhỏ hơn nghĩa là các kênh RGB gần nhau hơn; bỏ qua độ trong suốt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 từ 0 đến khoảng 441.67; 0 nghĩa là các kênh RGB giống hệt nhau. Chọn ngưỡng bằng các mẫu màu trên màn hình của bạn.","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":"Ước lượng hai màu trông khác nhau đến mức nào bằng CIE76 Delta E, một phép đo chênh lệch màu. Giá trị nhỏ hơn nghĩa là màu gần nhau hơn; bỏ qua độ trong suốt.","behavior":"Ước lượng hai màu trông khác nhau đến mức nào bằng CIE76 Delta E, một phép đo chênh lệch màu. Giá trị nhỏ hơn nghĩa là màu gần nhau hơn; bỏ qua độ trong suốt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 không âm; 0 nghĩa là các kênh RGB giống hệt nhau. Hãy thử ngưỡng trên màn hình của bạn vì cảm nhận độ giống màu có thể 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-in-range","kind":"METHOD","parentKey":"class-color","name":"in_range","signature":"color.in_range(min_color, max_color)","description":"Kiểm tra từng kênh RGB nằm trong khoảng gồm cả hai đầu; bỏ qua alpha. Cận dưới lớn hơn cận trên ở bất kỳ kênh nào gây lỗi.","behavior":"Kiểm tra từng kênh RGB nằm trong khoảng gồm cả hai đầu; bỏ qua alpha. Cận dưới lớn hơn cận trên ở bất kỳ kênh nào gây lỗi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"min_color","type":"Color | String | Number","defaultValue":null,"description":"Cận màu dưới.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"max_color","type":"Color | String | Number","defaultValue":null,"description":"Cận màu trên.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":null,"example":"# Kiểm tra màu có nằm trong khoảng RGB\nprint(Color(\"#808080\").in_range(\"#606060\", \"#A0A0A0\"))","aliases":[],"group":"FLOW"},{"key":"class-color-method-is-gray","kind":"METHOD","parentKey":"class-color","name":"is_gray","signature":"color.is_gray(spread=15)","description":"Kiểm tra max(R, G, B) - min(R, G, B) không vượt quá spread; bỏ qua alpha.","behavior":"Kiểm tra max(R, G, B) - min(R, G, B) không vượt quá spread; bỏ qua alpha.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"spread","type":"Int","defaultValue":"15","description":"Số nguyên hữu hạn từ 0 đến 255, tính cả hai đầu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":null,"example":"# Kiểm tra màu có gần xám\nprint(Color(\"#808080\").is_gray())","aliases":[],"group":"FLOW"},{"key":"class-color-method-compare","kind":"METHOD","parentKey":"class-color","name":"compare","signature":"color.compare(other, tolerance=0)","description":"Kiểm tra màu này có gần màu khác hay không. Chênh lệch từng kênh RGB phải không vượt quá tolerance; bỏ qua độ trong suốt.","behavior":"Kiểm tra màu này có gần màu khác hay không. Chênh lệch từng kênh RGB phải không vượt quá tolerance; bỏ qua độ trong suốt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Chênh lệch tối đa cho phép trên từng kênh RGB. 0 yêu cầu các kênh bằng nhau; 255 chấp nhận mọi màu RGB. Giá trị âm được đưa về 0. Tăng dần dựa trên mẫu màu màn hình thật.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"true nếu cả ba kênh RGB đều nằm trong tolerance; ngược lại là false.","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":"Đo chênh lệch tổng hợp của các kênh RGB giữa màu này và màu khác, bỏ qua độ trong suốt.","behavior":"Đo chênh lệch tổng hợp của các kênh RGB giữa màu này và màu khác, bỏ qua độ trong suốt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 từ 0 đến khoảng 441.67; 0 nghĩa là các kênh RGB giống hệt nhau. Chọn ngưỡng bằng các mẫu màu trên màn hình của bạn.","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":"Ước lượng màu này trông khác màu kia đến mức nào bằng CIE76 Delta E, bỏ qua độ trong suốt.","behavior":"Ước lượng màu này trông khác màu kia đến mức nào bằng CIE76 Delta E, bỏ qua độ trong suốt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 không âm; 0 nghĩa là các kênh RGB giống hệt nhau. Hãy thử ngưỡng trên màn hình của bạn vì cảm nhận độ giống màu có thể khác nhau.","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":"Tạo chữ nổi trên các app khác. Gọi show() để hiển thị và áp dụng các thay đổi sau đó. Dùng track() để bật theo dõi nhấn, kéo hoặc giữ. Đọc giá trị hiện tại bằng state(); text() và background() là phương thức.","behavior":"Tạo chữ nổi trên các app khác. Gọi show() để hiển thị và áp dụng các thay đổi sau đó. Dùng track() để bật theo dõi nhấn, kéo hoặc giữ. Đọc giá trị hiện tại bằng state(); text() và background() là phương thức.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 chữ. Cặp thẻ <b>...</b> đầy đủ chỉ in đậm phần chữ bên trong, kể cả qua nhiều dòng. Các thẻ và mã thực thể khác được giữ nguyên. Nếu thẻ in đậm thiếu hoặc thừa, toàn bộ nội dung hiển thị nguyên văn. state()[\"text\"] trả về nội dung gốc.","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(\"<b>Status:</b> Ready\", Point(420, 220, scale=\"width\", anchor=\"top\"), background=None)\nbadge.show()","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":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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":"Đặt nội dung chữ. Gọi show() để cập nhật chữ trên màn hình.","behavior":"Đặt nội dung chữ. Gọi show() để cập nhật chữ trên màn hình.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 chữ. Cặp thẻ <b>...</b> đầy đủ chỉ in đậm phần chữ bên trong, kể cả qua nhiều dòng. Các thẻ và mã thực thể khác được giữ nguyên. Nếu thẻ in đậm thiếu hoặc thừa, toàn bộ nội dung hiển thị nguyên văn. state()[\"text\"] trả về nội dung gốc.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính overlay này để gọi tiếp phương thức khác.","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.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":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 overlay này để gọi tiếp phương thức khác.","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":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 overlay này để gọi tiếp phương thức khác.","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)\nbadge.show()","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":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 overlay này để gọi tiếp phương thức khác.","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":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 overlay này để gọi tiếp phương thức khác.","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 nhấn, kéo và giữ. Nếu tất cả cờ là False, chữ đứng yên và thao tác chạm đi xuyên qua chữ. Tại phần chồng với highlight kéo được, chữ có bật theo dõi được ưu tiên nhận chạm. Thao tác bắt đầu ngoài chữ vẫn điều khiển highlight.","behavior":"Cấu hình theo dõi nhấn, kéo và giữ. Nếu tất cả cờ là False, chữ đứng yên và thao tác chạm đi xuyên qua chữ. Tại phần chồng với highlight kéo được, chữ có bật theo dõi được ưu tiên nhận chạm. Thao tác bắt đầu ngoài chữ vẫn điều khiển highlight.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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":"Báo PRESSED sau khi nhấn rồi nhả, không kéo và chưa đủ thời gian giữ lâu.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"move","type":"Boolean","defaultValue":"False","description":"Cho phép kéo chữ. Chuyển động trong ngưỡng chạm của thiết bị không làm chữ di chuyển; chỉ bắt đầu kéo khi vượt ngưỡng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"hold","type":"Boolean","defaultValue":"False","description":"Báo HOLDING khi đủ hold_ms, rồi HOLDED khi nhả; kéo di chuyển được ưu tiên.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"hold_ms","type":"Number","defaultValue":"600","description":"Thời gian giữ để báo HOLDING, tính bằng mili giây. Giá trị dưới 150 được tăng lên 150.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"OverlayText","returnDescription":"Trả về chính overlay này để gọi tiếp phương thức khá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, 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 chữ nổi. Vị trí được cập nhật sau khi kéo. Lời gọi này không tiêu thụ sự kiện tương tác.","behavior":"Lấy point góc trên-trái hiện tại của chữ nổi. Vị trí được cập nhật sau khi kéo. Lời gọi này không tiêu thụ sự kiện tương tác.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 chữ nổi hiện tại. Trả về None khi chữ chưa hiển thị hoặc chưa đo xong. Lời gọi này không tiêu thụ sự kiện tương tác.","behavior":"Lấy region bao quanh chữ nổi hiện tại. Trả về None khi chữ chưa hiển thị hoặc chưa đo xong. Lời gọi này không tiêu thụ sự kiện tương tác.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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ị chữ, kể cả sau hide(), và áp dụng thay đổi nội dung, kiểu chữ, vị trí, theo dõi hoặc thuộc tính có thể gán. Gọi lại show() sau mỗi lần đổi cấu hình.\nNếu chỉ đổi vị trí khi đang hiển thị, hệ thống chỉ giữ vị trí mới nhất cho khung hình kế tiếp. Lời gọi trả về trước khi vị trí xuất hiện: x/y là vị trí đã tiếp nhận; overlay_width_px/overlay_height_px là None. Các cập nhật khác chờ đến khi được áp dụng.\nKhi chữ đang hiển thị, show() giữ trạng thái và sự kiện tương tác nếu cấu hình theo dõi không đổi. Hiển thị lại sau hide() hoặc đổi cấu hình theo dõi đặt lại thành IDLE; đổi theo dõi cũng hủy thao tác cũ.","behavior":"Hiển thị chữ, kể cả sau hide(), và áp dụng thay đổi nội dung, kiểu chữ, vị trí, theo dõi hoặc thuộc tính có thể gán. Gọi lại show() sau mỗi lần đổi cấu hình.\nNếu chỉ đổi vị trí khi đang hiển thị, hệ thống chỉ giữ vị trí mới nhất cho khung hình kế tiếp. Lời gọi trả về trước khi vị trí xuất hiện: x/y là vị trí đã tiếp nhận; overlay_width_px/overlay_height_px là None. Các cập nhật khác chờ đến khi được áp dụng.\nKhi chữ đang hiển thị, show() giữ trạng thái và sự kiện tương tác nếu cấu hình theo dõi không đổi. Hiển thị lại sau hide() hoặc đổi cấu hình theo dõi đặt lại thành IDLE; đổi theo dõi cũng hủy thao tác cũ.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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.text(\"Running\")\nprint(badge.show())","aliases":[],"group":"FLOW"},{"key":"class-overlaytext-method-hide","kind":"METHOD","parentKey":"class-overlaytext","name":"hide","signature":"overlay.hide()","description":"Ẩn chữ. Gọi show() để hiển thị lại.","behavior":"Ẩn chữ. Gọi show() để hiển thị lại.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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":"Đọc trạng thái mới nhất. Khi bật theo dõi tương ứng:\nNhấn rồi nhả → PRESSED (1).\nĐang kéo → MOVING (2); nhả → MOVED (4).\nGiữ đủ hold_ms → HOLDING (3); nhả → HOLDED (7).\nCác trạng thái khác: IDLE (0), HIDDEN (5), OFF (6). Chỉ nhấn xuống chưa tạo sự kiện; kéo được ưu tiên hơn giữ.\nPRESSED, MOVED và HOLDED chỉ trả về một lần rồi đặt lại thành IDLE. MOVING và HOLDING giữ nguyên trong lúc tương tác. Chỉ lưu trạng thái mới nhất; sự kiện mới ghi đè sự kiện chưa đọc. Hủy thao tác không tạo sự kiện hoàn thành. Vị trí đang chờ được áp dụng trước khi đọc.\nChỉ state() tiêu thụ sự kiện hoàn thành. Sự kiện không tự hết hạn, nhưng đọc mỗi 100 ms không đảm bảo giữ mọi sự kiện giữa các lần đọc.","behavior":"Đọc trạng thái mới nhất. Khi bật theo dõi tương ứng:\nNhấn rồi nhả → PRESSED (1).\nĐang kéo → MOVING (2); nhả → MOVED (4).\nGiữ đủ hold_ms → HOLDING (3); nhả → HOLDED (7).\nCác trạng thái khác: IDLE (0), HIDDEN (5), OFF (6). Chỉ nhấn xuống chưa tạo sự kiện; kéo được ưu tiên hơn giữ.\nPRESSED, MOVED và HOLDED chỉ trả về một lần rồi đặt lại thành IDLE. MOVING và HOLDING giữ nguyên trong lúc tương tác. Chỉ lưu trạng thái mới nhất; sự kiện mới ghi đè sự kiện chưa đọc. Hủy thao tác không tạo sự kiện hoàn thành. Vị trí đang chờ được áp dụng trước khi đọc.\nChỉ state() tiêu thụ sự kiện hoàn thành. Sự kiện không tự hết hạn, nhưng đọc mỗi 100 ms không đảm bảo giữ mọi sự kiện giữa các lần đọc.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"off_all() chỉ xóa chữ nổi của luồng hiện tại. Cập nhật hiển thị có thể phải chờ. Tạo và sửa từng OverlayText trong một luồng."},"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 nội dung gốc, supports_inline_bold=True, status/status_label, cờ theo dõi và kích thước chữ nổi 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":"Đo thời gian đã trôi qua bằng mili giây. Tạm dừng rồi đếm tiếp mà không mất thời gian đã đếm.","behavior":"Đo thời gian đã trôi qua bằng mili giây. Tạm dừng rồi đếm tiếp mà không mất thời gian đã đếm.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer này để gọi tiếp phương thức khác.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer này để gọi tiếp phương thức khác.","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, hoặc bắt đầu nếu timer chưa từng chạy.","behavior":"Tiếp tục đếm, hoặc bắt đầu nếu timer chưa từng chạy.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer này để gọi tiếp phương thức khác.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer này để gọi tiếp phương thức khác.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer này để gọi tiếp phương thức khác.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Timer","returnDescription":"Trả về chính timer này để gọi tiếp phương thức khác.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"time","type":"Number","defaultValue":null,"description":"Thời gian cần so sánh, tính bằng mili giây. Giá trị âm dùng 0; bỏ phần lẻ.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Dùng model TFLite đã nhập trong Trình quản lý mẫu để nhận diện đối tượng hoặc phân loại ảnh. Chọn đúng loại model tại đó.\nĐầu ra hỗ trợ: nhận diện YOLOv8/YOLO11 [1,N,4+C]/[1,4+C,N]; nhận diện YOLO26 [1,N,6]/[N,6]; phân loại YOLO11/YOLO26 và MobileNetV3 [1,C]. Tự động hỗ trợ FLOAT32, INT8 và UINT8.\nPhân loại trả điểm và thông tin lớp, không có điểm hoặc vùng trên màn hình. Chạy model cần tệp cục bộ; không lấy được tệp sẽ báo lỗi.","behavior":"Dùng model TFLite đã nhập trong Trình quản lý mẫu để nhận diện đối tượng hoặc phân loại ảnh. Chọn đúng loại model tại đó.\nĐầu ra hỗ trợ: nhận diện YOLOv8/YOLO11 [1,N,4+C]/[1,4+C,N]; nhận diện YOLO26 [1,N,6]/[N,6]; phân loại YOLO11/YOLO26 và MobileNetV3 [1,C]. Tự động hỗ trợ FLOAT32, INT8 và UINT8.\nPhân loại trả điểm và thông tin lớp, không có điểm hoặc vùng trên màn hình. Chạy model cần tệp cục bộ; không lấy được tệp sẽ báo lỗi.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Cách đổi kích thước ảnh: LETTERBOX giữ tỷ lệ và thêm viền; STRETCH kéo giãn cho đủ kích thước đầu vào; CROP_CENTER cắt ở giữa.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"color_mode","type":"String","defaultValue":"RGB","description":"Định dạng màu ảnh dùng cho model: RGB, BGR hoặc GRAYSCALE.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"norm_mode","type":"String","defaultValue":"ZERO_ONE","description":"Cách chuyển giá trị pixel cho model: 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ị từ 0 đến 255 để tô viền được thêm bởi 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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 trên một ảnh màn hình hiện tại hoặc region đã truyền và trả MatchList của mọi lớp. Danh sách rỗng khi không có kết quả hoặc chưa có ảnh màn hình sẵn sàng. Thiếu quyền chụp màn hình, lỗi nạp hoặc chạy model sẽ báo lỗi.\nRegion cắt ảnh trước khi xử lý bằng model. Nên dùng ảnh giống dữ liệu huấn luyện; cắt ảnh có thể giảm độ chính xác. Kết quả phân loại không có điểm hoặc vùng bao.\nTrong chế độ Chỉnh sửa, cài đặt Khung debug nhận diện hiển thị vùng quét màu đỏ và khung đối tượng tìm thấy màu xanh, kể cả khi debug=False. Model phân loại chỉ hiển thị vùng quét.","behavior":"Chạy model trên một ảnh màn hình hiện tại hoặc region đã truyền và trả MatchList của mọi lớp. Danh sách rỗng khi không có kết quả hoặc chưa có ảnh màn hình sẵn sàng. Thiếu quyền chụp màn hình, lỗi nạp hoặc chạy model sẽ báo lỗi.\nRegion cắt ảnh trước khi xử lý bằng model. Nên dùng ảnh giống dữ liệu huấn luyện; cắt ảnh có thể giảm độ chính xác. Kết quả phân loại không có điểm hoặc vùng bao.\nTrong chế độ Chỉnh sửa, cài đặt Khung debug nhận diện hiển thị vùng quét màu đỏ và khung đối tượng tìm thấy màu xanh, kể cả khi debug=False. Model phân loại chỉ hiển thị vùng quét.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"threshold","type":"Number","defaultValue":"0.5","description":"Điểm tin cậy tối thiểu từ 0 đến 1. Khi chạy model, app dùng ngưỡng thấp nhất là 0.01.","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ố kết quả tối đa trả về. Bỏ phần lẻ, sau đó giới hạn giá trị trong 1..64.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"debug","type":"Boolean","defaultValue":"False","description":"True mở ảnh xem trước và kết quả model trong chế độ Chỉnh sửa. Nhận diện hiển thị khung và lớp; phân loại hiển thị ảnh đầu vào và điểm từng lớp. Chế độ Chỉ chạy bỏ qua tùy chọn này. Match trả về không có debug_result.","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":"Chạy song song các luồng macro có tên và gửi tin nhắn giữa chúng. Mỗi luồng có biến riêng. Truyền dữ liệu ban đầu qua Flow.params; tin nhắn là bản sao độc lập, được đọc theo thứ tự gửi.","behavior":"Chạy song song các luồng macro có tên và gửi tin nhắn giữa chúng. Mỗi luồng có biến riêng. Truyền dữ liệu ban đầu qua Flow.params; tin nhắn là bản sao độc lập, được đọc theo thứ tự gửi.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"yes","details":"Flow.start() trả số thứ tự Int dương. Tối đa hai luồng nền chạy cùng luồng chính. Macro chờ chúng; lỗi ở bất kỳ luồng nào hoặc System.stop() dừng tất cả."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-storage","class-screencapture"],"isCallable":false,"fields":[],"fieldDocs":[{"name":"params","type":"dict","defaultValue":null,"description":"Dữ liệu ban đầu của luồng này. Mỗi lần đọc trả một dict độc lập; sửa dict đó không đổi dữ liệu bên gửi hoặc các lần đọc sau. Luồng chính nhận dict rỗng.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Lưu template enemy và cấu hình watch_enemy trước khi chạy\n# Main: kích hoạt watcher rồi dừng sau tác vụ chính\nFlow.start(\"watch_enemy\")\nFlow.send(\"watch_enemy\", {\"command\": \"ARM\"})\nwait(1000)\nFlow.stop(\"watch_enemy\")","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 luồng đã cấu hình song song với luồng chính. Có thể gửi tin ngay khi lời gọi trả về. Tối đa hai luồng nền cùng chạy; chúng cũng có thể khởi chạy luồng khác.\nMột tên không thể chạy hai lần, kể cả khi đang tạm dừng hoặc đang dừng. Tên sai hoặc trùng, đủ số luồng nền, hoặc lỗi trong luồng sẽ dừng toàn bộ lượt chạy. System.stop() và Main Stop cũng dừng mọi luồng.\nLuồng chính chờ các luồng nền trước khi kết thúc lượt chạy: cần chủ động dừng luồng chạy vô hạn. Dữ liệu ban đầu được sao chép theo giới hạn của Flow.send().","behavior":"Khởi chạy luồng đã cấu hình song song với luồng chính. Có thể gửi tin ngay khi lời gọi trả về. Tối đa hai luồng nền cùng chạy; chúng cũng có thể khởi chạy luồng khác.\nMột tên không thể chạy hai lần, kể cả khi đang tạm dừng hoặc đang dừng. Tên sai hoặc trùng, đủ số luồng nền, hoặc lỗi trong luồng sẽ dừng toàn bộ lượt chạy. System.stop() và Main Stop cũng dừng mọi luồng.\nLuồng chính chờ các luồng nền trước khi kết thúc lượt chạy: cần chủ động dừng luồng chạy vô hạn. Dữ liệu ban đầu được sao chép theo giới hạn của Flow.send().","execution":{"blocking":"no","threadSafety":"serialized","parallel":"yes","details":"Chạy luồng nền có tên với bản sao đầu vào rồi trả về, không chờ kết thúc."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên chính xác của luồng đã cấu hình.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"params","type":"dict?","defaultValue":"None","description":"Dữ liệu ban đầu tùy chọn được sao chép cho luồng mới và đọc qua Flow.params.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Int","returnDescription":"Số dương tăng theo mỗi lần khởi chạy, dùng trong trạng thái dock và nhật ký. Không thể dùng số này để điều khiển luồng.","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-flow-static-method-send","kind":"STATIC_METHOD","parentKey":"class-flow","name":"send","signature":"Flow.send(name, data)","description":"Gửi bản sao độc lập đến luồng đang chạy mà không chờ. Nhiều luồng có thể gửi tin an toàn; tin được nhận theo thứ tự gửi, kể cả khi tạm dừng. Giá trị được phép gồm None, Boolean, số hữu hạn, String, list, tuple và dict có khóa String. Độ sâu lồng tối đa là 8, tổng số giá trị là 512 và tổng độ dài văn bản là 65536. Hàm, đối tượng tài nguyên hoặc của app và tham chiếu vòng gây lỗi. Mỗi lần khởi chạy có hàng đợi tin mới; tin chưa đọc bị bỏ khi luồng dừng hoặc kết thúc.","behavior":"Gửi bản sao độc lập đến luồng đang chạy mà không chờ. Nhiều luồng có thể gửi tin an toàn; tin được nhận theo thứ tự gửi, kể cả khi tạm dừng. Giá trị được phép gồm None, Boolean, số hữu hạn, String, list, tuple và dict có khóa String. Độ sâu lồng tối đa là 8, tổng số giá trị là 512 và tổng độ dài văn bản là 65536. Hàm, đối tượng tài nguyên hoặc của app và tham chiếu vòng gây lỗi. Mỗi lần khởi chạy có hàng đợi tin mới; tin chưa đọc bị bỏ khi luồng dừng hoặc kết thúc.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"yes","details":"Phối hợp các lời gọi đồng thời, không chờ tin nhắn hay dọn dẹp. Flow.stop() nhắm một luồng nền; luồng chính và các luồng khác tiếp tục."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên chính xác đã cấu hình của luồng đích. Luồng chính không có tên được tự động gán.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"data","type":"Any","defaultValue":null,"description":"Giá trị cần gửi. Giá trị được sao chép trước khi thêm vào hàng đợi tin.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"True nếu được chấp nhận; False khi đích không xác định, không hoạt động hoặc đang dừng.","example":"# Gửi lệnh ARM cho watcher đã cấu hình\nFlow.start(\"watch_enemy\")\naccepted = Flow.send(\"watch_enemy\", {\"command\": \"ARM\"})\nprint(accepted)","aliases":[],"group":"FLOW"},{"key":"class-flow-static-method-receive","kind":"STATIC_METHOD","parentKey":"class-flow","name":"receive","signature":"Flow.receive(timeout=None)","description":"Chờ và lấy tin cũ nhất của luồng này. Luồng chính và các luồng nền đều nhận được tin. Nhóm có tên chạy lồng trong cùng luồng dùng chung hàng đợi của luồng đó.\nHủy sẽ kết thúc chờ nhanh chóng; Pause giữ các tin trong hàng đợi. List và dict nhận được là bản sao độc lập.","behavior":"Chờ và lấy tin cũ nhất của luồng này. Luồng chính và các luồng nền đều nhận được tin. Nhóm có tên chạy lồng trong cùng luồng dùng chung hàng đợi của luồng đó.\nHủy sẽ kết thúc chờ nhanh chóng; Pause giữ các tin trong hàng đợi. List và dict nhận được là bản sao độc lập.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"yes","details":"Chờ tin nhắn của luồng này hoặc hết hạn. timeout=0 kiểm tra ngay. Dừng luồng nhanh chóng kết thúc việc chờ."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"timeout","type":"Number?","defaultValue":"None","description":"Thời gian chờ tùy chọn là số hữu hạn tính bằng mili giây: 0 <= timeout < 2^63. Phần lẻ mili giây bị bỏ; None chờ vô hạn, 0 kiểm tra ngay.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Any?","returnDescription":"Tin cũ nhất, hoặc None khi hết thời gian chờ hay kiểm tra ngay không thấy tin. Tin chứa None cũng trả về None.","example":"# Luồng watch_enemy đã cấu hình: chờ ARM rồi kiểm tra lệnh giữa các lượt xử lý\nmessage = Flow.receive()\nif message is not None and message.get(\"command\") == \"ARM\":\n    while True:\n        command = Flow.poll()\n        if command is not None:\n            print(command)\n        if Region().find(\"enemy\", timeout=0).found:\n            print(\"enemy\")\n        wait(100)","aliases":[],"group":"FLOW"},{"key":"class-flow-static-method-poll","kind":"STATIC_METHOD","parentKey":"class-flow","name":"poll","signature":"Flow.poll()","description":"Lấy ngay tin cũ nhất của luồng này mà không chờ. Dùng cùng hàng đợi tin và bản sao độc lập như Flow.receive().","behavior":"Lấy ngay tin cũ nhất của luồng này mà không chờ. Dùng cùng hàng đợi tin và bản sao độc lập như Flow.receive().","execution":{"blocking":"no","threadSafety":"serialized","parallel":"yes","details":"Phối hợp các lời gọi đồng thời, không chờ tin nhắn hay dọn dẹp. Flow.stop() nhắm một luồng nền; luồng chính và các luồng khác tiếp tục."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Any?","returnDescription":"Tin cũ nhất, hoặc None khi không có tin. Tin chứa None cũng trả về None.","example":"# Kiểm tra lệnh mà không chờ\nmessage = Flow.poll()\nif message is not None:\n    print(message)","aliases":[],"group":"FLOW"},{"key":"class-flow-static-method-running","kind":"STATIC_METHOD","parentKey":"class-flow","name":"running","signature":"Flow.running(name)","description":"Kiểm tra luồng có tên này đang chạy hoặc tạm dừng. Kết quả có thể thay đổi ngay sau lời gọi.","behavior":"Kiểm tra luồng có tên này đang chạy hoặc tạm dừng. Kết quả có thể thay đổi ngay sau lời gọi.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"yes","details":"Phối hợp các lời gọi đồng thời, không chờ tin nhắn hay dọn dẹp. Flow.stop() nhắm một luồng nền; luồng chính và các luồng khác tiếp tục."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên chính xác đã cấu hình của luồng đích. Luồng chính không có tên được tự động gán.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"True khi còn hoạt động; False khi không xác định, đang dừng hoặc đã kết thúc.","example":"print(Flow.running(\"watch_enemy\"))","aliases":[],"group":"FLOW"},{"key":"class-flow-static-method-stop","kind":"STATIC_METHOD","parentKey":"class-flow","name":"stop","signature":"Flow.stop(name)","description":"Yêu cầu dừng một luồng nền; trả về mà không chờ dọn dẹp. Luồng chính và các luồng khác vẫn chạy. Không thể dùng hàm này để dừng luồng chính. Tự dừng sẽ kết thúc luồng gọi.\nVới nhóm có tên chạy lồng, dừng luồng nền chứa nhóm đó. Chờ dọn dẹp xong trước khi chạy lại cùng tên.\nDock luồng nền có Pause/Resume. Main Pause/Resume tác động mọi luồng; Main Resume cũng xóa trạng thái tạm dừng riêng của chúng.","behavior":"Yêu cầu dừng một luồng nền; trả về mà không chờ dọn dẹp. Luồng chính và các luồng khác vẫn chạy. Không thể dùng hàm này để dừng luồng chính. Tự dừng sẽ kết thúc luồng gọi.\nVới nhóm có tên chạy lồng, dừng luồng nền chứa nhóm đó. Chờ dọn dẹp xong trước khi chạy lại cùng tên.\nDock luồng nền có Pause/Resume. Main Pause/Resume tác động mọi luồng; Main Resume cũng xóa trạng thái tạm dừng riêng của chúng.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"yes","details":"Phối hợp các lời gọi đồng thời, không chờ tin nhắn hay dọn dẹp. Flow.stop() nhắm một luồng nền; luồng chính và các luồng khác tiếp tục."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"name","type":"String","defaultValue":null,"description":"Tên chính xác đã cấu hình của luồng đích. Luồng chính không có tên được tự động gán.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"True khi vừa yêu cầu dừng; False khi đích vắng mặt, không xác định, đã đang dừng hoặc thuộc main. True không xác nhận đã dọn dẹp xong.","example":"print(Flow.stop(\"watch_enemy\"))","aliases":[],"group":"FLOW"},{"key":"class-list","kind":"COLLECTION","parentKey":null,"name":"list","signature":"list(iterable=(), /)","description":"Lưu các phần tử theo thứ tự, cho phép giá trị trùng nhau. Đọc vị trí bắt đầu từ 0, lặp qua phần tử, hoặc thêm, thay thế và xóa phần tử trong chính list đó.","behavior":"Lưu các phần tử theo thứ tự, cho phép giá trị trùng nhau. Đọc vị trí bắt đầu từ 0, lặp qua phần tử, hoặc thêm, thay thế và xóa phần tử trong chính list đó.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 list mới từ nguồn có thể lặp qua, như chuỗi, list hay generator. Giữ thứ tự phần tử; collection lồng bên trong vẫn dùng chung với nguồn.","behavior":"Tạo list rỗng hoặc list mới từ nguồn có thể lặp qua, như chuỗi, list hay generator. Giữ thứ tự phần tử; collection lồng bên trong vẫn dùng chung với nguồn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 bằng cách viết các phần tử trong ngoặc vuông.","behavior":"Tạo list bằng cách viết các phần tử trong ngoặc vuông.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"List mới có các phần tử theo thứ tự đã viết.","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 từ các giá trị do expr tính khi lặp qua nguồn. Dùng if để chỉ giữ phần tử đạt điều kiện; có thể dùng nhiều mệnh đề for/if. Biến vòng lặp chỉ có trong biểu thức này.","behavior":"Tạo list từ các giá trị do expr tính khi lặp qua nguồn. Dùng if để chỉ giữ phần tử đạt điều kiện; có thể dùng nhiều mệnh đề for/if. Biến vòng lặp chỉ có trong biểu thức này.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Biến hoặc nhóm biến nhận phần tử hiện tại. Chưa hỗ trợ cách nhận như *rest.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn có thể lặp qua, như chuỗi, collection hay generator; dictionary cung cấp các khóa.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Lượng cộng để tạo phần tử tiếp theo. Số âm đếm giảm; 0 gây lỗi. Nếu bước đi ra xa stop, kết quả là list rỗng.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 phần tử theo vị trí: 0 là đầu tiên, -1 là cuối cùng, các chỉ số âm khác đếm từ cuối.","behavior":"Đọc phần tử theo vị trí: 0 là đầu tiên, -1 là cuối cùng, các chỉ số âm khác đếm từ cuối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí phần tử: 0 là đầu tiên, -1 là cuối cùng.","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":"Trả về list mới từ start đến trước end. Chỉ số âm đếm từ cuối. Bỏ trống hai biên để lấy toàn bộ list theo chiều của step; collection lồng bên trong vẫn dùng chung.","behavior":"Trả về list mới từ start đến trước end. Chỉ số âm đếm từ cuối. Bỏ trống hai biên để lấy toàn bộ list theo chiều của step; collection lồng bên trong vẫn dùng chung.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Gán phần tử list vào các biến từ trái sang phải. Số biến phải bằng số phần tử, nếu không sẽ báo lỗi. Có thể lồng nhóm biến; chưa hỗ trợ *rest.","behavior":"Gán phần tử list vào các biến từ trái sang phải. Số biến phải bằng số phần tử, nếu không sẽ báo lỗi. Có thể lồng nhóm biến; chưa hỗ trợ *rest.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"a, b","type":"Targets","defaultValue":null,"description":"Các biến nhận phần tử; số biến phải bằng độ dài 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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Thêm từng phần tử từ nguồn có thể lặp qua vào cuối list này, giữ thứ tự của nguồn.","behavior":"Thêm từng phần tử từ nguồn có thể lặp qua vào cuối list này, giữ thứ tự của nguồn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 phần tử trước vị trí đã cho. Vị trí bắt đầu từ 0; chỉ số âm đếm từ cuối. Chỉ số trước phạm vi list sẽ chèn vào đầu, chỉ số vượt cuối list sẽ chèn vào cuối.","behavior":"Chèn phần tử trước vị trí đã cho. Vị trí bắt đầu từ 0; chỉ số âm đếm từ cuối. Chỉ số trước phạm vi list sẽ chèn vào đầu, chỉ số vượt cuối list sẽ chèn vào cuối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí bắt đầu tìm, có được lấy. Vị trí tính từ 0; số âm đếm từ cuối.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(list)","description":"Dừng trước vị trí này. Số âm đếm từ cuối.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 chính list này từ nhỏ đến lớn. Các giá trị so sánh bằng nhau giữ thứ tự ban đầu. Giá trị phải so sánh được: số và boolean, chuỗi, hoặc các list/tuple cùng loại có phần tử so sánh được; trộn loại không tương thích sẽ gây lỗi.","behavior":"Sắp xếp chính list này từ nhỏ đến lớn. Các giá trị so sánh bằng nhau giữ thứ tự ban đầu. Giá trị phải so sánh được: số và boolean, chuỗi, hoặc các list/tuple cùng loại có phần tử so sánh được; trộn loại không tương thích sẽ gây lỗi.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Xử lý giá trị trong luồng hiện tại. Hàm key cũng chạy ở đó; các lần chờ và thay đổi của nó xảy ra trước khi trả về."},"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 được gọi một lần cho mỗi phần tử để lấy giá trị dùng khi sắp xếp. None so sánh trực tiếp các 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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Trả về list mới có cùng phần tử. Thêm, xóa hay thay thế phần tử trong bản sao không đổi list gốc; collection lồng bên trong vẫn dùng chung.","behavior":"Trả về list mới có cùng phần tử. Thêm, xóa hay thay thế phần tử trong bản sao không đổi list gốc; collection lồng bên trong vẫn dùng chung.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"list","returnDescription":"List mới; không sao chép các collection lồng bên trong.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Lưu phần tử theo thứ tự, cho phép trùng nhau, nhưng không thể thêm, xóa hay thay thế sau khi tạo. List hay dictionary lồng bên trong vẫn có thể thay đổi. Trong điều kiện, tuple rỗng là false, tuple có phần tử là true.","behavior":"Lưu phần tử theo thứ tự, cho phép trùng nhau, nhưng không thể thêm, xóa hay thay thế sau khi tạo. List hay dictionary lồng bên trong vẫn có thể thay đổi. Trong điều kiện, tuple rỗng là false, tuple có phần tử là true.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 phần tử từ nguồn có thể lặp qua thành tuple. Collection lồng bên trong vẫn dùng chung với nguồn.","behavior":"Tạo tuple rỗng hoặc sao chép phần tử từ nguồn có thể lặp qua thành tuple. Collection lồng bên trong vẫn dùng chung với nguồn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":"()","description":"Nguồn tùy chọn có thể lặp qua, như chuỗi, list hay generator.","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 với các phần tử cách nhau bằng dấu phẩy. Dùng (value,) cho một phần tử; chỉ viết (value) không tạo tuple.","behavior":"Tạo tuple với các phần tử cách nhau bằng dấu phẩy. Dùng (value,) cho một phần tử; chỉ viết (value) không tạo tuple.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 vị trí: 0 là đầu tiên, -1 là cuối cùng, các chỉ số âm khác đếm từ cuối.","behavior":"Đọc phần tử tuple theo vị trí: 0 là đầu tiên, -1 là cuối cùng, các chỉ số âm khác đếm từ cuối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí phần tử: 0 là đầu tiên, -1 là cuối cùng.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Phần tử tại vị trí đó. Báo IndexError nếu vị trí nằm ngoài tuple.","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":"Trả về tuple mới từ start đến trước end. Chỉ số âm đếm từ cuối. Bỏ trống hai biên để lấy toàn bộ tuple theo chiều của step; collection lồng bên trong vẫn dùng chung.","behavior":"Trả về tuple mới từ start đến trước end. Chỉ số âm đếm từ cuối. Bỏ trống hai biên để lấy toàn bộ tuple theo chiều của step; collection lồng bên trong vẫn dùng chung.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Gán phần tử tuple vào các biến từ trái sang phải. Số biến phải bằng số phần tử, nếu không sẽ báo lỗi. Có thể lồng nhóm biến; chưa hỗ trợ *rest.","behavior":"Gán phần tử tuple vào các biến từ trái sang phải. Số biến phải bằng số phần tử, nếu không sẽ báo lỗi. Có thể lồng nhóm biến; chưa hỗ trợ *rest.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"x, y","type":"Targets","defaultValue":null,"description":"Các biến nhận phần tử; số biến phải bằng độ dài 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":"Trả về vị trí khớp đầu tiên trong phạm vi được chọn, hoặc báo ValueError nếu không có giá trị.","behavior":"Trả về vị trí khớp đầu tiên trong phạm vi được chọn, hoặc báo ValueError nếu không có giá trị.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí bắt đầu tìm, tính từ 0. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int","defaultValue":"len(tuple)","description":"Dừng tìm trước vị trí này. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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-motiontracker","kind":"CLASS","parentKey":null,"name":"MotionTracker","signature":"MotionTracker(region=None, exclude=None, max_displacement=80, max_gap_ms=850, max_frame_age_ms=250)","description":"Theo dõi độ tịnh tiến của nền giữa các khung hình bằng OpenCV với nhiều vùng mẫu. Khi tạo không chụp khung hình; mỗi flow được mở tối đa 16 tracker. Công cụ không nhận diện nhân vật hay định vị trên bản đồ. Hãy loại HUD và nhân vật; xử lý mức zoom của game bên ngoài bằng so khớp mẫu và tỷ lệ. Khi nghi có zoom hoặc xoay, kết quả là LOST, không phải ước lượng zoom.","behavior":"Theo dõi độ tịnh tiến của nền giữa các khung hình bằng OpenCV với nhiều vùng mẫu. Khi tạo không chụp khung hình; mỗi flow được mở tối đa 16 tracker. Công cụ không nhận diện nhân vật hay định vị trên bản đồ. Hãy loại HUD và nhân vật; xử lý mức zoom của game bên ngoài bằng so khớp mẫu và tỷ lệ. Khi nghi có zoom hoặc xoay, kết quả là LOST, không phải ước lượng zoom.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[{"name":"region","type":"Region | None","defaultValue":"None","description":"Vùng theo dõi tính bằng pixel màn hình, nằm hoàn toàn trong màn hình hiện tại, có chiều rộng và cao hữu hạn, dương. None chọn toàn màn hình. Tọa độ được cố định khi tạo.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"exclude","type":"list | tuple | None","defaultValue":"None","description":"Danh sách hoặc tuple tối đa 32 Region cần loại, được cắt theo vùng theo dõi. Mỗi vùng có chiều rộng và cao hữu hạn, dương; tọa độ được cố định khi tạo. None không loại vùng nào.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"max_displacement","type":"Number (1..256)","defaultValue":"80","description":"Độ dịch chuyển hữu hạn tối đa trên mỗi trục, tính bằng pixel màn hình; mặc định 80.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"max_gap_ms","type":"Number (1..5000)","defaultValue":"850","description":"Khoảng cách tối đa giữa các khung hình, là số nguyên mili giây; mặc định 850.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"max_frame_age_ms","type":"Number (1..5000)","defaultValue":"250","description":"Tuổi tối đa của khung hình, là số nguyên mili giây; mặc định 250.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"# Theo dõi chuyển động của nền giữa các khung hình đã chụp\ntracker = MotionTracker()\nfirst = tracker.update()\nwait(100)\nresult = tracker.update()\nif result.status == \"TRACKED\":\n    print(result.dx, result.dy)\ntracker.close()","aliases":[],"group":null},{"key":"class-motiontracker-method-update","kind":"METHOD","parentKey":"class-motiontracker","name":"update","signature":"tracker.update()","description":"Đọc khung hình đã chụp hiện tại và trả kết quả chuyển động. Phiên chụp màn hình phải đã được đồng ý và sẵn sàng. INITIALIZED tạo mốc; TRACKED trả độ tịnh tiến được chấp nhận; STALE là khung hình trùng, ở tương lai hoặc đã quá cũ trước khi xử lý và giữ nguyên mốc. LOST xóa tính liên tục để khung hình mới hợp lệ tiếp theo khởi tạo lại. Nếu khung hình quá cũ trong lúc xử lý hoặc Pause xảy ra trước khi bàn giao, LOST có reason là processing_frame_too_old. Gọi sau close sẽ báo lỗi.","behavior":"Đọc khung hình đã chụp hiện tại và trả kết quả chuyển động. Phiên chụp màn hình phải đã được đồng ý và sẵn sàng. INITIALIZED tạo mốc; TRACKED trả độ tịnh tiến được chấp nhận; STALE là khung hình trùng, ở tương lai hoặc đã quá cũ trước khi xử lý và giữ nguyên mốc. LOST xóa tính liên tục để khung hình mới hợp lệ tiếp theo khởi tạo lại. Nếu khung hình quá cũ trong lúc xử lý hoặc Pause xảy ra trước khi bàn giao, LOST có reason là processing_frame_too_old. Gọi sau close sẽ báo lỗi.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"MotionResult","returnDescription":null,"example":null,"aliases":[],"group":"FLOW"},{"key":"class-motiontracker-method-reset","kind":"METHOD","parentKey":"class-motiontracker","name":"reset","signature":"tracker.reset()","description":"Xóa mốc theo dõi nhưng vẫn có thể dùng tracker. Gọi sau close sẽ báo lỗi.","behavior":"Xóa mốc theo dõi nhưng vẫn có thể dùng tracker. Gọi sau close sẽ báo lỗi.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":null,"example":null,"aliases":[],"group":"FLOW"},{"key":"class-motiontracker-method-close","kind":"METHOD","parentKey":"class-motiontracker","name":"close","signature":"tracker.close()","description":"Giải phóng tracker; có thể gọi lại an toàn. Handle cũng được giải phóng khi macro hoặc flow kết thúc, bị dừng hay gặp lỗi. Có thể dùng lại handle qua các action trong cùng executor; handle được tách biệt giữa các flow.","behavior":"Giải phóng tracker; có thể gọi lại an toàn. Handle cũng được giải phóng khi macro hoặc flow kết thúc, bị dừng hay gặp lỗi. Có thể dùng lại handle qua các action trong cùng executor; handle được tách biệt giữa các flow.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":null,"example":null,"aliases":[],"group":"FLOW"},{"key":"class-motionresult","kind":"READ_ONLY_CLASS","parentKey":null,"name":"MotionResult","signature":"MotionResult","description":"Kết quả chỉ đọc từ MotionTracker.update(). Độ tịnh tiến mô tả chuyển động của nền giữa hai khung hình, không phải vị trí tuyệt đối. Theo dõi không nhấn, gửi thao tác nhập, tải lên hay lưu dữ liệu.","behavior":"Kết quả chỉ đọc từ MotionTracker.update(). Độ tịnh tiến mô tả chuyển động của nền giữa hai khung hình, không phải vị trí tuyệt đối. Theo dõi không nhấn, gửi thao tác nhập, tải lên hay lưu dữ liệu.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":false,"fields":["status","dx","dy","frame_id","captured_at_ms","dt_ms","age_ms","inliers","residual_px","reason"],"fieldDocs":[{"name":"status","type":"String","defaultValue":null,"description":"INITIALIZED tạo mốc; TRACKED có độ tịnh tiến được chấp nhận; STALE là khung hình trùng, ở tương lai hoặc đã quá cũ trước khi xử lý; LOST do khoảng cách quá lớn, thay đổi hình học, khung hình sai thứ tự, thiếu kết cấu, kết quả mơ hồ hoặc khung hình trở nên quá cũ trong lúc xử lý.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"dx","type":"Number | None","defaultValue":null,"description":"Độ tịnh tiến ngang của nền theo pixel màn hình độ phân giải đầy đủ, chỉ có khi TRACKED; chuyển sang trái mang dấu âm.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"dy","type":"Number | None","defaultValue":null,"description":"Độ tịnh tiến dọc của nền theo pixel màn hình độ phân giải đầy đủ, chỉ có khi TRACKED.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"frame_id","type":"Number","defaultValue":null,"description":"Định danh duy nhất của khung hình, không đổi khi đọc lại cùng khung hình trong bộ nhớ đệm.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"captured_at_ms","type":"Number","defaultValue":null,"description":"Thời điểm Android thu nhận khung hình theo đồng hồ đơn điệu, tính bằng mili giây, không phải thời điểm hiển thị.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"dt_ms","type":"Number | None","defaultValue":null,"description":"Số mili giây kể từ khung hình mốc, nếu có.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"age_ms","type":"Number","defaultValue":null,"description":"Tuổi cuối cùng của khung hình, tính bằng mili giây.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"inliers","type":"Number","defaultValue":null,"description":"Số vùng mẫu ủng hộ chuyển động được chấp nhận.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"residual_px","type":"Number | None","defaultValue":null,"description":"Sai số chuyển động theo pixel màn hình, nếu có.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"reason","type":"String","defaultValue":null,"description":"Lý do của trạng thái kết quả.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":null,"aliases":[],"group":null},{"key":"class-range","kind":"COLLECTION","parentKey":null,"name":"range","signature":"range(stop, /) | range(start, stop, step=1, /)","description":"Dãy số nguyên không thể thay đổi, được tạo bằng range(). Bạn có thể dùng lại dãy mà không cần tạo toàn bộ danh sách; dùng list() khi cần danh sách.","behavior":"Dãy số nguyên không thể thay đổi, được tạo bằng range(). Bạn có thể dùng lại dãy mà không cần tạo toàn bộ danh sách; dùng list() khi cần danh sách.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["start","stop","step"],"fieldDocs":[{"name":"start","type":"Int","defaultValue":null,"description":"Giới hạn bắt đầu, được tính vào phạm vi.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"stop","type":"Int","defaultValue":null,"description":"Giới hạn cuối, không được tính vào dãy.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"step","type":"Int","defaultValue":null,"description":"Khoảng cách giữa hai giá trị liên tiếp.","suggestAsNamedArg":true,"requirement":null,"callingMode":null}],"constants":[],"constructorParams":[{"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":"Khoảng cách giữa hai giá trị liên tiếp. Dùng số âm để đếm giảm; 0 gây lỗi.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"fieldExample":"numbers = range(2, 10, 2)\ntext(str(numbers.start))","constructorExample":null,"params":[],"returnType":null,"returnDescription":null,"example":"numbers = range(0, 10, 2)\ntext(str(list(numbers)))\ntext(str(numbers.index(4)))","aliases":[],"group":null},{"key":"class-range-method-count","kind":"METHOD","parentKey":"class-range","name":"count","signature":"range.count(value, /)","description":"Trả về số lần value xuất hiện: 0 hoặc 1.","behavior":"Trả về số lần value xuất hiện: 0 hoặc 1.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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. Các giá trị số được so sánh theo giá trị, nên 1.0 bằng 1.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":null,"example":"range(0, 10, 2).count(4)","aliases":[],"group":"FLOW"},{"key":"class-range-method-index","kind":"METHOD","parentKey":"class-range","name":"index","signature":"range.index(value, /)","description":"Trả về vị trí đầu tiên của value. Báo lỗi ValueError nếu không có giá trị này.","behavior":"Trả về vị trí đầu tiên của value. Báo lỗi ValueError nếu không có giá trị này.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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. Các giá trị số được so sánh theo giá trị, nên 1.0 bằng 1.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Int","returnDescription":null,"example":"range(0, 10, 2).index(4)","aliases":[],"group":"FLOW"},{"key":"class-set","kind":"COLLECTION","parentKey":null,"name":"set","signature":"set(iterable=(), /)","description":"Lưu giá trị không trùng nhau, có thể thêm hoặc xóa sau đó. Giá trị bằng nhau chỉ xuất hiện một lần: True, 1 và 1.0 bằng nhau. Phần tử phải dùng được làm khóa dictionary; list, dictionary, set hoặc tuple chứa chúng bị từ chối. Không phụ thuộc vào thứ tự lặp.","behavior":"Lưu giá trị không trùng nhau, có thể thêm hoặc xóa sau đó. Giá trị bằng nhau chỉ xuất hiện một lần: True, 1 và 1.0 bằng nhau. Phần tử phải dùng được làm khóa dictionary; list, dictionary, set hoặc tuple chứa chúng bị từ chối. Không phụ thuộc vào thứ tự lặp.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 giá trị từ nguồn có thể lặp qua, như list hay generator, chỉ giữ lần xuất hiện đầu tiên của mỗi giá trị bằng nhau.","behavior":"Tạo set rỗng hoặc gom giá trị từ nguồn có thể lặp qua, như list hay generator, chỉ giữ lần xuất hiện đầu tiên của mỗi giá trị bằng nhau.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":"()","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 bằng cách viết giá trị trong ngoặc nhọn. Dùng set() cho set rỗng; {} tạo dictionary rỗng.","behavior":"Tạo set bằng cách viết giá trị trong ngoặc nhọn. Dùng set() cho set rỗng; {} tạo dictionary rỗng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 từ giá trị do expr tính khi lặp qua nguồn, loại giá trị trùng. Dùng if để lọc phần tử; có thể dùng nhiều mệnh đề for/if. Biến vòng lặp chỉ có trong biểu thức này.","behavior":"Tạo set từ giá trị do expr tính khi lặp qua nguồn, loại giá trị trùng. Dùng if để lọc phần tử; có thể dùng nhiều mệnh đề for/if. Biến vòng lặp chỉ có trong biểu thức này.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Biến hoặc nhóm biến nhận phần tử hiện tại. Chưa hỗ trợ cách nhận như *rest.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn có thể lặp qua, như chuỗi, collection hay generator; dictionary cung cấp các khóa.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 cần tìm giá trị.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 giá trị khỏi set này, hoặc báo KeyError nếu không có.","behavior":"Xóa giá trị khỏi set này, hoặc báo KeyError nếu không có.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ị bất kỳ trong set này. Set rỗng gây KeyError.","behavior":"Xóa và trả về một giá trị bất kỳ trong set này. Set rỗng gây KeyError.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ừ các nguồn có thể lặp qua vào set này, chỉ giữ mỗi giá trị bằng nhau một lần.","behavior":"Thêm giá trị từ các nguồn có thể lặp qua vào set này, chỉ giữ mỗi giá trị bằng nhau một lần.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ộp set này với các nguồn có thể lặp qua, không giữ giá trị trùng. Set gốc không đổi.","behavior":"Trả về set mới gộp set này với các nguồn có thể lặp qua, không giữ giá trị trùng. Set gốc không đổi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 chứa giá trị của set này có trong mọi nguồn được truyền. Không truyền nguồn thì trả về bản sao. Set gốc không đổi.","behavior":"Trả về set mới chứa giá trị của set này có trong mọi nguồn được truyền. Không truyền nguồn thì trả về bản sao. Set gốc không đổi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 chứa giá trị của set này không có trong bất kỳ nguồn nào được truyền. Không truyền nguồn thì trả về bản sao. Set gốc không đổi.","behavior":"Trả về set mới chứa giá trị của set này không có trong bất kỳ nguồn nào được truyền. Không truyền nguồn thì trả về bản sao. Set gốc không đổi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Trả về set mới có cùng giá trị. Thêm hay xóa giá trị trong bản sao không đổi set gốc.","behavior":"Trả về set mới có cùng giá trị. Thêm hay xóa giá trị trong bản sao không đổi set gốc.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 mỗi giá trị một lần. Không phụ thuộc vào một thứ tự cụ thể.","behavior":"Lặp qua mỗi giá trị một lần. Không phụ thuộc vào một thứ tự cụ thể.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Lưu giá trị dưới các khóa và đọc bằng khóa. Khóa giữ thứ tự thêm vào; ghi vào khóa đã có sẽ thay giá trị mà không đổi vị trí khóa. Mỗi khóa có một giá trị.","behavior":"Lưu giá trị dưới các khóa và đọc bằng khóa. Khóa giữ thứ tự thêm vào; ghi vào khóa đã có sẽ thay giá trị mà không đổi vị trí khóa. Mỗi khóa có một giá trị.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 hoặc sao chép dictionary khác hay nguồn các cặp (key, value). Tham số có tên thêm cặp sau đó và thay giá trị của khóa trùng. Giá trị lồng bên trong dùng chung với nguồn.","behavior":"Tạo dictionary rỗng hoặc sao chép dictionary khác hay nguồn các cặp (key, value). Tham số có tên thêm cặp sau đó và thay giá trị của khóa trùng. Giá trị lồng bên trong dùng chung với nguồn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"mapping_or_pairs","type":"dict | Iterable","defaultValue":"()","description":"Một dict hoặc nguồn có thể lặp qua; mỗi phần tử phải là list hoặc tuple có đúng hai phần tử: khóa và giá trị.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"},{"name":"key=value","type":"Any?","defaultValue":null,"description":"Các cặp viết dạng key=value, được thêm sau nguồn; khóa trùng sẽ được thay giá trị.","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 bằng các cặp key: value trong ngoặc nhọn. Khóa lặp lại giữ giá trị được viết sau cùng.","behavior":"Tạo dictionary bằng các cặp key: value trong ngoặc nhọn. Khóa lặp lại giữ giá trị được viết sau cùng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"Any","defaultValue":null,"description":"Khóa xác định giá trị. Cho phép số, chuỗi và tuple chứa khóa hợp lệ; không cho phép list, dictionary hay set. True, 1 và 1.0 xác định cùng một khóa.","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ừ các cặp key: value tính khi lặp qua nguồn. Khóa trùng thay giá trị trước đó. Dùng if để lọc phần tử; có thể dùng nhiều mệnh đề for/if. Biến vòng lặp chỉ có trong biểu thức này.","behavior":"Tạo dictionary từ các cặp key: value tính khi lặp qua nguồn. Khóa trùng thay giá trị trước đó. Dùng if để lọc phần tử; có thể dùng nhiều mệnh đề for/if. Biến vòng lặp chỉ có trong biểu thức này.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Biến hoặc nhóm biến nhận phần tử hiện tại. Chưa hỗ trợ cách nhận như *rest.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Nguồn có thể lặp qua, như chuỗi, collection hay generator; dictionary cung cấp các khóa.","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 giá trị lưu dưới key. Thiếu khóa gây KeyError; dùng get() để cung cấp giá trị mặc định.","behavior":"Đọc giá trị lưu dưới key. Thiếu khóa gây KeyError; dùng get() để cung cấp giá trị mặc định.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ị được lưu, có thể là None. Thiếu khóa gây KeyError.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nmode = settings[\"mode\"]        # trả về farm\nmissing = settings.get(\"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Trả về view các tuple (key, value) theo thứ tự thêm vào, phản ánh cả thay đổi dictionary sau đó. Lặp qua view hoặc chuyển bằng list() để dùng chỉ số.","behavior":"Trả về view các tuple (key, value) theo thứ tự thêm vào, phản ánh cả thay đổi dictionary sau đó. Lặp qua view hoặc chuyển bằng list() để dùng chỉ số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict_items","returnDescription":"View dict_items; không thể đọc trực tiếp bằng chỉ số.","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, /)\ndictionary.pop(key, default, /)","description":"Xóa khóa và trả về giá trị của khóa. Nếu không có khóa, trả về default được truyền rõ, kể cả None; bỏ qua default sẽ gây KeyError.","behavior":"Xóa khóa và trả về giá trị của khóa. Nếu không có khóa, trả về default được truyền rõ, kể cả None; bỏ qua default sẽ gây KeyError.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":null,"description":"Giá trị trả về khi thiếu khóa, chỉ áp dụng khi truyền tham số này. Bỏ qua tham số sẽ gây KeyError nếu thiếu khóa.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"Any?","returnDescription":"Giá trị đã xóa, hoặc default được truyền rõ khi không có khóa.","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":"Trả về dictionary mới có cùng các cặp khóa và giá trị. Thêm, xóa hay thay thế cặp trong bản sao không đổi dictionary gốc; collection lồng bên trong vẫn dùng chung.","behavior":"Trả về dictionary mới có cùng các cặp khóa và giá trị. Thêm, xóa hay thay thế cặp trong bản sao không đổi dictionary gốc; collection lồng bên trong vẫn dùng chung.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"Một dict mới; các tập hợp lồng bên trong không được sao chép.","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":"Thêm cặp vào dictionary này từ dictionary khác hay nguồn các cặp (key, value), rồi áp dụng tham số có tên. Khóa trùng được thay giá trị mà không đổi vị trí.","behavior":"Thêm cặp vào dictionary này từ dictionary khác hay nguồn các cặp (key, value), rồi áp dụng tham số có tên. Khóa trùng được thay giá trị mà không đổi vị trí.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"other","type":"dict | Iterable","defaultValue":"()","description":"Một dict hoặc nguồn các list hay tuple có hai phần tử là khóa và giá trị.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"items","type":"Any?","defaultValue":null,"description":"Các cặp viết dạng key=value; chúng thay giá trị của khóa trùng từ other.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Trả về view các khóa theo thứ tự thêm vào, phản ánh cả thay đổi dictionary sau đó. Lặp qua view hoặc chuyển bằng list() để dùng chỉ số.","behavior":"Trả về view các khóa theo thứ tự thêm vào, phản ánh cả thay đổi dictionary sau đó. Lặp qua view hoặc chuyển bằng list() để dùng chỉ số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict_keys","returnDescription":"View dict_keys; không thể đọc trực tiếp bằng chỉ số.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nkeys = settings.keys()\nfirst_key = list(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":"Trả về view các giá trị theo thứ tự thêm khóa, phản ánh cả thay đổi dictionary sau đó. Lặp qua view hoặc chuyển bằng list() để dùng chỉ số.","behavior":"Trả về view các giá trị theo thứ tự thêm khóa, phản ánh cả thay đổi dictionary sau đó. Lặp qua view hoặc chuyển bằng list() để dùng chỉ số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict_values","returnDescription":"View dict_values; không thể đọc trực tiếp bằng chỉ số.","example":"settings = {\"mode\": \"farm\", \"retries\": 3}\nvalues = settings.values()\nlast_value = list(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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 khóa dictionary theo thứ tự thêm vào, gồm cả khóa được thêm sau khi tạo.","behavior":"Lặp qua khóa dictionary theo thứ tự thêm vào, gồm cả khóa được thêm sau khi tạo.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Lưu văn bản viết trong dấu nháy hoặc chuyển bằng str(value). Không thể sửa trực tiếp chuỗi; các phương thức chuỗi trả về giá trị mới. Vị trí và độ dài đếm theo mã Unicode: một emoji là một vị trí, nhưng chữ kèm dấu tách riêng hay emoji ghép có thể chiếm nhiều vị trí.","behavior":"Lưu văn bản viết trong dấu nháy hoặc chuyển bằng str(value). Không thể sửa trực tiếp chuỗi; các phương thức chuỗi trả về giá trị mới. Vị trí và độ dài đếm theo mã Unicode: một emoji là một vị trí, nhưng chữ kèm dấu tách riêng hay emoji ghép có thể chiếm nhiều vị trí.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 giá trị thành văn bản. Collection lớn hoặc giá trị lồng quá sâu được rút gọn và có dấu báo phần bị lược; chuỗi truyền trực tiếp được giữ nguyên.","behavior":"Chuyển giá trị thành văn bản. Collection lớn hoặc giá trị lồng quá sâu được rút gọn và có dấu báo phần bị lược; chuỗi truyền trực tiếp được giữ nguyên.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 vị trí, bắt đầu từ 0. Chỉ số âm đếm từ cuối: -1 là vị trí cuối.","behavior":"Đọc một ký tự theo vị trí, bắt đầu từ 0. Chỉ số âm đếm từ cuối: -1 là vị trí cuối.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí ký tự: 0 là đầu tiên, -1 là cuối cùng.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-only"}],"returnType":"String","returnDescription":"Chuỗi một ký tự. Báo IndexError nếu vị trí nằm ngoài chuỗi.","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":"Trả về chuỗi mới từ start đến trước end. Chỉ số âm đếm từ cuối. Khi bỏ trống hai biên, lấy toàn bộ chuỗi theo chiều của step.","behavior":"Trả về chuỗi mới từ start đến trước end. Chỉ số âm đếm từ cuối. Khi bỏ trống hai biên, lấy toàn bộ chuỗi theo chiều của step.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"chars","type":"String?","defaultValue":"None","description":"Xóa liên tiếp từng ký tự thuộc chuỗi này ở các đầu được chọn, không xóa cả chuỗi chars như một tiền tố hay hậu tố.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"chars","type":"String?","defaultValue":"None","description":"Xóa liên tiếp từng ký tự thuộc chuỗi này ở các đầu được chọn, không xóa cả chuỗi chars như một tiền tố hay hậu tố.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"chars","type":"String?","defaultValue":"None","description":"Xóa liên tiếp từng ký tự thuộc chuỗi này ở các đầu được chọn, không xóa cả chuỗi chars như một tiền tố hay hậu tố.","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 phần chuỗi được chọn có bắt đầu bằng prefix hay không, có phân biệt chữ hoa và chữ thường.","behavior":"Kiểm tra phần chuỗi được chọn có bắt đầu bằng prefix hay không, có phân biệt chữ hoa và chữ thường.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"prefix","type":"String | tuple","defaultValue":null,"description":"Văn bản hoặc tuple các văn bản có thể khớp; True nếu một văn bản khớp ở đầu.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int?","defaultValue":"0","description":"Vị trí đầu tiên được lấy, bắt đầu từ 0. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int?","defaultValue":"len(string)","description":"Dừng trước vị trí này. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","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 phần chuỗi được chọn có kết thúc bằng suffix hay không, có phân biệt chữ hoa và chữ thường.","behavior":"Kiểm tra phần chuỗi được chọn có kết thúc bằng suffix hay không, có phân biệt chữ hoa và chữ thường.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"suffix","type":"String | tuple","defaultValue":null,"description":"Văn bản hoặc tuple các văn bản có thể khớp; True nếu một văn bản khớp ở cuối.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int?","defaultValue":"0","description":"Vị trí đầu tiên được lấy, bắt đầu từ 0. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int?","defaultValue":"len(string)","description":"Dừng trước vị trí này. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí bắt đầu tìm, tính từ 0. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int?","defaultValue":"len(string)","description":"Dừng tìm trước vị trí này. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Int","returnDescription":"Vị trí khớp đầu tiên trong chuỗi gốc, tính từ 0, hoặc -1 nếu không có.","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":"Trả về vị trí khớp đầu tiên trong chuỗi gốc, hoặc báo ValueError nếu phần được chọn không chứa sub.","behavior":"Trả về vị trí khớp đầu tiên trong chuỗi gốc, hoặc báo ValueError nếu phần được chọn không chứa sub.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Vị trí bắt đầu tìm, tính từ 0. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int?","defaultValue":"len(string)","description":"Dừng tìm trước vị trí này. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"old","type":"String","defaultValue":null,"description":"Văn bản cần thay, không tính các lần khớp chồng lấn. Chuỗi rỗng chèn new tại các ranh giới ký tự, tối đa theo count.","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":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"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":"Trả về list các phần văn bản được tách tại sep. Với sep=None, nhóm khoảng trắng là một dấu phân tách và bỏ khoảng trắng đầu; sau maxsplit lần tách, phần còn lại được giữ thành một phần.","behavior":"Trả về list các phần văn bản được tách tại sep. Với sep=None, nhóm khoảng trắng là một dấu phân tách và bỏ khoảng trắng đầu; sau maxsplit lần tách, phần còn lại được giữ thành một phần.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sep","type":"String?","defaultValue":"None","description":"Văn bản phân tách; chuỗi phân tách rỗng gây ValueError. None tách theo các nhóm khoảng trắng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"maxsplit","type":"Int","defaultValue":"-1","description":"Số lần tách tối đa; số âm nghĩa là tất cả.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"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 các chuỗi từ nguồn có thể lặp qua, dùng chuỗi này để ngăn cách chúng. Phần tử không phải chuỗi sẽ gây lỗi.","behavior":"Nối các chuỗi từ nguồn có thể lặp qua, dùng chuỗi này để ngăn cách chúng. Phần tử không phải chuỗi sẽ gây lỗi.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"sub","type":"String","defaultValue":null,"description":"Văn bản cần đếm. Chuỗi rỗng khớp tại mỗi ranh giới, nên số lần bằng độ dài phần được chọn cộng 1.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"start","type":"Int?","defaultValue":"0","description":"Vị trí bắt đầu đếm, tính từ 0. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"},{"name":"stop","type":"Int?","defaultValue":"len(string)","description":"Dừng đếm trước vị trí này. Số âm đếm từ cuối; biên vượt phạm vi được giới hạn trong phần hiện có.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ố Unicode, gồm cả chữ số mũ và chữ số khoanh tròn.","behavior":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ số Unicode, gồm cả chữ số mũ và chữ số khoanh tròn.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 ký tự số Unicode, gồm cả phân số.","behavior":"Kiểm tra chuỗi không rỗng và mọi ký tự đều là chữ cái hoặc ký tự số Unicode, gồm cả phân số.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 ký tự số; False nếu chuỗi rỗng.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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 bảng để người dùng nhập thiết lập cho macro. Thêm các ô nhập rồi gọi show() để hiển thị bảng.","behavior":"Tạo bảng để người dùng nhập thiết lập cho macro. Thêm các ô nhập rồi gọi show() để hiển thị bảng.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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; không đặt lại thiết lập đã lưu native và không đổi định danh của chúng. 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; không đặt lại thiết lập đã lưu native và không đổi định danh của chúng.","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ông báo và chờ người dùng xác nhận rồi mới chạy tiếp script. Chuỗi hiển thị nguyên văn; giá trị khác hiển thị như str(value), với dữ liệu lồng nhau được chia thành nhiều dòng.","behavior":"Hiện thông báo và chờ người dùng xác nhận rồi mới chạy tiếp script. Chuỗi hiển thị nguyên văn; giá trị khác hiển thị như str(value), với dữ liệu lồng nhau được chia thành nhiều dòng.","execution":{"blocking":"yes","threadSafety":"serialized","parallel":"conditional","details":"Hiện thông báo và chờ xác nhận. Thông báo và bảng hộp thoại từ mọi luồng hiện lần lượ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":"Báo lỗi bằng thông báo này và dừng script. Khi chạy macro, màn hình lỗi cho biết luồng chạy và đường dẫn action. Giá trị khác được đổi thành văn bản dễ đọc như str(value).","behavior":"Báo lỗi bằng thông báo này và dừng script. Khi chạy macro, màn hình lỗi cho biết luồng chạy và đường dẫn action. Giá trị khác được đổi thành văn bản dễ đọc như str(value).","execution":{"blocking":"no","threadSafety":"serialized","parallel":"no","details":"Dừng mọi luồng kèm lỗi script, không 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 có thể chỉnh sửa. Ô số nhận số thập phân hữu hạn có dấu, ký pháp khoa học và khoảng trắng bao quanh; không nhận chuỗi rỗng, NaN, Infinity, số tràn hoặc số hệ 16. Dữ liệu không hợp lệ hiện lỗi và chặn Run trong hộp thoại; trên bảng nổi, bản nháp lỗi giữ giá trị hợp lệ cuối cùng và không được lưu.","behavior":"Thêm ô nhập có thể chỉnh sửa. Ô số nhận số thập phân hữu hạn có dấu, ký pháp khoa học và khoảng trắng bao quanh; không nhận chuỗi rỗng, NaN, Infinity, số tràn hoặc số hệ 16. Dữ liệu không hợp lệ hiện lỗi và chặn Run trong hộp thoại; trên bảng nổi, bản nháp lỗi giữ giá trị hợp lệ cuối cùng và không được lưu.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Khóa ô không rỗng trong dict trả về và thiết lập bền vững. Mỗi ô trong một bảng phải có khóa khác nhau. Thiết lập native dùng phạm vi macro cùng namespace được bảo vệ (hoặc macroId cục bộ), biến thể và tên ô; title, version, nhãn bản địa hóa và instance runtime không nằm trong khóa.","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|Number","defaultValue":"\"\"","description":"Giá trị đầu vào chỉ dùng khi không có giá trị native đã lưu hoặc giá trị Storage tương ứng. Ô số trên bảng nổi cần giá trị ban đầu hợp lệ từ thiết lập native, Storage hoặc default; nếu không show() sẽ báo lỗi.","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ận String hoặc \"number\" để nhận Number (float). Giá trị native đã lưu được ưu tiên; nếu không, chuỗi số đã lưu trước đây trong Storage vẫn được khôi phục.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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 ô để người dùng đánh dấu hoặc bỏ đánh dấu.","behavior":"Thêm ô để người dùng đánh dấu hoặc bỏ đánh dấu.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Khóa ô không rỗng trong dict trả về và thiết lập bền vững. Mỗi ô trong một bảng phải có khóa khác nhau. Thiết lập native dùng phạm vi macro cùng namespace được bảo vệ (hoặc macroId cục bộ), biến thể và tên ô; title, version, nhãn bản địa hóa và instance runtime không nằm trong khóa.","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":"Giá trị ban đầu chỉ dùng khi không có giá trị native đã lưu hoặc giá trị Storage tương ứng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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 công tắc để người dùng bật hoặc tắt.","behavior":"Thêm công tắc để người dùng bật hoặc tắt.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Khóa ô không rỗng trong dict trả về và thiết lập bền vững. Mỗi ô trong một bảng phải có khóa khác nhau. Thiết lập native dùng phạm vi macro cùng namespace được bảo vệ (hoặc macroId cục bộ), biến thể và tên ô; title, version, nhãn bản địa hóa và instance runtime không nằm trong khóa.","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":"Giá trị ban đầu chỉ dùng khi không có giá trị native đã lưu hoặc giá trị Storage tương ứng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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, multi_select=False, depends_on=None)","description":"Thêm bộ chọn radio-group, hoặc hiển thị dạng dropdown chọn đơn / chọn nhiều khi dropdown=True. Options có thể là list hoặc dict ánh xạ nhãn lựa chọn cha sang danh sách lựa chọn con khi thiết lập depends_on.","behavior":"Thêm bộ chọn radio-group, hoặc hiển thị dạng dropdown chọn đơn / chọn nhiều khi dropdown=True. Options có thể là list hoặc dict ánh xạ nhãn lựa chọn cha sang danh sách lựa chọn con khi thiết lập depends_on.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Khóa ô không rỗng trong dict trả về và thiết lập bền vững. Mỗi ô trong một bảng phải có khóa khác nhau. Thiết lập native dùng phạm vi macro cùng namespace được bảo vệ (hoặc macroId cục bộ), biến thể và tên ô; title, version, nhãn bản địa hóa và instance runtime không nằm trong khóa.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"options","type":"list[String]|dict[String, list[String]]","defaultValue":null,"description":"Danh sách lựa chọn hoặc dict ánh xạ từ nhãn của ô cha sang danh sách lựa chọn con khi có depends_on.","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|list|None","defaultValue":"None","description":"Lựa chọn ban đầu chỉ dùng khi không có giá trị native đã lưu hoặc giá trị Storage tương ứng: nhãn, chỉ số 0-based hoặc danh sách nhãn/chỉ số khi multi_select=True; None chọn lựa chọn đầu tiên (hoặc không chọn mục nào khi multi_select=True).","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"},{"name":"multi_select","type":"Boolean","defaultValue":"False","description":"Cho phép chọn nhiều mục khi hiển thị dạng dropdown. Bảng trả về danh sách chỉ số 0-based của các mục được chọn.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"depends_on","type":"String?","defaultValue":"None","description":"Tên biến của bộ chọn cha đứng trước mà dropdown này phụ thuộc vào để hiển thị danh sách động.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Khóa ô không rỗng trong dict trả về và thiết lập bền vững. Mỗi ô trong một bảng phải có khóa khác nhau. Thiết lập native dùng phạm vi macro cùng namespace được bảo vệ (hoặc macroId cục bộ), biến thể và tên ô; title, version, nhãn bản địa hóa và instance runtime không nằm trong khóa.","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; phải lớn hơn hoặc bằng min.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"step","type":"Number","defaultValue":"1","description":"Bước tăng dương giữa các giá trị trên thanh trượt.","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ị ban đầu chỉ dùng khi không có giá trị native đã lưu hoặc giá trị Storage tương ứng, sau đó được giới hạn theo min/max.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Khóa ô không rỗng trong dict trả về và thiết lập bền vững. Mỗi ô trong một bảng phải có khóa khác nhau. Thiết lập native dùng phạm vi macro cùng namespace được bảo vệ (hoặc macroId cục bộ), biến thể và tên ô; title, version, nhãn bản địa hóa và instance runtime không nằm trong khóa.","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; phải lớn hơn hoặc bằng min.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"step","type":"Number","defaultValue":"1","description":"Bước tăng nguyên dương cho mỗi lần nhấn + hoặc -. Tham số số được chuyển thành số nguyên.","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ị ban đầu chỉ dùng khi không có giá trị native đã lưu hoặc giá trị Storage tương ứng, sau đó được giới hạn theo min/max.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"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":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","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-localize","kind":"METHOD","parentKey":"class-macropanel","name":"localize","signature":"panel.localize(selector, variants, *, locales=None)","description":"Đăng ký bản sao bảng đã dịch cho bảng nổi. Khi đổi bộ chọn, nội dung đổi ngay cả lúc macro tạm dừng, không cần callback Python hay mở lại bảng; giá trị, bản nháp và vị trí cửa sổ được giữ nguyên. Chỉ được thay đổi văn bản: tiêu đề, phụ đề, nhãn và mô tả ô nhập, HTML và chữ hiển thị của lựa chọn. Các lựa chọn tương ứng theo vị trí; giá trị, Storage và mặc định vẫn theo bảng gốc. Lựa chọn của bộ chọn ngôn ngữ phải giống hệt nhau. Các bản phải có cùng số lượng, thứ tự, loại và tên thành phần, giới hạn số, input_type, multi_select, cấu trúc phụ thuộc và số lựa chọn, kể cả khóa và thứ tự các nhánh phụ thuộc. Không hỗ trợ bản địa hóa lồng nhau. Gọi lại sẽ thay các bản sao; thay đổi bảng nguồn sau đó chỉ có hiệu lực khi đăng ký lại. Hệ thống kiểm tra khi gọi và khi show(); thay đổi không tương thích sẽ báo lỗi. Bảng đã bản địa hóa không thể hiển thị ở chế độ dialog.","behavior":"Đăng ký bản sao bảng đã dịch cho bảng nổi. Khi đổi bộ chọn, nội dung đổi ngay cả lúc macro tạm dừng, không cần callback Python hay mở lại bảng; giá trị, bản nháp và vị trí cửa sổ được giữ nguyên. Chỉ được thay đổi văn bản: tiêu đề, phụ đề, nhãn và mô tả ô nhập, HTML và chữ hiển thị của lựa chọn. Các lựa chọn tương ứng theo vị trí; giá trị, Storage và mặc định vẫn theo bảng gốc. Lựa chọn của bộ chọn ngôn ngữ phải giống hệt nhau. Các bản phải có cùng số lượng, thứ tự, loại và tên thành phần, giới hạn số, input_type, multi_select, cấu trúc phụ thuộc và số lựa chọn, kể cả khóa và thứ tự các nhánh phụ thuộc. Không hỗ trợ bản địa hóa lồng nhau. Gọi lại sẽ thay các bản sao; thay đổi bảng nguồn sau đó chỉ có hiệu lực khi đăng ký lại. Hệ thống kiểm tra khi gọi và khi show(); thay đổi không tương thích sẽ báo lỗi. Bảng đã bản địa hóa không thể hiển thị ở chế độ dialog.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"selector","type":"String","defaultValue":null,"description":"Tên của radio_group hoặc dropdown chọn một mục đã thêm trước đó; bộ chọn này không được dùng multi_select hoặc depends_on.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"variants","type":"dict[String, MacroPanel]","defaultValue":null,"description":"Mỗi nhãn lựa chọn của bộ chọn phải có đúng một bảng tương ứng, dùng chính nhãn đó làm khóa. Các bảng được sao chép khi gọi; mặc định của chúng không thay đổi hành vi của bảng gốc.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"locales","type":"dict[String, String]?","defaultValue":"None","description":"Bản đồ tùy chọn từ nhãn lựa chọn sang mã ngôn ngữ ứng dụng en, vi, th, id hoặc fil. Phải bao phủ chính xác mọi biến thể và điều khiển nhãn dựng sẵn như tóm tắt Tạm dừng và chọn tất cả; None giữ ngôn ngữ của ứng dụng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"MacroPanel","returnDescription":"Chính bảng này, để có thể gọi tiếp phương thức khác của bảng trên kết quả trả về.","example":"# Chuyển bảng nổi giữa tiếng Anh và tiếng Việt\nen = MacroPanel(\"Fishing\")\nen.radio_group(\"language\", [\"English\", \"Tiếng Việt\"], label=\"Language\")\nen.checkbox(\"enabled\", label=\"Enabled\", checked=True)\nvi = MacroPanel(\"Câu cá\")\nvi.radio_group(\"language\", [\"English\", \"Tiếng Việt\"], label=\"Ngôn ngữ\")\nvi.checkbox(\"enabled\", label=\"Bật\", checked=True)\nen.localize(\"language\", {\"English\": en, \"Tiếng Việt\": vi}, locales={\"English\": \"en\", \"Tiếng Việt\": \"vi\"})\nconfig = en.show(mode=\"floating\")","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-show","kind":"METHOD","parentKey":"class-macropanel","name":"show","signature":"panel.show(*, mode=\"dialog\", anchor=\"top_left\", stop_button=True, width=None, height=None, collapsed=None, dock_position=None, pause_on_expand=True)","description":"Hiển thị bảng và trả về dict gồm tên ô nhập và giá trị. Giá trị native đã lưu được ưu tiên, sau đó đến mục Storage cùng tên rồi default của từng ô. Mỗi thay đổi hợp lệ lưu thiết lập native ngay và đồng bộ Storage, kể cả khi macro đang tạm dừng; script không cần gọi Storage.set(), values() hoặc close(). Ô đánh dấu và công tắc trả Boolean, thanh trượt và ô số trả Number, bộ tăng/giảm trả Int, bộ chọn trả chỉ số Int bắt đầu từ 0, còn ô văn bản trả String. Mở lại cùng lệnh show() liên tục mà không có thao tác runtime khác sẽ dừng script để tránh vòng lặp mở bảng vô tận.","behavior":"Hiển thị bảng và trả về dict gồm tên ô nhập và giá trị. Giá trị native đã lưu được ưu tiên, sau đó đến mục Storage cùng tên rồi default của từng ô. Mỗi thay đổi hợp lệ lưu thiết lập native ngay và đồng bộ Storage, kể cả khi macro đang tạm dừng; script không cần gọi Storage.set(), values() hoặc close(). Ô đánh dấu và công tắc trả Boolean, thanh trượt và ô số trả Number, bộ tăng/giảm trả Int, bộ chọn trả chỉ số Int bắt đầu từ 0, còn ô văn bản trả String. Mở lại cùng lệnh show() liên tục mà không có thao tác runtime khác sẽ dừng script để tránh vòng lặp mở bảng vô tận.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"show() dạng dialog chờ người dùng. show(mode=\"floating\") cho chạy tiếp mà không chờ xác nhận; dùng values() đọc ô nhập và close() đóng bảng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"mode","type":"String","defaultValue":"\"dialog\"","description":"dialog chờ xác nhận; nút Hủy trả về dict rỗng. floating trả về ngay và giữ bảng đến khi đóng hoặc kết thúc lượt chạy macro. Mở bảng nổi khác sẽ thay thế bảng đang hiển thị.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"anchor","type":"String","defaultValue":"\"top_left\"","description":"Vị trí bảng nổi mở rộng: top_left, top_right, bottom_left, bottom_right hoặc free. free bắt đầu ở góc trên trái và cho phép kéo bảng mở rộng độc lập với dock dùng chung. Kéo dock dùng chung chỉ di chuyển dock. Gọi lại show() giữ vị trí hiện tại.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"stop_button","type":"Boolean","defaultValue":"True","description":"Hiện nút Dừng trên bảng nổi mở rộng. Bảng thu nhỏ không có nút Dừng riêng; dock chính vẫn có nút Dừng thông thường ở chế độ row.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"width","type":"Int?","defaultValue":"None","description":"Độ rộng cửa sổ nổi đang mở, tính bằng pixel trên màn hình hiện tại; None dùng kích thước gọn tự động. Nhận số nguyên dương. Overlay giới hạn kích thước để đủ phần đầu và vừa vùng màn hình khả dụng; panel thu nhỏ luôn gọn. Không áp dụng scale tọa độ của Point.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"height","type":"Int?","defaultValue":"None","description":"Độ cao cửa sổ nổi đang mở, tính bằng pixel trên màn hình hiện tại; None tự điều chỉnh theo nội dung. Nhận số nguyên dương. Overlay giới hạn kích thước để đủ phần đầu và vừa vùng màn hình phía trên bàn phím; panel thu nhỏ luôn gọn. Không áp dụng scale tọa độ của Point.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"collapsed","type":"Boolean?","defaultValue":"None","description":"Chỉ dùng với mode floating; giá trị khác None bị từ chối trong mode dialog. True thu nhỏ bảng thành nút mở trên dock chính; False mở rộng bảng. None mở rộng bảng mới và giữ trạng thái hiện tại khi gọi lại show(). Có hiệu lực ngay lần hiển thị đầu tiên. Truyền lại anchor, width hoặc height tùy chỉnh trong các lần gọi show() sau để giữ bố cục mở rộng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"dock_position","type":"Point | tuple[Number, Number] | list[Number] | None","defaultValue":"None","description":"Chỉ dùng với mode floating; giá trị khác None bị từ chối trong mode dialog. Đặt góc trên trái của dock chính dùng chung bằng pixel trên màn hình hiện tại, kể cả khi bảng đang mở rộng hoặc trước lần thu nhỏ đầu tiên. Dock di chuyển với hiệu ứng 160 ms. Nhận Point(x, y) hoặc tuple/list gồm đúng hai số hữu hạn trong khoảng -2147483648 đến 2147483647; không áp dụng scale và neo của Point. Dock được giới hạn trong màn hình sau khi đo kích thước thực tế. None giữ vị trí hiện tại. Bảng mở rộng giữ vị trí riêng với mọi anchor, kể cả free.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"pause_on_expand","type":"Boolean","defaultValue":"True","description":"Chỉ dùng với mode floating; truyền rõ tham số này trong mode dialog sẽ báo lỗi. True tạm dừng macro khi bảng nổi đang mở rộng và hiển thị. show() trả về ngay; thực thi tạm dừng tại điểm kiểm tra runtime kế tiếp cho đến khi thu nhỏ, ẩn hoặc đóng bảng. Dùng collapsed=True hoặc pause_on_expand=False để script tiếp tục khi bảng đang mở. False tắt tạm dừng do bảng này; trạng thái tạm dừng thủ công vẫn được giữ. Mỗi lần show() dùng giá trị của lần gọi đó; nếu bỏ qua thì trở lại mặc định True.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"dict","returnDescription":"dialog trả về dict riêng. floating trả về cùng một dict khi gọi show() lại; thay đổi hợp lệ của người dùng cập nhật dict ngay và đã được lưu native, đồng bộ vào Storage. Biến gán riêng, như speed = config[\"speed\"], giữ giá trị đã đọc lúc gán. values() trả về bản sao riêng; close() giữ các giá trị cuối. Sửa dict trả về bằng Python không đổi bảng hoặc thiết lập đã lưu; lần cập nhật tiếp theo từ bảng sẽ thay thế các chỉnh sửa đó.","example":"# Bắt đầu thu nhỏ, sau đó mở rộng, thu nhỏ và di chuyển dock\npanel = MacroPanel(\"Run config\")\npanel.show(mode=\"floating\", collapsed=True, dock_position=Point(20, 100))\nwait(1000)\npanel.show(mode=\"floating\", collapsed=False, pause_on_expand=False)\nwait(1000)\npanel.show(mode=\"floating\", collapsed=True, dock_position=(100, 200))","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-values","kind":"METHOD","parentKey":"class-macropanel","name":"values","signature":"panel.values()","description":"Sao chép các giá trị hợp lệ cuối cùng sau show(). Thay đổi trên bảng về sau không đổi bản sao này. Thay đổi hợp lệ trên bảng nổi đã được lưu native và đồng bộ vào Storage ngay; sau close(), values() trả về các giá trị cuối. Gọi trước show() sẽ báo lỗi.","behavior":"Sao chép các giá trị hợp lệ cuối cùng sau show(). Thay đổi trên bảng về sau không đổi bản sao này. Thay đổi hợp lệ trên bảng nổi đã được lưu native và đồng bộ vào Storage ngay; sau close(), values() trả về các giá trị cuối. Gọi trước show() sẽ báo lỗi.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"dict riêng gồm tên ô nhập và giá trị.","example":"# Đọc cấu hình trực tiếp từ cửa sổ thu gọn ở mỗi lượt lặp\npanel = MacroPanel(\"Live controls\")\npanel.slider(\"speed\", min=1, max=10, default=5)\nconfig = panel.show(mode=\"floating\", anchor=\"free\", stop_button=True, width=320, height=240)\nfor index in range(10):\n    print(config[\"speed\"])\n    wait(1000)\nsnapshot = panel.values()\npanel.close()","aliases":[],"group":"FLOW"},{"key":"class-macropanel-method-close","kind":"METHOD","parentKey":"class-macropanel","name":"close","signature":"panel.close()","description":"Đóng bảng nổi này. Các giá trị đã chấp nhận đã được lưu native và đồng bộ vào Storage, kể cả khi macro đang tạm dừng. Thao tác này không dừng macro. Có thể gọi lại sau show(); values() vẫn trả về các giá trị cuối. Gọi trước show() sẽ báo lỗi.","behavior":"Đóng bảng nổi này. Các giá trị đã chấp nhận đã được lưu native và đồng bộ vào Storage, kể cả khi macro đang tạm dừng. Thao tác này không dừng macro. Có thể gọi lại sau show(); values() vẫn trả về các giá trị cuối. Gọi trước show() sẽ báo lỗi.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Tạo từng bảng trong một luồng. Hộp thoại hiện lần lượt và chờ; bảng nổi cho phép chạy tiếp. error() dừng mọi luồng."},"limitations":[],"relatedApis":["class-system-static-method-stop","class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"None","returnDescription":"Không có giá trị trả về.","example":"# Đọc cấu hình trực tiếp từ cửa sổ thu gọn ở mỗi lượt lặp\npanel = MacroPanel(\"Live controls\")\npanel.slider(\"speed\", min=1, max=10, default=5)\nconfig = panel.show(mode=\"floating\", anchor=\"free\", stop_button=True, width=320, height=240)\nfor index in range(10):\n    print(config[\"speed\"])\n    wait(1000)\nsnapshot = panel.values()\npanel.close()","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":true,"fields":["dev","battery","screen","memory"],"fieldDocs":[{"name":"dev","type":"dict","defaultValue":null,"description":"Thông tin thiết bị hiện tại: isEmulator, cấp API Android sdk, mã language, darkmode, khả năng touch và trạng thái sẵn sàng capture. Đọc lại để lấy thông tin mới.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"battery","type":"dict","defaultValue":null,"description":"Thông tin pin hiện tại: percent từ 0 đến 100, charging, temperature theo độ C và health dạng chữ. percent hoặc temperature không đọc được là -1; health không rõ là \"unknown\". Đọc lại để cập nhật.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"screen","type":"dict","defaultValue":null,"description":"Thông tin màn hình hiện tại: width và height theo pixel, hệ số density, dpi và orientation là góc xoay màn hình theo độ (0, 90, 180 hoặc 270). Đọc lại sau khi xoay thiết bị.","suggestAsNamedArg":true,"requirement":null,"callingMode":null},{"name":"memory","type":"dict","defaultValue":null,"description":"Bộ nhớ hệ thống hiện tại: avail, total và ngưỡng thiếu bộ nhớ threshold tính theo byte; low cho biết bộ nhớ khả dụng đang thấp. Đọc lại để cập nhật.","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":"Đọc ngày giờ hiện tại dưới dạng số mili giây kể từ 00:00:00 UTC ngày 01/01/1970.","behavior":"Đọc ngày giờ hiện tại dưới dạng số mili giây kể từ 00:00:00 UTC ngày 01/01/1970.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number","returnDescription":"Số mili giây kể từ 00:00:00 UTC ngày 01/01/1970.","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":"Đọc tên phiên bản CogniTab đang cài đặt.","behavior":"Đọc tên phiên bản CogniTab đang cài đặt.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"String","returnDescription":"Tên phiên bản CogniTab, hoặc \"unknown\" nếu không đọc được.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Đọc cấp API Android mà thiết bị đang sử dụng.","behavior":"Đọc cấp API Android mà thiết bị đang sử dụng.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Number","returnDescription":"Cấp API Android dưới dạng số.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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ông báo ngắn của Android. List, dict và các giá trị có cấu trúc khác được trình bày gọn để dễ đọc.","behavior":"Hiện thông báo ngắn của Android. List, dict và các giá trị có cấu trúc khác được trình bày gọn để dễ đọc.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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 mọi luồng macro; các dòng sau không chạy. Dùng Flow.stop(name) để dừng một luồng nền."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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ỏ tùy chọn, tính bằng pixel. Khi có bảng nổi thu nhỏ gắn vào, dock dùng kích thước tự nhiên; kích thước yêu cầu được giữ lại và áp dụng lại khi không còn bảng gắn vào.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"},{"name":"height","type":"Number?","defaultValue":"None","description":"Độ cao vùng dock thu nhỏ tùy chọn, tính bằng pixel. Khi có bảng nổi thu nhỏ gắn vào, dock dùng kích thước tự nhiên; kích thước yêu cầu được giữ lại và áp dụng lại khi không còn bảng gắn vào.","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 tùy chọn: icon, row hoặc hidden. icon giữ nút mở bảng nổi đang thu nhỏ. hidden có hiệu lực trong lượt chạy và giữ nút Dừng ở góc dưới trái khi không có nút Dừng trên bảng nổi đang hiển thị; khi bảng thu nhỏ, cửa sổ khẩn cấp này cũng có nút mở bảng.","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-send-key","kind":"STATIC_METHOD","parentKey":"class-system","name":"send_key","signature":"System.send_key(key)","description":"Gửi một cặp sự kiện nhấn/nhả phím Android tới ô nhập đang có focus qua Accessibility trên Android 13 trở lên. Gửi sự kiện phím mà không cần tìm vị trí phím trên bàn phím ảo.","behavior":"Gửi một cặp sự kiện nhấn/nhả phím Android tới ô nhập đang có focus qua Accessibility trên Android 13 trở lên. Gửi sự kiện phím mà không cần tìm vị trí phím trên bàn phím ảo.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"key","type":"String|Number","defaultValue":null,"description":"Tên phím Android không phân biệt hoa thường, có thể thêm tiền tố `KEYCODE_`, ví dụ `ENTER`, `TAB`, `ESCAPE`, `DEL`, `DPAD_LEFT`, `A` hoặc `F1`; hoặc mã phím Android là số nguyên dương, ví dụ `66` cho Enter. Khoảng trắng ở đầu/cuối tên phím được bỏ qua.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"}],"returnType":"Boolean","returnDescription":"`True` khi đã gửi cả hai sự kiện phím; `False` trên Android 12L trở xuống, khi phím không được hỗ trợ, không có kết nối tới ô nhập đang hoạt động hoặc gửi phím thất bại. Ứng dụng đích quyết định cách xử lý phím; cần kiểm tra màn hình trước khi tiếp tục. Hàm không gửi phím phần cứng tới toàn hệ thống và không xác nhận ứng dụng đã xử lý phím.","example":"# Gửi phím tới ô nhập đang có focus bằng tên hoặc mã phím Android\nsent = System.send_key(\"ENTER\")\nSystem.send_key(key=\"TAB\")\nSystem.send_key(66)","aliases":[],"group":"FLOW"},{"key":"class-system-static-method-back","kind":"STATIC_METHOD","parentKey":"class-system","name":"back","signature":"System.back()","description":"Yêu cầu Android quay lại, tương tự nhấn nút Back.","behavior":"Yêu cầu Android quay lại, tương tự nhấn nút Back.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Yêu cầu Android mở màn hình chính.","behavior":"Yêu cầu Android mở màn hình chính.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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ở bảng cài đặt nhanh của Android.","behavior":"Mở bảng cài đặt nhanh của Android.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Yêu cầu Android chụp ảnh màn hình.","behavior":"Yêu cầu Android chụp ảnh màn hình.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"Boolean","returnDescription":"`True` nếu Android chấp nhận thao tác, ngược lại là `False`.","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":"Điều khiển việc dùng lại ảnh chụp khi nhận diện màn hình trong lượt chạy macro hiện tại. Thông thường, một ảnh chụp có thể được dùng lại trong tối đa 100 ms. Gọi trực tiếp các phương thức trên ScreenCapture; không tạo đối tượng.","behavior":"Điều khiển việc dùng lại ảnh chụp khi nhận diện màn hình trong lượt chạy macro hiện tại. Thông thường, một ảnh chụp có thể được dùng lại trong tối đa 100 ms. Gọi trực tiếp các phương thức trên ScreenCapture; không tạo đối tượng.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Đổi cách dùng lại ảnh cho mọi luồng, không chụp ảnh, chờ hết thời lượng hay xin quyền chụp. Lần chụp sau dùng thiết lập này."},"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":"Giữ một ảnh chụp màn hình để kiểm tra nhiều lần cho đến khi gọi cache_off() hoặc lượt chạy macro kết thúc. Dùng ảnh tiếp theo có sẵn, hoặc ảnh hợp lệ gần nhất nếu chưa có ảnh mới. Chế độ này được ưu tiên hơn thiết lập dùng lại ảnh tự động và không xin quyền chụp màn hình.","behavior":"Giữ một ảnh chụp màn hình để kiểm tra nhiều lần cho đến khi gọi cache_off() hoặc lượt chạy macro kết thúc. Dùng ảnh tiếp theo có sẵn, hoặc ảnh hợp lệ gần nhất nếu chưa có ảnh mới. Chế độ này được ưu tiên hơn thiết lập dùng lại ảnh tự động và không xin quyền chụp màn hình.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Đổi cách dùng lại ảnh cho mọi luồng, không chụp ảnh, chờ hết thời lượng hay xin quyền chụp. Lần chụp sau dùng thiết lập này."},"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":"Ngừng giữ ảnh đã chọn bằng cache_on(). Thiết lập dùng lại ảnh tự động không đổi nên ảnh còn mới vẫn có thể được dùng lại. Gọi thêm auto_cache_off() khi mỗi lần kiểm tra cần ảnh mới nhất hiện có.","behavior":"Ngừng giữ ảnh đã chọn bằng cache_on(). Thiết lập dùng lại ảnh tự động không đổi nên ảnh còn mới vẫn có thể được dùng lại. Gọi thêm auto_cache_off() khi mỗi lần kiểm tra cần ảnh mới nhất hiện có.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Đổi cách dùng lại ảnh cho mọi luồng, không chụp ảnh, chờ hết thời lượng hay xin quyền chụp. Lần chụp sau dùng thiết lập này."},"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 dùng lại ảnh tự động để các yêu cầu chụp tìm ảnh mới nhất hiện có. Hàm trả về ngay; thời hạn bắt đầu từ lệnh gọi này và gọi lại sẽ thay thế thời hạn cũ. Áp dụng cho chụp bitmap, ảnh thô, TFLite và pixel. Việc này có thể tăng xử lý và hao pin mà không làm chạy nhanh hơn hoặc buộc Android vẽ pixel mới; thời gian chờ ảnh vẫn có giới hạn. Không hủy cache_on() hoặc xin quyền chụp màn hình.","behavior":"Tắt dùng lại ảnh tự động để các yêu cầu chụp tìm ảnh mới nhất hiện có. Hàm trả về ngay; thời hạn bắt đầu từ lệnh gọi này và gọi lại sẽ thay thế thời hạn cũ. Áp dụng cho chụp bitmap, ảnh thô, TFLite và pixel. Việc này có thể tăng xử lý và hao pin mà không làm chạy nhanh hơn hoặc buộc Android vẽ pixel mới; thời gian chờ ảnh vẫn có giới hạn. Không hủy cache_on() hoặc xin quyền chụp màn hình.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Đổi cách dùng lại ảnh cho mọi luồng, không chụp ảnh, chờ hết thời lượng hay xin quyền chụp. Lần chụp sau dùng thiết lập này."},"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":"Thời hạn theo số mili giây nguyên dương (100 và 100.0 đều hợp lệ). Bỏ qua hoặc dùng None để tắt đến khi gọi auto_cache_on() hoặc kết thúc lượt chạy macro. Số 0, số âm, số có phần lẻ, chuỗi, boolean và giá trị vượt giới hạn sẽ báo lỗi.","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":"Cho phép dùng lại ảnh tự động ngay, hủy thời hạn tắt trước đó. Chế độ này cũng được khôi phục khi lượt chạy macro kết thúc. Không hủy cache_on(), xin quyền chụp màn hình hoặc chờ.","behavior":"Cho phép dùng lại ảnh tự động ngay, hủy thời hạn tắt trước đó. Chế độ này cũng được khôi phục khi lượt chạy macro kết thúc. Không hủy cache_on(), xin quyền chụp màn hình hoặc chờ.","execution":{"blocking":"no","threadSafety":"serialized","parallel":"conditional","details":"Đổi cách dùng lại ảnh cho mọi luồng, không chụp ảnh, chờ hết thời lượng hay xin quyền chụp. Lần chụp sau dùng thiết lập này."},"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":"Lưu giá trị theo tên để macro hiện tại dùng lại ở các lần chạy sau. Mọi luồng trong cùng lượt chạy dùng chung Storage; biến thường chỉ dùng chung giữa các action PYTHON_CODE tuần tự trong một luồng, kể cả trong GROUP. Các luồng song song có biến riêng. Storage không phải kênh gửi tin giữa các tiến trình.","behavior":"Lưu giá trị theo tên để macro hiện tại dùng lại ở các lần chạy sau. Mọi luồng trong cùng lượt chạy dùng chung Storage; biến thường chỉ dùng chung giữa các action PYTHON_CODE tuần tự trong một luồng, kể cả trong GROUP. Các luồng song song có biến riêng. Storage không phải kênh gửi tin giữa các tiến trình.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Lưu giá trị theo khóa, thay thế giá trị cũ nếu có. Các kiểu được hỗ trợ gồm Number, String, Boolean, Point, Region, list, tuple, dict, set và None; collection có thể chứa collection khác.","behavior":"Lưu giá trị theo khóa, thay thế giá trị cũ nếu có. Các kiểu được hỗ trợ gồm Number, String, Boolean, Point, Region, list, tuple, dict, set và None; collection có thể chứa collection khác.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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 có giá trị trả về. Các lệnh đọc Storage khác thấy thay đổi ngay. Thay đổi được lưu xuống thiết bị sau 2 giây không có lượt ghi mới và được lưu lại khi macro cùng mọi luồng 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":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"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":"Lấy dict mà Storage đang dùng trong lượt chạy này. Mọi luồng dùng chung dict: thêm, sửa hoặc xóa mục trong dict làm Storage đổi ngay. Các chỉnh sửa được lưu sau 2 giây không có lượt ghi mới và lưu lại khi macro cùng mọi luồng nền kết thúc.","behavior":"Lấy dict mà Storage đang dùng trong lượt chạy này. Mọi luồng dùng chung dict: thêm, sửa hoặc xóa mục trong dict làm Storage đổi ngay. Các chỉnh sửa được lưu sau 2 giây không có lượt ghi mới và lưu lại khi macro cùng mọi luồng nền kết thúc.","execution":{"blocking":"conditional","threadSafety":"serialized","parallel":"conditional","details":"Các luồng dùng chung Storage. Từng thao tác, kể cả sửa bên trong tập hợp đã lưu, được bảo vệ. Luồng khác có thể ghi giữa get() và set(); dùng một luồng ghi để tránh ghi đè cập nhật đó."},"limitations":[],"relatedApis":["class-flow"],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"Chính dict của Storage, không phải bản sao riê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 rồi thả tại từng điểm đích. Mặc định, chờ nhấn xong rồi mới chạy tiếp. Có thể truyền tham số theo vị trí hoặc theo tên theo thứ tự trong chữ ký.","behavior":"Nhấn rồi thả tại từng điểm đích. Mặc định, chờ nhấn xong rồi mới chạy tiếp. Có thể truyền tham số theo vị trí hoặc theo tên theo thứ tự trong chữ ký.","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"parallel=True xếp hàng chạm; delay_before, delay_after vẫn chờ ngoài chế độ collect. Touch.collect() gom, send() gửi và wait() chờ hoàn tất. Các luồng chạm có thể ảnh hưởng nhau."},"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, tọa độ pixel cố định (x, y), hoặc kết quả tìm kiếm. Dùng Point khi cần co giãn hoặc neo tọa độ. Nhấn mọi điểm tìm được; không nhấn nếu không tìm được điểm nào.","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"hold_ms","type":"Int","defaultValue":"0","description":"Thời gian giữ tính bằng mili giây","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"offset","type":"tuple[Number, Number]","defaultValue":"(0, 0)","description":"Độ lệch ngang và dọc, tính bằng pixel, cộng vào tọa độ đích cuối cùng.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"random","type":"Number | tuple[Number, Number]","defaultValue":"0","description":"Độ lệch pixel ngẫu nhiên tối đa về mỗi phía của điểm đích. Một số áp dụng cho cả hai trục; (x, y) đặt riêng từng trục. Giá trị âm được đổi thành 0.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"delay_before","type":"Number","defaultValue":"0","description":"Thời gian chờ trước khi nhấn, tính bằng mili giây.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"delay_after","type":"Number","defaultValue":"0","description":"Thời gian chờ sau khi nhấn, tính bằng mili giây.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"},{"name":"parallel","type":"Boolean","defaultValue":"False","description":"True: đưa thao tác chạm vào hàng đợi và trả về mã số mà không chờ hoàn tất. Sau Touch.collect(), chờ Touch.send(); các thao tác đã gom có thể diễn ra đồng thời với delay_before khác nhau. Dùng Touch.cancel(id) để hủy một thao tác hoặc Touch.cancel() để hủy tất cả.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Number | list[Number] | None","returnDescription":"Khi parallel=True: mã thao tác chạm nếu có một điểm, hoặc danh sách mã nếu có nhiều điểm. Trường hợp khác, hoặc không tìm được điểm: 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":"Vuốt một ngón qua các SwipePoint theo thứ tự. Mặc định, chờ vuốt xong rồi mới chạy tiếp.","behavior":"Vuốt một ngón qua các SwipePoint theo thứ tự. Mặc định, chờ vuốt xong rồi mới chạy tiếp.","execution":{"blocking":"conditional","threadSafety":"limited","parallel":"conditional","details":"parallel=True xếp hàng chạm; delay_before, delay_after vẫn chờ ngoài chế độ collect. Touch.collect() gom, send() gửi và wait() chờ hoàn tất. Các luồng chạm có thể ảnh hưởng nhau."},"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":"True: đưa thao tác vuốt vào hàng đợi mà không chờ hoàn tất. Sau Touch.collect(), chờ Touch.send(). Dùng Touch.cancel(id) để hủy một thao tác hoặc Touch.cancel() để hủy tất cả.","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":"Chờ trong khoảng thời gian chỉ định rồi chạy tiếp script.","behavior":"Chờ trong khoảng thời gian chỉ định rồi chạy tiếp script.","execution":{"blocking":"yes","threadSafety":"limited","parallel":"conditional","details":"Chờ hết thời lượng hoặc chạm hoàn tất. Luồng khác có thể tiếp tục; tạm dừng và dừng 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 chờ tính bằng mili giây; giá trị âm được đổi thành 0. Vẫn có thể tạm dừng hoặc dừng macro trong lúc chờ.","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":"Thay nội dung ô nhập văn bản bằng value.","behavior":"Thay nội dung ô nhập văn bản bằng value.","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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: dùng ô nhập đang được chọn; nếu chưa chọn ô nào thì dùng ô nhập đầu tiên. N >= 1: chọn và dùng ô nhập thứ N.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"None","returnDescription":"None. Nếu không tìm được ô nhập, không nhập văn bản.","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Khoảng cách giữa hai giá trị liên tiếp. Dùng số âm để đếm giảm; 0 gây lỗi.","suggestAsNamedArg":false,"requirement":"overload-dependent","callingMode":"positional-only"}],"returnType":"range","returnDescription":"Dãy số nguyên bất biến, có thể duyệt lại, dừng trước stop. Rỗng nếu step đi ra xa stop. Dùng list(result) để tạo danh sách có thể sửa.","example":"# Nhấn lần lượt tại năm vị trí cách đều nhau\nnumbers = range(5)\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":"Đánh số từng phần tử khi duyệt đầu vào.","behavior":"Đánh số từng phần tử khi duyệt đầu vào.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","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":"enumerate","returnDescription":"Bộ duyệt dùng một lần, tạo các cặp (index, item). Chỉ đọc phần tử khi cần. Dùng list(result) để lưu các cặp.","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, strict=False)","description":"Ghép các phần tử cùng vị trí trong từng đầu vào khi duyệt.","behavior":"Ghép các phần tử cùng vị trí trong từng đầu vào khi duyệt.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterables","type":"Iterable","defaultValue":null,"description":"Các giá trị cần ghép. dict đóng góp key.","suggestAsNamedArg":false,"requirement":"optional","callingMode":"variadic"},{"name":"strict","type":"Boolean","defaultValue":"False","description":"False: dừng ở đầu vào ngắn nhất. True: báo lỗi trong lúc duyệt nếu các đầu vào khác độ dài. Truyền theo tên.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"zip","returnDescription":"Bộ duyệt dùng một lần, tạo tuple gồm một phần tử từ mỗi đầu vào. Dùng list(result) để lưu các tuple.","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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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-all","kind":"FUNCTION","parentKey":null,"name":"all","signature":"all(iterable, /)","description":"Trả False tại phần tử falsy đầu tiên; ngược lại trả True, kể cả khi iterable rỗng. Dùng phép duyệt và kiểm tra truthy thông thường; hỗ trợ tạm dừng và dừng.","behavior":"Trả False tại phần tử falsy đầu tiên; ngược lại trả True, kể cả khi iterable rỗng. Dùng phép duyệt và kiểm tra truthy thông thường; hỗ trợ tạm dừng và dừng.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Duyệt trong luồng hiện tại và dừng tại giá trị falsy đầu tiên. Phép duyệt hoặc kiểm tra truthy có thể gọi code người dùng hoặc chờ host; lỗi được truyền ra. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Tập hợp hoặc iterable cần kiểm tra.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":null,"example":"# Kiểm tra mọi điểm đều đạt\nscores = [0.9, 0.95]\nprint(all(score >= 0.85 for score in scores))","aliases":[],"group":"COLLECTION"},{"key":"function-any","kind":"FUNCTION","parentKey":null,"name":"any","signature":"any(iterable, /)","description":"Trả về True nếu ít nhất một phần tử trong iterable có giá trị đúng (truthy); dừng ở phần tử truthy đầu tiên. Trả về False khi iterable rỗng hoặc mọi phần tử đều falsy.","behavior":"Trả về True nếu ít nhất một phần tử trong iterable có giá trị đúng (truthy); dừng ở phần tử truthy đầu tiên. Trả về False khi iterable rỗng hoặc mọi phần tử đều falsy.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"Iterable","defaultValue":null,"description":"Tập hợp, String, range, bộ duyệt hoặc biểu thức sinh cần kiểm tra. Giá trị không duyệt được gây lỗi TypeError.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"True khi có phần tử truthy; ngược lại là False.","example":"scores = [0.42, 0.91, 0.65]\nhas_match = any(score >= 0.85 for score in scores)\nif has_match:\n    text(\"found\")","aliases":[],"group":"COLLECTION"},{"key":"function-globals","kind":"FUNCTION","parentKey":null,"name":"globals","signature":"globals()","description":"Trả về dict trực tiếp chứa biến, hàm và lớp toàn cục cấp script của lần chạy hiện tại.","behavior":"Trả về dict trực tiếp chứa biến, hàm và lớp toàn cục cấp script của lần chạy hiện tại.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[],"returnType":"dict","returnDescription":"Dict trực tiếp của các tên toàn cục. Đọc và cập nhật bằng khóa chuỗi áp dụng thẳng vào phạm vi toàn cục; khóa không phải chuỗi hoặc sửa Recognition sẽ gây lỗi.","example":"status = \"ready\"\nif \"status\" in globals():\n    text(str(globals()[\"status\"]))","aliases":[],"group":"COLLECTION"},{"key":"function-int","kind":"FUNCTION","parentKey":null,"name":"int","signature":"int(value=0, /)","description":"Chuyển value thành số nguyên bằng cách bỏ phần thập phân của đầu vào dạng số. Chuỗi phải chứa số nguyên; chuỗi có phần thập phân gây lỗi. True thành 1 và False thành 0.","behavior":"Chuyển value thành số nguyên bằng cách bỏ phần thập phân của đầu vào dạng số. Chuỗi phải chứa số nguyên; chuỗi có phần thập phân gây lỗi. True thành 1 và False thành 0.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float | Boolean | String","defaultValue":"0","description":"Giá trị cần ép kiểu","suggestAsNamedArg":false,"requirement":"optional","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=0.0, /)","description":"Chuyển value thành số thực. Chuỗi phải chứa số hợp lệ; True thành 1.0 và False thành 0.0.","behavior":"Chuyển value thành số thực. Chuỗi phải chứa số hợp lệ; True thành 1.0 và False thành 0.0.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Int | Float | Boolean | String","defaultValue":"0.0","description":"Giá trị cần ép kiểu","suggestAsNamedArg":false,"requirement":"optional","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 value thành văn bản. Chuỗi có sẵn được giữ nguyên; số và tập hợp có sẵn dùng cách biểu diễn văn bản của Python.","behavior":"Chuyển value thành văn bản. Chuỗi có sẵn được giữ nguyên; số và tập hợp có sẵn dùng cách biểu diễn văn bản của Python.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any","defaultValue":"\"\"","description":"Giá trị cần chuyển","suggestAsNamedArg":false,"requirement":"optional","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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-isinstance","kind":"FUNCTION","parentKey":null,"name":"isinstance","signature":"isinstance(value, class_or_tuple, /)","description":"Kiểm tra giá trị thuộc kiểu dựng sẵn, lớp giá trị DSL hay lớp tự định nghĩa. Không chuyển đổi giá trị.","behavior":"Kiểm tra giá trị thuộc kiểu dựng sẵn, lớp giá trị DSL hay lớp tự định nghĩa. Không chuyển đổi giá trị.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":false,"requirement":"required","callingMode":"positional-only"},{"name":"class_or_tuple","type":"Type | tuple[Type, ...]","defaultValue":null,"description":"Truyền tham chiếu kiểu không có dấu nháy: bool, int, float, str, list, tuple, dict, set, range, enumerate, zip; lớp giá trị DSL như Point, Match, AudioMatch; hoặc lớp tự định nghĩa. Tuple có thể lồng nhau và được kiểm tra từ trái sang phải đến khi khớp. Phần tử không hợp lệ được gặp trước khi khớp gây TypeError. Không nhận chuỗi hoặc type(value) vì type() trả văn bản. Flow, System, Storage, Touch, ScreenCapture và Recognition là không gian tên hoặc ngữ cảnh, không phải kiểu.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"True nếu khớp kiểu; ngược lại trả False, kể cả với tuple rỗng. bool cũng khớp int; int và float là hai kiểu khác nhau. Lớp tự định nghĩa được so theo đúng lần định nghĩa, kể cả khi tên giống nhau.","example":"# Kiểm tra kiểu giá trị trước khi sử dụng\nvalue = 42\nif isinstance(value, (int, float)):\n    print(value + 1)\nprint(isinstance(Point(10, 20), Point))","aliases":[],"group":"TYPE_CAST"},{"key":"function-hasattr","kind":"FUNCTION","parentKey":null,"name":"hasattr","signature":"hasattr(object, name, /)","description":"Kiểm tra đối tượng có thuộc tính hoặc phương thức bằng cách tra cứu thuộc tính thông thường của DSL. Không gọi phương thức.","behavior":"Kiểm tra đối tượng có thuộc tính hoặc phương thức bằng cách tra cứu thuộc tính thông thường của DSL. Không gọi phương thức.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tra cứu thuộc tính thông thường, không gọi phương thức. Đọc thuộc tính có thể đọc trạng thái hiện tại từ host. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"object","type":"Any","defaultValue":null,"description":"Đối tượng hoặc không gian tên cần kiểm tra.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"name","type":"String","defaultValue":null,"description":"Tên thuộc tính hoặc phương thức. Giá trị không phải chuỗi gây TypeError.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"True khi thuộc tính tồn tại, kể cả khi giá trị là None, False hoặc 0. Chỉ trả False khi không có thuộc tính; các lỗi tra cứu khác vẫn được báo. Khóa dict tuân theo quy tắc truy cập bằng dấu chấm của DSL.","example":"# Chỉ đọc tọa độ khi thuộc tính đó tồn tại\nvalue = Point(10, 20)\nif hasattr(value, \"x\"):\n    print(value.x)\nprint(hasattr(value, \"missing\"))","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 của script trên lớp phủ rồi chạy tiếp. Giá trị dùng cùng cách biểu diễn văn bản như str(value).","behavior":"In giá trị ra console của script trên lớp phủ rồi chạy tiếp. Giá trị dùng cùng cách biểu diễn văn bản như str(value).","execution":{"blocking":"conditional","threadSafety":"not-guaranteed","parallel":"conditional","details":"Việc chờ tùy API. Mỗi luồng nên sửa đối tượng riêng; nhiều luồng cùng sửa một đối tượng có thể cho kết quả ngoài dự kiến."},"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=False, /)","description":"Chuyển value thành True hoặc False để dùng trong điều kiện.","behavior":"Chuyển value thành True hoặc False để dùng trong điều kiện.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"value","type":"Any","defaultValue":"False","description":"Giá trị cần chuyển","suggestAsNamedArg":false,"requirement":"optional","callingMode":"positional-only"}],"returnType":"Boolean","returnDescription":"False với None, False, 0, chuỗi rỗng hoặc tập hợp rỗng; Match dùng giá trị found. Các trường hợp khác trả về 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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Int | 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":"Cộng các số đầu vào vào start và trả về tổng.","behavior":"Cộng các số đầu vào vào start và trả về tổng.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"list | tuple | set | generator","defaultValue":null,"description":"Tập hợp hoặc generator cung cấp lần lượt từng số. Biểu thức generator cần ngoặc riêng nếu phía sau còn đối số khác hoặc dấu phẩy cuối.","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":"Xử lý giá trị trong luồng hiện tại. Hàm key cũng chạy ở đó; các lần chờ và thay đổi của nó xảy ra trước khi trả về."},"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ó thể đọc lần lượt từng phần tử, như danh sách hoặc chuỗi. Với dict, so sánh các khóa.","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":"Hàm nhận từng phần tử; so sánh kết quả của hàm thay cho phần tử. None so sánh trực tiếp các phần tử.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"Any","returnDescription":"Phần tử gốc nhỏ nhất, hoặc default nếu đầu vào rỗng. Đầu vào rỗng mà không có default, hoặc các giá trị không thể so sánh, gây lỗi.","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":"Xử lý giá trị trong luồng hiện tại. Hàm key cũng chạy ở đó; các lần chờ và thay đổi của nó xảy ra trước khi trả về."},"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ó thể đọc lần lượt từng phần tử, như danh sách hoặc chuỗi. Với dict, so sánh các khóa.","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":"Hàm nhận từng phần tử; so sánh kết quả của hàm thay cho phần tử. None so sánh trực tiếp các phần tử.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"keyword-only"}],"returnType":"Any","returnDescription":"Phần tử gốc lớn nhất, hoặc default nếu đầu vào rỗng. Đầu vào rỗng mà không có default, hoặc các giá trị không thể so sánh, gây lỗi.","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ề danh sách mới được sắp xếp từ nhỏ đến lớn. Các phần tử có giá trị so sánh bằng nhau giữ thứ tự ban đầu, kể cả khi reverse=True.","behavior":"Trả về danh sách mới được sắp xếp từ nhỏ đến lớn. Các phần tử có giá trị so sánh bằng nhau giữ thứ tự ban đầu, kể cả khi reverse=True.","execution":{"blocking":"conditional","threadSafety":"isolated","parallel":"conditional","details":"Xử lý giá trị trong luồng hiện tại. Hàm key cũng chạy ở đó; các lần chờ và thay đổi của nó xảy ra trước khi trả về."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"iterable","type":"String | list | tuple | dict | set","defaultValue":null,"description":"Giá trị có thể đọc lần lượt từng phần tử, như danh sách hoặc chuỗi. Với dict, sắp xếp các khóa.","suggestAsNamedArg":false,"requirement":"required","callingMode":"positional-only"},{"name":"key","type":"Callable?","defaultValue":"None","description":"Hàm nhận từng phần tử; so sánh kết quả của hàm thay cho phần tử. None so sánh trực tiếp các phần tử.","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(number, ndigits=None)","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"limitations":[],"relatedApis":[],"isCallable":null,"fields":[],"fieldDocs":[],"constants":[],"constructorParams":[],"fieldExample":null,"constructorExample":null,"params":[{"name":"number","type":"Int | Float","defaultValue":null,"description":"Số đầu vào","suggestAsNamedArg":true,"requirement":"required","callingMode":"positional-or-keyword"},{"name":"ndigits","type":"Int?","defaultValue":"None","description":"Số chữ số thập phân cần giữ; số âm làm tròn đến hàng chục, hàng trăm, v.v. None trả về số nguyên. Giá trị ở chính giữa được làm tròn về kết quả chẵn gần nhất.","suggestAsNamedArg":true,"requirement":"optional","callingMode":"positional-or-keyword"}],"returnType":"Int | 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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Int | 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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Int","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Int","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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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ữ value trong khoảng min đến max: thay giá trị nằm ngoài khoảng bằng cận gần nhất. Có thể truyền hai cận theo thứ tự ngược.","behavior":"Giữ value trong khoảng min đến max: thay giá trị nằm ngoài khoảng bằng cận gần nhất. Có thể truyền hai cận theo thứ tự ngược.","execution":{"blocking":"no","threadSafety":"isolated","parallel":"yes","details":"Tính hoặc sửa giá trị, không chờ chụp ảnh, cử chỉ hay nhập liệu. Mỗi luồng dùng đối tượng có thể sửa riêng."},"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"}]}}