├── .github └── workflows │ └── upload_docs.yml ├── .gitignore ├── LICENSE ├── README.md ├── docs ├── Makefile ├── _static │ └── empty ├── conf.py ├── index.rst ├── make.bat └── wizsdk.rst ├── poetry.lock ├── pyproject.toml └── wizsdk ├── __init__.py ├── battle.py ├── card.py ├── client.py ├── constants.py ├── hotkey.py ├── images ├── confirm.png ├── enemy-first.png ├── friendlist.png ├── spellbook.png └── x.png ├── keyboard.py ├── mouse.py ├── pixels.py ├── utils.py └── window.py /.github/workflows/upload_docs.yml: -------------------------------------------------------------------------------- 1 | name: Upload_docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | runs-on: windows-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v1 14 | - name: Set up Python 3.8 15 | uses: actions/setup-python@v2 16 | with: 17 | python-version: 3.8 18 | - name: Install poetry 19 | run: py -3.8 -m pip install poetry 20 | - name: Install deps 21 | run: poetry install 22 | - name: Build docs 23 | run: poetry run sphinx-build docs docs/_build/html 24 | - uses: actions/upload-artifact@v1 25 | with: 26 | name: HTML_DOCS 27 | path: docs/_build/html 28 | - name: Commit documentation changes 29 | run: | 30 | git clone https://github.com/UnderpaidDev1/wizSDK.git --branch gh-pages --single-branch gh-pages 31 | xcopy /E /I /Y "docs\_build\html" "gh-pages" 32 | cd gh-pages 33 | git config --local user.email "action@github.com" 34 | git config --local user.name "GitHub Action" 35 | git add . 36 | git commit -m "Update documentation" -a 37 | shell: cmd 38 | - name: Push changes 39 | if: ${{ success() }} 40 | uses: ad-m/github-push-action@master 41 | with: 42 | branch: gh-pages 43 | directory: gh-pages 44 | github_token: ${{ secrets.GITHUB_TOKEN }} 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | dist 3 | wizsdk.egg-info 4 | venv 5 | test 6 | _spells 7 | _icons 8 | _captures 9 | pyvenv.cfg 10 | __main__.py 11 | **/__pycache__ 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WizSDK 2 | 3 | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) 4 | 5 | Wizard101 bot Software Development Kit 6 | A wrapper for [WizWalker](https://github.com/StarrFox/wizwalker) bundled with many other useful function. 7 | Designed to make building bots for farming / questing / bazaar sniping / selling / pet training 8 | 9 | ## documentation 10 | 11 | you can find the documentation [here](https://underpaiddev1.github.io/wizSDK/) 12 | 13 | you can download these from the gh-pages branch if desired 14 | 15 | ## install 16 | 17 | clone the repo or install from pypi `pip install -U wizsdk` 18 | 19 | ## discord 20 | 21 | join the offical discord [here](https://discord.gg/D9GRrbDzpt) 22 | 23 | ## development install 24 | 25 | This package uses [poetry](https://python-poetry.org/) 26 | 27 | ```shell script 28 | $ poetry install 29 | ``` 30 | 31 | ## building 32 | 33 | You'll need the dev install (see above) for this to work 34 | 35 | ### Docs 36 | 37 | ```shell script 38 | $ cd docs 39 | $ make html 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_static/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnderpaidDev1/wizSDK/366440904df487731be9e47c8d3f5bb7ac7aa623/docs/_static/empty -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | import os 14 | import sys 15 | 16 | sys.path.insert(0, os.path.abspath("..")) 17 | 18 | 19 | # -- Project information ----------------------------------------------------- 20 | 21 | project = "WizSDK" 22 | copyright = "2021, UnderpaidDev" 23 | author = "UnderpaidDev" 24 | 25 | # Get version from toml file 26 | import re 27 | 28 | with open("../pyproject.toml") as fp: 29 | version = re.search( 30 | r'\[tool.poetry\]\nname = "\w+"\n(version ?= ?"(\d+\.\d+\.\d+)")', fp.read() 31 | ).group(2) 32 | 33 | # -- General configuration --------------------------------------------------- 34 | 35 | # Add any Sphinx extension module names here, as strings. They can be 36 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 37 | # ones. 38 | extensions = [ 39 | "sphinx.ext.autodoc", 40 | "sphinx.ext.napoleon", 41 | ] 42 | 43 | # Add any paths that contain templates here, relative to this directory. 44 | templates_path = ["_templates"] 45 | 46 | # List of patterns, relative to source directory, that match files and 47 | # directories to ignore when looking for source files. 48 | # This pattern also affects html_static_path and html_extra_path. 49 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] 50 | 51 | 52 | # -- Options for HTML output ------------------------------------------------- 53 | 54 | # The theme to use for HTML and HTML Help pages. See the documentation for 55 | # a list of builtin themes. 56 | # 57 | html_theme = "sphinx_rtd_theme" 58 | 59 | # Add any paths that contain custom static files (such as style sheets) here, 60 | # relative to this directory. They are copied after the builtin static files, 61 | # so a file named "default.css" will overwrite the builtin "default.css". 62 | html_static_path = ["_static"] 63 | 64 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. WizSDK documentation master file, created by 2 | sphinx-quickstart on Tue Jan 19 08:56:25 2021. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to WizSDK's documentation! 7 | ================================== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | :caption: Contents: 12 | 13 | wizsdk 14 | 15 | 16 | Indices and tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/wizsdk.rst: -------------------------------------------------------------------------------- 1 | 2 | wizSDK Documentation 3 | ==================== 4 | 5 | .. module:: wizsdk 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | 10 | 11 | Client 12 | ====== 13 | 14 | .. autoclass:: Client 15 | :members: 16 | :undoc-members: 17 | :show-inheritance: 18 | 19 | 20 | Defaults 21 | -------- 22 | .. autodata:: wizsdk.client.SPELLS_FOLDER 23 | .. autodata:: wizsdk.client.IMAGE_FOLDER 24 | .. autodata:: wizsdk.client.DEFAULT_MOUNT_SPEED 25 | 26 | 27 | Helpers 28 | ------- 29 | .. autofunction:: wizsdk.client.register_clients 30 | .. autofunction:: wizsdk.client.unregister_all 31 | 32 | 33 | Battle 34 | ====== 35 | 36 | .. autoclass:: Battle 37 | :members: 38 | 39 | Card 40 | ==== 41 | 42 | .. autoclass:: Card 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | 48 | Keyboard 49 | ======== 50 | 51 | .. autoclass:: Keyboard 52 | :members: 53 | :undoc-members: 54 | 55 | Mouse 56 | ===== 57 | 58 | .. autoclass:: Mouse 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | DeviceContext 64 | ============= 65 | 66 | .. autoclass:: DeviceContext 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | Window 72 | ====== 73 | 74 | .. autoclass:: Window 75 | :members: 76 | :undoc-members: 77 | 78 | Hot Keys 79 | ====== 80 | 81 | .. autoclass:: HotkeyEvents 82 | :members: 83 | 84 | Utils 85 | ===== 86 | 87 | .. automodule:: wizsdk.utils 88 | :members: 89 | :undoc-members: 90 | :show-inheritance: 91 | -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "aioconsole" 3 | version = "0.2.1" 4 | description = "Asynchronous console and interfaces for asyncio" 5 | category = "main" 6 | optional = false 7 | python-versions = "*" 8 | 9 | [[package]] 10 | name = "aiofiles" 11 | version = "0.5.0" 12 | description = "File support for asyncio." 13 | category = "main" 14 | optional = false 15 | python-versions = "*" 16 | 17 | [[package]] 18 | name = "aiomonitor" 19 | version = "0.4.5" 20 | description = "aiomonitor adds monitor and python REPL capabilities for asyncio application" 21 | category = "main" 22 | optional = false 23 | python-versions = "*" 24 | 25 | [package.dependencies] 26 | aioconsole = "*" 27 | terminaltables = "*" 28 | 29 | [[package]] 30 | name = "alabaster" 31 | version = "0.7.12" 32 | description = "A configurable sidebar-enabled Sphinx theme" 33 | category = "main" 34 | optional = false 35 | python-versions = "*" 36 | 37 | [[package]] 38 | name = "appdirs" 39 | version = "1.4.4" 40 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 41 | category = "main" 42 | optional = false 43 | python-versions = "*" 44 | 45 | [[package]] 46 | name = "asyncchain" 47 | version = "0.1.1" 48 | description = "Small python library to allow \"async chaining\"" 49 | category = "main" 50 | optional = false 51 | python-versions = ">=3.7,<4.0" 52 | 53 | [[package]] 54 | name = "asyncio" 55 | version = "3.4.3" 56 | description = "reference implementation of PEP 3156" 57 | category = "main" 58 | optional = false 59 | python-versions = "*" 60 | 61 | [[package]] 62 | name = "atomicwrites" 63 | version = "1.4.0" 64 | description = "Atomic file writes." 65 | category = "dev" 66 | optional = false 67 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 68 | 69 | [[package]] 70 | name = "attrs" 71 | version = "21.2.0" 72 | description = "Classes Without Boilerplate" 73 | category = "dev" 74 | optional = false 75 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 76 | 77 | [package.extras] 78 | dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] 79 | docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] 80 | tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] 81 | tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] 82 | 83 | [[package]] 84 | name = "babel" 85 | version = "2.9.1" 86 | description = "Internationalization utilities" 87 | category = "main" 88 | optional = false 89 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 90 | 91 | [package.dependencies] 92 | pytz = ">=2015.7" 93 | 94 | [[package]] 95 | name = "certifi" 96 | version = "2020.12.5" 97 | description = "Python package for providing Mozilla's CA Bundle." 98 | category = "main" 99 | optional = false 100 | python-versions = "*" 101 | 102 | [[package]] 103 | name = "chardet" 104 | version = "4.0.0" 105 | description = "Universal encoding detector for Python 2 and 3" 106 | category = "main" 107 | optional = false 108 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 109 | 110 | [[package]] 111 | name = "click" 112 | version = "7.1.2" 113 | description = "Composable command line interface toolkit" 114 | category = "main" 115 | optional = false 116 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 117 | 118 | [[package]] 119 | name = "click-default-group" 120 | version = "1.2.2" 121 | description = "Extends click.Group to invoke a command without explicit subcommand name" 122 | category = "main" 123 | optional = false 124 | python-versions = "*" 125 | 126 | [package.dependencies] 127 | click = "*" 128 | 129 | [[package]] 130 | name = "colorama" 131 | version = "0.4.4" 132 | description = "Cross-platform colored terminal text." 133 | category = "main" 134 | optional = false 135 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 136 | 137 | [[package]] 138 | name = "docutils" 139 | version = "0.16" 140 | description = "Docutils -- Python Documentation Utilities" 141 | category = "main" 142 | optional = false 143 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 144 | 145 | [[package]] 146 | name = "idna" 147 | version = "2.10" 148 | description = "Internationalized Domain Names in Applications (IDNA)" 149 | category = "main" 150 | optional = false 151 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 152 | 153 | [[package]] 154 | name = "imagesize" 155 | version = "1.2.0" 156 | description = "Getting image size from png/jpeg/jpeg2000/gif file" 157 | category = "main" 158 | optional = false 159 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 160 | 161 | [[package]] 162 | name = "janus" 163 | version = "0.6.1" 164 | description = "Mixed sync-async queue to interoperate between asyncio tasks and classic threads" 165 | category = "main" 166 | optional = false 167 | python-versions = ">=3.6" 168 | 169 | [[package]] 170 | name = "jinja2" 171 | version = "3.0.0" 172 | description = "A very fast and expressive template engine." 173 | category = "main" 174 | optional = false 175 | python-versions = ">=3.6" 176 | 177 | [package.dependencies] 178 | MarkupSafe = ">=2.0.0rc2" 179 | 180 | [package.extras] 181 | i18n = ["Babel (>=2.7)"] 182 | 183 | [[package]] 184 | name = "loguru" 185 | version = "0.5.3" 186 | description = "Python logging made (stupidly) simple" 187 | category = "main" 188 | optional = false 189 | python-versions = ">=3.5" 190 | 191 | [package.dependencies] 192 | colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} 193 | win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} 194 | 195 | [package.extras] 196 | dev = ["codecov (>=2.0.15)", "colorama (>=0.3.4)", "flake8 (>=3.7.7)", "tox (>=3.9.0)", "tox-travis (>=0.12)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "Sphinx (>=2.2.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "black (>=19.10b0)", "isort (>=5.1.1)"] 197 | 198 | [[package]] 199 | name = "markupsafe" 200 | version = "2.0.0" 201 | description = "Safely add untrusted strings to HTML/XML markup." 202 | category = "main" 203 | optional = false 204 | python-versions = ">=3.6" 205 | 206 | [[package]] 207 | name = "more-itertools" 208 | version = "8.7.0" 209 | description = "More routines for operating on iterables, beyond itertools" 210 | category = "dev" 211 | optional = false 212 | python-versions = ">=3.5" 213 | 214 | [[package]] 215 | name = "numpy" 216 | version = "1.20.3" 217 | description = "NumPy is the fundamental package for array computing with Python." 218 | category = "main" 219 | optional = false 220 | python-versions = ">=3.7" 221 | 222 | [[package]] 223 | name = "opencv-python" 224 | version = "4.5.2.52" 225 | description = "Wrapper package for OpenCV python bindings." 226 | category = "main" 227 | optional = false 228 | python-versions = ">=3.6" 229 | 230 | [package.dependencies] 231 | numpy = ">=1.13.3" 232 | 233 | [[package]] 234 | name = "packaging" 235 | version = "20.9" 236 | description = "Core utilities for Python packages" 237 | category = "main" 238 | optional = false 239 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 240 | 241 | [package.dependencies] 242 | pyparsing = ">=2.0.2" 243 | 244 | [[package]] 245 | name = "pluggy" 246 | version = "0.13.1" 247 | description = "plugin and hook calling mechanisms for python" 248 | category = "dev" 249 | optional = false 250 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 251 | 252 | [package.extras] 253 | dev = ["pre-commit", "tox"] 254 | 255 | [[package]] 256 | name = "py" 257 | version = "1.10.0" 258 | description = "library with cross-python path, ini-parsing, io, code, log facilities" 259 | category = "dev" 260 | optional = false 261 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 262 | 263 | [[package]] 264 | name = "pygments" 265 | version = "2.9.0" 266 | description = "Pygments is a syntax highlighting package written in Python." 267 | category = "main" 268 | optional = false 269 | python-versions = ">=3.5" 270 | 271 | [[package]] 272 | name = "pymem" 273 | version = "1.8.3" 274 | description = "pymem: python memory access made easy" 275 | category = "main" 276 | optional = false 277 | python-versions = "*" 278 | 279 | [package.extras] 280 | doc = ["recommonmark", "sphinx", "sphinx-rtd-theme", "sphinxcontrib-napoleon"] 281 | test = ["codecov", "pytest", "pytest-cov"] 282 | 283 | [[package]] 284 | name = "pyparsing" 285 | version = "2.4.7" 286 | description = "Python parsing module" 287 | category = "main" 288 | optional = false 289 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 290 | 291 | [[package]] 292 | name = "pytest" 293 | version = "5.4.3" 294 | description = "pytest: simple powerful testing with Python" 295 | category = "dev" 296 | optional = false 297 | python-versions = ">=3.5" 298 | 299 | [package.dependencies] 300 | atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} 301 | attrs = ">=17.4.0" 302 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 303 | more-itertools = ">=4.0.0" 304 | packaging = "*" 305 | pluggy = ">=0.12,<1.0" 306 | py = ">=1.5.0" 307 | wcwidth = "*" 308 | 309 | [package.extras] 310 | checkqa-mypy = ["mypy (==v0.761)"] 311 | testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] 312 | 313 | [[package]] 314 | name = "pytz" 315 | version = "2021.1" 316 | description = "World timezone definitions, modern and historical" 317 | category = "main" 318 | optional = false 319 | python-versions = "*" 320 | 321 | [[package]] 322 | name = "requests" 323 | version = "2.25.1" 324 | description = "Python HTTP for Humans." 325 | category = "main" 326 | optional = false 327 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 328 | 329 | [package.dependencies] 330 | certifi = ">=2017.4.17" 331 | chardet = ">=3.0.2,<5" 332 | idna = ">=2.5,<3" 333 | urllib3 = ">=1.21.1,<1.27" 334 | 335 | [package.extras] 336 | security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] 337 | socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] 338 | 339 | [[package]] 340 | name = "snowballstemmer" 341 | version = "2.1.0" 342 | description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." 343 | category = "main" 344 | optional = false 345 | python-versions = "*" 346 | 347 | [[package]] 348 | name = "sphinx" 349 | version = "3.5.4" 350 | description = "Python documentation generator" 351 | category = "main" 352 | optional = false 353 | python-versions = ">=3.5" 354 | 355 | [package.dependencies] 356 | alabaster = ">=0.7,<0.8" 357 | babel = ">=1.3" 358 | colorama = {version = ">=0.3.5", markers = "sys_platform == \"win32\""} 359 | docutils = ">=0.12,<0.17" 360 | imagesize = "*" 361 | Jinja2 = ">=2.3" 362 | packaging = "*" 363 | Pygments = ">=2.0" 364 | requests = ">=2.5.0" 365 | snowballstemmer = ">=1.1" 366 | sphinxcontrib-applehelp = "*" 367 | sphinxcontrib-devhelp = "*" 368 | sphinxcontrib-htmlhelp = "*" 369 | sphinxcontrib-jsmath = "*" 370 | sphinxcontrib-qthelp = "*" 371 | sphinxcontrib-serializinghtml = "*" 372 | 373 | [package.extras] 374 | docs = ["sphinxcontrib-websupport"] 375 | lint = ["flake8 (>=3.5.0)", "isort", "mypy (>=0.800)", "docutils-stubs"] 376 | test = ["pytest", "pytest-cov", "html5lib", "cython", "typed-ast"] 377 | 378 | [[package]] 379 | name = "sphinx-rtd-theme" 380 | version = "0.5.2" 381 | description = "Read the Docs theme for Sphinx" 382 | category = "dev" 383 | optional = false 384 | python-versions = "*" 385 | 386 | [package.dependencies] 387 | docutils = "<0.17" 388 | sphinx = "*" 389 | 390 | [package.extras] 391 | dev = ["transifex-client", "sphinxcontrib-httpdomain", "bump2version"] 392 | 393 | [[package]] 394 | name = "sphinxcontrib-applehelp" 395 | version = "1.0.2" 396 | description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" 397 | category = "main" 398 | optional = false 399 | python-versions = ">=3.5" 400 | 401 | [package.extras] 402 | lint = ["flake8", "mypy", "docutils-stubs"] 403 | test = ["pytest"] 404 | 405 | [[package]] 406 | name = "sphinxcontrib-devhelp" 407 | version = "1.0.2" 408 | description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." 409 | category = "main" 410 | optional = false 411 | python-versions = ">=3.5" 412 | 413 | [package.extras] 414 | lint = ["flake8", "mypy", "docutils-stubs"] 415 | test = ["pytest"] 416 | 417 | [[package]] 418 | name = "sphinxcontrib-htmlhelp" 419 | version = "1.0.3" 420 | description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" 421 | category = "main" 422 | optional = false 423 | python-versions = ">=3.5" 424 | 425 | [package.extras] 426 | lint = ["flake8", "mypy", "docutils-stubs"] 427 | test = ["pytest", "html5lib"] 428 | 429 | [[package]] 430 | name = "sphinxcontrib-jsmath" 431 | version = "1.0.1" 432 | description = "A sphinx extension which renders display math in HTML via JavaScript" 433 | category = "main" 434 | optional = false 435 | python-versions = ">=3.5" 436 | 437 | [package.extras] 438 | test = ["pytest", "flake8", "mypy"] 439 | 440 | [[package]] 441 | name = "sphinxcontrib-qthelp" 442 | version = "1.0.3" 443 | description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." 444 | category = "main" 445 | optional = false 446 | python-versions = ">=3.5" 447 | 448 | [package.extras] 449 | lint = ["flake8", "mypy", "docutils-stubs"] 450 | test = ["pytest"] 451 | 452 | [[package]] 453 | name = "sphinxcontrib-serializinghtml" 454 | version = "1.1.4" 455 | description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." 456 | category = "main" 457 | optional = false 458 | python-versions = ">=3.5" 459 | 460 | [package.extras] 461 | lint = ["flake8", "mypy", "docutils-stubs"] 462 | test = ["pytest"] 463 | 464 | [[package]] 465 | name = "terminaltables" 466 | version = "3.1.0" 467 | description = "Generate simple tables in terminals from a nested list of strings." 468 | category = "main" 469 | optional = false 470 | python-versions = "*" 471 | 472 | [[package]] 473 | name = "urllib3" 474 | version = "1.26.4" 475 | description = "HTTP library with thread-safe connection pooling, file post, and more." 476 | category = "main" 477 | optional = false 478 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" 479 | 480 | [package.extras] 481 | secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] 482 | socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] 483 | brotli = ["brotlipy (>=0.6.0)"] 484 | 485 | [[package]] 486 | name = "wcwidth" 487 | version = "0.2.5" 488 | description = "Measures the displayed width of unicode strings in a terminal" 489 | category = "dev" 490 | optional = false 491 | python-versions = "*" 492 | 493 | [[package]] 494 | name = "win32-setctime" 495 | version = "1.0.3" 496 | description = "A small Python utility to set file creation time on Windows" 497 | category = "main" 498 | optional = false 499 | python-versions = ">=3.5" 500 | 501 | [package.extras] 502 | dev = ["pytest (>=4.6.2)", "black (>=19.3b0)"] 503 | 504 | [[package]] 505 | name = "wizwalker" 506 | version = "1.0.2" 507 | description = "Automation bot for wizard101" 508 | category = "main" 509 | optional = false 510 | python-versions = ">=3.8,<4.0" 511 | 512 | [package.dependencies] 513 | aioconsole = ">=0.2.1,<0.3.0" 514 | aiofiles = ">=0.5.0,<0.6.0" 515 | aiomonitor = ">=0.4.5,<0.5.0" 516 | appdirs = ">=1.4.4,<2.0.0" 517 | click = ">=7.1.2,<8.0.0" 518 | click_default_group = ">=1.2.2,<2.0.0" 519 | janus = ">=0.6.1,<0.7.0" 520 | loguru = ">=0.5.1,<0.6.0" 521 | pymem = "1.8.3" 522 | terminaltables = ">=3.1.0,<4.0.0" 523 | 524 | [metadata] 525 | lock-version = "1.1" 526 | python-versions = "^3.8" 527 | content-hash = "8964076a5dc023e2a157ff97d5d8a070d1d4dfebc52169a80b0392ad02081464" 528 | 529 | [metadata.files] 530 | aioconsole = [ 531 | {file = "aioconsole-0.2.1.tar.gz", hash = "sha256:f63d007c5c0fd5a30769af0a6b749307ea86001c4f217d3e5e9e248ccdfec1d0"}, 532 | ] 533 | aiofiles = [ 534 | {file = "aiofiles-0.5.0-py3-none-any.whl", hash = "sha256:377fdf7815cc611870c59cbd07b68b180841d2a2b79812d8c218be02448c2acb"}, 535 | {file = "aiofiles-0.5.0.tar.gz", hash = "sha256:98e6bcfd1b50f97db4980e182ddd509b7cc35909e903a8fe50d8849e02d815af"}, 536 | ] 537 | aiomonitor = [ 538 | {file = "aiomonitor-0.4.5-py3-none-any.whl", hash = "sha256:5c7ac38b2ee59cbad87162ef5c45d72c7b57b94c8a93e7f462184bf10f9ebccd"}, 539 | {file = "aiomonitor-0.4.5.tar.gz", hash = "sha256:6232c1ab14bf06cd7217845801c27340032f74e283bdaf32d01cdd3b7c673d0e"}, 540 | ] 541 | alabaster = [ 542 | {file = "alabaster-0.7.12-py2.py3-none-any.whl", hash = "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359"}, 543 | {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, 544 | ] 545 | appdirs = [ 546 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, 547 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, 548 | ] 549 | asyncchain = [ 550 | {file = "asyncchain-0.1.1-py3-none-any.whl", hash = "sha256:4cbee519b76b118b4749dd25b75acef107df1e07df2e7e3d419994db081d9c29"}, 551 | {file = "asyncchain-0.1.1.tar.gz", hash = "sha256:0e12a0e4c7e32b6d0c4f3833019ae25930b3ff455c2b3ed92869135d9b72d8a9"}, 552 | ] 553 | asyncio = [ 554 | {file = "asyncio-3.4.3-cp33-none-win32.whl", hash = "sha256:b62c9157d36187eca799c378e572c969f0da87cd5fc42ca372d92cdb06e7e1de"}, 555 | {file = "asyncio-3.4.3-cp33-none-win_amd64.whl", hash = "sha256:c46a87b48213d7464f22d9a497b9eef8c1928b68320a2fa94240f969f6fec08c"}, 556 | {file = "asyncio-3.4.3-py3-none-any.whl", hash = "sha256:c4d18b22701821de07bd6aea8b53d21449ec0ec5680645e5317062ea21817d2d"}, 557 | {file = "asyncio-3.4.3.tar.gz", hash = "sha256:83360ff8bc97980e4ff25c964c7bd3923d333d177aa4f7fb736b019f26c7cb41"}, 558 | ] 559 | atomicwrites = [ 560 | {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, 561 | {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, 562 | ] 563 | attrs = [ 564 | {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, 565 | {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, 566 | ] 567 | babel = [ 568 | {file = "Babel-2.9.1-py2.py3-none-any.whl", hash = "sha256:ab49e12b91d937cd11f0b67cb259a57ab4ad2b59ac7a3b41d6c06c0ac5b0def9"}, 569 | {file = "Babel-2.9.1.tar.gz", hash = "sha256:bc0c176f9f6a994582230df350aa6e05ba2ebe4b3ac317eab29d9be5d2768da0"}, 570 | ] 571 | certifi = [ 572 | {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, 573 | {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, 574 | ] 575 | chardet = [ 576 | {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, 577 | {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, 578 | ] 579 | click = [ 580 | {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, 581 | {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, 582 | ] 583 | click-default-group = [ 584 | {file = "click-default-group-1.2.2.tar.gz", hash = "sha256:d9560e8e8dfa44b3562fbc9425042a0fd6d21956fcc2db0077f63f34253ab904"}, 585 | ] 586 | colorama = [ 587 | {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, 588 | {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, 589 | ] 590 | docutils = [ 591 | {file = "docutils-0.16-py2.py3-none-any.whl", hash = "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af"}, 592 | {file = "docutils-0.16.tar.gz", hash = "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"}, 593 | ] 594 | idna = [ 595 | {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, 596 | {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, 597 | ] 598 | imagesize = [ 599 | {file = "imagesize-1.2.0-py2.py3-none-any.whl", hash = "sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1"}, 600 | {file = "imagesize-1.2.0.tar.gz", hash = "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"}, 601 | ] 602 | janus = [ 603 | {file = "janus-0.6.1-py3-none-any.whl", hash = "sha256:6dae3f1fd68a92dab49c1b93d269f22d2232feddf3a3b8842a881a6e67500c16"}, 604 | {file = "janus-0.6.1.tar.gz", hash = "sha256:4712e0ef75711fe5947c2db855bc96221a9a03641b52e5ae8e25c2b705dd1d0c"}, 605 | ] 606 | jinja2 = [ 607 | {file = "Jinja2-3.0.0-py3-none-any.whl", hash = "sha256:2f2de5285cf37f33d33ecd4a9080b75c87cd0c1994d5a9c6df17131ea1f049c6"}, 608 | {file = "Jinja2-3.0.0.tar.gz", hash = "sha256:ea8d7dd814ce9df6de6a761ec7f1cac98afe305b8cdc4aaae4e114b8d8ce24c5"}, 609 | ] 610 | loguru = [ 611 | {file = "loguru-0.5.3-py3-none-any.whl", hash = "sha256:f8087ac396b5ee5f67c963b495d615ebbceac2796379599820e324419d53667c"}, 612 | {file = "loguru-0.5.3.tar.gz", hash = "sha256:b28e72ac7a98be3d28ad28570299a393dfcd32e5e3f6a353dec94675767b6319"}, 613 | ] 614 | markupsafe = [ 615 | {file = "MarkupSafe-2.0.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:2efaeb1baff547063bad2b2893a8f5e9c459c4624e1a96644bbba08910ae34e0"}, 616 | {file = "MarkupSafe-2.0.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:441ce2a8c17683d97e06447fcbccbdb057cbf587c78eb75ae43ea7858042fe2c"}, 617 | {file = "MarkupSafe-2.0.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:45535241baa0fc0ba2a43961a1ac7562ca3257f46c4c3e9c0de38b722be41bd1"}, 618 | {file = "MarkupSafe-2.0.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:90053234a6479738fd40d155268af631c7fca33365f964f2208867da1349294b"}, 619 | {file = "MarkupSafe-2.0.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3b54a9c68995ef4164567e2cd1a5e16db5dac30b2a50c39c82db8d4afaf14f63"}, 620 | {file = "MarkupSafe-2.0.0-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:f58b5ba13a5689ca8317b98439fccfbcc673acaaf8241c1869ceea40f5d585bf"}, 621 | {file = "MarkupSafe-2.0.0-cp36-cp36m-win32.whl", hash = "sha256:a00dce2d96587651ef4fa192c17e039e8cfab63087c67e7d263a5533c7dad715"}, 622 | {file = "MarkupSafe-2.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:007dc055dbce5b1104876acee177dbfd18757e19d562cd440182e1f492e96b95"}, 623 | {file = "MarkupSafe-2.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a08cd07d3c3c17cd33d9e66ea9dee8f8fc1c48e2d11bd88fd2dc515a602c709b"}, 624 | {file = "MarkupSafe-2.0.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:3c352ff634e289061711608f5e474ec38dbaa21e3e168820d53d5f4015e5b91b"}, 625 | {file = "MarkupSafe-2.0.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:32200f562daaab472921a11cbb63780f1654552ae49518196fc361ed8e12e901"}, 626 | {file = "MarkupSafe-2.0.0-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:fef86115fdad7ae774720d7103aa776144cf9b66673b4afa9bcaa7af990ed07b"}, 627 | {file = "MarkupSafe-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:e79212d09fc0e224d20b43ad44bb0a0a3416d1e04cf6b45fed265114a5d43d20"}, 628 | {file = "MarkupSafe-2.0.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:79b2ae94fa991be023832e6bcc00f41dbc8e5fe9d997a02db965831402551730"}, 629 | {file = "MarkupSafe-2.0.0-cp37-cp37m-win32.whl", hash = "sha256:3261fae28155e5c8634dd7710635fe540a05b58f160cef7713c7700cb9980e66"}, 630 | {file = "MarkupSafe-2.0.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e4570d16f88c7f3032ed909dc9e905a17da14a1c4cfd92608e3fda4cb1208bbd"}, 631 | {file = "MarkupSafe-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8f806bfd0f218477d7c46a11d3e52dc7f5fdfaa981b18202b7dc84bbc287463b"}, 632 | {file = "MarkupSafe-2.0.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e77e4b983e2441aff0c0d07ee711110c106b625f440292dfe02a2f60c8218bd6"}, 633 | {file = "MarkupSafe-2.0.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:031bf79a27d1c42f69c276d6221172417b47cb4b31cdc73d362a9bf5a1889b9f"}, 634 | {file = "MarkupSafe-2.0.0-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:83cf0228b2f694dcdba1374d5312f2277269d798e65f40344964f642935feac1"}, 635 | {file = "MarkupSafe-2.0.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:4cc563836f13c57f1473bc02d1e01fc37bab70ad4ee6be297d58c1d66bc819bf"}, 636 | {file = "MarkupSafe-2.0.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:d00a669e4a5bec3ee6dbeeeedd82a405ced19f8aeefb109a012ea88a45afff96"}, 637 | {file = "MarkupSafe-2.0.0-cp38-cp38-win32.whl", hash = "sha256:161d575fa49395860b75da5135162481768b11208490d5a2143ae6785123e77d"}, 638 | {file = "MarkupSafe-2.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:58bc9fce3e1557d463ef5cee05391a05745fd95ed660f23c1742c711712c0abb"}, 639 | {file = "MarkupSafe-2.0.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3fb47f97f1d338b943126e90b79cad50d4fcfa0b80637b5a9f468941dbbd9ce5"}, 640 | {file = "MarkupSafe-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dab0c685f21f4a6c95bfc2afd1e7eae0033b403dd3d8c1b6d13a652ada75b348"}, 641 | {file = "MarkupSafe-2.0.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:664832fb88b8162268928df233f4b12a144a0c78b01d38b81bdcf0fc96668ecb"}, 642 | {file = "MarkupSafe-2.0.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:df561f65049ed3556e5b52541669310e88713fdae2934845ec3606f283337958"}, 643 | {file = "MarkupSafe-2.0.0-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:24bbc3507fb6dfff663af7900a631f2aca90d5a445f272db5fc84999fa5718bc"}, 644 | {file = "MarkupSafe-2.0.0-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:87de598edfa2230ff274c4de7fcf24c73ffd96208c8e1912d5d0fee459767d75"}, 645 | {file = "MarkupSafe-2.0.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:a19d39b02a24d3082856a5b06490b714a9d4179321225bbf22809ff1e1887cc8"}, 646 | {file = "MarkupSafe-2.0.0-cp39-cp39-win32.whl", hash = "sha256:4aca81a687975b35e3e80bcf9aa93fe10cd57fac37bf18b2314c186095f57e05"}, 647 | {file = "MarkupSafe-2.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:70820a1c96311e02449591cbdf5cd1c6a34d5194d5b55094ab725364375c9eb2"}, 648 | {file = "MarkupSafe-2.0.0.tar.gz", hash = "sha256:4fae0677f712ee090721d8b17f412f1cbceefbf0dc180fe91bab3232f38b4527"}, 649 | ] 650 | more-itertools = [ 651 | {file = "more-itertools-8.7.0.tar.gz", hash = "sha256:c5d6da9ca3ff65220c3bfd2a8db06d698f05d4d2b9be57e1deb2be5a45019713"}, 652 | {file = "more_itertools-8.7.0-py3-none-any.whl", hash = "sha256:5652a9ac72209ed7df8d9c15daf4e1aa0e3d2ccd3c87f8265a0673cd9cbc9ced"}, 653 | ] 654 | numpy = [ 655 | {file = "numpy-1.20.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:70eb5808127284c4e5c9e836208e09d685a7978b6a216db85960b1a112eeace8"}, 656 | {file = "numpy-1.20.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:6ca2b85a5997dabc38301a22ee43c82adcb53ff660b89ee88dded6b33687e1d8"}, 657 | {file = "numpy-1.20.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c5bf0e132acf7557fc9bb8ded8b53bbbbea8892f3c9a1738205878ca9434206a"}, 658 | {file = "numpy-1.20.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db250fd3e90117e0312b611574cd1b3f78bec046783195075cbd7ba9c3d73f16"}, 659 | {file = "numpy-1.20.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:637d827248f447e63585ca3f4a7d2dfaa882e094df6cfa177cc9cf9cd6cdf6d2"}, 660 | {file = "numpy-1.20.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:8b7bb4b9280da3b2856cb1fc425932f46fba609819ee1c62256f61799e6a51d2"}, 661 | {file = "numpy-1.20.3-cp37-cp37m-win32.whl", hash = "sha256:67d44acb72c31a97a3d5d33d103ab06d8ac20770e1c5ad81bdb3f0c086a56cf6"}, 662 | {file = "numpy-1.20.3-cp37-cp37m-win_amd64.whl", hash = "sha256:43909c8bb289c382170e0282158a38cf306a8ad2ff6dfadc447e90f9961bef43"}, 663 | {file = "numpy-1.20.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f1452578d0516283c87608a5a5548b0cdde15b99650efdfd85182102ef7a7c17"}, 664 | {file = "numpy-1.20.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:6e51534e78d14b4a009a062641f465cfaba4fdcb046c3ac0b1f61dd97c861b1b"}, 665 | {file = "numpy-1.20.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e515c9a93aebe27166ec9593411c58494fa98e5fcc219e47260d9ab8a1cc7f9f"}, 666 | {file = "numpy-1.20.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c1c09247ccea742525bdb5f4b5ceeacb34f95731647fe55774aa36557dbb5fa4"}, 667 | {file = "numpy-1.20.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:66fbc6fed94a13b9801fb70b96ff30605ab0a123e775a5e7a26938b717c5d71a"}, 668 | {file = "numpy-1.20.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:ea9cff01e75a956dbee133fa8e5b68f2f92175233de2f88de3a682dd94deda65"}, 669 | {file = "numpy-1.20.3-cp38-cp38-win32.whl", hash = "sha256:f39a995e47cb8649673cfa0579fbdd1cdd33ea497d1728a6cb194d6252268e48"}, 670 | {file = "numpy-1.20.3-cp38-cp38-win_amd64.whl", hash = "sha256:1676b0a292dd3c99e49305a16d7a9f42a4ab60ec522eac0d3dd20cdf362ac010"}, 671 | {file = "numpy-1.20.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:830b044f4e64a76ba71448fce6e604c0fc47a0e54d8f6467be23749ac2cbd2fb"}, 672 | {file = "numpy-1.20.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:55b745fca0a5ab738647d0e4db099bd0a23279c32b31a783ad2ccea729e632df"}, 673 | {file = "numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5d050e1e4bc9ddb8656d7b4f414557720ddcca23a5b88dd7cff65e847864c400"}, 674 | {file = "numpy-1.20.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9c65473ebc342715cb2d7926ff1e202c26376c0dcaaee85a1fd4b8d8c1d3b2f"}, 675 | {file = "numpy-1.20.3-cp39-cp39-win32.whl", hash = "sha256:16f221035e8bd19b9dc9a57159e38d2dd060b48e93e1d843c49cb370b0f415fd"}, 676 | {file = "numpy-1.20.3-cp39-cp39-win_amd64.whl", hash = "sha256:6690080810f77485667bfbff4f69d717c3be25e5b11bb2073e76bb3f578d99b4"}, 677 | {file = "numpy-1.20.3-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e465afc3b96dbc80cf4a5273e5e2b1e3451286361b4af70ce1adb2984d392f9"}, 678 | {file = "numpy-1.20.3.zip", hash = "sha256:e55185e51b18d788e49fe8305fd73ef4470596b33fc2c1ceb304566b99c71a69"}, 679 | ] 680 | opencv-python = [ 681 | {file = "opencv_python-4.5.2.52-cp36-cp36m-macosx_10_15_x86_64.whl", hash = "sha256:950242774a367efc90e3bed89e6e2fab7ff2867e2eafa440e4775b1ae57ac9f8"}, 682 | {file = "opencv_python-4.5.2.52-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:72f4e4f28169ecb9282570c4a86e992a762ea35ff67b19c05aab2c84eee212ca"}, 683 | {file = "opencv_python-4.5.2.52-cp36-cp36m-win32.whl", hash = "sha256:68f1baa789a1ae92642ad436d29088051471b2e5cea40705cb8c9f8c9fc3c050"}, 684 | {file = "opencv_python-4.5.2.52-cp36-cp36m-win_amd64.whl", hash = "sha256:2cc96b8a9011fa3451d71699069a6a8c3578d91d0158c559def997a1a049ae0c"}, 685 | {file = "opencv_python-4.5.2.52-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:71adc9f528d54fb41bfe275d7038ed4c9c5f1a4468419d4cac12dde6e938f3b8"}, 686 | {file = "opencv_python-4.5.2.52-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:b236001a5bacd18622db037e581521b38cffae070f345e05a7dd837dc3b7f2ef"}, 687 | {file = "opencv_python-4.5.2.52-cp37-cp37m-win32.whl", hash = "sha256:642ff6fe8d0a8297e248bf21676172381afbda767cd15ad51ab9d10201d99078"}, 688 | {file = "opencv_python-4.5.2.52-cp37-cp37m-win_amd64.whl", hash = "sha256:c8ee913a45aec73c4bb14c6c72c3c6ddbb0a1dd3ca45338b68bf169220396941"}, 689 | {file = "opencv_python-4.5.2.52-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:35d4fccd1e339df1e38eb1938af36c1972ab818684a747160403c1562008d867"}, 690 | {file = "opencv_python-4.5.2.52-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:a7aa72195cfd325a51fba287fadc61166367a3f89c57e7fe3e041132e192ac06"}, 691 | {file = "opencv_python-4.5.2.52-cp38-cp38-win32.whl", hash = "sha256:dfa168f827561c52f746d5d80e3b10f31d6428bf6f72652765139129f189110b"}, 692 | {file = "opencv_python-4.5.2.52-cp38-cp38-win_amd64.whl", hash = "sha256:cd231e073579192a8e4c88739e263de23bdaee0be7d85daae3afbda77e477da7"}, 693 | {file = "opencv_python-4.5.2.52-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:fd2e9e70ce30bdfdba6beeffeab117b760e6390e6b606e4b9f4ff03ccd2d7d1f"}, 694 | {file = "opencv_python-4.5.2.52-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:7e8e31b0e206c3567cb96408eb0e27314bb1526eb072f9e509db77af0262ecaf"}, 695 | {file = "opencv_python-4.5.2.52-cp39-cp39-win32.whl", hash = "sha256:1a9d6dd0b1d5cb6031c38b6acf2043b2ec1717093b39592c2a0b98f5b31c8d3e"}, 696 | {file = "opencv_python-4.5.2.52-cp39-cp39-win_amd64.whl", hash = "sha256:31d6a413d459a18ef280d88e8d9257cc5e5009657022c88bb88694a94ccce3ba"}, 697 | ] 698 | packaging = [ 699 | {file = "packaging-20.9-py2.py3-none-any.whl", hash = "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"}, 700 | {file = "packaging-20.9.tar.gz", hash = "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5"}, 701 | ] 702 | pluggy = [ 703 | {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, 704 | {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, 705 | ] 706 | py = [ 707 | {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, 708 | {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, 709 | ] 710 | pygments = [ 711 | {file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, 712 | {file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, 713 | ] 714 | pymem = [ 715 | {file = "Pymem-1.8.3-py2.py3-none-any.whl", hash = "sha256:b739e861a3ce69e4c1647d25d1db17eaf72d1eb8695542660824cc11a98e850e"}, 716 | {file = "Pymem-1.8.3.tar.gz", hash = "sha256:664b41b6a5be6635ded4b611cc834cb65d4268a1510acdddbf26317758f51146"}, 717 | ] 718 | pyparsing = [ 719 | {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, 720 | {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, 721 | ] 722 | pytest = [ 723 | {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, 724 | {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, 725 | ] 726 | pytz = [ 727 | {file = "pytz-2021.1-py2.py3-none-any.whl", hash = "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798"}, 728 | {file = "pytz-2021.1.tar.gz", hash = "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da"}, 729 | ] 730 | requests = [ 731 | {file = "requests-2.25.1-py2.py3-none-any.whl", hash = "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e"}, 732 | {file = "requests-2.25.1.tar.gz", hash = "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"}, 733 | ] 734 | snowballstemmer = [ 735 | {file = "snowballstemmer-2.1.0-py2.py3-none-any.whl", hash = "sha256:b51b447bea85f9968c13b650126a888aabd4cb4463fca868ec596826325dedc2"}, 736 | {file = "snowballstemmer-2.1.0.tar.gz", hash = "sha256:e997baa4f2e9139951b6f4c631bad912dfd3c792467e2f03d7239464af90e914"}, 737 | ] 738 | sphinx = [ 739 | {file = "Sphinx-3.5.4-py3-none-any.whl", hash = "sha256:2320d4e994a191f4b4be27da514e46b3d6b420f2ff895d064f52415d342461e8"}, 740 | {file = "Sphinx-3.5.4.tar.gz", hash = "sha256:19010b7b9fa0dc7756a6e105b2aacd3a80f798af3c25c273be64d7beeb482cb1"}, 741 | ] 742 | sphinx-rtd-theme = [ 743 | {file = "sphinx_rtd_theme-0.5.2-py2.py3-none-any.whl", hash = "sha256:4a05bdbe8b1446d77a01e20a23ebc6777c74f43237035e76be89699308987d6f"}, 744 | {file = "sphinx_rtd_theme-0.5.2.tar.gz", hash = "sha256:32bd3b5d13dc8186d7a42fc816a23d32e83a4827d7d9882948e7b837c232da5a"}, 745 | ] 746 | sphinxcontrib-applehelp = [ 747 | {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, 748 | {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, 749 | ] 750 | sphinxcontrib-devhelp = [ 751 | {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, 752 | {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, 753 | ] 754 | sphinxcontrib-htmlhelp = [ 755 | {file = "sphinxcontrib-htmlhelp-1.0.3.tar.gz", hash = "sha256:e8f5bb7e31b2dbb25b9cc435c8ab7a79787ebf7f906155729338f3156d93659b"}, 756 | {file = "sphinxcontrib_htmlhelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:3c0bc24a2c41e340ac37c85ced6dafc879ab485c095b1d65d2461ac2f7cca86f"}, 757 | ] 758 | sphinxcontrib-jsmath = [ 759 | {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, 760 | {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, 761 | ] 762 | sphinxcontrib-qthelp = [ 763 | {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, 764 | {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, 765 | ] 766 | sphinxcontrib-serializinghtml = [ 767 | {file = "sphinxcontrib-serializinghtml-1.1.4.tar.gz", hash = "sha256:eaa0eccc86e982a9b939b2b82d12cc5d013385ba5eadcc7e4fed23f4405f77bc"}, 768 | {file = "sphinxcontrib_serializinghtml-1.1.4-py2.py3-none-any.whl", hash = "sha256:f242a81d423f59617a8e5cf16f5d4d74e28ee9a66f9e5b637a18082991db5a9a"}, 769 | ] 770 | terminaltables = [ 771 | {file = "terminaltables-3.1.0.tar.gz", hash = "sha256:f3eb0eb92e3833972ac36796293ca0906e998dc3be91fbe1f8615b331b853b81"}, 772 | ] 773 | urllib3 = [ 774 | {file = "urllib3-1.26.4-py2.py3-none-any.whl", hash = "sha256:2f4da4594db7e1e110a944bb1b551fdf4e6c136ad42e4234131391e21eb5b0df"}, 775 | {file = "urllib3-1.26.4.tar.gz", hash = "sha256:e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937"}, 776 | ] 777 | wcwidth = [ 778 | {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, 779 | {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, 780 | ] 781 | win32-setctime = [ 782 | {file = "win32_setctime-1.0.3-py3-none-any.whl", hash = "sha256:dc925662de0a6eb987f0b01f599c01a8236cb8c62831c22d9cada09ad958243e"}, 783 | {file = "win32_setctime-1.0.3.tar.gz", hash = "sha256:4e88556c32fdf47f64165a2180ba4552f8bb32c1103a2fafd05723a0bd42bd4b"}, 784 | ] 785 | wizwalker = [ 786 | {file = "wizwalker-1.0.2-py3-none-any.whl", hash = "sha256:3b46eeccea0488926e69b42a57a65d2beb595093bbbd232215ee751184f59af1"}, 787 | {file = "wizwalker-1.0.2.tar.gz", hash = "sha256:76cd476d2ff6e34a4b40d04d09be7fe4fad38c7bf76dfa96cbcd569b106c14e1"}, 788 | ] 789 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "wizSDK" 3 | version = "1.5.0" 4 | description = "API for interacting with and making bots for wizard101" 5 | authors = ["Underpaid Dev "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.8" 10 | asyncio = "^3.4.3" 11 | numpy = "^1.19.1" 12 | opencv-python = "^4.4.0" 13 | asyncchain = "^0.1.0" 14 | wizwalker = "^1.x.x" 15 | Sphinx = "^3.4.3" 16 | 17 | [tool.poetry.dev-dependencies] 18 | pytest = "^5.2" 19 | Sphinx = "^3.4.3" 20 | sphinx-rtd-theme = "^0.5.1" 21 | 22 | [build-system] 23 | requires = ["poetry>=0.12"] 24 | build-backend = "poetry.masonry.api" 25 | -------------------------------------------------------------------------------- /wizsdk/__init__.py: -------------------------------------------------------------------------------- 1 | from .client import Client, unregister_all, register_clients 2 | from .utils import ( 3 | get_all_wiz_handles, 4 | count_wiz_clients, 5 | finish_all_loading, 6 | XYZYaw, 7 | run_threads, 8 | ) 9 | from .card import Card 10 | from .battle import Battle 11 | from .mouse import Mouse 12 | from .window import Window 13 | from .keyboard import Keyboard 14 | from .pixels import DeviceContext, match_image 15 | from .hotkey import HotkeyEvents 16 | 17 | # Clean up on exit 18 | import ctypes 19 | import ctypes.wintypes 20 | import asyncio 21 | 22 | 23 | def close_handler(dwCtrlType): 24 | asyncio.run(unregister_all()) 25 | return False 26 | 27 | 28 | handler_func_type = ctypes.WINFUNCTYPE(ctypes.wintypes.BOOL, ctypes.wintypes.DWORD) 29 | 30 | transformed_callback = handler_func_type(close_handler) 31 | 32 | # https://docs.microsoft.com/en-us/windows/console/setconsolectrlhandler 33 | ctypes.windll.kernel32.SetConsoleCtrlHandler(transformed_callback, True) 34 | -------------------------------------------------------------------------------- /wizsdk/battle.py: -------------------------------------------------------------------------------- 1 | # Native imports 2 | import sys 3 | from contextlib import suppress 4 | import asyncio 5 | 6 | # Custom imports 7 | from .pixels import DeviceContext, match_image 8 | from .card import Card 9 | from .utils import packaged_img 10 | 11 | 12 | class Battle(DeviceContext): 13 | """ 14 | Battle class 15 | 16 | Example: 17 | .. code-block:: py 18 | 19 | # register the client 20 | p1 = Client.register(name="Bot") 21 | # Get a battle object from the client 22 | battle = p1.get_battle("Test") 23 | # Loop 24 | while await battle.loop(): 25 | if battle.round_count == 1: 26 | # pass on the first round 27 | p1.pass_turn() 28 | else: 29 | # Cast enchanted tempest 30 | temp = await p1.find_spell("tempest") 31 | epic = await p1.find_spell("epic") 32 | 33 | if temp and epic: 34 | e_temp = await epic.enchant(temp) 35 | await e_temp.cast() 36 | else: 37 | await p1.pass_turn() 38 | """ 39 | 40 | def __init__(self, client, name=None, default_image_folder=""): 41 | super().__init__(client.window_handle) 42 | self.client = client 43 | self._default_image_folder = default_image_folder 44 | 45 | self.logging = self.client.logging 46 | self.is_idle = self.client.is_idle 47 | self.name = name 48 | 49 | self._round_count = 1 50 | self._going_first = False 51 | self.enemy_first = False 52 | 53 | self.is_over = False 54 | 55 | self.in_progress = False 56 | 57 | # rectangles defined as (x, y, width, height) 58 | self._spell_area = (245, 290, 370, 70) 59 | self._enemy_area = (68, 26, 650, 50) 60 | self._ally_area = (140, 580, 650, 50) 61 | 62 | @property 63 | def round_count(self) -> int: 64 | """ 65 | Current round of the fight. Starts at 1 66 | """ 67 | return self._round_count 68 | 69 | @property 70 | def going_first(self) -> bool: 71 | """ 72 | True if your team is going first, False if enemies are going first. Value is set once at the beginning of the fight. 73 | """ 74 | return self._going_first 75 | 76 | async def loop(self): 77 | """ 78 | Handles the looping logic for a battle. The loops exists when the battle ends. 79 | 80 | Examples: 81 | .. code-block:: py 82 | 83 | while await battle.loop(): 84 | print(battle.round_count) 85 | print(battle.enemy_first) 86 | print(battle.get_enemy_count()) 87 | """ 88 | 89 | if not self.in_progress and not self.is_over: 90 | await self._start() 91 | return True 92 | else: 93 | await self._next_turn() 94 | return not self.is_over 95 | 96 | def log(self, message): 97 | if self.logging: 98 | s = "" 99 | if self.name != None: 100 | s += f"[{self.name}] " 101 | s += message 102 | print(s) 103 | sys.stdout.flush() 104 | 105 | def print_round(self): 106 | self.log(f"----------- Battle round {self._round_count} -----------") 107 | 108 | def _is_turn(self) -> bool: 109 | """ 110 | Returns if it's our turn to play 111 | by matching pixels in the `flee` button 112 | """ 113 | flee_yellow = self.pixel_matches_color((546, 398), (255, 255, 0), tolerance=30) 114 | flee_brown = self.pixel_matches_color((578, 394), (124, 68, 0), tolerance=30) 115 | return flee_yellow and flee_brown 116 | 117 | async def _start(self) -> None: 118 | """ 119 | Waits for the first round then signals to the class that the battle has started. 120 | used in the `loop()` method 121 | """ 122 | while not self._is_turn(): 123 | await asyncio.sleep(1) 124 | 125 | self.is_over = False 126 | self.in_progress = True 127 | 128 | self.enemy_first = self._is_enemy_first() 129 | self._going_first = not self.enemy_first 130 | 131 | who_is = "Enemy is" if self.enemy_first else "You are" 132 | 133 | self.log(">> Battle is starting") 134 | self.log("======================================") 135 | self.log(f"{who_is} going first") 136 | 137 | self.print_round() 138 | 139 | async def _next_turn(self) -> None: 140 | """ 141 | Sleeps until next round or fight has ended 142 | Sets `is_over` to True if the fight has ended 143 | Increase the `_round_count` otherwise 144 | Used in the `loop()` method 145 | """ 146 | while self._is_turn(): 147 | await asyncio.sleep(1) 148 | 149 | while not self._is_turn() and not self.is_idle(): 150 | await asyncio.sleep(1) 151 | 152 | if not await self.client.walker.in_battle(): 153 | self.log("Battle has finished") 154 | 155 | await asyncio.sleep(0.5) 156 | self.is_over = True 157 | self.in_progress = False 158 | else: 159 | self._round_count += 1 160 | self.print_round() 161 | 162 | def get_enemy_positions(self): 163 | """ 164 | Gets the indices of the enemies present 165 | 166 | Examples: 167 | .. code-block:: py 168 | 169 | # Register 170 | player = client.register(name="test") 171 | # Get the battle 172 | battle = player.get_battle() 173 | while await battle.loop(): 174 | enemies = battle.get_enemy_positions() # -> [0, 1] 175 | print(len(enemies)) # -> 2 176 | # Get the position of the first enemy in battle 177 | first_enemy = enemies[0] # -> 0 178 | # Get spell 179 | firecat = await player.find_spell('firecat') # -> Card 180 | if firecat: 181 | # Cast at enemy position 182 | await firecat.cast(target=first_enemy) 183 | """ 184 | Y = 75 185 | COLOR = (207, 186, 135) 186 | enemies = [] 187 | for i in range(4): 188 | X = (174 * (i)) + 203 189 | if self.pixel_matches_color((X, Y), COLOR, tolerance=30): 190 | enemies.append(i) 191 | 192 | return enemies 193 | 194 | def get_enemy_count(self): 195 | """ 196 | Returns the number enemies in the fight 197 | """ 198 | return len(self.get_enemy_positions()) 199 | 200 | def find_enemy(self, enemy_image): 201 | """ 202 | Attemps to find the position of an enemy that matches the image provided 203 | returns 0, 1, 2, 3 if found otherwise returns False 204 | """ 205 | found = self.locate_on_screen( 206 | enemy_image, region=self._enemy_area, threshold=0.2 207 | ) 208 | 209 | if found: 210 | return round((found[0] - 60) / 170) 211 | 212 | return False 213 | 214 | def find_ally(self, ally_image): 215 | """ 216 | Attemps to find the position of an ally the matches the image provided 217 | returns 4, 5, 6, 7 if found otherwise returns False 218 | """ 219 | 220 | found = self.locate_on_screen(ally_image, region=self._ally_area, threshold=0.2) 221 | 222 | if found: 223 | return 7 - round((found[0] - 100) / 170) 224 | 225 | return False 226 | 227 | def _is_enemy_first(self): 228 | turn_arrow_region = (230, 240, 80, 60) 229 | return bool( 230 | self.client.locate_on_screen( 231 | "enemy-first.png", 232 | region=turn_arrow_region, 233 | threshold=0.2, 234 | folder=packaged_img(), 235 | ) 236 | ) 237 | 238 | -------------------------------------------------------------------------------- /wizsdk/card.py: -------------------------------------------------------------------------------- 1 | # Third-party imports 2 | import asyncio 3 | 4 | # Custom imports 5 | from wizsdk.mouse import Mouse 6 | 7 | 8 | mouse = Mouse() 9 | Card = None 10 | 11 | 12 | class Card: 13 | def __init__(self, client, name, spell_x): 14 | self.client = client 15 | self.name = name 16 | self.spell_x = spell_x 17 | self.spell_y = 325 18 | 19 | def __str__(self): 20 | return f"{self.name} at ({self.spell_x}, {self.spell_y})" 21 | 22 | async def enchant(self, spell: Card) -> Card: 23 | """ 24 | Enchants `spell` with self. 25 | 26 | Returns: 27 | A new Card object representing the new enchanted spell 28 | 29 | """ 30 | self.client.log(f"Enchanting {spell.name} with {self.name}") 31 | 32 | card_width = 52 33 | enchant_is_before = self.spell_x < spell.spell_x 34 | # click self 35 | await self.client.mouse.click( 36 | self.spell_x, self.spell_y, duration=0.3, delay=0.6 37 | ) 38 | # click spell 39 | await self.client.mouse.click( 40 | spell.spell_x, spell.spell_y, duration=0.3, delay=0.6 41 | ) 42 | # calculate new spell_x of enchanted spell 43 | 44 | new_pos = spell.spell_x + (card_width / 2) 45 | if enchant_is_before: 46 | new_pos -= card_width 47 | 48 | new_name = f"{self.name}-{spell.name}" 49 | 50 | await asyncio.sleep(0.2) 51 | return Card(self.client, new_name, new_pos) 52 | 53 | async def cast(self, target=None): 54 | """ 55 | Selects spell. 56 | If target is specified, it clicks on target (0-3 for enemies, 4-7 for allies) 57 | 58 | .. code-block:: py 59 | 60 | 0 1 2 3 61 | ------- 62 | 7 6 5 4 63 | 64 | Args: 65 | target (int, optional): The target to select after clicking the spell 66 | """ 67 | self.client.log(f"Casting {self.name}") 68 | await self.client.mouse.click( 69 | self.spell_x, self.spell_y, duration=0.3, delay=0.6 70 | ) 71 | 72 | if target != None: 73 | if target < 4: 74 | x = (174 * target) + 130 75 | y = 50 76 | elif target < 8: 77 | x = (174 * (7 - target)) + 160 78 | y = 590 79 | else: 80 | print( 81 | f"Invalid value for target, expect int between 0 - 7, got {target}" 82 | ) 83 | return False 84 | await self.client.mouse.click(x, y, duration=0.3, delay=0.6) 85 | await asyncio.sleep( 86 | 0.5 87 | ) # Helps when changing the active state of overlapping windows. 88 | 89 | -------------------------------------------------------------------------------- /wizsdk/client.py: -------------------------------------------------------------------------------- 1 | # Native imports 2 | from contextlib import suppress 3 | import ctypes 4 | import os, sys 5 | import asyncio 6 | from typing import Optional 7 | 8 | # Third-party imports 9 | import cv2 10 | import numpy 11 | import wizwalker 12 | from wizwalker import XYZ 13 | 14 | # Custom imports 15 | from .utils import get_all_wiz_handles, XYZYaw, packaged_img 16 | from .pixels import DeviceContext, match_image 17 | from .keyboard import Keyboard 18 | from .mouse import Mouse 19 | from .window import Window 20 | from .battle import Battle 21 | from .card import Card 22 | 23 | # rectangles defined as (x, y, width, height) 24 | AREA_FRIENDS = (623, 63, 35, 250) 25 | AREA_SPELLS = (245, 290, 370, 70) 26 | AREA_CONFIRM = (355, 370, 100, 70) 27 | 28 | SPELLS_FOLDER = "spells" 29 | """ Default folder to look for spells in""" 30 | 31 | IMAGE_FOLDER = "" 32 | """ Default folder to look for images in.""" 33 | 34 | DEFAULT_MOUNT_SPEED = 1.4 35 | """ Default mount speed (40%) """ 36 | 37 | user32 = ctypes.windll.user32 38 | 39 | # Keep track of all clients 40 | all_clients = [] 41 | 42 | 43 | async def unregister_all(): 44 | """ 45 | Properly unregisters all clients 46 | """ 47 | print("Un-hooking all registered clients") 48 | for client in all_clients: 49 | await client.unregister() 50 | 51 | 52 | class Client(DeviceContext, Keyboard, Window): 53 | """ 54 | Main class for wizSDK. 55 | 56 | Example: 57 | .. code-block:: py 58 | 59 | # registers a new client 60 | player = client.register(name="My Bot") 61 | await player.activate_hooks() 62 | 63 | 64 | """ 65 | 66 | def __init__(self, handle=None, silent_mouse=False): 67 | # Inherit all methods from Parent Classes 68 | super().__init__(handle) 69 | self.window_handle = handle 70 | self.logging = True 71 | self.name = None 72 | 73 | self._default_image_folder = IMAGE_FOLDER 74 | self.walker = None 75 | self.silent_mouse = silent_mouse 76 | self.mouse = None 77 | 78 | @classmethod 79 | def register(cls, nth=0, name=None, handle=None, silent_mouse: bool = False): 80 | """ 81 | Assigns the instance to a wizard101 window. (Required before using any other SDK methods) 82 | 83 | Args: 84 | nth (int, optional): Index of the wizard101 client to use (if there's more than one) 85 | name (str, optional): Name to prepend to the window title. Used for identifying which windows are controlled. 86 | silent_mouse: When enabled, moves the mouse without taking control of the actual cursor 87 | """ 88 | client = cls() 89 | global all_clients 90 | 91 | client.silent_mouse = silent_mouse 92 | if handle: 93 | client.window_handle = handle 94 | else: 95 | handles = get_all_wiz_handles() 96 | 97 | if len(handles) == 0: 98 | client.log("No Wizard101 windows detected") 99 | return None 100 | 101 | handles.sort() 102 | # Assigns the one at index nth 103 | client.window_handle = handles[nth] 104 | 105 | # A window exists, add it to global variable 106 | all_clients.append(client) 107 | 108 | client.walker = wizwalker.Client(client.window_handle) 109 | 110 | client.mouse = Mouse(client.window_handle, client.silent_mouse, client.walker) 111 | 112 | if name: 113 | client.set_name(name) 114 | 115 | return client 116 | 117 | async def activate_hooks(self, *hook_names): 118 | """ 119 | Activate all hooks excluding special hooks like "mouseless_cursor_move" 120 | """ 121 | if len(hook_names): 122 | print( 123 | "Specifying hook_names is now deprecated. Use no arguments to activate all hooks (except silent mouse)" 124 | ) 125 | 126 | await self.walker.activate_hooks() 127 | 128 | await self.send_key("d") 129 | await self.send_key("a") 130 | 131 | async def activate_silent_mouse_hook(self): 132 | await self.walker.hook_handler.activate_mouseless_cursor_hook() 133 | 134 | async def activate_all_hooks(self): 135 | """ 136 | Activate all hooks (including special hooks like "mouseless_cursor_move") 137 | """ 138 | if self.silent_mouse: 139 | await self.activate_silent_mouse_hook() 140 | await self.activate_hooks() 141 | 142 | def set_name(self, name: str): 143 | """ 144 | Sets the window title. Useful to identify which window the bot is running on 145 | Args: 146 | name (str): The text to prepend to the window title 147 | """ 148 | self.name = name 149 | user32.SetWindowTextW(self.window_handle, f"[{name}] Wizard101") 150 | 151 | def log(self, message: str): 152 | """ 153 | Debug log function. Useful to identify which client the log is coming from. 154 | Args: 155 | message (str): The message to log. ``[client-name]: message`` 156 | """ 157 | if self.logging: 158 | s = "" 159 | if self.name != None: 160 | s += f"[{self.name}] " 161 | s += message 162 | print(s) 163 | sys.stdout.flush() 164 | 165 | async def unregister(self): 166 | """ 167 | Properly unregister hooks and clean up possible ongoing asyncio tasks 168 | """ 169 | user32.SetWindowTextW(self.window_handle, "Wizard101") 170 | await self.walker.close() 171 | return 1 172 | 173 | async def wait(self, seconds: float): 174 | """ 175 | Alias for asyncio.sleep() 176 | 177 | Args: 178 | seconds (float): number of seconds to "sleep" 179 | """ 180 | await asyncio.sleep(seconds) 181 | return self 182 | 183 | """ 184 | STATE DETECTION 185 | """ 186 | 187 | async def get_player_level(self) -> int: 188 | """ 189 | Gets player level value from memory. 190 | 191 | Returns: 192 | The level of the player as an int 193 | """ 194 | 195 | return await self.walker.stats.reference_level() 196 | 197 | async def get_gold(self) -> int: 198 | """ 199 | Gets gold value from memory. 200 | 201 | Returns: 202 | The player's gold value as an int 203 | """ 204 | 205 | return await self.walker.stats.current_gold() 206 | 207 | async def get_health(self) -> int: 208 | """ 209 | Gets health value from memory. 210 | Returns: 211 | The health value of the player as an int 212 | """ 213 | 214 | return await self.walker.stats.current_hitpoints() 215 | 216 | async def get_health_max(self) -> int: 217 | """ 218 | Gets maximum health value from memory. 219 | 220 | Returns: 221 | The max health value of the player as an int 222 | """ 223 | 224 | return await self.walker.stats.max_hitpoints() 225 | 226 | async def get_health_percentage(self) -> int: 227 | """ 228 | Gets health, and max health value from memory then divides them. For accurate values, only use after finishing a fight or after getting whisps. Returns 99,999 if the stats hook hasn't run. 229 | 230 | Returns: 231 | The health percentage of the player as an int rounded down to the first decimal. 232 | """ 233 | 234 | return round( 235 | await self.walker.stats.current_hitpoints() 236 | / await self.walker.stats.max_hitpoints() 237 | * 100, 238 | 1, 239 | ) 240 | 241 | async def get_mana(self) -> int: 242 | """ 243 | Gets mana value from memory. 244 | 245 | Returns: 246 | The mana value of the player as an int 247 | """ 248 | 249 | return await self.walker.stats.current_mana() 250 | 251 | async def get_mana_max(self) -> int: 252 | """ 253 | Gets maximum mana value from memory. 254 | 255 | Returns: 256 | The maximum mana value of the player as an int 257 | """ 258 | 259 | return await self.walker.stats.max_mana() 260 | 261 | async def get_mana_percentage(self) -> int: 262 | """ 263 | Gets health, and max health value from memory then divides them. 264 | 265 | Returns: 266 | The health percentage of the player as an int rounded down to the first decimal. 267 | """ 268 | 269 | return round( 270 | await self.walker.stats.current_mana() 271 | / await self.walker.stats.max_mana() 272 | * 100, 273 | 1, 274 | ) 275 | 276 | def is_crown_shop(self) -> bool: 277 | """ 278 | Detects if the crown shop is open by matching a red pixel in the "close" icon. 279 | 280 | Returns: 281 | bool: True if the menu is open / False otherwise 282 | """ 283 | return self.pixel_matches_color((788, 53), (197, 40, 41), 50) 284 | 285 | def is_idle(self): 286 | """ 287 | Detects if the player is idle (out of loading and not in battle) by matching pixels in the spellbook. 288 | 289 | Returns: 290 | bool: True if the player is idle / False otherwise 291 | """ 292 | # spellbook_yellow = self.pixel_matches_color( 293 | # (781, 551), (255, 251, 64), tolerance=30 294 | # ) 295 | # spellbook_brown = self.pixel_matches_color( 296 | # (728, 587), (79, 29, 29), tolerance=30 297 | # ) 298 | 299 | # spellbook_gray = self.pixel_matches_color( 300 | # (747, 538), (27, 47, 63), tolerance=30 301 | # ) 302 | # print(spellbook_brown, spellbook_yellow, spellbook_gray) 303 | # return spellbook_brown and spellbook_yellow and spellbook_gray 304 | spell_book_area = self.get_image(region=(725, 555, 60, 60)) 305 | return match_image( 306 | spell_book_area, packaged_img("spellbook.png"), threshold=0.05 307 | ) 308 | 309 | def is_dialog_more(self): 310 | """ 311 | Detects if the dialog (from NPCs etc.) is open by matching pixels in the "more" or "done" button. 312 | 313 | Returns: 314 | bool: True if the dialog menu is open / False otherwise 315 | """ 316 | more_lower_right = self.pixel_matches_color((674, 621), (110, 30, 53), 15) 317 | more_top_left = self.pixel_matches_color((592, 613), (111, 31, 52), 15) 318 | return more_lower_right and more_top_left 319 | 320 | def is_health_low(self): 321 | """ 322 | DEPRECATED: 323 | Detects if the player's health is low by matching a red pixel in the lower third of the globe. 324 | 325 | Returns: 326 | bool: is the health low 327 | """ 328 | # Matches a pixel in the lower third of the health globe 329 | POSITION = (23, 563) 330 | COLOR = (126, 41, 3) 331 | TOLERANCE = 15 332 | return not self.pixel_matches_color(POSITION, COLOR, tolerance=TOLERANCE) 333 | 334 | def is_mana_low(self): 335 | """ 336 | DEPRECATED: 337 | Detects if the player's mana is low by matching a blue pixel in the lower third of the globe. 338 | 339 | Returns: 340 | bool: is the mana low 341 | """ 342 | # Matches a pixel in the lower third of the mana globe 343 | POSITION = (79, 591) 344 | COLOR = (66, 13, 83) 345 | TOLERANCE = 15 346 | return not self.pixel_matches_color(POSITION, COLOR, tolerance=TOLERANCE) 347 | 348 | def is_press_x(self): 349 | """ 350 | Detects if the "press x" prompt is present by matching the "x" image. 351 | 352 | Returns: 353 | bool: "press X" has been found 354 | """ 355 | x_area = self.get_image(region=(350, 540, 100, 20)) 356 | found = match_image(x_area, packaged_img("x.png")) 357 | return found != False 358 | 359 | def get_confirm(self): 360 | """ 361 | Detects if a "confirm" prompt is open (either from teleporting a friend or exiting an unfinished dungeon). It does this by matching a "confirm" image. 362 | 363 | Returns: 364 | tuple: (x, y) where the confirm button has been found 365 | """ 366 | confirm_img = self.get_image(AREA_CONFIRM) 367 | found = match_image(confirm_img, packaged_img("confirm.png"), threshold=0.2) 368 | if found: 369 | x = found[0] + AREA_CONFIRM[0] 370 | y = found[1] + AREA_CONFIRM[1] 371 | found = (x, y) 372 | 373 | return found 374 | 375 | async def get_backpack_space_left(self) -> Optional[int]: 376 | """ 377 | Gets the backpack space left. Will try to refresh the value by quickly opening and closing the backpack if necessary. Returns None if it wasn't able to get the value. 378 | 379 | Returns: 380 | space left in the backpack, None if it's not able to get the value. 381 | """ 382 | 383 | backpack_data = False 384 | 385 | while not backpack_data: 386 | try: 387 | backpack_data = await self.walker.backpack_space() 388 | except ValueError: 389 | await self.send_key("b") 390 | await asyncio.sleep(0.2) 391 | 392 | await self.send_key("b") 393 | 394 | space_used, space_total = backpack_data 395 | return space_total - space_used 396 | 397 | """ 398 | ACTIONS BASED ON STATES 399 | """ 400 | 401 | async def use_potion_if_needed(self, health=1000, mana=20): 402 | """ 403 | Clicks on a potion if health or mana values drop below the settings 404 | 405 | Args: 406 | health: Health value threshold. Potion will be used if health value drops below 407 | mana: Mana value threshold. Potion will be used if mana value drops below 408 | 409 | Returns: 410 | None 411 | """ 412 | h = await self.get_health() 413 | m = await self.get_mana() 414 | 415 | mana_low = m < mana 416 | health_low = h < health 417 | 418 | if mana_low: 419 | self.log(f"Mana is at {m}, using potion") 420 | if health_low: 421 | self.log(f"Health is at {h}, using potion") 422 | if mana_low or health_low: 423 | await self.mouse.click(160, 590, delay=0.2) 424 | 425 | async def finish_loading(self, *, timeout=None) -> bool: 426 | """ 427 | Waits for player to have gone through the loading screen. 428 | If this function is called too late and the player is already out of the loading screen, it will wait indefinitely. 429 | 430 | Args: 431 | timeout (optional): value in seconds to timeout if it hasn't finished yet. Defaults to None 432 | 433 | Returns: 434 | True if the function completed successfully, False if the function timed out. 435 | """ 436 | 437 | async def _loading_coro(): 438 | self.log("Awaiting loading") 439 | 440 | self.walker.wait_for_zone_change() 441 | 442 | await asyncio.sleep(2) 443 | 444 | # run it with the timeout 445 | try: 446 | await asyncio.wait_for(_loading_coro(), timeout=timeout) 447 | return True 448 | except asyncio.TimeoutError: 449 | return False 450 | 451 | async def go_through_dialog(self, times=1, *, timeout=None): 452 | # Wait for press X, or more/done button 453 | """ 454 | Goes through the prompts of the dialog ("press x" or "more"/"continue"). Waits for "press x" or the dialog box before starting. 455 | 456 | Args: 457 | times (int): Defaults to 1 458 | The number of times to repeat. (When going through quests, you might need to set this to 2. There's one to hand in the quest, the second to get the next quest) 459 | timeout (optional): value in seconds to timeout if it hasn't finished yet. Defaults to None 460 | 461 | Returns: 462 | True if the function completed successfully, False if the function timed out. 463 | """ 464 | 465 | async def _dialog_coro(times): 466 | self.log("Going through dialog") 467 | while times >= 1: 468 | times -= 1 469 | while (not self.is_press_x()) and (not self.is_dialog_more()): 470 | await asyncio.sleep(0.5) 471 | 472 | if self.is_press_x(): 473 | await self.send_key("X", 0.1) 474 | 475 | while not self.is_dialog_more(): 476 | await asyncio.sleep(0.5) 477 | 478 | while self.is_dialog_more(): 479 | await self.send_key("SPACEBAR", 0.1) 480 | await asyncio.sleep(0.1) 481 | 482 | await asyncio.sleep(1) 483 | 484 | # run it with the timeout 485 | try: 486 | await asyncio.wait_for(_dialog_coro(times), timeout=timeout) 487 | return True 488 | except asyncio.TimeoutError: 489 | return False 490 | 491 | async def logout_and_in(self, confirm=False, *, confirm_timeout=None, timeout=None): 492 | """ 493 | Logs the user out and then logs it in again. 494 | 495 | Args: 496 | confirm (bool, optional): Should the bot wait for a "confirm" prompt before continuing. Defaults to False 497 | Set to True if logging out durring a battle or to exit an unfinished dungeon. 498 | confirm_timeout: timeout argument for the ``click_confirm`` task. Defaults to None 499 | timeout: time in seconds before the function times out. Defaults to None 500 | 501 | Returns: 502 | True if the function completed successfully, False if the function timed out. 503 | """ 504 | 505 | async def _coro(): 506 | self.log("Logging out") 507 | await self.send_key("ESC", 0.1) 508 | await self.mouse.click(259, 506, delay=0.3) 509 | if confirm: 510 | await self.click_confirm(timeout=confirm_timeout) 511 | # wait for player select screen 512 | self.log("Wait for loading") 513 | while not ( 514 | self.pixel_matches_color((361, 599), (133, 36, 62), tolerance=20) 515 | ): 516 | await self.wait(0.5) 517 | 518 | self.log("Logging back in") 519 | await self.mouse.click(395, 594) 520 | await self.finish_loading() 521 | if self.is_crown_shop(): 522 | await self.wait(0.5) 523 | await self.send_key("ESC", 0.1) 524 | await self.send_key("ESC", 0.1) 525 | 526 | # run it with the timeout 527 | try: 528 | await asyncio.wait_for(_coro(), timeout=timeout) 529 | return True 530 | except asyncio.TimeoutError: 531 | return False 532 | 533 | async def press_x(self, *, timeout=None): 534 | """ 535 | Waits for the "press x" prompt and sends the "X" key. 536 | 537 | Args: 538 | timeout (optional): value in seconds to timeout if it hasn't finished yet. Defaults to None 539 | 540 | Returns: 541 | True if the function completed successfully, False if the function timed out. 542 | """ 543 | 544 | async def _press_x_coro(): 545 | while not self.is_press_x(): 546 | await self.wait(0.5) 547 | await self.send_key("X", 0.1) 548 | 549 | # run it with the timeout 550 | try: 551 | await asyncio.wait_for(_press_x_coro(), timeout=timeout) 552 | return True 553 | except asyncio.TimeoutError: 554 | return False 555 | 556 | async def click_confirm(self, *, timeout=None): 557 | """ 558 | Waits for the "confirm" prompt, and clicks "confirm" 559 | 560 | Args: 561 | timeout (optional): value in seconds to timeout if it hasn't finished yet. Defaults to None 562 | 563 | Returns: 564 | True if the function completed successfully, False if the function timed out. 565 | """ 566 | 567 | async def _confirm_coro(): 568 | await self.wait(0.2) # 569 | confirm = self.get_confirm() 570 | while not confirm: 571 | await self.wait(0.5) 572 | confirm = self.get_confirm() 573 | 574 | await self.mouse.click(*confirm, duration=0.2, delay=0.2) 575 | await self.wait(0.5) 576 | 577 | # run it with the timeout 578 | try: 579 | await asyncio.wait_for(_confirm_coro(), timeout=timeout) 580 | return True 581 | except asyncio.TimeoutError: 582 | return False 583 | 584 | """ 585 | POSITION & MOVEMENT 586 | """ 587 | 588 | async def get_quest_xyz(self) -> tuple: 589 | """ 590 | Gets the X, Y, Z coordinates to the quest destination 591 | Requires the ``quest_struct`` hook to be activated 592 | 593 | Returns: 594 | tuple: (X, Y, Z) value of the quest goal location. 595 | """ 596 | return await self.walker.quest_position.position() 597 | 598 | async def get_player_location(self) -> XYZYaw: 599 | """ 600 | Fetches the player's XYZYaw location 601 | Requires the `player_struct` hook to be activated 602 | 603 | Returns: 604 | XYZYaw: (X, Y, Z, Yaw) tuple values of the player's position and direction. 605 | """ 606 | xyz = await self.walker.body.position() 607 | yaw = await self.walker.body.yaw() 608 | return XYZYaw(x=xyz.x, y=xyz.y, z=xyz.z, yaw=yaw) 609 | 610 | async def teleport_to(self, location: XYZYaw): 611 | """ 612 | Teleports to XYZYaw location 613 | Will return immediately if player movement is locked 614 | Requires the ``player_struct`` hook to be activated 615 | 616 | Args: 617 | location (XYZYaw): location to move to 618 | """ 619 | if await self.walker.move_lock(): 620 | return 621 | 622 | await self.walker.teleport( 623 | XYZ(location.x, location.y, location.z), location.yaw 624 | ) 625 | await self.send_key("W", 0.1) 626 | 627 | async def walk_to(self, location: XYZYaw, mount_speed: float = -1): 628 | """ 629 | Walks to XYZYaw location in a **straight** line only. 630 | Will _not_ work if there are obstacles in the way. Ideal for short distances 631 | Will return immediately if player movement is locked 632 | Requires the `player_struct` hook to be activated. 633 | 634 | 635 | Args: 636 | location (XYZYaw): The location to walk to. 637 | (Only the x and y value will actually be used) 638 | """ 639 | if mount_speed != -1: 640 | print("Mound_speed is deprecated. Wizwalker now gets the speed from memory") 641 | 642 | await self.walker.goto(location.x, location.y) 643 | 644 | async def teleport_to_friend(self, match_img) -> bool: 645 | """ 646 | Completes a set of actions to teleport to a friend. 647 | The friend must have the proper symbol next to it. 648 | The symbol must match the image passed as 'match_img'. 649 | 650 | Args: 651 | match_img: A string of the image file name, or a list of bytes returned by ``Client.get_image`` 652 | The friend icon to find to select which friend to teleport to. 653 | 654 | Returns: 655 | bool: Whether the friend was found or not. 656 | """ 657 | if not self.silent_mouse: 658 | self.set_active() 659 | # Check if friends already opened (and close it) 660 | friend_icon_area = self.get_image(region=(750, 35, 30, 30)) 661 | while not match_image( 662 | friend_icon_area, packaged_img("friendlist.png"), threshold=0.05 663 | ): 664 | await self.send_key("F") 665 | await self.wait(0.2) 666 | friend_icon_area = self.get_image(region=(775, 30, 40, 40)) 667 | 668 | # Open friend menu 669 | await self.send_key("F") 670 | await self.wait(0.2) 671 | 672 | # Find friend that matches friend match_img 673 | found = False 674 | last_page = False 675 | while (not found) and (not last_page): 676 | last_page = not self.pixel_matches_color((775, 328), (206, 44, 24), 50) 677 | found = self.locate_on_screen(match_img, region=AREA_FRIENDS, threshold=0.2) 678 | 679 | if (not found) and not last_page: 680 | await self.mouse.click(775, 328, duration=0.2) 681 | await self.mouse.move_to(775, 328, 0.3) 682 | 683 | if found is not False: 684 | _, y = found 685 | 686 | # Select friend 687 | await self.mouse.click(670, y, duration=0.2, delay=0.5) 688 | # Select port 689 | await self.mouse.click(450, 115, duration=0.2, delay=0.5) 690 | # Select yes 691 | await self.click_confirm() 692 | await self.wait(1) 693 | 694 | return True 695 | else: 696 | self.log("Friend could not be found") 697 | return False 698 | 699 | async def face_quest_destination(self) -> None: 700 | """ 701 | Changes the player's yaw to be facing the quest destination. 702 | *Note:* depending on your location, this may differ from where your quest arrow is pointing to 703 | """ 704 | xyz = await self.walker.body.position() 705 | quest_xyz = await self.walker.quest_position.position() 706 | yaw = xyz.yaw(quest_xyz) 707 | await self.walker.set_yaw(yaw) 708 | 709 | async def is_move_locked(self): 710 | """ 711 | Detects if player is locked in combat 712 | 713 | Returns: 714 | bool: Whether player is move locked by combat or not. 715 | """ 716 | 717 | return await self.walker.in_battle() 718 | 719 | """ 720 | BATTLE ACTIONS & METHODS 721 | """ 722 | 723 | def get_battle(self, name: str = None) -> Battle: 724 | """ 725 | Fetch a ``battle`` associated with the client 726 | 727 | Args: 728 | name (str): Name of battle for logging purposes. 729 | 730 | Returns: 731 | Battle: object with battle methods linked to this client 732 | """ 733 | return Battle(self, name, default_image_folder=self._default_image_folder) 734 | 735 | async def find_spell( 736 | self, spell_name: str, threshold: float = 0.12, ignore_gray_detection=False 737 | ) -> Card: 738 | """ 739 | Searches spell area for an image matching ``spell_name``. An additional check to see if the spell is grayed out is done by default. 740 | 741 | Args: 742 | spell_name (str): The name of the spell as you have it saved in your spells image folder. 743 | threshold (float): How precise the match should be. The lower this value, the more exact the match will be. 744 | ignore_gray_detection (bool): should the gray detection be ignored. defaults to False 745 | 746 | Returns: 747 | int: x positions of spell if found, None otherwise 748 | """ 749 | # Move into the window if the window isn't active 750 | if not self.silent_mouse and not self.is_active(): 751 | self.set_active() 752 | await self.mouse.move_to(100, 100, duration=0.2) 753 | else: 754 | # Move mouse out of area to get a clear image 755 | await self.mouse.move_out(AREA_SPELLS) 756 | 757 | # Get screenshot of `spell_area` 758 | b_spell_area = self.get_image(AREA_SPELLS) 759 | 760 | extensions = [".png", ".jpg", "jpeg", ".bmp"] 761 | file_name = spell_name 762 | if not spell_name[-4:] in extensions: 763 | file_name += ".png" 764 | 765 | spell_path = os.path.join(SPELLS_FOLDER, file_name) 766 | 767 | res = match_image(b_spell_area, spell_path, threshold) 768 | 769 | if res: 770 | x, y = res 771 | # We're only interested in the x position 772 | offset_x = AREA_SPELLS[0] 773 | # a card width is 52 pixels, round to the nearest 1/2 card (26 pixels) 774 | adjusted_x = round(x / 26) * 26 775 | 776 | spell_pos = offset_x + adjusted_x 777 | 778 | if not ignore_gray_detection: 779 | # Check if the card is grayed out 780 | grayness = self.is_gray_rect( 781 | (spell_pos - 10, 310, 20, 20), threshold=25 782 | ) 783 | # print(file_name, grayness) 784 | if grayness < 25: 785 | if grayness > 20: 786 | print(f"{file_name} was found, but gray was detected.") 787 | print("If this is an error, contact wizSDK dev.") 788 | return None 789 | 790 | return Card(self, spell_name, spell_pos) 791 | else: 792 | return None 793 | 794 | async def pass_turn(self) -> None: 795 | """ 796 | Clicks `pass` while in a battle 797 | """ 798 | await self.mouse.click(254, 398, duration=0.2, delay=0.5) 799 | await self.wait(0.5) 800 | 801 | async def autocast(self, *spells: str, target=None): 802 | """ 803 | Short-hand for ``find_spell`` followed by ``cast_spell``. Finds and casts spells. If 2 spells are provided, it will enchant spell 2 with spell 1. If target is provided, it will click the target. If any of the spells are not found, this function exits with False. 804 | 805 | Args: 806 | spells: provide up to 2 spell arguments 807 | target (int, optional): the target to cast the spell on. See ``Card.cast`` 808 | 809 | Returns: 810 | True if all spells were found, False otherwise 811 | 812 | Examples: 813 | .. code-block:: py 814 | 815 | player = Client.register(name="Bot") 816 | battle = player.get_battle("Test") 817 | # Loop 818 | while await battle.loop(): 819 | # The following are all correct ways of using `autocast` 820 | await player.autocast("epic", "bat", target=0) 821 | await player.autocast("epic", "tempest") 822 | await player.autocast("storm-blade", target=4) 823 | """ 824 | 825 | if len(spells) == 0: 826 | print(f"Invalid call to `autocast`, expected 1-3 arguments, received none") 827 | return 828 | 829 | elif type(spells[-1]) == int: 830 | # The 3rd argument becomes the target 831 | target = spells[-1] 832 | spells = spells[:-1] 833 | 834 | found = [await self.find_spell(s) for s in spells[:2]] 835 | 836 | # Return False if some spells weren't found 837 | if sum([bool(c) for c in found]) != len(found): 838 | return False 839 | 840 | if len(found) == 2: 841 | to_cast = await found[0].enchant(found[1]) 842 | else: 843 | to_cast = found[0] 844 | 845 | await to_cast.cast(target=target) 846 | return True 847 | 848 | 849 | def register_clients( 850 | n_handles_expected: int, 851 | names: list = [], 852 | confirm_position: bool = False, 853 | silent_mouse: bool = False, 854 | ) -> list: 855 | """ 856 | Register multiple clients, sorted from left to right, top to bottom. 857 | 858 | Args: 859 | n_handles_expected (int): the expected # of wiz windows opened. Use -1 for undetermined 860 | names (list): A list of strings that will serve as the names of the windows 861 | confirm_position (bool): prompt the user to confirm the windows order before continuing 862 | silent_mouse: When enabled, moves the mouse without taking control of the actual cursor 863 | 864 | Returns: 865 | client_list (list): A list populated with ``Client`` instances 866 | """ 867 | accepted = False 868 | while not accepted: 869 | handles = get_all_wiz_handles() 870 | n_handles = len(handles) 871 | 872 | if n_handles != n_handles_expected and n_handles_expected > 0: 873 | print( 874 | f"Invalid number of windows open. {n_handles_expected} required, {n_handles} detected." 875 | ) 876 | os.system("pause") 877 | exit() 878 | else: 879 | print(f"{n_handles} windows detected") 880 | 881 | # Fill names array if necessary 882 | for i in range(n_handles - len(names)): 883 | names.append(None) 884 | 885 | # Register and order the windows from left to right, top to bottom 886 | w = [ 887 | Client.register(handle=handles[i], silent_mouse=silent_mouse) 888 | for i in range(n_handles) 889 | ] 890 | 891 | # Sort 892 | def sort_func(win): 893 | rect = win.get_rect() 894 | round_y = (rect[1] // 100) * 100 895 | return rect[0] + (round_y * 10) 896 | 897 | w.sort(key=sort_func) 898 | 899 | # Set names 900 | for i in range(len(w)): 901 | if i < len(names): 902 | w[i].set_name(names[i]) 903 | 904 | # Confirm position 905 | if confirm_position: 906 | print("Is this order ok?") 907 | answer = input("[y] or n: ") 908 | if answer.lower().strip()[0] == "y" or answer == "": 909 | accepted = True 910 | else: 911 | print("Re-order the windows") 912 | os.system("pause") 913 | else: 914 | accepted = True 915 | 916 | # Returns the sorted clients in an array 917 | return w 918 | -------------------------------------------------------------------------------- /wizsdk/constants.py: -------------------------------------------------------------------------------- 1 | # https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes 2 | keycode_map = { 3 | "Left mouse": 1, 4 | "Right mouse": 2, 5 | "Control-break processing": 3, 6 | "Middle mouse": 4, 7 | "X1 mouse": 5, 8 | "X2 mouse": 6, 9 | "Undefined": 7, 10 | "BACKSPACE": 8, 11 | "TAB": 9, 12 | "CLEAR": 12, 13 | "ENTER": 13, 14 | "SHIFT": 16, 15 | "CTRL": 17, 16 | "ALT": 18, 17 | "PAUSE": 19, 18 | "CAPS LOCK": 20, 19 | "ESC": 27, 20 | "SPACEBAR": 32, 21 | "SPACE": 32, 22 | "PAGE UP": 33, 23 | "PAGE DOWN": 34, 24 | "END": 35, 25 | "HOME": 36, 26 | "LEFT ARROW": 37, 27 | "UP ARROW": 38, 28 | "RIGHT ARROW": 39, 29 | "DOWN ARROW": 40, 30 | "SELECT": 41, 31 | "PRINT": 42, 32 | "EXECUTE": 43, 33 | "PRINT SCREEN": 44, 34 | "INS": 45, 35 | "DEL": 46, 36 | "HELP": 47, 37 | "0": 48, 38 | "1": 49, 39 | "2": 50, 40 | "3": 51, 41 | "4": 52, 42 | "5": 53, 43 | "6": 54, 44 | "7": 55, 45 | "8": 56, 46 | "9": 57, 47 | "A": 65, 48 | "B": 66, 49 | "C": 67, 50 | "D": 68, 51 | "E": 69, 52 | "F": 70, 53 | "G": 71, 54 | "H": 72, 55 | "I": 73, 56 | "J": 74, 57 | "K": 75, 58 | "L": 76, 59 | "M": 77, 60 | "N": 78, 61 | "O": 79, 62 | "P": 80, 63 | "Q": 81, 64 | "R": 82, 65 | "S": 83, 66 | "T": 84, 67 | "U": 85, 68 | "V": 86, 69 | "W": 87, 70 | "X": 88, 71 | "Y": 89, 72 | "Z": 90, 73 | "Left Windows": 91, 74 | "Right Windows": 92, 75 | "Applications": 93, 76 | "Reserved": 252, 77 | "Computer Sleep": 95, 78 | "Numeric pad 0": 96, 79 | "Numeric pad 1": 97, 80 | "Numeric pad 2": 98, 81 | "Numeric pad 3": 99, 82 | "Numeric pad 4": 100, 83 | "Numeric pad 5": 101, 84 | "Numeric pad 6": 102, 85 | "Numeric pad 7": 103, 86 | "Numeric pad 8": 104, 87 | "Numeric pad 9": 105, 88 | "Multiply": 106, 89 | "Add": 107, 90 | "Separator": 108, 91 | "Subtract": 109, 92 | "Decimal": 110, 93 | "Divide": 111, 94 | "F1": 112, 95 | "F2": 113, 96 | "F3": 114, 97 | "F4": 115, 98 | "F5": 116, 99 | "F6": 117, 100 | "F7": 118, 101 | "F8": 119, 102 | "F9": 120, 103 | "F10": 121, 104 | "F11": 122, 105 | "F12": 123, 106 | "F13": 124, 107 | "F14": 125, 108 | "F15": 126, 109 | "F16": 127, 110 | "F17": 128, 111 | "F18": 129, 112 | "F19": 130, 113 | "F20": 131, 114 | "F21": 132, 115 | "F22": 133, 116 | "F23": 134, 117 | "F24": 135, 118 | "NUM LOCK": 144, 119 | "SCROLL LOCK": 145, 120 | "Left SHIFT": 160, 121 | "Right SHIFT": 161, 122 | "Left CONTROL": 162, 123 | "Right CONTROL": 163, 124 | "Left MENU": 164, 125 | "Right MENU": 165, 126 | "Browser Back": 166, 127 | "Browser Forward": 167, 128 | "Browser Refresh": 168, 129 | "Browser Stop": 169, 130 | "Browser Search": 170, 131 | "Browser Favorites": 171, 132 | "Browser Start and Home": 172, 133 | "Volume Mute": 173, 134 | "Volume Down": 174, 135 | "Volume Up": 175, 136 | "Next Track": 176, 137 | "Previous Track": 177, 138 | "Stop Media": 178, 139 | "Play/Pause Media": 179, 140 | "Start Mail": 180, 141 | "Select Media": 181, 142 | "Start Application 1": 182, 143 | "Start Application 2": 183, 144 | "OEM specific": 230, 145 | "IME PROCESS": 229, 146 | "Attn": 246, 147 | "CrSel": 247, 148 | "ExSel": 248, 149 | "Erase EOF": 249, 150 | "Play": 250, 151 | "Zoom": 251, 152 | "PA1": 253, 153 | "Clear": 254, 154 | } 155 | -------------------------------------------------------------------------------- /wizsdk/hotkey.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import ctypes 3 | import re 4 | import inspect 5 | 6 | user32 = ctypes.windll.user32 7 | 8 | from wizsdk.constants import keycode_map 9 | from wizsdk.client import unregister_all 10 | 11 | 12 | class HotkeyEvents: 13 | """ 14 | Hotkey event manager class 15 | 16 | Examples: 17 | .. code-block:: py 18 | 19 | import wizsdk 20 | import asyncio 21 | 22 | # Initiate the event manager 23 | events = wizsdk.HotkeyEvents() 24 | 25 | # Add hotkeys 26 | def print_hello(): 27 | print("Hello, world!") 28 | 29 | events.set_hotkey("ctrl + q", events.safe_quit) # safetly quit the program 30 | events.set_hotkey("SPACEBAR", print_hello) 31 | events.set_hotkey("Left mouse", lambda: print("click")) 32 | 33 | 34 | async def main_function(): 35 | # main script goes here 36 | 37 | # run the two coroutines at the same time 38 | wizsdk.run_threads(events.listen(), main_function()) 39 | 40 | 41 | """ 42 | 43 | def __init__(self, debug=False): 44 | self._actions = {} 45 | self._pressed = {} 46 | self.debug = debug 47 | 48 | def _code_from_str(self, key): 49 | try: 50 | return keycode_map[key] 51 | except KeyError: 52 | # If this throws an error, it won't be catched 53 | # This is expected behavior 54 | return keycode_map[key.upper()] 55 | 56 | def _str_to_keycodes(self, trigger): 57 | # Split 58 | keys = re.split("\s*\+\s*", trigger) 59 | # Conver to keycodes 60 | return tuple([self._code_from_str(k) for k in keys]) 61 | 62 | def _trigger_to_str(self, trigger): 63 | rev = {a: b for (b, a) in keycode_map.items()} 64 | return " + ".join([rev[k] for k in trigger]) 65 | 66 | def set_hotkey(self, trigger: str, action): 67 | """ 68 | Registers a hotkey 69 | 70 | Args: 71 | trigger: the hotkey(s) that will trigger the action. Separate multiple keys with a ``+`` 72 | action: the function that will run when the hotkey is triggered. This can be a regular or an ``await``able function 73 | 74 | """ 75 | if type(trigger) != str: 76 | raise ValueError( 77 | f"Invalid trigger of type {type(trigger)}. Expecting type `str`" 78 | ) 79 | 80 | if not callable(action): 81 | raise ValueError("Invalid param `action`. Param not callable") 82 | 83 | try: 84 | 85 | keys_as_codes = self._str_to_keycodes(trigger) 86 | 87 | self.debug and print(trigger, keys_as_codes) 88 | 89 | self._actions[keys_as_codes] = action 90 | # Start as True so that it's not executed on start 91 | self._pressed[keys_as_codes] = True 92 | except KeyError: 93 | print("One or more of the hot keys are invalid:", trigger) 94 | return False 95 | 96 | def unset_hotkey(self, trigger): 97 | """ 98 | Removes a previously set hotkey 99 | 100 | Args: 101 | trigger: the same trigger used to register the hotkey 102 | """ 103 | self._actions.pop(self._str_to_keycodes(trigger), None) 104 | print(self._actions.keys()) 105 | 106 | async def listen(self): 107 | """ 108 | starts an event loop that will listen for key presses and call actions triggered by the hotkeys. 109 | """ 110 | while True: 111 | await asyncio.sleep(0.02) 112 | for (trigger, action) in self._actions.items(): 113 | all_keys_pressed = all( 114 | [user32.GetAsyncKeyState(keycode) for keycode in trigger] 115 | ) 116 | was_pressed = self._pressed[trigger] 117 | if not was_pressed and all_keys_pressed: 118 | self.debug and print( 119 | f"hotkey {self._trigger_to_str(trigger)} triggered" 120 | ) 121 | # Check if the action is a coroutine and needs to be awaited 122 | if inspect.iscoroutinefunction(action): 123 | await action() 124 | else: 125 | action() 126 | # prevents double events by waiting for the keys to be released before being triggered again 127 | self._pressed[trigger] = True 128 | 129 | elif not all_keys_pressed and was_pressed: 130 | self._pressed[trigger] = False 131 | 132 | async def safe_quit(self): 133 | """ 134 | Safetly quit the program by first un-hooking all clients. 135 | """ 136 | await unregister_all() 137 | quit() 138 | 139 | 140 | if __name__ == "__main__": 141 | from utils import run_threads 142 | 143 | # A few tests 144 | events = HotkeyEvents(debug=True) 145 | events.set_hotkey("alt + q", events.safe_quit) 146 | events.set_hotkey("Left mouse", lambda: print("click")) 147 | 148 | async def main_function(): 149 | while True: 150 | await asyncio.sleep(1) 151 | print("waiting") 152 | 153 | run_threads(events.listen(), main_function()) 154 | -------------------------------------------------------------------------------- /wizsdk/images/confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnderpaidDev1/wizSDK/366440904df487731be9e47c8d3f5bb7ac7aa623/wizsdk/images/confirm.png -------------------------------------------------------------------------------- /wizsdk/images/enemy-first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnderpaidDev1/wizSDK/366440904df487731be9e47c8d3f5bb7ac7aa623/wizsdk/images/enemy-first.png -------------------------------------------------------------------------------- /wizsdk/images/friendlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnderpaidDev1/wizSDK/366440904df487731be9e47c8d3f5bb7ac7aa623/wizsdk/images/friendlist.png -------------------------------------------------------------------------------- /wizsdk/images/spellbook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnderpaidDev1/wizSDK/366440904df487731be9e47c8d3f5bb7ac7aa623/wizsdk/images/spellbook.png -------------------------------------------------------------------------------- /wizsdk/images/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnderpaidDev1/wizSDK/366440904df487731be9e47c8d3f5bb7ac7aa623/wizsdk/images/x.png -------------------------------------------------------------------------------- /wizsdk/keyboard.py: -------------------------------------------------------------------------------- 1 | # Native imports 2 | import ctypes 3 | import ctypes.wintypes 4 | 5 | # Third-party imports 6 | import asyncio 7 | 8 | # Custom imports 9 | from wizsdk.constants import keycode_map 10 | 11 | user32 = ctypes.windll.user32 12 | 13 | 14 | class Keyboard: 15 | """ 16 | Keyboard class. 17 | Sends events directly to the client. Must pass in ``window_handle`` of the client to use. 18 | """ 19 | 20 | def __init__(self, window_handle): 21 | # super().__init__(window_handle) 22 | self.window_handle = window_handle 23 | self.key_tasks = {} 24 | 25 | async def hold_key(self, key, seconds=0.1): 26 | """ 27 | Hold down a key for an amount of time. The key is sent directly to the client, the client does not need to be in focus. 28 | 29 | Args: 30 | key (str): The key to hold down. 31 | "TAB", "ENTER", "ALT", "ESC", "SPACE" and others are also accepted as special keys 32 | seconds (int, optional): duration to hold for 33 | """ 34 | self.key_down(key) 35 | await asyncio.sleep(seconds) 36 | self.key_up(key) 37 | 38 | async def send_key(self, key, seconds=0.1): 39 | """ 40 | Alias for ``hold_key`` 41 | """ 42 | await self.hold_key(key, seconds) 43 | 44 | def key_down(self, key): 45 | """ 46 | Hold down a key. Call ``key_up`` to release. 47 | 48 | Args: 49 | key (str): The key to hold down 50 | """ 51 | self.key_tasks[key] = asyncio.create_task(self._key_send_task(key)) 52 | 53 | def key_up(self, key=None): 54 | """ 55 | Release a key that has been pressed down 56 | 57 | Args: 58 | key (str, optional): The key to release 59 | If no key is specified, all keys will be released 60 | """ 61 | if key: 62 | self._key_cancel_task(key) 63 | else: 64 | for k in self.key_tasks.keys(): 65 | self.key_up(k) 66 | 67 | def type_key(self, char): 68 | """ 69 | Sends a key to the client. 70 | This is a different event than ``send_key`` and is only useful for the chat window. 71 | 72 | Args: 73 | char: The character to type 74 | "TAB", "ENTER", "ALT", "ESC", "SPACE" and others are also accepted as special keys 75 | """ 76 | code = None 77 | try: 78 | code = keycode_map[char] 79 | except KeyError: 80 | code = ord(char) 81 | 82 | user32.PostMessageW(self.window_handle, 0x102, code, 0) 83 | 84 | def type_string(self, string): 85 | """ 86 | Type a string of letters directly to the window. 87 | 88 | Args: 89 | string: the text to type 90 | """ 91 | for s in string: 92 | self.type_key(s) 93 | 94 | async def _key_send_task(self, key): 95 | while True: 96 | self._send_key_event(key, 0) 97 | await asyncio.sleep(0.1) 98 | 99 | def _key_cancel_task(self, key): 100 | if key in self.key_tasks.keys(): 101 | self.key_tasks[key].cancel() 102 | 103 | self._send_key_event(key, 1) 104 | 105 | def _send_key_event(self, key, event): 106 | try: 107 | code = keycode_map[key.upper()] 108 | msg = 0x101 if event else 0x100 109 | # https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagew 110 | # https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-keydown 111 | user32.PostMessageW(self.window_handle, msg, code, 0) 112 | except KeyError: 113 | print("Invalid key provided") 114 | 115 | 116 | if __name__ == "__main__": 117 | """ Some tests """ 118 | from wizwalker.utils import get_all_wizard_handles 119 | 120 | try: 121 | window_handle = get_all_wizard_handles()[0] 122 | except IndexError: 123 | print("No running wizard101 windows") 124 | exit(0) 125 | 126 | keyboard = Keyboard(window_handle) 127 | 128 | async def say_hello(): 129 | keyboard.type_key("\r") 130 | await asyncio.sleep(0.2) 131 | keyboard.type_string("Hello world!\r") 132 | 133 | async def test(): 134 | # Hold down 2 keys 135 | keyboard.key_down("D") 136 | keyboard.key_down("W") 137 | await asyncio.sleep(2) 138 | # Release 1 139 | keyboard.key_up("D") 140 | await asyncio.sleep(1) 141 | # Release all keys 142 | keyboard.key_up() 143 | # Hold s for .5 seconds 144 | await keyboard.hold_key("s", 0.5) 145 | 146 | # Wait and say hello! 147 | await asyncio.sleep(0.1) 148 | await say_hello() 149 | 150 | asyncio.run(test()) 151 | -------------------------------------------------------------------------------- /wizsdk/mouse.py: -------------------------------------------------------------------------------- 1 | # Native imports 2 | import ctypes 3 | from ctypes.wintypes import POINT 4 | import time 5 | import asyncio 6 | 7 | # Custom imports 8 | from wizsdk.window import Window, screen_size 9 | 10 | # If the mouse is over a coordinate in FAILSAFE_POINTS and FAILSAFE is True, the FailSafeException is raised. 11 | # The rest of the points are added to the FAILSAFE_POINTS list at the bottom of this file, after size() has been defined. 12 | # The points are for the corners of the screen, but note that these points don't automatically change if the screen resolution changes. 13 | FAILSAFE = True 14 | FAILSAFE_POINTS = [(0, 0)] 15 | MINIMUM_DURATION = 0.1 16 | MINIMUM_SLEEP = 0.02 17 | 18 | 19 | class FailSafeException(Exception): 20 | """ 21 | Exception raised when the mouse is over (0, 0). Protactive measure to regain control of your mouse. 22 | """ 23 | 24 | def __init__( 25 | self, 26 | message="Mouse fail-safe triggered from mouse moving to a corner of the screen.", 27 | ): 28 | self.message = message 29 | super().__init__(self.message) 30 | 31 | 32 | def getPointOnLine(x1, y1, x2, y2, n): 33 | """ 34 | Returns an (x, y) tuple of the point that has progressed a proportion ``n`` along the line defined by the two 35 | ``x1``, ``y1`` and ``x2``, ``y2`` coordinates. 36 | This function was copied from pytweening module, so that it can be called even if PyTweening is not installed. 37 | """ 38 | x = ((x2 - x1) * n) + x1 39 | y = ((y2 - y1) * n) + y1 40 | return (x, y) 41 | 42 | 43 | class Mouse(Window): 44 | """ 45 | Class for controlling the computer's mouse. 46 | """ 47 | 48 | _MOUSEEVENTF_MOVE = 0x0001 # mouse move 49 | _MOUSEEVENTF_LEFTDOWN = 0x0002 # left button down 50 | _MOUSEEVENTF_LEFTUP = 0x0004 # left button up 51 | _MOUSEEVENTF_RIGHTDOWN = 0x0008 # right button down 52 | _MOUSEEVENTF_RIGHTUP = 0x0010 # right button up 53 | _MOUSEEVENTF_MIDDLEDOWN = 0x0020 # middle button down 54 | _MOUSEEVENTF_MIDDLEUP = 0x0040 # middle button up 55 | _MOUSEEVENTF_WHEEL = 0x0800 # wheel button rolled 56 | _MOUSEEVENTF_ABSOLUTE = 0x8000 # absolute move 57 | _SM_CXSCREEN = 0 58 | _SM_CYSCREEN = 1 59 | 60 | def __init__(self, window_handle=None, silent_mode=False, walker=None): 61 | """ 62 | Args: 63 | silent_mode: When enabled, moves the mouse without taking control of the actual cursor 64 | walker: A wizwalker client. It is required for silent mode 65 | """ 66 | super().__init__(window_handle) 67 | # Window handle to which the mouse events will be relative to 68 | self.window_handle = window_handle 69 | self.walker = walker 70 | 71 | if silent_mode and walker == None: 72 | raise ValueError("A walker must be passed to Mouse to use silent mode") 73 | 74 | self.silent_mode = silent_mode 75 | self.silent_xpos = 0 76 | self.silent_ypos = 0 77 | self.silent_init = False 78 | 79 | def _do_event(self, flags, x_pos, y_pos, data, extra_info): 80 | """generate a mouse event""" 81 | if not self.silent_mode: 82 | x_calc = int( 83 | 65536 * x_pos / ctypes.windll.user32.GetSystemMetrics(self._SM_CXSCREEN) 84 | + 1 85 | ) 86 | y_calc = int( 87 | 65536 * y_pos / ctypes.windll.user32.GetSystemMetrics(self._SM_CYSCREEN) 88 | + 1 89 | ) 90 | return ctypes.windll.user32.mouse_event( 91 | flags, x_calc, y_calc, data, extra_info 92 | ) 93 | else: 94 | raise RuntimeError( 95 | "Mouse._do_event is not supported with silent mode enabled" 96 | ) 97 | 98 | def _get_button_value(self, button_name, button_up=False): 99 | """convert the name of the button into the corresponding value""" 100 | buttons = 0 101 | if button_name.find("right") >= 0: 102 | buttons = self._MOUSEEVENTF_RIGHTDOWN 103 | if button_name.find("left") >= 0: 104 | buttons += self._MOUSEEVENTF_LEFTDOWN 105 | if button_name.find("middle") >= 0: 106 | buttons += self._MOUSEEVENTF_MIDDLEDOWN 107 | if button_up: 108 | buttons = buttons << 1 109 | return buttons 110 | 111 | async def init_silent_mode(self): 112 | if self.silent_mode and not self.silent_init: 113 | point = POINT() 114 | point.x = 100 115 | point.y = 100 116 | ctypes.windll.user32.ClientToScreen(self.window_handle, ctypes.byref(point)) 117 | self.silent_xpos = point.x 118 | self.silent_ypos = point.y 119 | await self.walker.mouse_handler.set_mouse_position( 120 | self.silent_xpos, self.silent_ypos, convert_from_client=False 121 | ) 122 | self.silent_init = True 123 | 124 | async def _set_position(self, pos): 125 | """ 126 | Set the position of the mouse to the specified coordinates 127 | """ 128 | (x, y) = pos 129 | 130 | if not self.silent_mode: 131 | self._do_event( 132 | self._MOUSEEVENTF_MOVE + self._MOUSEEVENTF_ABSOLUTE, x, y, 0, 0 133 | ) 134 | else: 135 | await self.init_silent_mode() 136 | self.silent_xpos = x 137 | self.silent_ypos = y 138 | await self.walker.mouse_handler.set_mouse_position( 139 | self.silent_xpos, self.silent_ypos, convert_from_client=False 140 | ) 141 | 142 | async def move_to(self, x, y, duration=0.5): 143 | """ 144 | Move the mouse to the x, y coordinates relative to the window 145 | """ 146 | # We need to get from (startx, starty) to (x, y) 147 | 148 | # Set the X, Y to be relative to the window position 149 | await self.init_silent_mode() 150 | wX, wY, *_ = self.get_rect() 151 | 152 | x += wX 153 | y += wY 154 | 155 | startx, starty = self.get_position() 156 | x_offset = x - startx 157 | y_offset = y - starty 158 | 159 | width, height = screen_size() 160 | 161 | steps = [(x, y)] 162 | 163 | if duration > MINIMUM_DURATION: 164 | num_steps = max(width, height) 165 | sleep_amount = duration / num_steps 166 | 167 | if sleep_amount < MINIMUM_SLEEP: 168 | num_steps = int(duration / MINIMUM_SLEEP) 169 | sleep_amount = duration / num_steps 170 | 171 | steps = [ 172 | getPointOnLine(startx, starty, x, y, (n / num_steps)) 173 | for n in range(num_steps) 174 | ] 175 | steps.append((x, y)) 176 | 177 | for _x, _y in steps: 178 | if len(steps) > 1: 179 | # A single step doesn't require tweening 180 | time.sleep(sleep_amount) 181 | 182 | _x = int(round(_x)) 183 | _y = int(round(_y)) 184 | 185 | # Failsafe check 186 | if not self.silent_mode and (_x, _y) not in FAILSAFE_POINTS: 187 | self.failSafeCheck() 188 | 189 | await self._set_position((_x, _y)) 190 | 191 | # Failsafe check 192 | if not self.silent_mode and not (_x, _y) not in FAILSAFE_POINTS: 193 | self.failSafeCheck() 194 | 195 | def wizsdk_client_coords_to_wizwalker(self, x: int, y: int) -> tuple: 196 | """ 197 | Converts WizSDK client coords to wizwalker client coords 198 | """ 199 | # make absolute 200 | wX, wY, *_ = self.get_rect() 201 | x += wX 202 | y += wY 203 | 204 | # convert to the client coords wizwalker uses 205 | point = POINT(int(x), int(y)) 206 | if ( 207 | ctypes.windll.user32.ScreenToClient(self.window_handle, ctypes.byref(point)) 208 | == 0 209 | ): 210 | raise RuntimeError("Screen to client conversion failed") 211 | 212 | return (point.x, point.y) 213 | 214 | async def click(self, x=-1, y=-1, button="left", duration=None, delay=0.1): 215 | """Click at the specified placed""" 216 | # Set default duration 217 | if duration is None: 218 | if x == -1 and y == -1: 219 | duration = 0 220 | else: 221 | duration = 0.5 222 | 223 | # If position is not set, use current mouse position 224 | old_pos = self.get_position() 225 | x = x if (x != -1) else old_pos[0] 226 | y = y if (y != -1) else old_pos[1] 227 | await self.move_to(x, y, duration=duration) 228 | await asyncio.sleep(delay) 229 | if not self.silent_mode: 230 | self.set_active() 231 | self._do_event( 232 | self._get_button_value(button, False) 233 | + self._get_button_value(button, True), 234 | 0, 235 | 0, 236 | 0, 237 | 0, 238 | ) 239 | else: 240 | (nx, ny) = self.wizsdk_client_coords_to_wizwalker( 241 | x, y 242 | ) # this is needed because walker.click implicitly converts client to screen, but with a different method 243 | await self.walker.mouse_handler.click( 244 | nx, ny, right_click=button != "left", sleep_duration=delay 245 | ) 246 | 247 | def double_click(self, pos=(-1, -1), button="left"): 248 | """Double click at the specifed placed""" 249 | for i in range(2): 250 | self.click(pos, button) 251 | 252 | def get_position(self): 253 | """get mouse position""" 254 | if not self.silent_mode: 255 | point = POINT() 256 | ctypes.windll.user32.GetCursorPos(ctypes.byref(point)) 257 | return (point.x, point.y) 258 | else: 259 | return (self.silent_xpos, self.silent_ypos) 260 | 261 | def get_rel_position(self): 262 | """get mouse position relative to window""" 263 | if not self.silent_mode: 264 | wx, wy = self.get_rect()[:2] 265 | x, y = self.get_position() 266 | return (x - wx, y - wy) 267 | else: 268 | wx, wy = self.get_rect()[:2] 269 | return (self.silent_xpos - wx, self.silent_ypos - wy) 270 | 271 | def in_rect(self, rect_area): 272 | """ 273 | Returns true if the mouse is in the given region 274 | """ 275 | x, y, w, h = rect_area 276 | wx, wy = self.get_rect()[:2] 277 | # Make the position of the rect relative to the window 278 | x += wx 279 | y += wy 280 | 281 | mouseX, mouseY = self.get_position() 282 | return mouseX > x and mouseX < (x + w) and mouseY > y and mouseY < (y + h) 283 | 284 | async def move_out(self, rect_area): 285 | """ 286 | Move the mouse outside of the given rect 287 | If the mouse is already outside, return 288 | """ 289 | x, y = self.get_rel_position() 290 | while self.in_rect(rect_area): 291 | # TODO find fastest way out of rect 292 | y -= 100 293 | await self.move_to(x, y, duration=0.1) 294 | 295 | def failSafeCheck(self): 296 | if not self.silent_mode and FAILSAFE and self.get_position() in FAILSAFE_POINTS: 297 | raise FailSafeException 298 | 299 | 300 | if __name__ == "__main__": 301 | import asyncio 302 | 303 | async def main(): 304 | mouse = Mouse() 305 | mouse._set_position((100, 100)) 306 | await mouse.move_to(10, 100, duration=1) 307 | 308 | asyncio.run(main()) 309 | -------------------------------------------------------------------------------- /wizsdk/pixels.py: -------------------------------------------------------------------------------- 1 | # Native imports 2 | import ctypes 3 | import ctypes.wintypes 4 | from os import path 5 | 6 | # Third-party imports 7 | import numpy as np 8 | import cv2 9 | 10 | # Custom imports 11 | from .window import Window 12 | 13 | 14 | user32 = ctypes.WinDLL("user32.dll") 15 | gdi32 = ctypes.WinDLL("gdi32.dll") 16 | 17 | # Converted to python from https://docs.microsoft.com/en-us/windows/win32/gdi/capturing-an-image 18 | # by Starrfox 19 | 20 | 21 | class _BITMAPINFOHEADER(ctypes.Structure): 22 | _fields_ = [ 23 | ("biSize", ctypes.c_uint32), 24 | ("biWidth", ctypes.c_int), 25 | ("biHeight", ctypes.c_int), 26 | ("biPlanes", ctypes.c_short), 27 | ("biBitCount", ctypes.c_short), 28 | ("biCompression", ctypes.c_uint32), 29 | ("biSizeImage", ctypes.c_uint32), 30 | ("biXPelsPerMeter", ctypes.c_long), 31 | ("biYPelsPerMeter", ctypes.c_long), 32 | ("biClrUsed", ctypes.c_uint32), 33 | ("biClrImportant", ctypes.c_uint32), 34 | ] 35 | 36 | 37 | least_gray = 0 38 | 39 | 40 | class _BITMAP(ctypes.Structure): 41 | _fields_ = [ 42 | ("bmType", ctypes.c_long), 43 | ("bmWidth", ctypes.c_long), 44 | ("bmHeight", ctypes.c_long), 45 | ("bmWidthBytes", ctypes.c_long), 46 | ("bmPlanes", ctypes.wintypes.WORD), 47 | ("bmBitsPixel", ctypes.wintypes.WORD), 48 | ("bmBits", ctypes.wintypes.LPVOID), 49 | ] 50 | 51 | 52 | class DeviceContext(Window): 53 | """ 54 | Base class for accessing the Window's Device Context (pixels, image captures, etc..) 55 | """ 56 | 57 | def __init__(self, handle): 58 | super().__init__(handle) 59 | self.window_handle = handle 60 | 61 | def get_image(self, region=None): 62 | """ 63 | returns a byte array with the pixel data of the ``region`` from the ``window_handle`` window. ``region`` is relative to the ``window_handle`` window. If no ``region`` is specified, it will capture the entire window. If no ``window_handle`` is provided on initiation, monitor 1 is used as the context. 64 | 65 | Args: 66 | region: (x, y, width, height) tuple relative to the ``window_handle`` context. Defaults to None 67 | 68 | Returns: 69 | A 2d numpy array representing the pixel data of the captured region. 70 | """ 71 | 72 | _, _, w, h = self.get_rect() 73 | x, y = 0, 0 74 | 75 | if region and len(region) == 4: 76 | x, y, w, h = region 77 | 78 | # Get devices context 79 | wDC = user32.GetWindowDC(self.window_handle) 80 | if wDC == 0: 81 | print("Window handle retrieval error") 82 | return [] 83 | 84 | # Where we will move the pixels to 85 | mDC = gdi32.CreateCompatibleDC(wDC) 86 | if mDC == 0: 87 | print("Memory device creation error") 88 | return [] 89 | 90 | gdi32.SetStretchBltMode(wDC, 4) 91 | # Create empty bitmap 92 | mBM = gdi32.CreateCompatibleBitmap(wDC, w, h) 93 | if mBM == 0: 94 | print("Bitmap creation error") 95 | return [] 96 | 97 | # Select wDC into bitmap 98 | gdi32.SelectObject(mDC, mBM) 99 | 100 | gdi32.BitBlt(mDC, 0, 0, w, h, wDC, x, y, 0x00CC0020) 101 | 102 | bitmap = _BITMAP() 103 | 104 | bits_transfered = 0 105 | while bits_transfered == 0: 106 | bits_transfered = gdi32.GetObjectA( 107 | mBM, ctypes.sizeof(_BITMAP), ctypes.byref(bitmap) 108 | ) 109 | 110 | bi = _BITMAPINFOHEADER() 111 | bi.biSize = ctypes.sizeof(_BITMAPINFOHEADER) 112 | bi.biWidth = bitmap.bmWidth 113 | bi.biHeight = bitmap.bmHeight 114 | bi.biPlanes = 1 115 | bi.biBitCount = 32 116 | bi.biCompression = 0 117 | bi.biSizeImage = 0 118 | bi.biXPelsPerMeter = 0 119 | bi.biYPelsPerMeter = 0 120 | bi.biClrUsed = 0 121 | bi.biClrImportant = 0 122 | 123 | bitmap_size = ( 124 | ( 125 | (bitmap.bmWidth * bitmap.bmBitsPixel + bitmap.bmBitsPixel - 1) 126 | // bitmap.bmBitsPixel 127 | ) 128 | * 4 129 | * bitmap.bmHeight 130 | ) 131 | 132 | bitmap_buffer = (ctypes.c_char * bitmap_size)() 133 | 134 | gdi32.GetDIBits( 135 | wDC, 136 | mBM, 137 | 0, 138 | bitmap.bmHeight, 139 | ctypes.byref(bitmap_buffer), 140 | ctypes.byref(bi), 141 | 0, 142 | ) 143 | 144 | gdi32.DeleteObject(mBM) 145 | gdi32.DeleteDC(mDC) 146 | user32.ReleaseDC(self.window_handle, wDC) 147 | 148 | img = np.frombuffer(bitmap_buffer.raw, dtype="uint8") 149 | img = img.reshape((bitmap.bmHeight, bitmap.bmWidth, 4)) 150 | img = np.flip(img, 0) 151 | # Remove the alpha channel 152 | img = img[:, :, :3] 153 | return img 154 | 155 | def get_pixel(self, x, y) -> tuple: 156 | """ 157 | Returns the (red, green, blue) channel's of the pixel at ``x``, ``y`` relative to the ``window_handle`` context. 158 | 159 | Args: 160 | x 161 | y 162 | 163 | Returns: 164 | (r, g, b) tuple 165 | """ 166 | hDC = user32.GetWindowDC(self.window_handle) 167 | rgb = gdi32.GetPixel(hDC, x, y) 168 | user32.ReleaseDC(self.window_handle, hDC) 169 | r = rgb & 0xFF 170 | g = (rgb >> 8) & 0xFF 171 | b = (rgb >> 16) & 0xFF 172 | return (r, g, b) 173 | 174 | def screenshot(self, filename, region=None): 175 | """ 176 | captures a screenshot of the provided ``region``, saves it to file as ``filename``. 177 | 178 | Args: 179 | filename: what to save to image as 180 | region: (x, y, width, height) tuple relative to the ``window_handle`` context. Defaults to None 181 | """ 182 | image = self.get_image(region=region) 183 | cv2.imshow("mat", image) 184 | cv2.waitKey(0) 185 | cv2.imwrite(filename, image) 186 | 187 | def pixel_matches_color(self, xy, expected_rgb, tolerance=0): 188 | """ 189 | gets the value of a pixel with ``get_pixel`` and checks it against ``expected_rgb``. Accepts ``tolerance`` amount of differences between the pixel and its expected value. 190 | """ 191 | pixel = self.get_pixel(*xy) 192 | if len(pixel) == 3 or len(expected_rgb) == 3: # RGB mode 193 | r, g, b = pixel[:3] 194 | exR, exG, exB = expected_rgb[:3] 195 | return ( 196 | (abs(r - exR) <= tolerance) 197 | and (abs(g - exG) <= tolerance) 198 | and (abs(b - exB) <= tolerance) 199 | ) 200 | else: 201 | assert ( 202 | False 203 | ), f"Color mode was expected to be length 3 (RGB), but pixel is length {len(pixel)} and expected_RGB is length { len(expected_rgb)}" 204 | 205 | def is_gray_rect(self, region, threshold=25): 206 | """ 207 | calculates if a ``(x, y, width, height)`` ``region`` is gray by iterating through all its pixels and calculating the difference between the channel with the lowest value, and the one with the highest value. Stops iterating if that value is greater than ``threshold``. Returns the highest of the values calculated. 208 | 209 | Args: 210 | region: (x, y, width, height) tuple relative to the ``window_handle`` context. 211 | threshold: difference allowed between highest channel and lowest channel to still be considered gray. 212 | 213 | Returns: 214 | the greatest difference between the highest channel and lowest channel. 215 | """ 216 | # global least_gray 217 | least_gray = 0 218 | 219 | w, h = region[2:] 220 | img = self.get_image(region) 221 | 222 | gray = True 223 | 224 | # Check if all pixels in image are gray 225 | for x in range(h): 226 | if not gray: 227 | break 228 | 229 | for y in range(w): 230 | pixel = img[x][y] 231 | 232 | # Determine if a pixel is gray enough 233 | color = abs(int(min(*pixel)) - int(max(*pixel))) 234 | if color > least_gray: 235 | least_gray = color 236 | 237 | if color > threshold: 238 | gray = False 239 | break 240 | 241 | return least_gray 242 | 243 | def locate_on_screen( 244 | self, match_img, region=None, *, threshold=0.1, debug=False, folder=None 245 | ): 246 | """ 247 | Attempts to locate `match_img` in the Wizard101 window. 248 | pass a rect tuple `(x, y, width, height)` as the `region` argument to narrow 249 | down the area to look for the image. 250 | Adjust `threshold` for the precision of the match (between 0 and 1, the lowest being more precise). 251 | Set `debug` to True for extra debug info 252 | 253 | Args: 254 | match_img: to image to locate, can be a file name or a numpy array 255 | region: (x, y, width, height) tuple relative to the ``window_handle`` context. Defaults to None 256 | theshold: precision of the match -- between 0 and 1, the lowest being more precise 257 | debug: set to True to show a pop up of the area that matched the image provided. 258 | folder: folder to look in. Overrides ``IMAGE_FOLDER`` default 259 | 260 | Returns: 261 | (x, y) tuple for center of match if found. False otherwise. 262 | 263 | """ 264 | to_match = ( 265 | path.join(folder or self._default_image_folder or "", match_img) 266 | if type(match_img) == str 267 | else match_img 268 | ) 269 | match = match_image( 270 | self.get_image(region=region), to_match, threshold, debug=debug 271 | ) 272 | 273 | if not match or not region: 274 | return match 275 | 276 | region_x, region_y = region[:2] 277 | x, y = match 278 | return x + region_x, y + region_y 279 | 280 | 281 | def _to_cv2_img(data): 282 | if type(data) is str: 283 | # It's a file name 284 | # cv2.IMREAD_COLOR ignores alpha channel, loads only rgb 285 | img = cv2.imdecode(np.fromfile(data, dtype=np.uint8), cv2.IMREAD_COLOR) 286 | 287 | return img 288 | 289 | elif type(data) is np.ndarray: 290 | # It's a np array 291 | return data 292 | 293 | return None 294 | 295 | 296 | def match_image(largeImg, smallImg, threshold=0.1, debug=False): 297 | """ 298 | Finds smallImg in largeImg using template matching 299 | Adjust threshold for the precision of the match (between 0 and 1, the lowest being more precise) 300 | 301 | Returns: 302 | tuple (x, y) of the center of the match if it's found, False otherwise. 303 | """ 304 | 305 | method = cv2.TM_SQDIFF_NORMED 306 | 307 | small_image = _to_cv2_img(smallImg) 308 | large_image = _to_cv2_img(largeImg) 309 | 310 | if (small_image is None) or (large_image is None): 311 | print("Error: large_image or small_image is None") 312 | return False 313 | 314 | h, w = small_image.shape[:-1] 315 | 316 | if debug: 317 | print("large_image:", large_image.shape) 318 | print("small_image:", small_image.shape) 319 | 320 | try: 321 | result = cv2.matchTemplate(small_image, large_image, method) 322 | except cv2.error as e: 323 | # The image was not found. like, not even close. :P 324 | print(e) 325 | return False 326 | 327 | # We want the minimum squared difference 328 | mn, _, mnLoc, _ = cv2.minMaxLoc(result) 329 | 330 | if mn >= threshold: 331 | if debug: 332 | cv2.imshow("output", large_image) 333 | cv2.waitKey(0) 334 | return False 335 | 336 | # Extract the coordinates of our best match 337 | x, y = mnLoc 338 | 339 | if debug: 340 | print(f"Match at ({x}, {y}) relative to region") 341 | # Draw the rectangle: 342 | # Get the size of the template. This is the same size as the match. 343 | trows, tcols = small_image.shape[:2] 344 | 345 | # If I don't call this a get a TypeError :P 346 | large_image = np.array(large_image) 347 | # Draw the rectangle on large_image 348 | cv2.rectangle(large_image, (x, y), (x + tcols, y + trows), (0, 0, 255), 2) 349 | 350 | # Display the original image with the rectangle around the match. 351 | cv2.imshow("output", large_image) 352 | 353 | # The image is only displayed if we call this 354 | cv2.waitKey(0) 355 | 356 | # Return coordinates to center of match 357 | return (x + (w // 2), y + (h // 2)) 358 | -------------------------------------------------------------------------------- /wizsdk/utils.py: -------------------------------------------------------------------------------- 1 | # Native imports 2 | import ctypes, os 3 | from collections import namedtuple 4 | import asyncio 5 | 6 | user32 = ctypes.windll.user32 7 | 8 | XYZYaw = namedtuple("XYZYaw", "x y z yaw") 9 | """ 10 | Used to store player location 11 | 12 | :meta private: 13 | """ 14 | 15 | 16 | def run_threads(*coroutines, return_when=asyncio.FIRST_COMPLETED): 17 | """ 18 | creates an asyncio event loop to run coroutines concurrently 19 | 20 | Args: 21 | coroutines: any amount of coroutines to run at the same time 22 | return_when: when to stop the threads and return: asyncio.FIRST_COMPLETED, asyncio.ALL_COMPLETED, or asyncio.FIRST_EXCEPTION 23 | 24 | """ 25 | 26 | loop = asyncio.get_event_loop() 27 | job = asyncio.wait(coroutines, return_when=return_when) 28 | 29 | done, pending = loop.run_until_complete(job) 30 | 31 | # finish / cancel all tasks properly 32 | # https://stackoverflow.com/a/62443715/10751635 33 | for t in pending: 34 | t.cancel() 35 | 36 | while not all([t.done() for t in pending]): 37 | loop._run_once() 38 | 39 | 40 | def get_all_wiz_handles() -> list: 41 | """ 42 | Retrieves all window handles for windows that have the 43 | 'Wizard Graphical Client' class 44 | 45 | Returns: 46 | List of all the wizard101 device handles 47 | """ 48 | target_class = "Wizard Graphical Client" 49 | 50 | handles = [] 51 | 52 | # callback takes a window handle and an lparam and returns true/false on if we should keep going 53 | # iterating 54 | # https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms633498(v=vs.85) 55 | def callback(handle, _): 56 | class_name = ctypes.create_unicode_buffer(len(target_class)) 57 | # win_title = ctypes.create_unicode_buffer(100) 58 | 59 | user32.GetClassNameW(handle, class_name, len(target_class) + 1) 60 | # user32.GetWindowTextW(handle, win_title, 101) 61 | 62 | if target_class == class_name.value: 63 | handles.append(handle) 64 | 65 | # iterate all windows 66 | return 1 67 | 68 | # https://docs.python.org/3/library/ctypes.html#callback-functions 69 | enumwindows_func_type = ctypes.WINFUNCTYPE( 70 | ctypes.c_bool, # return type 71 | ctypes.c_int, # arg1 type 72 | ctypes.POINTER(ctypes.c_int), # arg2 type 73 | ) 74 | 75 | # Transform callback into a form we can pass to the dll 76 | callback = enumwindows_func_type(callback) 77 | 78 | # EnumWindows takes a callback every iteration is passed to 79 | # and an lparam 80 | # https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows 81 | user32.EnumWindows(callback, 0) 82 | 83 | return handles 84 | 85 | 86 | def count_wiz_clients() -> int: 87 | """ 88 | Returns the number of wizard101 clients detected 89 | 90 | Returns: 91 | Number of wizard101 clients detected 92 | """ 93 | return len(get_all_wiz_handles()) 94 | 95 | 96 | async def finish_all_loading(*players): 97 | """ 98 | Wait for all players passed in as arguments to have gone through the loading screen. 99 | """ 100 | await asyncio.gather(*[player.finish_loading() for player in players]) 101 | 102 | 103 | def packaged_img(filename: str = ""): 104 | """ 105 | Helper function to reference images packaged within the WizSDK module 106 | 107 | Returns: 108 | Full file path to the packaged image. 109 | """ 110 | return os.path.dirname(__file__) + "/images/" + filename 111 | -------------------------------------------------------------------------------- /wizsdk/window.py: -------------------------------------------------------------------------------- 1 | import ctypes 2 | from ctypes import WinDLL 3 | 4 | user32 = ctypes.WinDLL("user32.dll") 5 | 6 | 7 | def screen_size(): 8 | """Returns the width and height of the screen as a two-integer tuple. 9 | Returns: 10 | (width, height) tuple of the screen size, in pixels. 11 | """ 12 | return ( 13 | ctypes.windll.user32.GetSystemMetrics(0), 14 | ctypes.windll.user32.GetSystemMetrics(1), 15 | ) 16 | 17 | 18 | class Window: 19 | """ 20 | Base class for all classes in wizSDK. Keeps track of the wizard101 app window. 21 | """ 22 | 23 | def __init__(self, handle=None): 24 | # If window_handle is None, Window represents the screen 25 | self.window_handle = handle 26 | 27 | def is_active(self) -> bool: 28 | """ Returns true if the window is focused """ 29 | if self.window_handle: 30 | return self.window_handle == user32.GetForegroundWindow() 31 | else: 32 | # The "screen" is always active 33 | return True 34 | 35 | def set_active(self): 36 | """ Sets the window to active if it isn't already """ 37 | if self.window_handle and not self.is_active(): 38 | user32.SetForegroundWindow(self.window_handle) 39 | return self 40 | 41 | def get_rect(self) -> tuple: 42 | """ 43 | Gets the area rectangle of the window (x, y, width, height) relative to the monitor position. 44 | 45 | Returns: 46 | tuple (x, y, width, height) of the window 47 | """ 48 | if self.window_handle: 49 | rect = ctypes.wintypes.RECT() 50 | user32.GetWindowRect(self.window_handle, ctypes.byref(rect)) 51 | # Returns (x, y, w, h) tuple 52 | return (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top) 53 | else: 54 | # Return rect of screen 55 | return (0, 0, *screen_size()) 56 | --------------------------------------------------------------------------------