{"id":19000803,"url":"https://github.com/binux/ankulua-vision","last_synced_at":"2025-04-22T17:07:10.297Z","repository":{"id":142060904,"uuid":"151800592","full_name":"binux/ankulua-vision","owner":"binux","description":"UI to help making ankulua scripts","archived":false,"fork":false,"pushed_at":"2018-10-14T22:17:17.000Z","size":3354,"stargazers_count":38,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T07:17:36.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-06T03:16:00.000Z","updated_at":"2025-04-11T15:09:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"8043792e-0c66-4b30-b60e-4ac2a4f4fb34","html_url":"https://github.com/binux/ankulua-vision","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binux%2Fankulua-vision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binux%2Fankulua-vision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binux%2Fankulua-vision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binux%2Fankulua-vision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binux","download_url":"https://codeload.github.com/binux/ankulua-vision/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285682,"owners_count":21405297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T18:08:25.371Z","updated_at":"2025-04-22T17:07:10.289Z","avatar_url":"https://github.com/binux.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ankulua-vision\n\n\u003e An electron app to help making [AnkuLua](https://play.google.com/store/apps/details?id=com.appautomatic.ankulua.trial) scripts.\n\n**You need AnkuLua to use the scripts generated by this app**\n\nAnkuLua:\n\u003e AnkuLua is an Android app that focus on the automation of any Android app.\n\u003e The basic operations are:\n\u003e   * take screen snap shop and look for specific image on the screen \n\u003e   * take some actions (such as click, drag and drop and etc.) based on the searching result\nRead more: http://ankulua.boards.net/thread/2/ankulua-introduction\n\n#### Download\n\nhttps://github.com/binux/ankulua-vision/releases\n\n#### How to use\n\n![screenshot](static/Screenshot.png)\n\n1. Run the app, select your work folder for the script.\n2. Add screen capture of the game by clicking `Add Screen` or drag and drop into the window.\n3. Name the screen like `base`, `battle`, `mission`\n4. Click `Add Detect Zone` and drag and draw the region that can be used to identify the screen.\n  * You could adjust the similarity required or search range if the position may changes.\n  * If you are detecting a popup dialog that partly overlaying on another screen, make sure add more detect zones than the lower layer screen. Otherwise it may detected as the screen below the dialog.\n5. Click `Add Hotspot` and drag and draw the region that can be clicked, and list all possible screens it may link to.\n  * You could adjust the similarity and search range like detect zone.\n  * You could use them later in your lua script (see below).\n  * After region created, you can double click it and jump between screens.\n6. `Back` and `Save \u0026 Generate`\n7. Start editing your script `\u003cWORK_FOLDER\u003e/start.lua`\n\n#### Script \u0026 APIs\n\nEdit the script `\u003cWORK_FOLDER\u003e/start.lua` with your favorite editor.\n\nIt's basically a AnkuLua script written in lua language. You could find more information from [here](http://ankulua.boards.net/thread/2/ankulua-introduction) or [here in Chinese](http://ankulua-tw.boards.net/thread/2/ankulua)\n\n##### stateMachine:goto(...)\n\nGoto one or more screens/states. Example: `stateMachine:goto('base', 'mission', 'battle', 'missionResult');`\n\nReturn: last state\n\n##### stateMachine:find([region], image, [timeout])\n\nFind `image`, you could use the `file` generated by ankulua-vision, if you do so, `find` method will respect the similarity and search range you set. If `timeout` set, it will wait up to `timeout` seconds before return `nil`. Example: `stateMachine:find('btn_base_combat', 10)`\n\nReturn: [Match Object](http://ankulua.boards.net/thread/6/objects-methods-introduction-sikuli-compatible) or `nil`\n\n##### stateMachine:dragFind(image, down, left)\n\nDrag the screen and find the `image`. `down \u003e 0` drag down, `down \u003c 0` drag up, `down = 0` drag up then down. `left \u003e 0` drag left, `left \u003c 0` drag right, `left = 0` drag right then left\n\nReturn: [Match Object](http://ankulua.boards.net/thread/6/objects-methods-introduction-sikuli-compatible) or `nil`\n\n##### stateMachine:click(image, [timeout])\n\nClick on `image`, if `image` is a `file` generated by ankulua-vision, it will respect the setting, and try to match the `image` before click, you could set similarity to 0 by skip image matching and always click the region. if `timeout` set, it will wait up to `timeout` seconds before return `nil`.\n\nReturn: true if success\n\n##### stateMachine:zoomOut()\n\n##### stateMachine:checkState(state)\n\nReturn: score if match given state\n\n##### stateMachine:getState()\n\nReturn: current state\n\n##### stateMachine:leaveState(state, timeout=10)\n\nWait until leave state\n\nReturn: true if success\n\n##### stateMachine:waitStates(states, [timeout])\n\nWait until enter state or states, example: `stateMachine:waitStates({'base', 'battle'})`\n\n##### stateMachine:plan(state, target)\n##### stateMachine:play(state, target)\n\n##### stateMachine:register(state, target, action)\n\nRegister an `action`(type: function) from `state` to `target`, `target` could be a name of existing screen or a new screen. You can `stateMachine:goto` the `target` screen you defined here. It can be used to defined complex state transfers or short cuts. `action` is a function, and must return a known state name. Example:\n\n```\nstateMachine:register('mission', 'mission_43e_select', function ()\n  stateMachine:log('select mission')\n  stateMachine:click('btn_mission_mission_ep04.png', 2)\n  stateMachine:click('btn_mission_emergency.png', 2)\n  if not stateMachine:click('btn_mission_ep04_emergency_combatSetting.png', 3) then return end\n  return stateMachine:waitStates(\"combatSetting\")\nend)\n\nstateMachine:goto('mission', 'mission_43e_select', 'combat')\n```\n\n##### option: \n\n```\nstateMachine.highlightTime = 0.3\nstateMachine.highlightFind = true\nstateMachine.highlightClick = true\n```\n\n\n#### Build Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# serve with hot reload at localhost:9080\nnpm run dev\n\n# build electron application for production\nnpm run build\n```\n\n---\n\nThis project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[fad1966](https://github.com/SimulatedGREG/electron-vue/tree/fad1966ffb4b7f27639e224bbbebf349f7ef7d8a) using [vue-cli](https://github.com/vuejs/vue-cli). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinux%2Fankulua-vision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinux%2Fankulua-vision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinux%2Fankulua-vision/lists"}