├── LICENSE
├── README.md
└── taojinbi.js
/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 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # taobao_taojinbi
2 | 本项目主要用于自动执行淘金币及芭芭农场相关任务,**后续代码持续更新,转载引用请注明出处,你的☆就是我的动力**
3 |
4 | # 测试环境
5 | 华为P30Pro + [autojs4.1.1](https://share.weiyun.com/owu3tBNr) + [淘宝v10.1.0](https://www.wandoujia.com/apps/32267/history)
6 | (*华为P30Pro屏幕大小为1080x2340,此分辨率对特殊任务支持最佳*)
7 |
8 | # 脚本功能列表
9 | - 自动执行淘金币所有浏览任务
10 | - 自动执行[逛好店领一大波金币]任务 (包含浏览10s+10金币任务/收藏店铺+10金币)
11 | - 自动执行[逛蚂蚁庄园喂小鸡]任务
12 | - 自动执行[签到领取话费充值金]任务
13 | - 自动执行[淘宝成就签到/月账单任务]
14 | - 自动执行[淘宝人生逛街领能量]掷色子任务 (需截图权限)
15 | - 自动执行[逛农场领免费水果]任务 (需截图权限,包括全部子任以及支付宝芭芭农场任务)
16 | - 自动执行[蚂蚁森林]任务,收取好友能量 (需截图权限)
17 | - 自动执行[淘金币夺宝]任务
18 | - 自动执行[天天步数红包赛]任务
19 | - 浏览任务完成立即返回,无需额外等待
20 |
21 | **关于芭芭农场升级0.01%的2种解决方法:方法1:在淘宝中执行完任务后关闭autojs,然后在支付宝中升级;方法2:在手机应用设置中清除淘宝的本地数据,重新登录淘宝后再升级 (推荐方法1)**
22 |
23 | 关于‘宝卡’任务,本人淘金币列表中无该任务,因此无法测试。若无法成功执行,请在参数配置页“简单任务跳过关键字”中添加对应任务关键字,即可跳过该任务
24 |
25 | # 更新日志
26 |
27 | **v1.7.4** 2021年6月26日09:31:12
28 | 1. 同步Apk更新
29 | 2. 跳转恢复按钮点击方式
30 |
31 | **v1.7.3** 2021年6月18日20:13:04
32 | 1. 紧急修复报错问题,报错原因:列表中前天被添加了一个空的任务,导致获取失败报错。
33 | 2. 保存配置后下次启动默认加载配置
34 |
35 | **v1.7.2** 2021年6月15日21:23:04
36 | 1. 阅读小说卡顿问题
37 | 2. 淘金币夺宝,兑换关键字修改问题
38 | 3. 红包签到跳转失败 (后续可能使用url进行跳转)
39 |
40 | **v1.7.1** 2021年6月2日21:23:04
41 | 1. 喂小鸡任务直接返回
42 | 2. 简单任务跳过六一淘金币专场活动
43 |
44 | **v1.7.0** 2021年5月31日23:18:43
45 | 1. 淘金币新增618喵币活动 (只在淘金币执行一次)
46 | 2. 解决部分简单浏览任务下滑问题
47 | 3. 阅读小说转特殊任务
48 |
49 | **v1.6.10** 2021年5月16日11:03:51
50 | 1. 解决芭芭农场"精选"任务下滑才时间过短问题
51 | 2. 解决淘宝人生掷色子任务中“神秘礼物”无法取消问题
52 |
53 | **v1.6.9** 2021年5月13日23:06:38
54 | 1. 解决芭芭农场"精选"任务下滑才得奖励问题
55 | 2. 添加"每日领红包任务"
56 | 3. 解决去“天猫APP”任务,但没有安装天猫的问题
57 |
58 | **v1.6.8** 2021年5月3日15:16:44
59 | 1. 解决浏览精选宝贝,下滑才计时的问题
60 |
61 | **v1.6.7** 2021年4月25日21:31:14
62 | 1. 淘宝人生加载过慢
63 | 2. 收藏店铺关键字更新为‘订阅+10’
64 |
65 | **v1.6.6** 2021年3月26日17:59:33
66 | 1. 解决消消乐升级后,手机back键无效问题(必须点击左上角图标- -)以及跳过指定界面
67 |
68 | **v1.6.5** 2021年3月16日20:11:36
69 | 1. 解决支付宝芭芭农场点击领取无效问题
70 | 2. 解决淘金币夺宝名称更改问题
71 |
72 | **v1.6.4** 2021年3月13日10:11:36
73 | 1. 解决逛好店领大量金币任务的关键字(关键字被添加了浏览10秒)被修改问题
74 | 2. 解决步数打开任务的关键字被修改的问题
75 | 3. 解决去天猫APP任务的子标题关键字被修改的问题
76 | 4. 解决喂小鸡任务的关键字被修改问题
77 |
78 | **v1.6.3** 2021年3月12日17:33:06
79 | 1. 取消店铺订阅,淘宝版本升级,我的主页中关注店铺修改为订阅店铺
80 | 2. 解决淘宝人生掷色子关键字更名问题和加载过慢问题
81 | 3. 淘宝成就签到关键字更名问题
82 |
83 | **v1.6.2** 2021年3月9日20:35:57
84 | 1. 解决芭芭农场淘宝人生装扮抽奖后无奖励问题
85 | 2. 解决支付宝芭芭农场任务不执行问题
86 |
87 | **v1.6.1** 2021年3月3日19:35:24
88 | 1. 添加[简单任务跳过关键字]配置,可跳过不想执行的简单浏览任务,比如刚出的“根据图片找商品同款”和“步数”打卡任务,目前内容为“商品同款”,多个可使用‘|’分割
89 | 2. 修改进入芭芭农场的进入方式为:我的淘宝->芭芭农场
90 |
91 | **v1.6.0** 2021年3月1日19:07:42
92 | 1. 添加芭芭农场内全任务(包括支付宝芭芭农场),可单独执行。关于芭芭农场升级0.01%的2种解决方法:方法1:在淘宝中执行任务后,关闭autojs,在支付宝中升级;方法2:在手机应用设置中清除淘宝的本地数据,重新登录后再升级 (推荐方法1)
93 | 2. 删除淘宝通知权限权限任务
94 | 3. 添加每月一次的[淘宝成就月账单]任务
95 |
96 |
97 | **v1.5.12** 2021年2月19日19:23:43
98 | 1. 新增[淘宝人生新春抽红包任务],解决该任务未执行导致淘宝签到任务无法出现问题
99 | 2. 解决薅羊毛充值金无法领取问题
100 | 3. 取消年货节任务
101 |
102 | **v1.5.11** 2021年2月12日21:34:22
103 | 1. 年货节添加任务[淘宝无门槛红包]和[淘宝人生]
104 | 2. 夺宝任务,[立即参与]按钮->[立即夺宝]
105 | 3. 步数打卡为修改为简单浏览任务
106 |
107 | **v1.5.10** 2021年2月1日21:35:28
108 | 1. 淘宝删除了“年货节浇灌福气”入口,解决无法进入该活动问题
109 |
110 | **v1.5.9** 2021年1月31日10:03:16
111 | 1. 解决农场合种“继续努力”弹窗问题
112 | 2. 淘金币夺宝“查看上一次奖励”无法返回问题(吐槽一下1次居然增加到200淘金币了)
113 |
114 | **v1.5.8** 2021年1月29日20:05:59
115 | 1. 更新[取消所有店铺关注]任务
116 | 2. 淘宝年货任务新增领取次日奖励,新增[浏览金币小镇任务]
117 | 3. 解决100金币夺宝任务"去“我的奖品”查看"弹窗问题
118 |
119 | **v1.5.7** 2021年1月26日19:02:03
120 | 1. 解决[活力步数兑换红包任务]点击免费领取失效问题
121 | 2. 解决[领话费充值金任务]卡住问题
122 |
123 | **v1.5.6** 2021年1月23日12:46:30
124 | 1. 解决新版支付宝蚂蚁森林界面更新问题
125 | 2. 修复年货节浇灌福气btn_col为空报错问题
126 |
127 | **v1.5.5** 2021年1月22日20:04:48
128 | 1. 解决消消乐返回界面调整为“暂时离开和集福气”而导致无法返回到主界面问题
129 | 2. 发布[taojinbiv1.5.5]apk版,支持在线秒检测并更新到最新版本
130 |
131 | **v1.5.4** 2021年1月21日11:54:11
132 | 1. 修复年货节浇灌福气运行错误问题,暂未发现升级才加0.02%的原因,实在不行请重装最新淘宝手动执吧
133 |
134 | **v1.5.3** 2021年1月20日20:46:10
135 | 1. 淘宝v9.0.0测试年货节浇灌福气任务
136 | 2. 新版年货节浇灌福气任务默认执行2次,解决漏掉新刷新的简单任务(不同的淘宝用户,特殊任务不一样)
137 |
138 | **v1.5.2** 2021年1月19日19:59:32
139 | 1. 修复掷骰子任务-弹窗礼包问题
140 | 2. [去年货节浇灌福气]界面布局更新,添加了[消消乐任务],非P30Pro手机建议单独执行[去年货节浇灌福气]全任务
141 |
142 | **v1.5.1** 2021年1月18日20:34:58
143 | 1. 解决[年货节浇灌福气]任务中"集福气"按钮的text变化问题
144 | 2. 恢复[加载配置]按钮,解决脚本最新配置和用户配置不匹配问题(用户自定义配置后,请和最新脚本进行比对后再加载,否则可能会导致新脚本一些功能因为旧的配置而无法使用)
145 |
146 | **v1.5.0** 2021年1月17日19:28:30
147 | 1. 更新UI界面,用户可以在主主界面选择执行选定的任务,在配置界面配置对应的任务关键字,用户可自行修改(**解决活动经常更换名称问题**)
148 | 2. 新增[年货节浇灌福气]任务,用户可在淘金币列表选择中勾选[年货节浇灌福气]任务进行执行,若未勾选[执行福气全部子任务],只会执行[年货节浇灌福气]的签到任务和施肥;用户也可单独执行该任务(在程序主界面下拉可见,单独执行默认运行全部子任务)
149 | 3. 添加[保存当前配置]按钮用于保存当前用户的选择项和关键字配置信息,下一次启动默认自动加载上传保存的配置信息
150 |
151 | **v1.4.2** 2021年1月14日19:19:03
152 | 1. 修复直播活动更新后无法返回问题
153 | 2. 延长点击关注店铺时长,解决网络卡顿导致关注不成功问题
154 | 3. 发布[淘金币v1.4.2]apk版,**请提前为程序开启无障碍服务和悬浮框权限**
155 | 4. 由于个人问题(年后换工作),以后将不定期维护该项目,望谅解
156 |
157 | **v1.4.1** 2021年1月12日19:46:43
158 | 1. 修复[淘金币夺宝任务]下注太快无奖励问题
159 | 2. 添加[保存选择项状态]按钮用于保存当前用户的任务选择状态
160 |
161 | **v1.4.0** 2021年1月11日20:30:34
162 | 1. 更新UI界面,所有特殊任务都在列表中可选择执行
163 | 2. 添加[淘金币夺宝任务],需花费100淘金币,做人还是需要点理想,说不定就中了呢
164 | 3. 新增[直接启动支付宝蚂蚁森林偷取好友能量]按钮,需提前添加蚂蚁森林到首页
165 | 4. 新增[取消所有关注的店铺]按钮用于取消所有关注的店铺,**慎用**
166 |
167 | **v1.3.11** 2021年1月10日09:36:43
168 | 1. 淘宝升级到v9.18.0
169 | 2. 修复淘宝新版本[天天红包赛]弹窗问题
170 |
171 | **v1.3.10** 2021年1月7日19:50:28
172 | 1. 修复[关注+10]单击问题,感谢Sirius2s的提醒
173 | 2. 发布[淘金币v1.3.10]apk版
174 |
175 | **v1.3.9** 2021年1月3日21:58:23
176 | 1. 删掉淘金币夺宝任务(下注才能获取能量),不知道你们中过没有,反正我全输光了- -
177 |
178 | **v1.3.8** 2020年12月29日19:42:37
179 | 1. 更新[淘金币夺宝任务]的关键字名称
180 |
181 | **v1.3.7** 2020年12月28日19:32:31
182 | 1. 应网友请求,添加[去天猫APP领红包任务]到任务选择栏中
183 |
184 | **v1.3.6** 2020年12月24日19:22:57
185 | 1. 解决消消乐完成消除回到主界面,出现[再玩一次]弹窗问题
186 | 2. 淘金币auto.js-v1.3.6全任务视频演示:https://www.bilibili.com/video/BV1Dt4y1k7xq/
187 |
188 | **v1.3.5** 2020年12月23日20:13:04
189 | 1. 解决[淘宝吃货任务]弹窗导致无法返回问题
190 | 2. 解决[消消乐任务]弹窗导致无法返回问题
191 | 3. 在[开启淘宝通知权限任务]中暂时关闭终端显示
192 | 4. 删除了活力中心脚本,有需要的可在[v1.3.4页面](https://github.com/JavisPeng/taojinbi/tree/v1.3.4)下载
193 | 5. 所有任务默认检查执行3次,每次执行后检查是否在淘金币列表界面,不在则跳转到该界面,防止back函数导致乱跳转问题
194 | 6. 发布[淘金币v1.3.5]apk版
195 |
196 | **v1.3.4** 2020年12月22日19:46:20
197 | 1. 淘金币新增[淘宝通知权限任务],开启后会再执行关闭 (默认在通知关闭下才有该任务,在华为机上测试通过)
198 | 2. 查找‘赚金币’按钮时间由3秒修改为8秒,兼容部分机型卡顿问题
199 | 3. 个人精力有限,今后只重点维护淘金币任务,因而把活力中心代码分离出来(huoli.js),后期不在维护该脚本,有需要的可在[v1.3.4页面](https://github.com/JavisPeng/taojinbi/tree/v1.3.4)下载
200 | 4. **至此淘宝币全任务在P30Pro上测试通过**,当然不包含特定时间刷的任务和下单任务
201 |
202 | **v1.3.3** 2020年12月21日19:50:31
203 | 1. 用户可在文件开头中定义,需跳过不执行的简单浏览任务主题关键字
204 | 2. 用户可在文件开头中定义[去天猫APP领红包任务]是否执行
205 | 3. 解决活力中心[1000步换红包任务]执行失败问题
206 | 4. 发布[淘金币v1.3.3]apk版
207 |
208 | **v1.3.2** 2020年12月20日11:44:35
209 | 1. 修复淘金币在任务列表中继续返回导致任务结束问题,
210 | 2. 淘宝人生掷色子任务中,添加了自动领取包裹和奖励,解决任务卡住问题
211 |
212 | **v1.3.1** 2020年12月19日13:18:57
213 | 1. 淘金币任务列表新增[100淘金币夺宝任务]
214 | 2. 解决活力中心训练时无法单击关闭按钮问题
215 |
216 | **v1.3.0** 2020年12月18日19:56:49
217 | 1. 应网友请求,附加**活力中心任务**(包括自动浏览任务和自动点击训练按钮),默认在淘金币完成后执行,若只执行活力中心任务,可在main函数注释掉taojinbi_task()这行
218 | 2. 整合特殊任务[逛直播间任务]到简单浏览任务中
219 |
220 | **v1.2.3** 2020年12月17日20:50:41
221 | 1. 消消乐和蚂蚁森林任务中暂时隐藏终端,对应任务结束后再显示 (不隐藏可能收取不到全部能量)
222 | 2. 发布[淘金币v1.2.3]apk版
223 |
224 | **v1.2.2** 2020年12月16日19:36:39
225 | 1. 新增蚂蚁森林任务,支持自定义'找能量'收取好友能量的次数
226 | 2. 解决'天猫领红包任务',取消了'继续逛逛'按钮问题
227 |
228 | **v1.2.1** 2020年12月14日19:57:06
229 | 1. 新增消消乐任务,需截图权限,目前在测试P30Pro上测试通过
230 | 2. 考虑到不同的机型,某些需截图权限的特殊任务可能会不兼容,启动时添加了可选的额外执行的任务: ['淘宝人生掷色子任务', '逛农场领免费水果任务', '消消乐任务']
231 | 3. 添加了APK发布版,用户可直接运行
232 |
233 | **v1.2.0** 2020年12月13日20:52:53
234 | 1. 简化代码删减了双12的部分
235 | 2. 对需要截图功能的[淘宝人生逛街领能量]和[逛农场领免费水果] 设置了是否执行的全局变量,用户可选择是否执行该任务
236 | 3. 任务执行等待时间设置为全局变量,默认为15秒
237 |
238 | **v1.1.4** 2020年12月12日21:04:28
239 | 1. 修复淘金币看直播任务,有时不能返回问题
240 |
241 | **v1.1.3** 2020年12月11日20:13:13
242 | 1. 修复天猫app没安装,等待过长问题
243 | 2. 修复特殊任务后,新出简单浏览任务遗漏问题
244 | 3. 无法修复'双12红包兑现红包太少问题'
245 |
246 | **v1.1.2** 2020年12月10日20:38:12
247 | 1. 解决淘金币执行过程中会返回到主页面问题(本质是按钮单击没有生效)
248 | 2. 把淘宝人生、逛好店任务、喂小鸡任务、逛直播间任务添加到特殊任务中
249 | 3. 解决芭芭农场双12任务后,淘金币没有肥料问题
250 |
251 | **v1.1.1** 2020年12月9日19:36:44
252 | 1. 修复逛新加任务不能获取问题
253 | 3. 某些任务(拍照识图)只在最新版淘宝中才存在,当前淘宝已换成最新版v9.16.0,经测试金币还是同样的奖励
254 |
255 | **v1.1.0** 2020年12月8日19:51:51
256 | 1. 代码基本重构,为适应不同机型,添加了截图查找功能(**需授予截图权限**)
257 | 2. 添加任务运行选择功能,可单独执行任务
258 |
259 | # 使用说明
260 | ## Auto.js中运行
261 | 1. 下载 [autojs4.1.1](https://share.weiyun.com/owu3tBNr)
262 | 2. 在电脑端下载taojinbi.js文件,使用电脑端qq或微信发给手机端
263 | 3. 导入js文件到autojs(可直接在微信/QQ/文件浏览中选择使用其他方式打开)
264 | 4. 在autojs中开启无障碍服务并点击运行导入的js文件
265 |
266 | auto.js视频运行教程:https://www.bilibili.com/video/BV1Dt4y1k7xq/
267 |
268 |
269 | ## 淘金币app运行
270 | 1. 在[release页面](https://github.com/JavisPeng/taojinbi/releases)下载taojinbi.apk并安装
271 | 2. 为淘金币开启无障碍服务和悬浮框权限(悬浮框权限在华为手机:设置->应用->应用功能->淘金币->显示在其他应用的上层->允许)
272 |
273 | 淘金币app视频运行教程:https://www.bilibili.com/video/BV1kp4y1q7CD/
274 |
275 |
276 | # 免责声明
277 | 为本人Auto.js学习交流的开源非营利项目,仅作为程序员之间相互学习交流之用,使用需严格遵守开源许可协议。严禁用于商业用途,禁止使用进行任何盈利活动。对一切非法使用所产生的后果,本人概不负责。
278 |
--------------------------------------------------------------------------------
/taojinbi.js:
--------------------------------------------------------------------------------
1 | "ui";
2 | auto() //开启无障碍服务 v1.7.3
3 |
4 | if (floaty && floaty.hasOwnProperty("checkPermission") && !floaty.checkPermission()) {
5 | floaty.requestPermission(); toast("请先开启悬浮窗权限再运行,否则无法显示提示"); exit()
6 | }
7 |
8 | //===================用户可编辑参数===================
9 | //所有任务重复次数,解决新增任务问题
10 | var MAX_ALL_TASK_EPOCH = 2
11 | //浏览任务最大执行次数
12 | var MAX_EPOCH = 101
13 | //任务执行默认等待的时长 考虑到网络卡顿问题 默认15秒
14 | var wait_sec = 15
15 | //序列化数据到本地
16 | var storage = storages.create("javis486");
17 | //线程执行其任务
18 | var thread = null
19 |
20 | //===================通用函数=========================
21 | //点击控件
22 | function btn_click(x) { if (x) return x.click() }
23 |
24 | //点击控件所在坐标
25 | function btn_position_click(x) { if (x) click(x.bounds().centerX(), x.bounds().centerY()) }
26 |
27 | //不断查找元素x的父元素,指定满足要求(解决模拟器和手机不查找元素不一致问题)
28 | function btn_assure_click(x) {
29 | if (x && x.clickable()) return x.click()
30 | for (let ii = 0; ii < 6; ii++) {
31 | if (!x) break
32 | x = x.parent()
33 | if (x && x.clickable()) return x.click()
34 | let list_x = x.children()
35 | for (let i = 0; i < list_x.length; i++) {
36 | if (list_x[i] && list_x[i].clickable()) {
37 | return list_x[i].click()
38 | }
39 | }
40 | }
41 | return false
42 | }
43 |
44 | //消息提示
45 | function toast_console(msg, tshow) {
46 | console.log(msg);
47 | if (tshow) toast(msg);
48 | }
49 |
50 | // 截屏查找图片颜色并单击对应的点
51 | function cs_click(num, rgb, xr, yr, wr, hr, flipup) {
52 | while (num--) {
53 | let img = captureScreen()
54 | if (flipup != undefined) img = images.rotate(img, 180)
55 | let point = findColor(img, rgb, { region: [img.getWidth() * xr, img.getHeight() * yr, img.getWidth() * wr, img.getHeight() * hr], threshold: 8 })
56 | if (point) {
57 | if (flipup != undefined) {
58 | point.x = img.getWidth() - point.x; point.y = img.getHeight() - point.y
59 | }
60 | return click(point.x, point.y);
61 | }
62 | if (num) sleep(1000)
63 | }
64 | return false
65 | }
66 |
67 | //===================业务逻辑函数=========================
68 | //获取[浏览以下商品]的所在组控件数
69 | function get_group_count() {
70 | let x = textContains('浏览以下商品').findOne(5)
71 | if (x) return x.parent().childCount()
72 | return 0
73 | }
74 |
75 | //等待sec秒,有完成提示后立即返回
76 | function wait(sec, title) {
77 | let t_sec = sec
78 | let pre_num = 0 //[浏览以下商品]的所在组控件数有时会变化
79 | let reg = new RegExp(input_value(ui.txt_simple_down_reg_str))
80 | slide_down = title && reg.test(title)
81 | while (sec--) {
82 | let a1 = textMatches('点我领取奖励|任务已完成快去领奖吧|任务完成|任务已完成|任务已经|任务已经全部完成啦').findOne(10)
83 | let cur_num = get_group_count()
84 | let a10 = pre_num > 0 && cur_num != pre_num; pre_num = cur_num
85 | let a = descMatches('任务完成|快去领奖吧').findOne(1000)
86 | if (a1 || a10 || a) {
87 | toast_console('到时立即返回')
88 | return true
89 | }
90 | if (!slide_down) slide_down = textContains('下滑').findOne(200)
91 | if (sec <= t_sec - 2 && slide_down) {
92 | swipe(device.width * 0.5, device.height * 0.75, device.width * 0.5, device.height * 0.5, 800)
93 | }
94 | if (title && title.indexOf('喂小鸡') > -1) break
95 | }
96 | toast_console('等待' + t_sec + 's返回');
97 | return true
98 | }
99 |
100 | //根据正则表达式获取任务
101 | function get_task(key_reg_str, skip_reg) {
102 | sleep(500); textMatches('每日来访领能量.+|累计任务奖励|x500').findOne(3000);
103 | let list_x = textMatches(input_value(ui.txt_btn_reg_str)).find()
104 | let reg = new RegExp(key_reg_str)
105 | for (let i = 0; i < list_x.length; i++) {
106 | let btn_topic = list_x[i].parent().child(0).child(0) //主题
107 | if (!btn_topic) continue
108 | let btn_desc = list_x[i].parent().child(0).child(1).child(0) //描述
109 | if (!btn_desc) continue
110 | let txt_desc = btn_desc.text()
111 | let txt_topic = btn_topic.text()
112 | if (skip_reg != undefined && skip_reg.test(txt_topic)) continue
113 | if (reg.test(txt_desc) || reg.test(txt_topic)) {
114 | toast_console(txt_topic)
115 | let obj = new Object(); obj.x = list_x[i]; obj.txt = txt_topic;
116 | return obj
117 | }
118 | }
119 | return null
120 | }
121 |
122 | //淘金币获取奖励
123 | function get_rewards(reward) {
124 | if (reward) {
125 | sleep(500); btn_click(text('领取奖励').findOne(1000)); sleep(3000) //等待调整布局
126 | }
127 | }
128 |
129 | //确保任务按钮被单击,解决单击时布局发生改变的问题
130 | function assure_click_task(name) {
131 | let obj = null
132 | for (let i = 0; i < 3; i++) {
133 | obj = get_task(name)
134 | if (!obj) return false
135 | if (obj.x) break
136 | }
137 | if (!obj.x) {
138 | toast_console('无法找到[' + name + '任务],请确保其在未完成任务列表中'); return false
139 | }
140 | obj.x.click();
141 | return true
142 | }
143 |
144 | //保证返回到任务界面
145 | function assure_back(tag) {
146 | let num = 8
147 | while (num-- && !text(tag).findOne(1000)) {
148 | back()
149 | btn_click(textMatches("残忍离开|立即领取").findOne(200))
150 | }
151 | }
152 |
153 | //淘宝人生套装任务
154 | function suit_task() {
155 | toast_console('查看-淘宝人生套装任务')
156 | if (!assure_click_task('套装')) return
157 | sleep(5000); cs_click(6, '#fed362', 0.2, 0.05, 0.7, 0.4, true) //领取套装
158 | sleep(5000); assure_back('x500')
159 | }
160 |
161 | function do_baba_farm(all_task) {
162 | //金色获取肥料按钮
163 | btn_click(text('继续努力').findOne(1000))
164 | if (btn_click(text('立即领取').findOne(1000))) {
165 | btn_assure_click(text('肥料礼包').findOne(1000))
166 | btn_click(text('开心收下').findOne(1000))
167 | btn_click(text('去施肥').findOne(1000))
168 | }
169 | cs_click(6, '#fed362', 0.5, 0.45, 0.45, 0.25) //领取肥料
170 | sleep(500); btn_position_click(text('去施肥,赚更多肥料').findOne(1000)); sleep(500)
171 | //签到列表领肥料
172 | if (cs_click(3, '#9dbe77', 0.66, 0.66, 0.25, 0.25)) {
173 | console.log('打开签到列表领肥料'); sleep(1000)
174 | btn_click(text('去签到').findOne(1000)); btn_click(text('去领取').findOne(1000)); sleep(2000)
175 | if (all_task) {
176 | do_simple_task(16, 16, '浏览', 'x500', false)
177 | if (ui.ck_baba_suit_task.checked) {
178 | suit_task()
179 | }
180 | if (ui.ck_baba_xxl_task.checked) {
181 | xiaoxiaole_task()
182 | }
183 | if (ui.ck_baba_zhifubao_task.checked) {
184 | zhifubao_baba_farm_task()
185 | }
186 | }
187 | btn_click(text('去领取').findOne(1000))
188 | btn_click(text('关闭').findOne(1000)); sleep(1000)
189 | if (all_task && ui.ck_baba_friend_forest_task.checked) {
190 | friend_forest_task()
191 | }
192 | }
193 | }
194 |
195 | //芭芭农场任务
196 | function baba_farm_task() {
197 | toast_console('查看-芭芭农场任务')
198 | if (!assure_click_task(input_value(ui.txt_baba_farm_task_reg_str))) return
199 | sleep(6000)
200 | do_baba_farm()
201 | cs_click(3, '#fff39f', 0.45, 0.6, 0.25, 0.35) //金色施肥按钮
202 | sleep(500); assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
203 | }
204 |
205 | //淘宝成就签到
206 | function achievement_signin_task() {
207 | toast_console('查看-淘宝成就签到任务')
208 | if (!assure_click_task(input_value(ui.txt_achievement_task_reg_str))) return
209 | btn_click(text("成就礼包").findOne(3000))
210 | btn_click(text("我收下了").findOne(1000))
211 | let btn_x = text('成就签到').findOne(2000)
212 | if (btn_x) {
213 | btn_x.parent().child(3).click()
214 | }
215 | btn_click(text("我收下了").findOne(1000))
216 | sleep(1000); assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
217 | }
218 |
219 | //淘宝成就月账单任务
220 | function achievement_month_task() {
221 | toast_console('查看-淘宝成就月账单任务')
222 | if (!assure_click_task(input_value(ui.txt_achievement_month_reg_str))) return
223 | btn_assure_click(text('月度账单').findOne(3000)); sleep(2000)
224 | assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
225 |
226 | }
227 |
228 | //喂小鸡任务,可以直接返回
229 | function feed_chick_task() {
230 | toast_console('查看-蚂蚁庄园喂小鸡任务')
231 | if (!assure_click_task(input_value(ui.txt_feedchick_task_reg_str))) return
232 | sleep(1000); btn_click(text('取消').findOne(2000));
233 | assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
234 | }
235 |
236 | //蚂蚁森林偷取能量
237 | function steal_energy(num_find) {
238 | let num = 5
239 | while (num-- && !textMatches('.+动态').findOne(1000)) sleep(500);
240 | if (textMatches('.+动态').findOne(500)) {
241 | let point = null; num = 5
242 | while (num--) {
243 | let img = captureScreen();
244 | point = findColor(img, '#ff6e01', { region: [img.getWidth() * 0.7, img.getHeight() * 0.6, img.getWidth() * 0.25, img.getHeight() * 0.25], threshold: 8 })
245 | if (point) break
246 | sleep(1000)
247 | }
248 | if (!point) {
249 | toast('找能量按钮去哪了?'); exit()
250 | }
251 | for (let i = 1; i <= num_find; i++) {
252 | for (let j = 0; j < 12; j++) {
253 | if (!cs_click(1, '#b6ff00', 0.1, 0.2, 0.8, 0.4)) break
254 | sleep(400)
255 | }
256 | if (num_find == 1) return
257 | click(point.x, point.y); sleep(1500)
258 | if (!textMatches('.+动态').findOne(1000)) break
259 | toast('找能量/' + i)
260 | }
261 | }
262 | toast('找能量执行完毕')
263 | }
264 |
265 | //蚂蚁森林任务
266 | function ant_forest_task(num, back_reg) {
267 | toast_console('查看-蚂蚁森林任务')
268 | if (!assure_click_task(input_value(ui.txt_antforest_reg_str))) return
269 | btn_click(text('打开').findOne(1000))
270 | sleep(2000); console.hide(); steal_energy(num); console.show()
271 | assure_back(back_reg); get_rewards(true)
272 | }
273 |
274 | //逛好店领10金币
275 | function browse_goodshop_task(not_key_reg_str) {
276 | toast_console('查看-逛好店并领10金币任务')
277 | if (!assure_click_task(input_value(ui.txt_browse_goog_shop_reg_str))) return
278 | for (let i = 0; i < 11 && ui.ck_earn_10coin.checked; i++) {
279 | let btn_x = desc('逛10秒+10').findOne(2000)
280 | toast_console('逛10秒+10金币/' + (i + 1))
281 | if (!btn_x) break
282 | btn_x.parent().click(); sleep(13000);
283 | if (ui.ck_pat_shop.checked) {
284 | btn_x = textContains('+10').findOne(800)
285 | if (btn_x) {
286 | btn_click(btn_x.parent()); sleep(800)
287 | }
288 | }
289 | back(); sleep(800);
290 | }
291 | wait(wait_sec); assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
292 | }
293 |
294 | //去天猫红包任务
295 | function tianmao_task() {
296 | toast_console('查看-去天猫APP领红包任务')
297 | if (!assure_click_task(input_value(ui.txt_tianmao_task_reg_str))) return
298 | sleep(4000)
299 |
300 | if (text('打开手机天猫APP').findOne(1500)) {
301 | back(); sleep(1500); back(); wait(wait_sec)
302 | }
303 | else if (text('攻略').findOne(4000)) {
304 | btn_click(textContains('继续逛逛').findOne(1000))
305 | wait(wait_sec)
306 | }
307 | assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
308 | }
309 |
310 | //淘宝人生掷骰子任务
311 | function dice_task() {
312 | toast_console('查看-淘宝人生掷骰子任务')
313 | if (!assure_click_task(input_value(ui.txt_dice_task_reg_str))) return
314 | console.hide(); sleep(11000);
315 | //去他大爷的神秘礼物
316 | toast_console('掷骰子任务-查看是否有神秘礼物(QTM的神秘礼盒)', true)
317 | cs_click(3, '#fe5200', 0.2, 0.5, 0.3, 0.2);
318 | //单击礼包
319 | toast_console('掷骰子任务-查看是否有礼包(QTM的礼包)', true)
320 | cs_click(3, '#fee998', 0.2, 0.2, 0.7, 0.8);
321 | //橙色收下奖励按钮按钮
322 | toast_console('掷骰子任务-点击5次开心收下按钮(一点都不开心- -)', true)
323 | for (let i = 0; i < 5; i++) {
324 | cs_click(1, '#ff7d44', 0.1, 0.15, 0.2, 0.5, true); sleep(500)
325 | }
326 | sleep(1000)
327 | //金色前进按钮
328 | toast_console('掷骰子任务-尝试点击色子前进', true);
329 | cs_click(5, '#fff89d', 0.3, 0.5, 0.3, 0.2); sleep(2000)
330 | //橙色收下奖励按钮按钮
331 | cs_click(2, '#ff7d44', 0.1, 0.15, 0.2, 0.5, true);
332 | toast_console('返回');
333 | back(); sleep(1000)
334 | //橙色返回淘宝按钮
335 | cs_click(3, '#ff7d44', 0.1, 0.15, 0.2, 0.5, true)
336 | btn_click(text('立刻离开').findOne(1000)); get_rewards(true); console.show()
337 | }
338 |
339 | //618喵币活动
340 | function miaomiao618_tak() {
341 | toast_console('查看-618喵币任务')
342 | if (!assure_click_task("喂猫")) return
343 | sleep(1000)
344 | btn_click(textContains('自生产猫币').findOne(2000))
345 | let btn = textContains('喂猫领红包').findOne(2000)
346 | btn_click(btn); sleep(2000)
347 | assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
348 | }
349 |
350 | //阅读小说
351 | function reading_task() {
352 | toast_console('查看-阅读小说任务')
353 | if (!assure_click_task("阅读任意小说")) return
354 | sleep(1000)
355 | let btn_x = text('5').findOne(3000)
356 | if (btn_x) {
357 | btn_position_click(btn_x); sleep(1000)
358 | btn_x = textContains('进入阅读页').findOne(2000)
359 | if (btn_x) {
360 | btn_position_click(btn_x);
361 | wait(12)
362 | assure_back(input_value(ui.txt_task_list_ui_reg)); get_rewards(true)
363 | }
364 | }
365 | }
366 |
367 |
368 | //消消乐任务
369 | function xiaoxiaole_task() {
370 | toast_console('查看-消消乐任务')
371 | if (!assure_click_task(input_value(ui.txt_xiaoxiaole_task_reg_str))) return
372 | console.hide(); sleep(10000)
373 | cs_click(3, '#11c6bf', 0.2, 0.6, 0.3, 0.3); //开心收下奖励
374 | cs_click(3, '#ffffff', 0.8, 0.05, 0.2, 0.2) //跳过
375 | sleep(2000)
376 | //回到主页
377 | for (let i = 0; i < 6; i++) {
378 | cs_click(1, '#8d5546', 0, 0, 0.1, 0.1); sleep(1000) //back();
379 | if (cs_click(1, '#ffbd29', 0.2, 0.5, 0.45, 0.45)) break //橙色返回
380 | if (cs_click(1, '#965417', 0.2, 0.2, 0.6, 0.6, true)) break //咖啡色暂时返回
381 | }
382 | toast("回到主页了么,您?");
383 | sleep(3000) //过渡动画
384 | //邮件领取 pass
385 | cs_click(3, '#ffffff', 0.65, 0.15, 0.3, 0.5); sleep(500)
386 | //滑到屏幕下方
387 | for (let i = 0; i < 8; i++)swipe(device.width / 2, device.height / 2, device.width / 2, device.height / 5, 500)
388 | //点击第一关 绿色圆圈
389 | sleep(1000); cs_click(3, '#63cbc4', 0.5, 0.3, 0.4, 0.4, true); sleep(2000)
390 | //开始 绿色方块
391 | cs_click(2, '#11c6bf', 0.3, 0.5, 0.3, 0.3); sleep(2000)
392 | cs_click(3, '#ffffff', 0.8, 0.05, 0.2, 0.2) //跳过
393 | sleep(2000)
394 | //消除方块,兼容不同机型
395 | let rgb = '#fff0e0'
396 | img = captureScreen()
397 | let point1 = findColor(img, rgb, { region: [img.getWidth() * 0.2, img.getHeight() * 0.3, img.getWidth() * 0.4, img.getHeight() * 0.4], threshold: 4 })
398 | img = images.rotate(img, 180)
399 | let point2 = findColor(img, rgb, { region: [img.getWidth() * 0.2, img.getHeight() * 0.3, img.getWidth() * 0.4, img.getHeight() * 0.4], threshold: 4 })
400 | if (point1 && point2) {
401 | let box_x = (img.getWidth() - point2.x - point1.x) / 5
402 | let box_y = (img.getHeight() - point2.y - point1.y) / 6
403 | list_xy = [[0, 1, 0, 2], [0, 5, 0, 4], [2, 2, 3, 2]]
404 | list_xy.forEach(xy => {
405 | x1 = (xy[0] + 0.5) * box_x + point1.x; x2 = (xy[2] + 0.5) * box_x + point1.x
406 | y1 = (xy[1] + 0.5) * box_y + point1.y; y2 = (xy[3] + 0.5) * box_y + point1.y
407 | swipe(x1, y1, x2, y2, 600); sleep(800)
408 | });
409 | }
410 | cs_click(2, '#8d5546', 0, 0, 0.1, 0.1); //back()
411 | sleep(1000);
412 | //回到主页1 灰色的暂时离开
413 | cs_click(2, '#9d6031', 0.2, 0.2, 0.4, 0.5, true)
414 | //回到主页2 金色的回到主页
415 | cs_click(2, '#ffbd29', 0.2, 0.5, 0.45, 0.45); sleep(2000);
416 | //再挑战?
417 | cs_click(5, '#ffffff', 0.6, 0.15, 0.35, 0.5); sleep(800)
418 | //返回淘宝按钮
419 | back(); sleep(1000);
420 | cs_click(3, '#ff6e09', 0.2, 0.2, 0.4, 0.4, true);
421 | console.show(); get_rewards(true)
422 | }
423 |
424 | //淘金币夺宝任务,需花费100淘金币
425 | function duobao_task(back_reg) {
426 | toast_console('查看-100淘金币夺宝任务')
427 | if (!assure_click_task(input_value(ui.txt_doubao_task_reg_str))) return
428 | if (btn_assure_click(text('去“我的奖品”查看').findOne(3000))) {
429 | swipe(device.width / 2, device.height * 0.8, device.width / 2, device.height * 0.2, 500)
430 | }
431 | btn_assure_click(textMatches('立即参与|立即夺宝').findOne(3000))
432 | btn_click(text('参与兑换抽奖号').findOne(2000))
433 | sleep(1500)
434 | let num = 5
435 | let btn_x = textStartsWith('消耗').findOne(1000)
436 | while (num-- && btn_x) //{btn_click(text('-').findOne(1000))
437 | click(btn_x.bounds().centerX() - btn_x.bounds().width(), btn_x.bounds().centerY())
438 | btn_click(text('淘金币兑换').findOne(1000)); sleep(200)
439 | btn_click(text('确认兑换').findOne(1000)); sleep(200)
440 | btn_click(text('我知道了').findOne(1000)); sleep(1000)
441 | back(); sleep(800); back(); sleep(800); back(); sleep(800); cs_click(4, '#ff7d44', 0.1, 0.2, 0.5, 0.5, true)
442 | get_rewards(true)
443 | }
444 |
445 | //执行简单的浏览任务
446 | function do_simple_task(epoch, sec, reg_str, back_reg, reward) {
447 | toast_console('查看-可执行的简单浏览任务')
448 | skip_reg = new RegExp(input_value(ui.txt_simple_skip_reg_str))
449 | for (let i = 0; i < epoch; i++) {
450 | let obj = get_task(reg_str, skip_reg)
451 | if (!obj) {
452 | console.log('简单浏览任务执行完毕'); break
453 | }
454 | if (!obj.x) {
455 | console.log('继续执行简单浏览任务'); continue
456 | }
457 | obj.x.click();
458 | wait(sec, obj.txt)
459 | let num = 8
460 | while (num-- && !text(back_reg).findOne(1000)) {
461 | if (obj.txt.indexOf('充值金') > -1) {
462 | btn_click(text('O1CN01NN8T8d1tBlBM5R7qG_!!6000000005864-1-tps-100-100').findOne(1000))
463 | sleep(500); btn_click(text('立即领取').findOne(1000)); sleep(500);
464 | }
465 | back(); btn_position_click(desc('继续退出').findOne(400))
466 | btn_click(textMatches('残忍离开|回到淘宝').findOne(400))
467 | //if (obj.txt.indexOf('淘宝吃货') > -1) cs_click(1, '#ff4c55', 0.2, 0.2, 0.4, 0.4, true)
468 | }
469 | get_rewards(reward)
470 | }
471 | }
472 |
473 |
474 | //进入到淘金币列表界面
475 | function enter_taojinbi_task_list() {
476 | let task_list_ui_reg = input_value(ui.txt_task_list_ui_reg)
477 | if (!text(task_list_ui_reg).findOne(2000)) {
478 | let num = 8
479 | while (num-- && !desc('领淘金币').findOne(1000)) back();
480 | let btn_x = desc('领淘金币').findOne(500)
481 | if (!btn_x) {
482 | toast_console('请手动回到我的淘宝主界面后重新运行'); exit()
483 | }
484 | btn_x.click(); toast_console('进入到淘金币主界面..'); sleep(2000)
485 | for (let i = 0; i < 6; i++) {
486 | btn_click(text('签到领金币').findOne(1000)); btn_click(text('领取奖励').findOne(1000))
487 | btn_x = text('赚金币').findOne(1000)
488 | if (btn_x) break
489 | }
490 | if (!btn_x) {
491 | toast_console('无法找到[赚金币]按钮,请重新运行程序'); exit()
492 | }
493 | btn_x.click()
494 | }
495 | toast_console('进入到淘金币列表界面..'); textMatches('每日来访领能量.+').findOne(6000);
496 | // app.startActivity({
497 | // packageName: "com.taobao.taobao",
498 | // data: 'taobao://pages.tmall.com/wow/z/tmtjb/town/task'
499 | // });
500 | }
501 |
502 | //红包签到
503 | function do_envelope_signin() {
504 | btn_click(desc('我的淘宝').findOne(2000)); sleep(1000)
505 | let btn = text('红包签到').findOne(1000)
506 | if (btn) {
507 | btn_position_click(btn); sleep(3000); back()
508 | }
509 | }
510 |
511 | function taojinbi_task() {
512 | let simple_task_reg_str = input_value(ui.txt_simple_task_reg_str)
513 | let task_list_ui_reg = input_value(ui.txt_task_list_ui_reg)
514 | for (let i = 0; i < MAX_ALL_TASK_EPOCH; i++) {
515 | toast_console("#第" + (i + 1) + "次执行全任务")
516 | app.launch('com.taobao.taobao'); sleep(1500) //启动淘宝
517 | if (ui.ck_envelope_task.checked) {
518 | do_envelope_signin()
519 | }
520 | enter_taojinbi_task_list()
521 | if (ui.ck_simple_task.checked) {
522 | do_simple_task(MAX_EPOCH, wait_sec, simple_task_reg_str, task_list_ui_reg, true)
523 | }
524 | if (ui.ck_618_task.checked) {
525 | miaomiao618_tak()
526 | }
527 | if (ui.ck_reading_task.checked) {
528 | reading_task()
529 | }
530 | if (ui.ck_dice_task.checked) {
531 | dice_task()
532 | }
533 | if (ui.ck_baba_farm_task.checked) {
534 | baba_farm_task()
535 | }
536 | if (ui.ck_antforest.checked) {
537 | ant_forest_task(8, input_value(ui.txt_task_list_ui_reg))
538 | }
539 | if (ui.ck_browse_goog_shop.checked) {
540 | browse_goodshop_task();
541 | }
542 | if (ui.ck_achievement_month_task.checked) {
543 | achievement_month_task()
544 | }
545 | if (ui.ck_achievement_task.checked) {
546 | achievement_signin_task()
547 | }
548 | if (ui.ck_doubao_task.checked) {
549 | duobao_task(task_list_ui_reg)
550 | }
551 | if (ui.ck_tianmao_task.checked) {
552 | tianmao_task()
553 | }
554 | if (ui.ck_xiaoxiaole_task.checked) {
555 | xiaoxiaole_task()
556 | }
557 | get_rewards(true)
558 | }
559 | toast_console('*****淘金任务执行完毕*****')
560 | }
561 |
562 | function main() {
563 | requestScreenCapture(false);
564 | console.show();
565 | console.log("淘金币" + storage.get('taojinbi_version', '') + " 本APP完全免费,作者:Javis486,github下载地址:https://github.com/JavisPeng/taojinbi")
566 | taojinbi_task();
567 | toast_console('###***全部任务执行完毕***###')
568 | }
569 |
570 |
571 | //获取选择框列表
572 | function get_check_box_list() {
573 | return [ui.ck_envelope_task, ui.ck_simple_task, ui.ck_dice_task, ui.ck_baba_farm_task, ui.ck_antforest, ui.ck_tianmao_task,
574 | ui.ck_achievement_task, ui.ck_browse_goog_shop, ui.ck_earn_10coin, ui.ck_pat_shop,
575 | ui.ck_doubao_task, ui.ck_xiaoxiaole_task, ui.ck_achievement_month_task,
576 | ui.ck_baba_suit_task, ui.ck_baba_xxl_task, ui.ck_baba_zhifubao_task, ui.ck_baba_friend_forest_task, ui.ck_618_task, ui.ck_reading_task
577 | ];
578 | }
579 |
580 | //获取输入框列表
581 | function get_input_list() {
582 | return [ui.txt_btn_reg_str, ui.txt_task_list_ui_reg, ui.txt_simple_task_reg_str, ui.txt_feedchick_task_reg_str, ui.txt_browse_goog_shop_reg_str,
583 | ui.txt_baba_farm_task_reg_str, ui.txt_dice_task_reg_str, ui.txt_doubao_task_reg_str, ui.txt_achievement_task_reg_str, ui.txt_simple_down_reg_str,
584 | ui.txt_antforest_reg_str, ui.txt_tianmao_task_reg_str, ui.txt_xiaoxiaole_task_reg_str, ui.txt_achievement_month_reg_str, ui.txt_simple_skip_reg_str
585 | ];
586 | }
587 |
588 |
589 | function input_value(x) {
590 | return String(x.getText())
591 | }
592 |
593 | //保存选项
594 | function save_opt() {
595 | let list_ck = get_check_box_list().map(x => x.checked)
596 | let list_txt = get_input_list().map(x => input_value(x))
597 | storage.put("list_ck", list_ck)
598 | storage.put("list_txt", list_txt)
599 | toast_console('选项保存成功', true);
600 | }
601 |
602 | //加载选择项状态
603 | function load_opt() {
604 | let list_ck_v = storage.get("list_ck", null)
605 | let list_txt_v = storage.get("list_txt", null)
606 | if (list_ck_v) {
607 | let list_ck = get_check_box_list();
608 | for (let i = 0; i < list_ck_v.length; i++) {
609 | list_ck[i].checked = list_ck_v[i];
610 | }
611 | }
612 | if (list_txt_v) {
613 | let list_txt = get_input_list();
614 | for (let i = 0; i < list_txt_v.length; i++) {
615 | list_txt[i].setText(list_txt_v[i]);
616 | }
617 | }
618 | }
619 |
620 | //选择项开关
621 | function task_toggle() {
622 | list_ck = get_check_box_list();
623 | list_ck.forEach(x => {
624 | x.checked = !x.checked;
625 | })
626 | }
627 |
628 | //直接启动支付宝蚂蚁森林偷取好友能量,需添加蚂蚁森林到首页
629 | function zfb_antforest() {
630 | if (thread && thread.isAlive()) {
631 | toast_console('当前程序正在执行其他任务,请结束后再运行', true); return
632 | }
633 | thread = threads.start(function () {
634 | requestScreenCapture(false);
635 | app.launch('com.eg.android.AlipayGphone'); sleep(2000)
636 | let btn_ant = textContains('蚂蚁森林').findOne(5000)
637 | if (!btn_ant) {
638 | toast_console('无法找到蚂蚁森林,请先添加到支付宝首页', true); return
639 | }
640 | btn_position_click(btn_ant)
641 | steal_energy(64);
642 | });
643 | }
644 |
645 | //单独执行芭芭农场全任务
646 | function solo_baba_farm() {
647 | if (thread && thread.isAlive()) {
648 | toast_console('当前程序正在执行其他任务,请结束后再运行', true); return
649 | }
650 | thread = threads.start(function () {
651 | requestScreenCapture(false);
652 | app.launch('com.taobao.taobao');
653 | if (!text('亲密度').findOne(1000)) {
654 | btn_assure_click(desc('我的淘宝').findOne(3000))
655 | let btn_x = desc('芭芭农场').findOne(3000)
656 | if (!btn_x) {
657 | toast_console('无法进入芭芭农场主界面,请手动回到淘宝主界面后重新运行'); exit()
658 | }
659 | btn_x.click(); toast_console('进入芭芭农场主界面..');
660 | sleep(6000)
661 | btn_click(text('立即去收').findOne(2000))
662 | if (text('兑换').findOne(3000)) {
663 | cs_click(2, '#984f2e', 0.05, 0.2, 0.1, 0.3); sleep(6000)
664 | }
665 | }
666 | console.show()
667 | do_baba_farm(true)
668 | toast_console('**芭芭农场任务完成**');
669 | });
670 | }
671 |
672 | //支付宝芭芭农场
673 | function zhifubao_baba_farm_task() {
674 | toast_console('查看-支付宝芭芭农场任务')
675 | if (!assure_click_task('支付宝芭芭农场')) return
676 | //btn_position_click(textContains('支付宝芭芭农场').findOne(1000))
677 | toast_console('等待农场主界面出现');
678 | btn_click(text('继续赚肥料').findOne(7000)); sleep(2000)
679 | toast_console('领取肥料');
680 | cs_click(4, '#fed362', 0.55, 0.65, 0.45, 0.15); sleep(1500); //领取肥料
681 | btn_click(text('去施肥').findOne(1000)); sleep(500)
682 | if (cs_click(2, '#fed362', 0.1, 0.2, 0.1, 0.2, true)) { //打开列表
683 | toast_console('开始领取'); sleep(1500)
684 | for (let i = 0; i < 4; i++) {
685 | btn_click(text('领取').findOne(500)); sleep(500)
686 | }
687 | let btn_water = textContains('浇水').findOne(1000)//蚂蚁森林任务
688 | if (btn_water) {
689 | click(btn_water.bounds().right + 10, btn_water.bounds().top)
690 | console.hide(); steal_energy(1, true); assure_back('队伍设置'); console.show()
691 | sleep(1000); btn_click(text('领取').findOne(1000));
692 | }
693 | if (btn_click(text('去逛逛').findOne(1000))) {
694 | sleep(4000); btn_click(textContains('继续赚').findOne(5000)); return
695 | }
696 | }
697 | assure_back('x500')
698 | }
699 |
700 | //芭芭农场中的好友林
701 | function friend_forest_task() {
702 | toast_console('前往芭芭农场中的好友林'); sleep(3000)
703 | btn_click(textContains('我知道啦').findOne(3500))
704 | console.hide()
705 | cs_click(3, '#fed362', 0.01, 0.5, 0.2, 0.3); sleep(2000)// 打开好友林
706 | if (cs_click(3, '#b63223', 0.4, 0.1, 0.2, 0.3)) { //中心领取
707 | btn_click(textMatches('继续加油|开心收下').findOne(1000))
708 | }
709 | //收取肥料
710 | let fu = images.fromBase64('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAAOABEDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAMCBQb/xAAcEAACAwEBAQEAAAAAAAAAAAABAgADERITIQT/xAAXAQADAQAAAAAAAAAAAAAAAAAAAwQF/8QAGBEBAQADAAAAAAAAAAAAAAAAAAECERL/2gAMAwEAAhEDEQA/ALHn1f8AQQzau59khWE8LFZtY/RsQz2e1qVkAEndjK1ue2hWZeUOiZ8TY3dabmEX0YQP5f/Z')
711 | for (let i = 0; i < 8; i++) {
712 | let img = captureScreen()
713 | var point = findImage(img, fu, { region: [0.1 * device.width, 0.3 * device.height], threshold: 0.9 });
714 | if (point) {
715 | click(point.x, point.y); sleep(1000)
716 | }
717 | }
718 | if (btn_click(text('点我领肥料').findOne(1000))) {
719 | btn_click(text('立即去浇灌').findOne(1000)); console.show(); sleep(4000); return
720 | }
721 | if (btn_click(text('立即领取').findOne(1000))) {
722 | btn_click(text('开心收下').findOne(1000))
723 | }
724 | console.show(); back()
725 | }
726 |
727 | //取消关注的店铺
728 | function cancel_pat_shop() {
729 | if (thread && thread.isAlive()) {
730 | toast_console('当前程序正在执行其他任务,请结束后再运行', true); return
731 | }
732 | thread = threads.start(function () {
733 | app.launch('com.taobao.taobao');
734 | toast('单击我的淘宝'); btn_assure_click(desc('我的淘宝').findOne(6000))
735 | toast('点击关注店铺'); btn_assure_click(desc('订阅店铺').findOne(2000)); sleep(1000)
736 | btn_assure_click(desc('全部').findOne(2000));
737 | for (let i = 0; i < MAX_EPOCH; i++) {
738 | let list_x = className("ImageView").find()
739 | for (let i = 0; i < list_x.length; i++) {
740 | let btn_x = list_x[i]
741 | let h = btn_x.bounds().bottom - btn_x.bounds().top
742 | if (h < 10) { //hight较小的控件
743 | if (btn_x && btn_x.parent()) {
744 | btn_x.parent().click(); sleep(500)
745 | let bnt_cancel = desc('取消订阅').findOne(1000)
746 | if (bnt_cancel) {
747 | btn_click(bnt_cancel.parent()); sleep(500)
748 | }
749 | }
750 | }
751 | }
752 | }
753 | })
754 | }
755 |
756 |
757 | ui.layout(
758 |
759 |
760 |
761 |
762 |
763 |
764 |
828 |
829 |
830 | );
831 |
832 |
833 | //创建选项菜单(右上角)
834 | ui.emitter.on("create_options_menu", menu => {
835 | menu.add("关于");
836 | });
837 |
838 | //监听选项菜单点击
839 | ui.emitter.on("options_item_selected", (e, item) => {
840 | switch (item.getTitle()) {
841 | case "关于":
842 | alert("关于", "淘金币" + storage.get('taojinbi_version', '') + " 本APP完全免费,作者:Javis486,github下载地址:https://github.com/JavisPeng/taojinbi");
843 | break;
844 | }
845 | e.consumed = true;
846 | });
847 | activity.setSupportActionBar(ui.toolbar);
848 |
849 | //设置滑动页面的标题
850 | ui.viewpager.setTitles(["淘金币", '芭芭农场', "参数配置"]);
851 | //让滑动页面和标签栏联动
852 | ui.tabs.setupWithViewPager(ui.viewpager);
853 | //按钮单击事件
854 | ui.btn_toogle.click(task_toggle)
855 | ui.btn_save_opt.click(save_opt)
856 | ui.btn_antforest.click(zfb_antforest)
857 | ui.btn_cancel_pat_shop.click(cancel_pat_shop)
858 | ui.btn_exit.click(function () { ui.finish() })
859 | ui.btn_babafarm.click(solo_baba_farm)
860 |
861 | load_opt() //加载保存配置
862 |
863 | //运行选择项
864 | ui.btn_run_main.click(function () {
865 | if (thread && thread.isAlive()) {
866 | toast_console('当前程序正在执行其他任务,请结束后再运行', true); return
867 | }
868 | thread = threads.start(function () {
869 | main(); exit()
870 | })
871 | })
872 |
--------------------------------------------------------------------------------