Compare commits

...

No commits in common. "ChaosChemnitz" and "gh-pages" have entirely different histories.

247 changed files with 1212 additions and 33023 deletions

View File

@ -1,18 +0,0 @@
# CloudBot editor configuration normalization
# Copied from Drupal (GPL)
# @see http://editorconfig.org/
# This is the top-most .editorconfig file; do not search in parent directories.
root = true
# All files.
[*]
end_of_line = LF
indent_style = space
indent_size = 4
# Not in the spec yet:
# @see https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

15
.gitignore vendored
View File

@ -1,15 +0,0 @@
persist
config
config.ssl
gitflow
*.db
*.log
.*.swp
*.pyc
*.orig
.project
.geany
*.sublime-project
*.sublime-workspace
.idea/
plugins/data/GeoLiteCity.dat

View File

@ -1,55 +0,0 @@
# How to contribute
I like to encourage you to contribute to the repository.
This should be as easy as possible for you but there are a few things to consider when contributing.
The following guidelines for contribution should be followed if you want to submit a pull request.
## TL;DR
* Read [Github documentation](http://help.github.com/) and [Pull Request documentation](http://help.github.com/send-pull-requests/)
* Fork the repository
* Edit the files, add new files
* Check the files with [`pep8`](https://pypi.python.org/pypi/pep8), fix any reported errors
* Check that the files work as expected in CloudBot
* Create a new branch with a descriptive name for your feature (optional)
* Commit changes, push to your fork on GitHub
* Create a new pull request, provide a short summary of changes in the title line, with more information in the description field.
* After submitting the pull request, join the IRC channel (irc.esper.net #cloudbot) and paste a link to the pull request so people are aware of it
* After discussion, your pull request will be accepted or rejected.
## How to prepare
* You need a [GitHub account](https://github.com/signup/free)
* Submit an [issue ticket](https://github.com/ClouDev/CloudBot/issues) for your issue if the is no one yet.
* Describe the issue and include steps to reproduce if it's a bug.
* Ensure to mention the earliest version that you know is affected.
* If you are able and want to fix this, fork the repository on GitHub
## Make Changes
* In your forked repository, create a topic branch for your upcoming patch. (e.g. `feature--autoplay` or `bugfix--ios-crash`)
* Usually this is based on the develop branch.
* Create a branch based on master; `git branch
fix/develop/my_contribution develop` then checkout the new branch with `git
checkout fix/develop/my_contribution`. Please avoid working directly on the `develop` branch.
* Make sure you stick to the coding style that is used already.
* Make use of the [`.editorconfig`](http://editorconfig.org/) file.
* Make commits of logical units and describe them properly.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Check your changes with [`pep8`](https://pypi.python.org/pypi/pep8). Ignore messages about line length.
## Submit Changes
* Push your changes to a topic branch in your fork of the repository.
* Open a pull request to the original repository and choose the right original branch you want to patch.
_Advanced users may use [`hub`](https://github.com/defunkt/hub#git-pull-request) gem for that._
* If not done in commit messages (which you really should do) please reference and update your issue with the code changes. But _please do not close the issue yourself_.
_Notice: You can [turn your previously filed issues into a pull-request here](http://issue2pr.herokuapp.com/)._
* Even if you have write access to the repository, do not directly push or merge pull-requests. Let another team member review your pull request and approve.
# Additional Resources
* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
* [Read the Issue Guidelines by @necolas](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md) for more details
* [This CONTRIBUTING.md from here](https://github.com/anselmh/CONTRIBUTING.md)

View File

@ -1,34 +0,0 @@
Thanks to everyone who has contributed to CloudBot! Come in IRC and ping me if I forgot anyone.
Luke Rogers (lukeroge)
Neersighted
blha303
cybojenix
KsaRedFx
nathanblaney
thenoodle68
nasonfish
urbels
puffrfish
Sepero
TheFiZi
mikeleigh
Spudstabber
frozenMC
frdmn
We are using code from the following projects:
./plugins/mlia.py - https://github.com/infinitylabs/UguuBot
./plugins/horoscope.py - https://github.com/infinitylabs/UguuBot
color section in ./plugins/utility.py - https://github.com/hitzler/homero
Special Thanks:
Rmmh (created skybot!)
lahwran (for his advice and stuff I stole from his skybot fork!)
TheNoodle (for helping with some plugins when I was first starting out)
If any of your code is in here and you don't have credit, I'm sorry. I didn't keep track of a lot of code I added in the early days of the project.
You are all awesome :)

186
LICENSE
View File

@ -1,186 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

View File

@ -1,96 +0,0 @@
# CloudBot
## About
CloudBot is a Python IRC bot based on [Skybot](http://git.io/skybot) by [rmmh](http://git.io/rmmh).
## Getting and using CloudBot
### Download
Get CloudBot at [https://github.com/ClouDev/CloudBot/zipball/develop](https://github.com/ClouDev/CloudBot/zipball/develop "Get CloudBot from Github!").
Unzip the resulting file, and continue to read this document.
### Install
Before you can run the bot, you need to install a few Python dependencies. LXML is required while Enchant and PyDNS are needed for several plugins.
These can be installed with `pip` (The Python package manager):
[sudo] pip install -r requirements.txt
If you use `pip`, you will also need the following packages on linux or `pip` will fail to install the requirements.
```python, python-dev, libenchant-dev, libenchant1c2a, libxslt-dev, libxml2-dev.```
#### How to install `pip`
curl -O http://python-distribute.org/distribute_setup.py # or download with your browser on windows
python distribute_setup.py
easy_install pip
If you are unable to use pip, there are Windows installers for LXML available for [64 bit](https://pypi.python.org/packages/2.7/l/lxml/lxml-2.3.win-amd64-py2.7.exe) and [32 bit](https://pypi.python.org/packages/2.7/l/lxml/lxml-2.3.win32-py2.7.exe) versions of Python.
### Run
Before you run the bot, rename `config.default` to `config` and edit it with your preferred settings.
Once you have installed the required dependencies and renamed the config file, you can run the bot! Make sure you are in the correct folder and run the following command:
`python bot.py`
On Windows you can usually just double-click `bot.py` to start the bot, as long as you have Python installed correctly.
## Getting help with CloudBot
### Documentation
To configure your CloudBot, visit the [Config Wiki Page](http://git.io/cloudbotircconfig).
To write your own plugins, visit the [Plugin Wiki Page](http://git.io/cloudbotircplugins).
More at the [Wiki Main Page](http://git.io/cloudbotircwiki).
(some of the information on the wiki is outdated and needs to be rewritten)
### Support
The developers reside in [#CloudBot](irc://irc.esper.net/cloudbot) on [EsperNet](http://esper.net) and would be glad to help you.
If you think you have found a bug/have a idea/suggestion, please **open a issue** here on Github.
### Requirements
CloudBot runs on **Python** *2.7.x*. It is currently developed on **Windows** *8* with **Python** *2.7.5*.
It **requires the Python module** lXML.
The module `Enchant` is needed for the spellcheck plugin.
The module `PyDNS` is needed for SRV record lookup in the mcping plugin.
**Windows** users: Windows compatibility some plugins is **broken** (such as ping), but we do intend to add it. Eventually.
## Example CloudBots
You can find a number of example bots in [#CloudBot](irc://irc.esper.net/cloudbot "Connect via IRC to #CloudBot on irc.esper.net").
## License
CloudBot is **licensed** under the **GPL v3** license. The terms are as follows.
CloudBot
Copyright © 2011-2013 Luke Rogers
CloudBot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CloudBot is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CloudBot. If not, see <http://www.gnu.org/licenses/>.

View File

@ -1,74 +0,0 @@
#!/usr/bin/env python
import os
import Queue
import sys
import time
import re
sys.path += ['plugins', 'lib'] # add stuff to the sys.path for easy imports
os.chdir(sys.path[0] or '.') # do stuff relative to the install directory
class Bot(object):
pass
print 'CloudBot DEV <http://git.io/cloudbotirc>'
# create new bot object
bot = Bot()
bot.vars = {}
# record start time for the uptime command
bot.start_time = time.time()
print 'Begin Plugin Loading.'
# bootstrap the reloader
eval(compile(open(os.path.join('core', 'reload.py'), 'U').read(),
os.path.join('core', 'reload.py'), 'exec'))
reload(init=True)
config()
if not hasattr(bot, 'config'):
exit()
print 'Connecting to IRC...'
bot.conns = {}
try:
for name, conf in bot.config['connections'].iteritems():
# strip all spaces and capitalization from the connection name
name = name.replace(" ", "_")
name = re.sub('[^A-Za-z0-9_]+', '', name)
print 'Connecting to server: %s' % conf['server']
if conf.get('ssl'):
bot.conns[name] = SSLIRC(name, conf['server'], conf['nick'], conf=conf,
port=conf.get('port', 6667), channels=conf['channels'],
ignore_certificate_errors=conf.get('ignore_cert', True))
else:
bot.conns[name] = IRC(name, conf['server'], conf['nick'], conf=conf,
port=conf.get('port', 6667), channels=conf['channels'])
except Exception as e:
print 'ERROR: malformed config file', e
sys.exit()
bot.persist_dir = os.path.abspath('persist')
if not os.path.exists(bot.persist_dir):
os.mkdir(bot.persist_dir)
print 'Connection(s) made, starting main loop.'
while True:
reload() # these functions only do things
config() # if changes have occured
for conn in bot.conns.itervalues():
try:
out = conn.out.get_nowait()
main(conn, out)
except Queue.Empty:
pass
while all(conn.out.empty() for conn in bot.conns.itervalues()):
time.sleep(.1)

View File

@ -1,77 +0,0 @@
{
"connections": {
"hackint": {
"server": "irc.hackint.eu",
"nick": "antibot",
"user": "antibot",
"realname": "CloudBot - http://git.io/cloudbotirc",
"mode": "",
"_nickserv_password": "",
"-nickserv_user": "",
"channels": [
"#ChaosChemnitz",
"#logbot"
],
"invite_join": true,
"auto_rejoin": false,
"command_prefix": "."
}
},
"disabled_plugins": [],
"disabled_commands": [],
"acls": {},
"api_keys": {
"tvdb": "",
"wolframalpha": "",
"lastfm": "",
"rottentomatoes": "",
"soundcloud": "",
"twitter_consumer_key": "",
"twitter_consumer_secret": "",
"twitter_access_token": "",
"twitter_access_secret": "",
"wunderground": "",
"googletranslate": "",
"rdio_key": "",
"rdio_secret": ""
},
"permissions": {
"admins": {
"perms": [
"adminonly",
"addfactoid",
"delfactoid",
"ignore",
"botcontrol",
"permissions_users",
"op"
],
"users": [
"examplea!user@example.com",
"exampleb!user@example.com"
]
},
"moderators": {
"perms": [
"addfactoid",
"delfactoid",
"ignore"
],
"users": [
"stummi!~Stummi@stummi.org"
]
}
},
"plugins": {
"factoids": {
"prefix": false
},
"ignore": {
"ignored": []
}
},
"censored_strings": [
"mypass",
"mysecret"
]
}

View File

@ -1,27 +0,0 @@
import inspect
import json
import os
def save(conf):
json.dump(conf, open('config', 'w'), sort_keys=True, indent=2)
if not os.path.exists('config'):
print "Please rename 'config.default' to 'config' to set up your bot!"
print "For help, see http://git.io/cloudbotirc"
print "Thank you for using CloudBot!"
sys.exit()
def config():
# reload config from file if file has changed
config_mtime = os.stat('config').st_mtime
if bot._config_mtime != config_mtime:
try:
bot.config = json.load(open('config'))
bot._config_mtime = config_mtime
except ValueError, e:
print 'error: malformed config', e
bot._config_mtime = 0

View File

@ -1,26 +0,0 @@
import os
import sqlite3
import thread
threaddbs = {}
def get_db_connection(conn, name=''):
"""returns an sqlite3 connection to a persistent database"""
if not name:
name = '{}.db'.format(conn.name)
threadid = thread.get_ident()
if name in threaddbs and threadid in threaddbs[name]:
return threaddbs[name][threadid]
filename = os.path.join(bot.persist_dir, name)
db = sqlite3.connect(filename, timeout=10)
if name in threaddbs:
threaddbs[name][threadid] = db
else:
threaddbs[name] = {threadid: db}
return db
bot.get_db_connection = get_db_connection

View File

@ -1,263 +0,0 @@
import re
import socket
import time
import thread
import Queue
from ssl import wrap_socket, CERT_NONE, CERT_REQUIRED, SSLError
def decode(txt):
for codec in ('utf-8', 'iso-8859-1', 'shift_jis', 'cp1252'):
try:
return txt.decode(codec)
except UnicodeDecodeError:
continue
return txt.decode('utf-8', 'ignore')
def censor(text):
text = text.replace('\n', '').replace('\r', '')
replacement = '[censored]'
if 'censored_strings' in bot.config:
if bot.config['censored_strings']:
words = map(re.escape, bot.config['censored_strings'])
regex = re.compile('({})'.format("|".join(words)))
text = regex.sub(replacement, text)
return text
class crlf_tcp(object):
"""Handles tcp connections that consist of utf-8 lines ending with crlf"""
def __init__(self, host, port, timeout=300):
self.ibuffer = ""
self.obuffer = ""
self.oqueue = Queue.Queue() # lines to be sent out
self.iqueue = Queue.Queue() # lines that were received
self.socket = self.create_socket()
self.host = host
self.port = port
self.timeout = timeout
def create_socket(self):
return socket.socket(socket.AF_INET, socket.TCP_NODELAY)
def run(self):
noerror = 0
while 1:
try:
self.socket.connect((self.host, self.port))
break
except socket.gaierror as e:
time.sleep(5)
except socket.timeout as e:
time.sleep(5)
thread.start_new_thread(self.recv_loop, ())
thread.start_new_thread(self.send_loop, ())
def recv_from_socket(self, nbytes):
return self.socket.recv(nbytes)
def get_timeout_exception_type(self):
return socket.timeout
def handle_receive_exception(self, error, last_timestamp):
print("Receive exception: %s" % (error))
if time.time() - last_timestamp > self.timeout:
print("Receive timeout. Restart connection.")
self.iqueue.put(StopIteration)
self.socket.close()
return True
return False
def handle_send_exception(self, error):
print("Send exception: %s" % (error))
self.iqueue.put(StopIteration)
self.socket.close()
return True
def recv_loop(self):
last_timestamp = time.time()
while True:
try:
data = self.recv_from_socket(4096)
self.ibuffer += data
if data:
last_timestamp = time.time()
else:
if time.time() - last_timestamp > self.timeout:
self.iqueue.put(StopIteration)
self.socket.close()
return
time.sleep(1)
except (self.get_timeout_exception_type(), socket.error) as e:
if self.handle_receive_exception(e, last_timestamp):
return
continue
except AttributeError:
return
while '\r\n' in self.ibuffer:
line, self.ibuffer = self.ibuffer.split('\r\n', 1)
self.iqueue.put(decode(line))
def send_loop(self):
while True:
try:
line = self.oqueue.get().splitlines()[0][:500]
if line == StopIteration:
return
print ">>> %r" % line
self.obuffer += line.encode('utf-8', 'replace') + '\r\n'
while self.obuffer:
sent = self.socket.send(self.obuffer)
self.obuffer = self.obuffer[sent:]
except socket.error as e:
self.handle_send_exception(e)
return
class crlf_ssl_tcp(crlf_tcp):
"""Handles ssl tcp connetions that consist of utf-8 lines ending with crlf"""
def __init__(self, host, port, ignore_cert_errors, timeout=300):
self.ignore_cert_errors = ignore_cert_errors
crlf_tcp.__init__(self, host, port, timeout)
def create_socket(self):
return wrap_socket(crlf_tcp.create_socket(self), server_side=False,
cert_reqs=CERT_NONE if self.ignore_cert_errors else
CERT_REQUIRED)
def recv_from_socket(self, nbytes):
return self.socket.read(nbytes)
def get_timeout_exception_type(self):
return SSLError
def handle_receive_exception(self, error, last_timestamp):
# this is terrible
#if not "timed out" in error.args[0]:
# raise
return crlf_tcp.handle_receive_exception(self, error, last_timestamp)
def handle_send_exception(self, error):
return crlf_tcp.handle_send_exception(self, error)
irc_prefix_rem = re.compile(r'(.*?) (.*?) (.*)').match
irc_noprefix_rem = re.compile(r'()(.*?) (.*)').match
irc_netmask_rem = re.compile(r':?([^!@]*)!?([^@]*)@?(.*)').match
irc_param_ref = re.compile(r'(?:^|(?<= ))(:.*|[^ ]+)').findall
class IRC(object):
"""handles the IRC protocol"""
def __init__(self, name, server, nick, port=6667, channels=[], conf={}):
self.name = name
self.channels = channels
self.conf = conf
self.server = server
self.port = port
self.nick = nick
self.history = {}
self.vars = {}
self.out = Queue.Queue() # responses from the server are placed here
# format: [rawline, prefix, command, params,
# nick, user, host, paramlist, msg]
self.connect()
thread.start_new_thread(self.parse_loop, ())
def create_connection(self):
return crlf_tcp(self.server, self.port)
def connect(self):
self.conn = self.create_connection()
thread.start_new_thread(self.conn.run, ())
self.set_pass(self.conf.get('server_password'))
self.set_nick(self.nick)
self.cmd("USER",
[conf.get('user', 'cloudbot'), "3", "*", conf.get('realname',
'CloudBot - http://git.io/cloudbot')])
def parse_loop(self):
while True:
# get a message from the input queue
msg = self.conn.iqueue.get()
if msg == StopIteration:
self.connect()
continue
# parse the message
if msg.startswith(":"): # has a prefix
prefix, command, params = irc_prefix_rem(msg).groups()
else:
prefix, command, params = irc_noprefix_rem(msg).groups()
nick, user, host = irc_netmask_rem(prefix).groups()
mask = nick + "!" + user + "@" + host
paramlist = irc_param_ref(params)
lastparam = ""
if paramlist:
if paramlist[-1].startswith(':'):
paramlist[-1] = paramlist[-1][1:]
lastparam = paramlist[-1]
# put the parsed message in the response queue
self.out.put([msg, prefix, command, params, nick, user, host,
mask, paramlist, lastparam])
# if the server pings us, pong them back
if command == "PING":
self.cmd("PONG", paramlist)
def set_pass(self, password):
if password:
self.cmd("PASS", [password])
def set_nick(self, nick):
self.cmd("NICK", [nick])
def join(self, channel):
""" makes the bot join a channel """
self.send("JOIN {}".format(channel))
if channel not in self.channels:
self.channels.append(channel)
def part(self, channel):
""" makes the bot leave a channel """
self.cmd("PART", [channel])
if channel in self.channels:
self.channels.remove(channel)
def msg(self, target, text):
""" makes the bot send a PRIVMSG to a target """
self.cmd("PRIVMSG", [target, text])
def ctcp(self, target, ctcp_type, text):
""" makes the bot send a PRIVMSG CTCP to a target """
out = u"\x01{} {}\x01".format(ctcp_type, text)
self.cmd("PRIVMSG", [target, out])
def cmd(self, command, params=None):
if params:
params[-1] = u':' + params[-1]
self.send(u"{} {}".format(command, ' '.join(params)))
else:
self.send(command)
def send(self, str):
self.conn.oqueue.put(str)
class SSLIRC(IRC):
def __init__(self, name, server, nick, port=6667, channels=[], conf={},
ignore_certificate_errors=True):
self.ignore_cert_errors = ignore_certificate_errors
IRC.__init__(self, name, server, nick, port, channels, conf)
def create_connection(self):
return crlf_ssl_tcp(self.server, self.port, self.ignore_cert_errors)

View File

@ -1,195 +0,0 @@
import thread
import traceback
thread.stack_size(1024 * 512) # reduce vm size
class Input(dict):
def __init__(self, conn, raw, prefix, command, params,
nick, user, host, mask, paraml, msg):
chan = paraml[0].lower()
if chan == conn.nick.lower(): # is a PM
chan = nick
def message(message, target=chan):
"""sends a message to a specific or current channel/user"""
conn.msg(target, message)
def reply(message, target=chan):
"""sends a message to the current channel/user with a prefix"""
if target == nick:
conn.msg(target, message)
else:
conn.msg(target, u"({}) {}".format(nick, message))
def action(message, target=chan):
"""sends an action to the current channel/user or a specific channel/user"""
conn.ctcp(target, "ACTION", message)
def ctcp(message, ctcp_type, target=chan):
"""sends an ctcp to the current channel/user or a specific channel/user"""
conn.ctcp(target, ctcp_type, message)
def notice(message, target=nick):
"""sends a notice to the current channel/user or a specific channel/user"""
conn.cmd('NOTICE', [target, message])
dict.__init__(self, conn=conn, raw=raw, prefix=prefix, command=command,
params=params, nick=nick, user=user, host=host, mask=mask,
paraml=paraml, msg=msg, server=conn.server, chan=chan,
notice=notice, message=message, reply=reply, bot=bot,
action=action, ctcp=ctcp, lastparam=paraml[-1])
# make dict keys accessible as attributes
def __getattr__(self, key):
return self[key]
def __setattr__(self, key, value):
self[key] = value
def run(func, input):
args = func._args
if 'inp' not in input:
input.inp = input.paraml
if args:
if 'db' in args and 'db' not in input:
input.db = get_db_connection(input.conn)
if 'input' in args:
input.input = input
if 0 in args:
out = func(input.inp, **input)
else:
kw = dict((key, input[key]) for key in args if key in input)
out = func(input.inp, **kw)
else:
out = func(input.inp)
if out is not None:
input.reply(unicode(out))
def do_sieve(sieve, bot, input, func, type, args):
try:
return sieve(bot, input, func, type, args)
except Exception:
print 'sieve error',
traceback.print_exc()
return None
class Handler(object):
"""Runs plugins in their own threads (ensures order)"""
def __init__(self, func):
self.func = func
self.input_queue = Queue.Queue()
thread.start_new_thread(self.start, ())
def start(self):
uses_db = 'db' in self.func._args
db_conns = {}
while True:
input = self.input_queue.get()
if input == StopIteration:
break
if uses_db:
db = db_conns.get(input.conn)
if db is None:
db = bot.get_db_connection(input.conn)
db_conns[input.conn] = db
input.db = db
try:
run(self.func, input)
except:
import traceback
traceback.print_exc()
def stop(self):
self.input_queue.put(StopIteration)
def put(self, value):
self.input_queue.put(value)
def dispatch(input, kind, func, args, autohelp=False):
for sieve, in bot.plugs['sieve']:
input = do_sieve(sieve, bot, input, func, kind, args)
if input is None:
return
if not (not autohelp or not args.get('autohelp', True) or input.inp or not (func.__doc__ is not None)):
input.notice(input.conn.conf["command_prefix"] + func.__doc__)
return
if func._thread:
bot.threads[func].put(input)
else:
thread.start_new_thread(run, (func, input))
def match_command(command):
commands = list(bot.commands)
# do some fuzzy matching
prefix = filter(lambda x: x.startswith(command), commands)
if len(prefix) == 1:
return prefix[0]
elif prefix and command not in prefix:
return prefix
return command
def main(conn, out):
inp = Input(conn, *out)
command_prefix = conn.conf.get('command_prefix', '.')
# EVENTS
for func, args in bot.events[inp.command] + bot.events['*']:
dispatch(Input(conn, *out), "event", func, args)
if inp.command == 'PRIVMSG':
# COMMANDS
if inp.chan == inp.nick: # private message, no command prefix
prefix = '^(?:[{}]?|'.format(command_prefix)
else:
prefix = '^(?:[{}]|'.format(command_prefix)
command_re = prefix + inp.conn.nick
command_re += r'[,;:]+\s+)(\w+)(?:$|\s+)(.*)'
m = re.match(command_re, inp.lastparam)
if m:
trigger = m.group(1).lower()
command = match_command(trigger)
if isinstance(command, list): # multiple potential matches
input = Input(conn, *out)
input.notice("Did you mean {} or {}?".format
(', '.join(command[:-1]), command[-1]))
elif command in bot.commands:
input = Input(conn, *out)
input.trigger = trigger
input.inp_unstripped = m.group(2)
input.inp = input.inp_unstripped.strip()
func, args = bot.commands[command]
dispatch(input, "command", func, args, autohelp=True)
# REGEXES
for func, args in bot.plugs['regex']:
m = args['re'].search(inp.lastparam)
if m:
input = Input(conn, *out)
input.inp = m
dispatch(input, "regex", func, args)

View File

@ -1,160 +0,0 @@
import collections
import glob
import os
import re
import sys
import traceback
if 'mtimes' not in globals():
mtimes = {}
if 'lastfiles' not in globals():
lastfiles = set()
def make_signature(f):
return f.func_code.co_filename, f.func_name, f.func_code.co_firstlineno
def format_plug(plug, kind='', lpad=0):
out = ' ' * lpad + '{}:{}:{}'.format(*make_signature(plug[0]))
if kind == 'command':
out += ' ' * (50 - len(out)) + plug[1]['name']
if kind == 'event':
out += ' ' * (50 - len(out)) + ', '.join(plug[1]['events'])
if kind == 'regex':
out += ' ' * (50 - len(out)) + plug[1]['regex']
return out
def reload(init=False):
changed = False
if init:
bot.plugs = collections.defaultdict(list)
bot.threads = {}
core_fileset = set(glob.glob(os.path.join("core", "*.py")))
for filename in core_fileset:
mtime = os.stat(filename).st_mtime
if mtime != mtimes.get(filename):
mtimes[filename] = mtime
changed = True
try:
eval(compile(open(filename, 'U').read(), filename, 'exec'),
globals())
except Exception:
traceback.print_exc()
if init: # stop if there's an error (syntax?) in a core
sys.exit() # script on startup
continue
if filename == os.path.join('core', 'reload.py'):
reload(init=init)
return
fileset = set(glob.glob(os.path.join('plugins', '*.py')))
# remove deleted/moved plugins
for name, data in bot.plugs.iteritems():
bot.plugs[name] = [x for x in data if x[0]._filename in fileset]
for filename in list(mtimes):
if filename not in fileset and filename not in core_fileset:
mtimes.pop(filename)
for func, handler in list(bot.threads.iteritems()):
if func._filename not in fileset:
handler.stop()
del bot.threads[func]
# compile new plugins
for filename in fileset:
mtime = os.stat(filename).st_mtime
if mtime != mtimes.get(filename):
mtimes[filename] = mtime
changed = True
try:
code = compile(open(filename, 'U').read(), filename, 'exec')
namespace = {}
eval(code, namespace)
except Exception:
traceback.print_exc()
continue
# remove plugins already loaded from this filename
for name, data in bot.plugs.iteritems():
bot.plugs[name] = [x for x in data
if x[0]._filename != filename]
for func, handler in list(bot.threads.iteritems()):
if func._filename == filename:
handler.stop()
del bot.threads[func]
for obj in namespace.itervalues():
if hasattr(obj, '_hook'): # check for magic
if obj._thread:
bot.threads[obj] = Handler(obj)
for type, data in obj._hook:
bot.plugs[type] += [data]
if not init:
print '### new plugin (type: %s) loaded:' % \
type, format_plug(data)
if changed:
bot.commands = {}
for plug in bot.plugs['command']:
name = plug[1]['name'].lower()
if not re.match(r'^\w+$', name):
print '### ERROR: invalid command name "{}" ({})'.format(name, format_plug(plug))
continue
if name in bot.commands:
print "### ERROR: command '{}' already registered ({}, {})".format(name,
format_plug(bot.commands[name]),
format_plug(plug))
continue
bot.commands[name] = plug
bot.events = collections.defaultdict(list)
for func, args in bot.plugs['event']:
for event in args['events']:
bot.events[event].append((func, args))
if init:
print ' plugin listing:'
if bot.commands:
# hack to make commands with multiple aliases
# print nicely
print ' command:'
commands = collections.defaultdict(list)
for name, (func, args) in bot.commands.iteritems():
commands[make_signature(func)].append(name)
for sig, names in sorted(commands.iteritems()):
names.sort(key=lambda x: (-len(x), x)) # long names first
out = ' ' * 6 + '%s:%s:%s' % sig
out += ' ' * (50 - len(out)) + ', '.join(names)
print out
for kind, plugs in sorted(bot.plugs.iteritems()):
if kind == 'command':
continue
print ' {}:'.format(kind)
for plug in plugs:
print format_plug(plug, kind=kind, lpad=6)
print

View File

@ -1,72 +0,0 @@
import random
from util import hook
with open("plugins/data/larts.txt") as f:
larts = [line.strip() for line in f.readlines()
if not line.startswith("//")]
with open("plugins/data/insults.txt") as f:
insults = [line.strip() for line in f.readlines()
if not line.startswith("//")]
with open("plugins/data/flirts.txt") as f:
flirts = [line.strip() for line in f.readlines()
if not line.startswith("//")]
@hook.command
def lart(inp, action=None, nick=None, conn=None, notice=None):
"""lart <user> -- LARTs <user>."""
target = inp.strip()
if " " in target:
notice("Invalid username!")
return
# if the user is trying to make the bot slap itself, slap them
if target.lower() == conn.nick.lower() or target.lower() == "itself":
target = nick
values = {"user": target}
phrase = random.choice(larts)
# act out the message
action(phrase.format(**values))
@hook.command
def insult(inp, nick=None, action=None, conn=None, notice=None):
"""insult <user> -- Makes the bot insult <user>."""
target = inp.strip()
if " " in target:
notice("Invalid username!")
return
if target == conn.nick.lower() or target == "itself":
target = nick
else:
target = inp
out = 'insults {}... "{}"'.format(target, random.choice(insults))
action(out)
@hook.command
def flirt(inp, action=None, conn=None, notice=None):
"""flirt <user> -- Make the bot flirt with <user>."""
target = inp.strip()
if " " in target:
notice("Invalid username!")
return
if target == conn.nick.lower() or target == "itself":
target = 'itself'
else:
target = inp
out = 'flirts with {}... "{}"'.format(target, random.choice(flirts))
action(out)

View File

@ -1,89 +0,0 @@
"""brainfuck interpreter adapted from (public domain) code at
http://brainfuck.sourceforge.net/brain.py"""
import re
import random
from util import hook
BUFFER_SIZE = 5000
MAX_STEPS = 1000000
@hook.command('brainfuck')
@hook.command
def bf(inp):
"""bf <prog> -- Executes <prog> as Brainfuck code."""
program = re.sub('[^][<>+-.,]', '', inp)
# create a dict of brackets pairs, for speed later on
brackets = {}
open_brackets = []
for pos in range(len(program)):
if program[pos] == '[':
open_brackets.append(pos)
elif program[pos] == ']':
if len(open_brackets) > 0:
brackets[pos] = open_brackets[-1]
brackets[open_brackets[-1]] = pos
open_brackets.pop()
else:
return 'unbalanced brackets'
if len(open_brackets) != 0:
return 'unbalanced brackets'
# now we can start interpreting
ip = 0 # instruction pointer
mp = 0 # memory pointer
steps = 0
memory = [0] * BUFFER_SIZE # initial memory area
rightmost = 0
output = "" # we'll save the output here
# the main program loop:
while ip < len(program):
c = program[ip]
if c == '+':
memory[mp] += 1 % 256
elif c == '-':
memory[mp] -= 1 % 256
elif c == '>':
mp += 1
if mp > rightmost:
rightmost = mp
if mp >= len(memory):
# no restriction on memory growth!
memory.extend([0] * BUFFER_SIZE)
elif c == '<':
mp -= 1 % len(memory)
elif c == '.':
output += chr(memory[mp])
if len(output) > 500:
break
elif c == ',':
memory[mp] = random.randint(1, 255)
elif c == '[':
if memory[mp] == 0:
ip = brackets[ip]
elif c == ']':
if memory[mp] != 0:
ip = brackets[ip]
ip += 1
steps += 1
if steps > MAX_STEPS:
if output == '':
output = '(no output)'
output += '[exceeded {} iterations]'.format(MAX_STEPS)
break
stripped_output = re.sub(r'[\x00-\x1F]', '', output)
if stripped_output == '':
if output != '':
return 'no printable output'
return 'no output'
return stripped_output[:430].decode('utf8', 'ignore')

View File

@ -1,18 +0,0 @@
import re
import random
from util import hook
@hook.command
def choose(inp):
"""choose <choice1>, [choice2], [choice3], [choice4], ... --
Randomly picks one of the given choices."""
c = re.findall(r'([^,]+)', inp)
if len(c) == 1:
c = re.findall(r'(\S+)', inp)
if len(c) == 1:
return 'The decision is up to you!'
return random.choice(c).strip()

View File

@ -1,121 +0,0 @@
# from jessi bot
import urllib2
import hashlib
import re
import unicodedata
from util import hook
# these are just parts required
# TODO: Merge them.
arglist = ['', 'y', '', '', '', '', '', '', '', '', 'wsf', '',
'', '', '', '', '', '', '', '0', 'Say', '1', 'false']
always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'abcdefghijklmnopqrstuvwxyz'
'0123456789' '_.-')
headers = {'X-Moz': 'prefetch', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1)Gecko/20100101 Firefox/7.0',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Referer': 'http://www.cleverbot.com',
'Pragma': 'no-cache', 'Cache-Control': 'no-cache, no-cache', 'Accept-Language': 'en-us;q=0.8,en;q=0.5'}
keylist = ['stimulus', 'start', 'sessionid', 'vText8', 'vText7', 'vText6',
'vText5', 'vText4', 'vText3', 'vText2', 'icognoid',
'icognocheck', 'prevref', 'emotionaloutput', 'emotionalhistory',
'asbotname', 'ttsvoice', 'typing', 'lineref', 'fno', 'sub',
'islearning', 'cleanslate']
MsgList = list()
def quote(s, safe='/'): # quote('abc def') -> 'abc%20def'
s = s.encode('utf-8')
s = s.decode('utf-8')
print "s= " + s
print "safe= " + safe
safe += always_safe
safe_map = dict()
for i in range(256):
c = chr(i)
safe_map[c] = (c in safe) and c or ('%%%02X' % i)
try:
res = map(safe_map.__getitem__, s)
except:
print "blank"
return ''
print "res= " + ''.join(res)
return ''.join(res)
def encode(keylist, arglist):
text = str()
for i in range(len(keylist)):
k = keylist[i]
v = quote(arglist[i])
text += '&' + k + '=' + v
text = text[1:]
return text
def Send():
data = encode(keylist, arglist)
digest_txt = data[9:29]
new_hash = hashlib.md5(digest_txt).hexdigest()
arglist[keylist.index('icognocheck')] = new_hash
data = encode(keylist, arglist)
req = urllib2.Request('http://www.cleverbot.com/webservicemin',
data, headers)
f = urllib2.urlopen(req)
reply = f.read()
return reply
def parseAnswers(text):
d = dict()
keys = ['text', 'sessionid', 'logurl', 'vText8', 'vText7', 'vText6',
'vText5', 'vText4', 'vText3', 'vText2', 'prevref', 'foo',
'emotionalhistory', 'ttsLocMP3', 'ttsLocTXT', 'ttsLocTXT3',
'ttsText', 'lineRef', 'lineURL', 'linePOST', 'lineChoices',
'lineChoicesAbbrev', 'typingData', 'divert']
values = text.split('\r')
i = 0
for key in keys:
d[key] = values[i]
i += 1
return d
def ask(inp):
arglist[keylist.index('stimulus')] = inp
if MsgList:
arglist[keylist.index('lineref')] = '!0' + str(len(
MsgList) / 2)
asw = Send()
MsgList.append(inp)
answer = parseAnswers(asw)
for k, v in answer.iteritems():
try:
arglist[keylist.index(k)] = v
except ValueError:
pass
arglist[keylist.index('emotionaloutput')] = str()
text = answer['ttsText']
MsgList.append(text)
return text
@hook.command("cb")
def cleverbot(inp, reply=None):
reply(ask(inp))
''' # TODO: add in command to control extra verbose per channel
@hook.event('PRIVMSG')
def cbevent(inp, reply=None):
reply(ask(inp))
@hook.command("cbver", permissions=['cleverbot'])
def cleverbotverbose(inp, notice=None):
if on in input
'''

View File

@ -1,126 +0,0 @@
#!/bin/bash
echo ""
echo " ________ ______ __ "
echo " / ____/ /___ __ ______/ / __ )____ / /_"
echo " / / / / __ \/ / / / __ / __ / __ \/ __/"
echo "/ /___/ / /_/ / /_/ / /_/ / /_/ / /_/ / /_ "
echo "\____/_/\____/\__,_/\__,_/_____/\____/\__/ "
echo " http://git.io/cloudbotirc by ClouDev "
echo ""
locatefiles() {
botfile="/bot.py"
botfile=$(pwd)$botfile
logfile="/bot.log"
logfile=$(pwd)$logfile
}
running() {
if [[ $(ps aux|grep bot.py|grep -v grep|grep -v daemon|grep -v SCREEN) != "" ]]; then
true
else
false
fi
}
checkbackend() {
if dpkg -l| grep ^ii|grep daemon|grep 'turns other' > /dev/null; then
backend="daemon"
elif dpkg -l| grep ^ii|grep screen|grep 'terminal multi' > /dev/null; then
backend="screen"
else
backend="manual"
fi
return 0
}
setcommands() {
status() {
if running; then
echo "CloudBot is running!"
else
echo "CloudBot is not running!"
fi
}
clear() {
: > $logfile
}
if [ "$backend" == "daemon" ]; then
start() {
daemon -r -n cloudbot -O $logfile python $botfile
}
stop() {
daemon -n cloudbot --stop
}
elif [ "$backend" == "screen" ]; then
start() {
screen -d -m -S cloudbot -t cloudbot python $botfile > $logfile 2>&1
}
stop() {
pid=`ps ax|grep -v grep|grep python|grep -v SCREEN|grep $botfile|awk '{print $1}'`
kill $pid
}
elif [ "$backend" == "manual" ]; then
start() {
$botfile
}
stop() {
pid=`ps ax|grep -v grep|grep python|grep $botfile|awk '{print $1}'`
kill $pid
}
fi
}
processargs() {
case $1 in
start|-start|--start)
if running; then
echo "Cannot start! Bot is already running!"
exit 1
else
echo "Starting CloudBot... ($backend)"
start
fi
;;
stop|-stop|--stop)
if running; then
echo "Stopping CloudBot... ($backend)"
stop
else
echo "Cannot stop! Bot is not already running!"
exit 1
fi
;;
restart|-restart|--restart)
if running; then
echo "Restarting CloudBot... ($backend)"
stop
sleep 3
start
else
echo "Cannot restart! Bot is not already running!"
exit 1
fi
;;
clear|-clear|--clear)
echo "Clearing logs..."
clear
;;
status|-status|--status)
status
;;
*)
usage="usage: ./cloudbot {start|stop|restart|clear|status}"
echo $usage
;;
esac
}
main() {
locatefiles
checkbackend
setcommands
processargs $1
}
main $*
exit 0

View File

@ -1,25 +0,0 @@
import random
from util import hook
@hook.command(autohelp=False)
def coin(inp, action=None):
"""coin [amount] -- Flips [amount] of coins."""
if inp:
try:
amount = int(inp)
except (ValueError, TypeError):
return "Invalid input!"
else:
amount = 1
if amount == 1:
action("flips a coin and gets {}.".format(random.choice(["heads", "tails"])))
elif amount == 0:
action("makes a coin flipping motion with its hands.")
else:
heads = int(random.normalvariate(.5 * amount, (.75 * amount) ** .5))
tails = amount - heads
action("flips {} coins and gets {} heads and {} tails.".format(amount, heads, tails))

View File

@ -1,37 +0,0 @@
from util import hook
import re
CORRECTION_RE = r'^(s|S)/.*/.*/?\S*$'
@hook.regex(CORRECTION_RE)
def correction(match, input=None, conn=None, message=None):
split = input.msg.split("/")
if len(split) == 4:
nick = split[3].lower()
else:
nick = None
find = split[1]
replace = split[2]
for item in conn.history[input.chan].__reversed__():
name, timestamp, msg = item
if msg.startswith("s/"):
# don't correct corrections, it gets really confusing
continue
if nick:
if nick != name.lower():
continue
if find in msg:
if "\x01ACTION" in msg:
msg = msg.replace("\x01ACTION ", "/me ").replace("\x01", "")
message(u"Correction, <{}> {}".format(name, msg.replace(find, "\x02" + replace + "\x02")))
return
else:
continue
return u"Did not find {} in any recent messages.".format(find)

View File

@ -1,60 +0,0 @@
from util import http, hook
## CONSTANTS
exchanges = {
"blockchain": {
"api_url": "https://blockchain.info/ticker",
"func": lambda data: u"Blockchain // Buy: \x0307${:,.2f}\x0f -"
u" Sell: \x0307${:,.2f}\x0f".format(data["USD"]["buy"], data["USD"]["sell"])
},
"coinbase": {
"api_url": "https://coinbase.com/api/v1/prices/spot_rate",
"func": lambda data: u"Coinbase // Current: \x0307${:,.2f}\x0f".format(float(data['amount']))
},
"bitpay": {
"api_url": "https://bitpay.com/api/rates",
"func": lambda data: u"Bitpay // Current: \x0307${:,.2f}\x0f".format(data[0]['rate'])
},
"bitstamp": {
"api_url": "https://www.bitstamp.net/api/ticker/",
"func": lambda data: u"BitStamp // Current: \x0307${:,.2f}\x0f - High: \x0307${:,.2f}\x0f -"
u" Low: \x0307${:,.2f}\x0f - Volume: {:,.2f} BTC".format(float(data['last']),
float(data['high']),
float(data['low']),
float(data['volume']))
}
}
## HOOK FUNCTIONS
@hook.command("btc", autohelp=False)
@hook.command(autohelp=False)
def bitcoin(inp):
"""bitcoin <exchange> -- Gets current exchange rate for bitcoins from several exchanges, default is Blockchain.
Supports MtGox, Bitpay, Coinbase and BitStamp."""
inp = inp.lower()
if inp:
if inp in exchanges:
exchange = exchanges[inp]
else:
return "Invalid Exchange"
else:
exchange = exchanges["blockchain"]
data = http.get_json(exchange["api_url"])
func = exchange["func"]
return func(data)
@hook.command("ltc", autohelp=False)
@hook.command(autohelp=False)
def litecoin(inp, message=None):
"""litecoin -- gets current exchange rate for litecoins from BTC-E"""
data = http.get_json("https://btc-e.com/api/2/ltc_usd/ticker")
ticker = data['ticker']
message("Current: \x0307${:,.2f}\x0f - High: \x0307${:,.2f}\x0f"
" - Low: \x0307${:,.2f}\x0f - Volume: {:,.2f} LTC".format(ticker['buy'], ticker['high'], ticker['low'],
ticker['vol_cur']))

View File

@ -1,39 +0,0 @@
import base64
from util import hook
def encode(key, clear):
enc = []
for i in range(len(clear)):
key_c = key[i % len(key)]
enc_c = chr((ord(clear[i]) + ord(key_c)) % 256)
enc.append(enc_c)
return base64.urlsafe_b64encode("".join(enc))
def decode(key, enc):
dec = []
enc = base64.urlsafe_b64decode(enc.encode('ascii', 'ignore'))
for i in range(len(enc)):
key_c = key[i % len(key)]
dec_c = chr((256 + ord(enc[i]) - ord(key_c)) % 256)
dec.append(dec_c)
return "".join(dec)
@hook.command
def cypher(inp):
"""cypher <pass> <string> -- Cyphers <string> with <password>."""
passwd = inp.split(" ")[0]
inp = " ".join(inp.split(" ")[1:])
return encode(passwd, inp)
@hook.command
def decypher(inp):
"""decypher <pass> <string> -- Decyphers <string> with <password>."""
passwd = inp.split(" ")[0]
inp = " ".join(inp.split(" ")[1:])
return decode(passwd, inp)

View File

@ -1,26 +0,0 @@
<g>As I see it, yes
<g>It is certain
<g>It is decidedly so
<g>Most likely
<g>Outlook good
<g>Signs point to yes
<g>One would be wise to think so
<g>Naturally
<g>Without a doubt
<g>Yes
<g>Yes, definitely
<g>You may rely on it
<y>Reply hazy, try again
<y>Ask again later
<y>Better not tell you now
<y>Cannot predict now
<y>Concentrate and ask again
<y>You know the answer better than I
<y>Maybe...
<r>You're kidding, right?
<r>Don't count on it
<r>In your dreams
<r>My reply is no
<r>My sources say no
<r>Outlook not so good
<r>Very doubtful

Binary file not shown.

View File

@ -1,54 +0,0 @@
I bet your name's Mickey, 'cause you're so fine.
Hey, pretty mama. You smell kinda pretty, wanna smell me?
I better get out my library card, 'cause I'm checkin' you out.
If you were a booger, I'd pick you.
If I could rearrange the alphabet, I would put U and I together.
I've been bad, take me to your room.
I think Heaven's missing an angel.
Are you a parking ticket? Because you've got FINE written all over you.
That shirt looks good on you, it'd look better on my bedroom floor.
Can I have your phone number? I seem to have lost mine.
I cant help to notice but you look a lot like my next girlfriend.
Aren't your feet tired? Because you've been running through my mind all day.
I must be asleep, 'cause you are a dream come true.
I like large posteriors and I cannot prevaricate.
How you doin'?
If I said you had a good body, would you hold it against me?
Hey, baby cakes.
Nice butt.
I love you like a fat kid loves cake.
Do you believe in love at first sight? Or should I walk by again...?
Do you have a map? I think I just got lost in your eyes.
Want to see my good side? Hah, that was a trick question, all I have are good sides.
You look like a woman who appreciates the finer things in life. Come over here and feel my velour bedspread.
Now you're officially my woman. Kudos! I can't say I don't envy you.
I find that the most erotic part of a woman is the boobies.
I wish I was one of your tears, so I could be born in your eye, run down your cheek, and die on your lips.
If you want to climb aboard the Love Train, you've got to stand on the Love Tracks. But you might just get smushed by a very sensual cow-catcher.
Its a good thing I wore my gloves today; otherwise, youd be too hot to handle.
Lets say you and I knock some very /sensual/ boots.
I lost my phone number, can I have yours?
Does this rag smell like chloroform to you?
I'm here, where are your other two wishes?
Apart from being sexy, what do you do for a living?
Hi, I'm Mr. Right. Someone said you were looking for me.
You got something on your chest: My eyes.
Are you from Tennessee? Cause you're the only TEN I see.
Are you an alien? Because you just abducted my heart.
Excuse me, but I think you dropped something!!! MY JAW!!!
If I followed you home, would you keep me?
I wish you were a Pony Carousel outside Walmart, so I could ride you all day long for a quarter.
Where have you been all my life?
I'm just a love machine, and I don't work for nobody but you.
Do you live on a chicken farm? Because you sure know how to raise cocks.
Are you wearing space pants? Because your ass is out of this world.
Nice legs. What time do they open?
Are you lost? Because its so strange to see an angel so far from heaven.
Your daddy must have been a baker, because you've got a nice set of buns.
You're so beautiful that last night you made me forget my pickup line.
I've never seen such dark eyes with so much light in them.
I think we should just be friends with sexual tension.
Whenever I see you I feel like a dog dying to get out of the car.
If I'd have held you any closer I'd be in back of you.
I wish I were on Facebook so I could poke you.
I want you like JFK wanted a car with a roof.

View File

@ -1,57 +0,0 @@
Help! I'm stuck in the fortune cookie factory!
He who laughs at himself never runs out of things to laugh at.
The world is your oyster.
Today will be a good day.
Life's short, party naked.
Haters gonna hate.
You are amazing and let no one tell you otherwise.
A starship ride has been promised to you by the galactic wizard.
That wasnt chicken.
You will become a hermit and be sad and lonely for the rest of your life.
Dont fry bacon in the nude.
The road to riches is paved with homework.
Take calculated risks. That is quite different from being rash.
DO THE IMPOSSIBLE, SEE THE INVISIBLE.
You cannot plough a field by turning it over in your mind. Unless you have telekinesis.
No one can make you feel inferior without your consent.
Never lose the ability to find beauty in ordinary things.
Ignore previous fortune.
Smile more.
YOU'RE THE BEST AROUND, NOTHIN'S GONNA EVER KEEP YA DOWN.
The cake is not a lie.
Never take life seriously. Nobody gets out alive anyway.
Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
Never go to a doctor whose office plants have died.
Always remember you're unique, just like everyone else.
What if everything is an illusion and nothing exists? (In that case, I definitely overpaid for my carpet)
Dont be discouraged, because every wrong attempt discarded is another step forward.
Even if you are on the right track, you will get run over if you just sit there.
Think like a man of action, and act like a man of thought.
When in doubt, lubricate.
It is time for you to live up to your family name and face FULL LIFE CONSEQUENCES.
It's a good day to do what has to be done.
Move near the countryside and you will be friends of John Freeman.
If you can't beat 'em, mock 'em.
Use gun. And if that don't work, use more gun.
LOOK OUT BEHIND YOU
You will die, but become reanimated as a Zombie, and forever roam the earth in search of purpose... And brains, of course.
This message will self destruct in 10 seconds.
You will live a normal life, with a normal home, a normal job, and a normal future.
You'll never know what you can do until you try.
A person of words and not deeds is like a garden full of weeds.
You are talented in many ways
Be both a speaker of words and a doer of deeds.
A visit to a strange place will bring you renewed perspective.
A passionate new romance will appear in your life when you least expect it.
If you care enough for a result, you will most certainly attain it.
To be loved, be loveable.
Step away from the power position for one day.
If you want to get a sure crop with a big yield, sow wild oats.
It doesn't take guts to quit.
You can expect a change for the better in job or status in the future.
As the wallet grows, so do the needs.
You have a reputation for being straightforward and honest.
Learn a new language and get a new soul.
A dubious friend may be an enemy in camouflage.
A tall dark stranger will soon enter our life.
Keep staring. I'll do a trick.

File diff suppressed because one or more lines are too long

View File

@ -1,30 +0,0 @@
You are the son of a motherless ogre.
Your mother was a hamster and your father smelled of elderberries.
I once owned a dog that was smarter than you.
Go climb a wall of dicks.
You fight like a dairy farmer.
I've spoken to apes more polite than you.
Go and boil your bottom! Son of a silly person!
Go away or I shall taunt you a second time.
Shouldn't you have a license for being that ugly?
Calling you an idiot would be an insult to all the stupid people.
Why don't you slip into something more comfortable...like a coma.
Well, they do say opposites attract...so I sincerely hope you meet somebody who is attractive, honest, intelligent, and cultured...
Are you always this stupid or are you just making a special effort today?
Yo momma so fat when she sits around the house she sits AROUND the house.
Yo momma so ugly she made an onion cry.
Is your name Maple Syrup? It should be, you sap.
Bite my shiny metal ass!
Up yours, meatbag.
Don't piss me off today, I'm running out of places to hide the bodies...
Why don't you go outside and play hide and go fuck yourself!
I'll use small words you're sure to understand, you warthog-faced buffoon.
You are a sad, strange little man, and you have my pity.
Sit your five dollar ass down before I make change.
What you've just said is one of the most insanely idiotic things I've ever heard. Everyone in this room is now dumber for having listened to it. May God have mercy on your soul.
Look up Idiot in the dictionary. Know what you'll find? The definition of the word IDIOT, which you are.
You're dumber than a bag of hammers.
Why don't you go back to your home on Whore Island?
If I had a dick this is when I'd tell you to suck it.
Go play in traffic.
The village called, they want their idiot back.

View File

@ -1,620 +0,0 @@
1 Stone
1:1 Granite
1:2 Polished Granite
1:3 Diorite
1:4 Polished Diorite
1:5 Andesite
1:6 Polished Andesite
2 Grass
3 Dirt
3:1 Dirt (No Grass)
3:2 Podzol
4 Cobblestone
5 Wooden Plank (Oak)
5:1 Wooden Plank (Spruce)
5:2 Wooden Plank (Birch)
5:3 Wooden Plank (Jungle)
5:4 Wooden Plank (Acacia)
5:5 Wooden Plank (Dark Oak)
6 Sapling (Oak)
6:1 Sapling (Spruce)
6:2 Sapling (Birch)
6:3 Sapling (Jungle)
6:4 Sapling (Acacia)
6:5 Sapling (Dark Oak)
7 Bedrock
8 Water
9 Water (No Spread)
10 Lava
11 Lava (No Spread)
12 Sand
12:1 Red Sand
13 Gravel
14 Gold Ore
15 Iron Ore
16 Coal Ore
17 Wood (Oak)
17:1 Wood (Spruce)
17:2 Wood (Birch)
17:3 Wood (Jungle)
17:4 Wood (Oak 4)
17:5 Wood (Oak 5)
18 Leaves (Oak)
18:1 Leaves (Spruce)
18:2 Leaves (Birch)
18:3 Leaves (Jungle)
19 Sponge
20 Glass
21 Lapis Lazuli Ore
22 Lapis Lazuli Block
23 Dispenser
24 Sandstone
24:1 Sandstone (Chiseled)
24:2 Sandstone (Smooth)
25 Note Block
26 Bed (Block)
27 Rail (Powered)
28 Rail (Detector)
29 Sticky Piston
30 Cobweb
31 Tall Grass (Dead Shrub)
31:1 Tall Grass
31:2 Tall Grass (Fern)
32 Dead Shrub
33 Piston
34 Piston (Head)
35 Wool
35:1 Orange Wool
35:2 Magenta Wool
35:3 Light Blue Wool
35:4 Yellow Wool
35:5 Lime Wool
35:6 Pink Wool
35:7 Gray Wool
35:8 Light Gray Wool
35:9 Cyan Wool
35:10 Purple Wool
35:11 Blue Wool
35:12 Brown Wool
35:13 Green Wool
35:14 Red Wool
35:15 Black Wool
36 Piston (Moving)
37 Dandelion
38 Poppy
38:1 Blue Orchid
38:2 Allium
38:4 Red Tulip
38:5 Orange Tulip
38:6 White Tulip
38:7 Pink Tulip
38:8 Oxeye Daisy
39 Brown Mushroom
40 Red Mushroom
41 Block of Gold
42 Block of Iron
43 Stone Slab (Double)
43:1 Sandstone Slab (Double)
43:2 Wooden Slab (Double)
43:3 Cobblestone Slab (Double)
43:4 Brick Slab (Double)
43:5 Stone Brick Slab (Double)
43:6 Nether Brick Slab (Double)
43:7 Quartz Slab (Double)
43:8 Smooth Stone Slab (Double)
43:9 Smooth Sandstone Slab (Double)
44 Stone Slab
44:1 Sandstone Slab
44:2 Wooden Slab
44:3 Cobblestone Slab
44:4 Brick Slab
44:5 Stone Brick Slab
44:6 Nether Brick Slab
44:7 Quartz Slab
45 Brick
46 TNT
47 Bookshelf
48 Moss Stone
49 Obsidian
50 Torch
51 Fire
52 Mob Spawner
53 Wooden Stairs (Oak)
54 Chest
55 Redstone Wire
56 Diamond Ore
57 Block of Diamond
58 Workbench
59 Wheat (Crop)
60 Farmland
61 Furnace
62 Furnace (Smelting)
63 Sign (Block)
64 Wood Door (Block)
65 Ladder
66 Rail
67 Cobblestone Stairs
68 Sign (Wall Block)
69 Lever
70 Stone Pressure Plate
71 Iron Door (Block)
72 Wooden Pressure Plate
73 Redstone Ore
74 Redstone Ore (Glowing)
75 Redstone Torch (Off)
76 Redstone Torch
77 Button (Stone)
78 Snow
79 Ice
80 Snow Block
81 Cactus
82 Clay Block
83 Sugar Cane (Block)
84 Jukebox
85 Fence
86 Pumpkin
87 Netherrack
88 Soul Sand
89 Glowstone
90 Portal
91 Jack-O-Lantern
92 Cake (Block)
93 Redstone Repeater (Block Off)
94 Redstone Repeater (Block On)
95 Stained Glass (White)
95:1 Stained Glass (Orange)
95:2 Stained Glass (Magenta)
95:3 Stained Glass (Light Blue)
95:4 Stained Glass (Yellow)
95:5 Stained Glass (Lime)
95:6 Stained Glass (Pink)
95:7 Stained Glass (Gray)
95:8 Stained Glass (Light Grey)
95:9 Stained Glass (Cyan)
95:10 Stained Glass (Purple)
95:11 Stained Glass (Blue)
95:12 Stained Glass (Brown)
95:13 Stained Glass (Green)
95:14 Stained Glass (Red)
95:15 Stained Glass (Black)
96 Trapdoor
97 Monster Egg (Stone)
97:1 Monster Egg (Cobblestone)
97:2 Monster Egg (Stone Brick)
97:3 Monster Egg (Mossy Stone Brick)
97:4 Monster Egg (Cracked Stone)
97:5 Monster Egg (Chiseled Stone)
98 Stone Bricks
98:1 Mossy Stone Bricks
98:2 Cracked Stone Bricks
98:3 Chiseled Stone Brick
99 Brown Mushroom (Block)
100 Red Mushroom (Block)
101 Iron Bars
102 Glass Pane
103 Melon (Block)
104 Pumpkin Vine
105 Melon Vine
106 Vines
107 Fence Gate
108 Brick Stairs
109 Stone Brick Stairs
110 Mycelium
111 Lily Pad
112 Nether Brick
113 Nether Brick Fence
114 Nether Brick Stairs
115 Nether Wart
116 Enchantment Table
117 Brewing Stand (Block)
118 Cauldron (Block)
119 End Portal
120 End Portal Frame
121 End Stone
122 Dragon Egg
123 Redstone Lamp
124 Redstone Lamp (On)
125 Oak-Wood Slab (Double)
125:1 Spruce-Wood Slab (Double)
125:2 Birch-Wood Slab (Double)
125:3 Jungle-Wood Slab (Double)
125:4 Acacia Wood Slab (Double)
125:5 Dark Oak Wood Slab (Double)
126 Oak-Wood Slab
126:1 Spruce-Wood Slab
126:2 Birch-Wood Slab
126:3 Jungle-Wood Slab
126:4 Acacia Wood Slab
126:5 Dark Oak Wood Slab
127 Cocoa Plant
128 Sandstone Stairs
129 Emerald Ore
130 Ender Chest
131 Tripwire Hook
132 Tripwire
133 Block of Emerald
134 Wooden Stairs (Spruce)
135 Wooden Stairs (Birch)
136 Wooden Stairs (Jungle)
137 Command Block
138 Beacon
139 Cobblestone Wall
139:1 Mossy Cobblestone Wall
140 Flower Pot (Block)
141 Carrot (Crop)
142 Potatoes (Crop)
143 Button (Wood)
144 Head Block (Skeleton)
144:1 Head Block (Wither)
144:2 Head Block (Zombie)
144:3 Head Block (Steve)
144:4 Head Block (Creeper)
145 Anvil
145:1 Anvil (Slightly Damaged)
145:2 Anvil (Very Damaged)
146 Trapped Chest
147 Weighted Pressure Plate (Light)
148 Weighted Pressure Plate (Heavy)
149 Redstone Comparator (Off)
150 Redstone Comparator (On)
151 Daylight Sensor
152 Block of Redstone
153 Nether Quartz Ore
154 Hopper
155 Quartz Block
155:1 Chiseled Quartz Block
155:2 Pillar Quartz Block
156 Quartz Stairs
157 Rail (Activator)
158 Dropper
159 Stained Clay (White)
159:1 Stained Clay (Orange)
159:2 Stained Clay (Magenta)
159:3 Stained Clay (Light Blue)
159:4 Stained Clay (Yellow)
159:5 Stained Clay (Lime)
159:6 Stained Clay (Pink)
159:7 Stained Clay (Gray)
159:8 Stained Clay (Light Gray)
159:9 Stained Clay (Cyan)
159:10 Stained Clay (Purple)
159:11 Stained Clay (Blue)
159:12 Stained Clay (Brown)
159:13 Stained Clay (Green)
159:14 Stained Clay (Red)
159:15 Stained Clay (Black)
160 Stained Glass Pane (White)
160:1 Stained Glass Pane (Orange)
160:2 Stained Glass Pane (Magenta)
160:3 Stained Glass Pane (Light Blue)
160:4 Stained Glass Pane (Yellow)
160:5 Stained Glass Pane (Lime)
160:6 Stained Glass Pane (Pink)
160:7 Stained Glass Pane (Gray)
160:8 Stained Glass Pane (Light Gray)
160:9 Stained Glass Pane (Cyan)
160:10 Stained Glass Pane (Purple)
160:11 Stained Glass Pane (Blue)
160:12 Stained Glass Pane (Brown)
160:13 Stained Glass Pane (Green)
160:14 Stained Glass Pane (Red)
160:15 Stained Glass Pane (Black)
162 Wood (Acacia Oak)
162:1 Wood (Dark Oak)
163 Wooden Stairs (Acacia)
164 Wooden Stairs (Dark Oak)
165 Slime Block
170 Hay Bale
171 Carpet (White)
171:1 Carpet (Orange)
171:2 Carpet (Magenta)
171:3 Carpet (Light Blue)
171:4 Carpet (Yellow)
171:5 Carpet (Lime)
171:6 Carpet (Pink)
171:7 Carpet (Grey)
171:8 Carpet (Light Gray)
171:9 Carpet (Cyan)
171:10 Carpet (Purple)
171:11 Carpet (Blue)
171:12 Carpet (Brown)
171:13 Carpet (Green)
171:14 Carpet (Red)
171:15 Carpet (Black)
172 Hardened Clay
173 Block of Coal
174 Packed Ice
175 Sunflower
175:1 Lilac
175:2 Double Tallgrass
175:3 Large Fern
175:4 Rose Bush
175:5 Peony
256 Iron Shovel
257 Iron Pickaxe
258 Iron Axe
259 Flint and Steel
260 Apple
261 Bow
262 Arrow
263 Coal
263:1 Charcoal
264 Diamond Gem
265 Iron Ingot
266 Gold Ingot
267 Iron Sword
268 Wooden Sword
269 Wooden Shovel
270 Wooden Pickaxe
271 Wooden Axe
272 Stone Sword
273 Stone Shovel
274 Stone Pickaxe
275 Stone Axe
276 Diamond Sword
277 Diamond Shovel
278 Diamond Pickaxe
279 Diamond Axe
280 Stick
281 Bowl
282 Mushroom Stew
283 Gold Sword
284 Gold Shovel
285 Gold Pickaxe
286 Gold Axe
287 String
288 Feather
289 Gunpowder
290 Wooden Hoe
291 Stone Hoe
292 Iron Hoe
293 Diamond Hoe
294 Gold Hoe
295 Wheat Seeds
296 Wheat
297 Bread
298 Leather Helmet
299 Leather Chestplate
300 Leather Leggings
301 Leather Boots
302 Chainmail Helmet
303 Chainmail Chestplate
304 Chainmail Leggings
305 Chainmail Boots
306 Iron Helmet
307 Iron Chestplate
308 Iron Leggings
309 Iron Boots
310 Diamond Helmet
311 Diamond Chestplate
312 Diamond Leggings
313 Diamond Boots
314 Gold Helmet
315 Gold Chestplate
316 Gold Leggings
317 Gold Boots
318 Flint
319 Raw Porkchop
320 Cooked Porkchop
321 Painting
322 Golden Apple
322:1 Enchanted Golden Apple
323 Sign
324 Wooden Door
325 Bucket
326 Bucket (Water)
327 Bucket (Lava)
328 Minecart
329 Saddle
330 Iron Door
331 Redstone Dust
332 Snowball
333 Boat
334 Leather
335 Bucket (Milk)
336 Clay Brick
337 Clay
338 Sugar Cane
339 Paper
340 Book
341 Slime Ball
342 Minecart (Storage)
343 Minecart (Powered)
344 Egg
345 Compass
346 Fishing Rod
347 Watch
348 Glowstone Dust
349 Raw Fish
349:1 Raw Salmon
349:2 Clownfish
349:3 Pufferfish
350 Cooked Fish
350:1 Cooked Salmon
350:2 Clownfish
350:3 Pufferfish
351 Ink Sack
351:1 Rose Red Dye
351:2 Cactus Green Dye
351:3 Cocoa Bean
351:4 Lapis Lazuli
351:5 Purple Dye
351:6 Cyan Dye
351:7 Light Gray Dye
351:8 Gray Dye
351:9 Pink Dye
351:10 Lime Dye
351:11 Dandelion Yellow Dye
351:12 Light Blue Dye
351:13 Magenta Dye
351:14 Orange Dye
351:15 Bone Meal
352 Bone
353 Sugar
354 Cake
355 Bed
356 Redstone Repeater
357 Cookie
358 Map
359 Shears
360 Melon (Slice)
361 Pumpkin Seeds
362 Melon Seeds
363 Raw Beef
364 Steak
365 Raw Chicken
366 Cooked Chicken
367 Rotten Flesh
368 Ender Pearl
369 Blaze Rod
370 Ghast Tear
371 Gold Nugget
372 Nether Wart Seeds
373 Water Bottle
373:16 Awkward Potion
373:32 Thick Potion
373:64 Mundane Potion
373:8193 Regeneration Potion (0:45)
373:8194 Swiftness Potion (3:00)
373:8195 Fire Resistance Potion (3:00)
373:8196 Poison Potion (0:45)
373:8197 Healing Potion
373:8198 Night Vision Potion (3:00)
373:8200 Weakness Potion (1:30)
373:8201 Strength Potion (3:00)
373:8202 Slowness Potion (1:30)
373:8204 Harming Potion
373:8205 Water Breathing Potion (3:00)
373:8206 Invisibility Potion (3:00)
373:8225 Regeneration Potion II (0:22)
373:8226 Swiftness Potion II (1:30)
373:8228 Poison Potion II (0:22)
373:8229 Healing Potion II
373:8233 Strength Potion II (1:30)
373:8236 Harming Potion II
373:8257 Regeneration Potion (2:00)
373:8258 Swiftness Potion (8:00)
373:8259 Fire Resistance Potion (8:00)
373:8260 Poison Potion (2:00)
373:8262 Night Vision Potion (8:00)
373:8264 Weakness Potion (4:00)
373:8265 Strength Potion (8:00)
373:8266 Slowness Potion (4:00)
373:8269 Water Breathing Potion (8:00)
373:8270 Invisibility Potion (8:00)
373:8289 Regeneration Potion II (1:00)
373:8290 Swiftness Potion II (4:00)
373:8292 Poison Potion II (1:00)
373:8297 Strength Potion II (4:00)
373:16385 Regeneration Splash (0:33)
373:16386 Swiftness Splash (2:15)
373:16387 Fire Resistance Splash (2:15)
373:16388 Poison Splash (0:33)
373:16389 Healing Splash
373:16390 Night Vision Splash (2:15)
373:16392 Weakness Splash (1:07)
373:16393 Strength Splash (2:15)
373:16394 Slowness Splash (1:07)
373:16396 Harming Splash
373:16397 Breathing Splash (2:15)
373:16398 Invisibility Splash (2:15)
373:16417 Regeneration Splash II (0:16)
373:16418 Swiftness Splash II (1:07)
373:16420 Poison Splash II (0:16)
373:16421 Healing Splash II
373:16425 Strength Splash II (1:07)
373:16428 Harming Splash II
373:16449 Regeneration Splash (1:30)
373:16450 Swiftness Splash (6:00)
373:16451 Fire Resistance Splash (6:00)
373:16452 Poison Splash (1:30)
373:16454 Night Vision Splash (6:00)
373:16456 Weakness Splash (3:00)
373:16457 Strength Splash (6:00)
373:16458 Slowness Splash (3:00)
373:16461 Breathing Splash (6:00)
373:16462 Invisibility Splash (6:00)
373:16481 Regeneration Splash II (0:45)
373:16482 Swiftness Splash II (3:00)
373:16484 Poison Splash II (0:45)
373:16489 Strength Splash II (3:00)
374 Glass Bottle
375 Spider Eye
376 Fermented Spider Eye
377 Blaze Powder
378 Magma Cream
379 Brewing Stand
380 Cauldron
381 Eye of Ender
382 Glistering Melon (Slice)
383:50 Spawn Egg (Creeper)
383:51 Spawn Egg (Skeleton)
383:52 Spawn Egg (Spider)
383:54 Spawn Egg (Zombie)
383:55 Spawn Egg (Slime)
383:56 Spawn Egg (Ghast)
383:57 Spawn Egg (Zombie Pigmen)
383:58 Spawn Egg (Endermen)
383:59 Spawn Egg (Cave Spider)
383:60 Spawn Egg (Silverfish)
383:61 Spawn Egg (Blaze)
383:62 Spawn Egg (Magma Cube)
383:65 Spawn Egg (Bat)
383:66 Spawn Egg (Witch)
383:90 Spawn Egg (Pig)
383:91 Spawn Egg (Sheep)
383:92 Spawn Egg (Cow)
383:93 Spawn Egg (Chicken)
383:94 Spawn Egg (Squid)
383:95 Spawn Egg (Wolf)
383:96 Spawn Egg (Mooshroom)
383:98 Spawn Egg (Ocelot)
383:100 Spawn Egg (Horse)
383:120 Spawn Egg (Villager)
384 Bottle of Enchanting
385 Fire Charge
386 Book and Quill
387 Written Book
388 Emerald
389 Item Frame
390 Flower Pot
391 Carrot
392 Potato
393 Baked Potato
394 Poisonous Potato
395 Empty Map
396 Golden Carrot
397 Head (Skeleton)
397:1 Head (Wither)
397:2 Head (Zombie)
397:3 Head (Steve)
397:4 Head (Creeper)
398 Carrot on a Stick
399 Nether Star
400 Pumpkin Pie
401 Firework Rocket
402 Firework Star
403 Enchanted Book
404 Redstone Comparator
405 Nether Brick (Item)
406 Nether Quartz
407 Minecart (TNT)
408 Minecart (Hopper)
417 Iron Horse Armor
418 Gold Horse Armor
419 Diamond Horse Armor
420 Lead
421 Name Tag
422 Minecart (Command Block)
2256 Music Disk (13)
2257 Music Disk (Cat)
2258 Music Disk (Blocks)
2259 Music Disk (Chirp)
2260 Music Disk (Far)
2261 Music Disk (Mall)
2262 Music Disk (Mellohi)
2263 Music Disk (Stal)
2264 Music Disk (Strad)
2265 Music Disk (Ward)
2266 Music Disk (11)
2267 Music Disk (Wait)

View File

@ -1,79 +0,0 @@
{
"templates": [
"rips off {user}'s {limbs} and leaves them to die.",
"grabs {user}'s head and rips it clean off their body.",
"grabs a {gun} and riddles {user}'s body with bullets.",
"gags and ties {user} then throws them off a {tall_thing}.",
"crushes {user} with a huge spiked {spiked_thing}.",
"glares at {user} until they die of boredom.",
"stabs {user} in the heart a few times with a {weapon_stab}.",
"rams a {weapon_explosive} up {user}'s ass and lets off a few rounds.",
"crushes {user}'s skull in with a {weapon_crush}.",
"unleashes the armies of Isengard on {user}.",
"gags and ties {user} then throws them off a {tall_thing} to their death.",
"reaches out and punches right through {user}'s chest.",
"slices {user}'s limbs off with a {weapon_slice}.",
"throws {user} to Cthulu and watches them get ripped to shreds.",
"feeds {user} to an owlbear who then proceeds to maul them violently.",
"turns {user} into a snail and covers then in salt.",
"snacks on {user}'s dismembered body.",
"stuffs {bomb} up {user}'s ass and waits for it to go off.",
"puts {user} into a sack, throws the sack in the river, and hurls the river into space.",
"goes bowling with {user}'s bloody disembodied head.",
"sends {user} to /dev/null!",
"feeds {user} coke and mentos till they violently explode."
],
"parts": {
"gun": [
"AK47",
"machine gun",
"automatic pistol",
"Uzi"
],
"limbs": [
"legs",
"arms",
"limbs"
],
"weapon_stab": [
"knife",
"shard of glass",
"sword blade",
"butchers knife",
"corkscrew"
],
"weapon_slice": [
"sharpened katana",
"chainsaw",
"polished axe"
],
"weapon_crush": [
"spiked mace",
"baseball bat",
"wooden club",
"massive steel ball",
"heavy iron rod"
],
"weapon_explosive": [
"rocket launcher",
"grenade launcher",
"napalm launcher"
],
"tall_thing": [
"bridge",
"tall building",
"cliff",
"mountain"
],
"spiked_thing": [
"boulder",
"rock",
"barrel of rocks"
],
"bomb": [
"a bomb",
"some TNT",
"a bunch of C4"
]
}
}

View File

@ -1,22 +0,0 @@
rips off {user}'s legs and leaves them to die.
grabs {user}'s head and rips it clean off their body.
grabs a machine gun and riddles {user}'s body with bullets.
gags and ties {user} then throws them off a bridge.
crushes {user} with a huge spiked boulder.
glares at {user} until they die of boredom.
shivs {user} in the heart a few times.
rams a rocket launcher up {user}'s ass and lets off a few rounds.
crushes {user}'s skull in with a spiked mace.
unleashes the armies of Isengard on {user}.
gags and ties {user} then throws them off a building to their death.
reaches out and punches right through {user}'s chest.
slices {user}'s limbs off with a sharpened Katana.
throws {user} to Cthulu and watches them get ripped to shreds.
feeds {user} to an owlbear who then proceeds to maul them violently.
turns {user} into a snail and salts them.
snacks on {user}'s dismembered body.
stuffs some TNT up {user}'s ass and waits for it to go off.
puts {user} into a sack, throws the sack in the river, and hurls the river into space.
goes bowling with {user}'s bloody disembodied head.
sends {user} to /dev/null!
feeds {user} coke and mentos till they violently explode.

View File

@ -1,99 +0,0 @@
smacks {user} in the face with a burlap sack full of broken glass.
swaps {user}'s shampoo with glue.
installs Windows Vista on {user}'s computer.
forces {user} to use perl for 3 weeks.
registers {user}'s name with 50 known spammers.
resizes {user}'s console to 40x24.
takes {user}'s drink.
dispenses {user}'s email address to a few hundred 'bulk mailing services'.
pokes {user} in the eye.
beats {user} senseless with a 50lb Linux manual.
cats /dev/random into {user}'s ear.
signs {user} up for AOL.
downvotes {user} on Reddit.
enrolls {user} in Visual Basic 101.
sporks {user}.
drops a truckload of support tickets on {user}.
judo chops {user}.
sets {user}'s resolution to 800x600.
formats {user}'s harddrive to fat12.
rm -rf's {user}.
stabs {user}.
makes {user} learn C++.
steals {user}'s mojo.
strangles {user} with a doohicky mouse cord.
whacks {user} with the cluebat.
sells {user} on EBay.
drops creepers on {user}'s house.
throws all of {user}'s diamond gear into lava.
uses {user} as a biological warfare study.
uses the 'Customer Appreciation Bat' on {user}.
puts {user} in the Total Perspective Vortex.
casts {user} into the fires of Mt. Doom.
gives {user} a melvin.
turns {user} over to the Fun Police.
turns over {user} to Agent Smith to be 'bugged'.
takes away {user}'s internet connection.
pushes {user} past the Shoe Event Horizon.
counts '1, 2, 5... er... 3!' and hurls the Holy Handgrenade Of Antioch at {user}.
puts {user} in a nest of camel spiders.
puts 'alias vim=emacs' in {user}'s /etc/profile.
uninstalls every web browser from {user}'s system.
signs {user} up for getting hit on the head lessons.
makes {user} try to set up a Lexmark printer.
fills {user}'s eyedrop bottle with lime juice.
casts {user} into the fires of Mt. Doom.
gives {user} a Flying Dutchman.
rips off {user}'s arm, and uses it to beat them to death.
pierces {user}'s nose with a rusty paper hole puncher.
pokes {user} with a rusty nail.
puts sugar between {user}'s bedsheets.
pours sand into {user}'s breakfast.
mixes epoxy into {user}'s toothpaste.
puts Icy-Hot in {user}'s lube container.
forces {user} to use a Commodore 64 for all their word processing.
puts {user} in a room with several heavily armed manic depressives.
makes {user} watch reruns of "Blue's Clues".
puts lye in {user}'s coffee.
tattoos the Windows symbol on {user}'s ass.
lets Borg have his way with {user}.
signs {user} up for line dancing classes at the local senior center.
wakes {user} out of a sound sleep with some brand new nipple piercings.
gives {user} a 2 gauge Prince Albert.
forces {user} to eat all their veggies.
covers {user}'s toilet paper with lemon-pepper.
fills {user}'s ketchup bottle with Dave's Insanity sauce.
forces {user} to stare at an incredibly frustrating and seemingly never-ending IRC political debate.
knocks two of {user}'s teeth out with a 2x4.
removes Debian from {user}'s system.
switches {user} over to CentOS.
uses {user}'s iPod for skeet shooting practice.
gives {user}'s phone number to Borg.
posts {user}'s IP, username(s), and password(s) on 4chan.
forces {user} to use words like 'irregardless' and 'administrate' (thereby sounding like a real dumbass).
tickles {user} until they wet their pants and pass out.
replaces {user}'s KY with elmer's clear wood glue.
replaces {user}'s TUMS with alka-seltzer tablets.
squeezes habanero pepper juice into {user}'s tub of vaseline.
forces {user} to learn the Win32 API.
gives {user} an atomic wedgie.
ties {user} to a chair and forces them to listen to 'N Sync at full blast.
forces {user} to use notepad for text editing.
frowns at {user} really, really hard.
jabs a hot lighter into {user}'s eye sockets.
forces {user} to browse the web with IE6.
takes {user} out at the knees with a broken pool cue.
forces {user} to listen to emo music.
lets a few creepers into {user}'s house.
signs {user} up for the Iowa State Ferret Legging Championship.
attempts to hotswap {user}'s RAM.
dragon punches {user}.
puts railroad spikes into {user}'s side.
replaces {user}'s lubricant with liquid weld.
replaces {user}'s stress pills with rat poison pellets.
replaces {user}'s itch cream with hair removal cream.
does the Australian Death Grip on {user}.
dances upon the grave of {user}'s ancestors.
farts loudly in {user}'s general direction.
flogs {user} with stinging nettle.
hands {user} a poison ivy joint.

View File

@ -1,170 +0,0 @@
{
"name": "Dragon names",
"author": "Brett Slocum",
"templates": {
"default": "{start}{end}"
},
"default_templates": [
"default"
],
"parts": {
"end": [
"bald",
"beald",
"balt",
"balth",
"beorht",
"berct",
"berict",
"beorn",
"bern",
"brand",
"broad",
"burg",
"burh",
"cyni",
"cyn",
"degn",
"ferth",
"flaed",
"fled",
"for",
"frith",
"frit",
"frid",
"gar",
"geld",
"gifu",
"geofu",
"gisl",
"gund",
"gunn",
"gyth",
"gyd",
"haed",
"hathu",
"heard",
"hard",
"here",
"heri",
"helm",
"hild",
"hun",
"lac",
"laf",
"lid",
"lind",
"linda",
"maer",
"man",
"mon",
"mund",
"noth",
"raed",
"red",
"refu",
"ric",
"sig",
"sige",
"stan",
"swith",
"swid",
"theof",
"theow",
"thryth",
"thryd",
"wealch",
"walh",
"weald",
"wald",
"weard",
"ward",
"wic",
"wict",
"wiht",
"wine",
"wini",
"wiw",
"wiv",
"wuda",
"wida",
"wudu",
"wulf",
"ulf",
"wyn",
"wynn"
],
"start": [
"Aelf",
"Aelb",
"Aethel",
"Aedil",
"Badu",
"Beado",
"Beo",
"Blith",
"Bregu",
"Ceol",
"Ceon",
"Coin",
"Cene",
"Cuth",
"Cud",
"Cwic",
"Cuic",
"Quic",
"Dryct",
"Dryht",
"Ead",
"Ed",
"Aead",
"Eald",
"Ald",
"Ealh",
"Alh",
"Earcon",
"Ercon",
"Earn",
"Ecg",
"Ec",
"Eofor",
"Eorcon",
"Eormen",
"Yrmen",
"Folc",
"Ford",
"Fri",
"Gold",
"Grim",
"Haem",
"Haeth",
"Heah",
"Healf",
"Hreth",
"Hroth",
"Huaet",
"Hyg",
"Hugu",
"Iaru",
"Leof",
"Maegen",
"Oidil",
"Ongen",
"Os",
"Rath",
"Saex",
"Sax",
"Sex",
"Sele",
"Tat",
"Theod",
"Til",
"Torct",
"Trum",
"Tun",
"Waeg",
"Wig",
"Wil"
]
}
}

View File

@ -1,54 +0,0 @@
{
"name": "Dwarven names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"bur",
"fur",
"gan",
"gnus",
"gnar",
"li",
"lin",
"lir",
"mli",
"nar",
"nus",
"rin",
"ran",
"sin",
"sil",
"sur"
],
"mid": [
"a",
"e",
"i",
"o",
"oi",
"u"
],
"first": [
"B",
"D",
"F",
"G",
"Gl",
"H",
"K",
"L",
"M",
"N",
"R",
"S",
"T",
"V"
]
}
}

View File

@ -1,85 +0,0 @@
{
"name": "Elven female names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"clya",
"lindi",
"di",
"dien",
"dith",
"dia",
"lith",
"lia",
"ndra",
"ng",
"nia",
"niel",
"rith",
"thien",
"thiel",
"viel",
"wen",
"wien",
"wiel"
],
"mid": [
"a",
"a",
"adrie",
"ara",
"e",
"e",
"ebri",
"i",
"io",
"ithra",
"ilma",
"il-Ga",
"o",
"orfi",
"o",
"u",
"y"
],
"first": [
"An",
"Am",
"Bel",
"Cel",
"C",
"Cal",
"Del",
"El",
"Elr",
"Elv",
"Eow",
"Ear",
"F",
"G",
"Gal",
"Gl",
"H",
"Is",
"Leg",
"Lem",
"M",
"N",
"P",
"R",
"S",
"T",
"Thr",
"Tin",
"Ur",
"Un",
"V"
]
}
}

View File

@ -1,86 +0,0 @@
{
"name": "Elven male names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"l",
"las",
"lad",
"ldor",
"ldur",
"lith",
"mir",
"n",
"nd",
"ndel",
"ndil",
"ndir",
"nduil",
"ng",
"mbor",
"r",
"ril",
"riand",
"rion",
"wyn"
],
"mid": [
"a",
"a",
"adrie",
"ara",
"e",
"e",
"ebri",
"i",
"io",
"ithra",
"ilma",
"il-Ga",
"o",
"orfi",
"o",
"u",
"y"
],
"first": [
"An",
"Am",
"Bel",
"Cel",
"C",
"Cal",
"Del",
"El",
"Elr",
"Elv",
"Eow",
"Ear",
"F",
"G",
"Gal",
"Gl",
"H",
"Is",
"Leg",
"Lem",
"M",
"N",
"P",
"R",
"S",
"T",
"Thr",
"Tin",
"Ur",
"Un",
"V"
]
}
}

View File

@ -1,554 +0,0 @@
{
"name": "General fantasy names",
"author": "Brett Slocum",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"ty",
"carn",
"ar",
"acy",
"er",
"al",
"gary",
"y",
"ar",
"arny",
"alen",
"carth",
"gant",
"y",
"ber",
"art",
"dal",
"arth",
"arth",
"an",
"ere",
"geth",
"aldy",
"yn",
"valer",
"arne",
"aller",
"varn",
"ayne",
"an",
"nal",
"tyne",
"ayne",
"art",
"ont",
"ney",
"aver",
"lyn",
"iel",
"gar",
"y",
"arry",
"or",
"quine",
"astar",
"er",
"aryn",
"art",
"war",
"asty",
"zane",
"arik",
"ayne",
"an",
"oller",
"warty",
"aryne",
"chean",
"ta",
"un",
"tha",
"reth",
"ant",
"el",
"yne",
"el",
"tuny",
"wat",
"juin",
"dor",
"gayn",
"tyn",
"dar",
"car",
"gine",
"codd",
"quent",
"eas",
"ew",
"azer",
"ont",
"ly",
"stead",
"orn",
"en",
"cath",
"iera",
"que",
"air",
"la",
"art",
"erry",
"sa",
"ar",
"er",
"ern",
"arty",
"doth",
"y",
"ert",
"dy",
"orn",
"ont",
"ern",
"ayn",
"art",
"warne",
"arn",
"in",
"ian",
"el",
"ak",
"il",
"ydd",
"ime",
"yn",
"en",
"in",
"im",
"el",
"ar",
"ro",
"is",
"is",
"ro",
"era",
"ene",
"in",
"ane",
"iam",
"ain",
"ir",
"un",
"il",
"bin",
"lin",
"is",
"sene",
"bin",
"lir",
"ame",
"a",
"fyn",
"se",
"in",
"yd",
"ien",
"ain",
"yn",
"ar",
"er",
"in",
"sume",
"ras",
"on",
"mel",
"luth",
"ance",
"er",
"yn",
"an",
"ar",
"ayne",
"eth",
"nyd",
"ter",
"rik",
"nik",
"ro",
"a",
"mel",
"yn",
"ris",
"lene",
"ane",
"yr"
],
"mid": [
"gur",
"carn",
"az",
"acy",
"ayn",
"asc",
"gary",
"hen",
"tan",
"arny",
"alen",
"carth",
"gant",
"rath",
"cam",
"art",
"ron",
"arth",
"arth",
"carad",
"ere",
"geth",
"aldy",
"yn",
"valer",
"arne",
"aller",
"varn",
"ar",
"an",
"nal",
"tyne",
"ar",
"art",
"ont",
"aur",
"aver",
"lyn",
"as",
"gar",
"cuth",
"arry",
"or",
"quine",
"astar",
"mel",
"aryn",
"art",
"war",
"asty",
"zane",
"arik",
"ayne",
"loc",
"oller",
"warty",
"aryne",
"chean",
"quin",
"tar",
"dar",
"reth",
"ant",
"an",
"yne",
"ax",
"tuny",
"wat",
"juin",
"a",
"gayn",
"on",
"an",
"car",
"gine",
"codd",
"quent",
"eas",
"ew",
"azer",
"am",
"ly",
"stead",
"orn",
"ar",
"cath",
"iera",
"que",
"air",
"la",
"art",
"erry",
"end",
"om",
"ast",
"et",
"arty",
"doth",
"cath",
"ert",
"dy",
"orn",
"ont",
"tak",
"ar",
"art",
"warne",
"arn",
"in",
"ian",
"el",
"ak",
"il",
"ydd",
"ime",
"yn",
"en",
"in",
"im",
"el",
"ar",
"ro",
"is",
"is",
"ro",
"era",
"ene",
"in",
"ane",
"iam",
"ain",
"ir",
"un",
"il",
"bin",
"lin",
"is",
"sene",
"bin",
"lir",
"ame",
"a",
"fyn",
"y",
"in",
"yd",
"ien",
"ain",
"yn",
"ar",
"er",
"in",
"sume",
"ras",
"id",
"mel",
"luth",
"ance",
"er",
"yn",
"an",
"ar",
"ayne",
"eth",
"len",
"ter",
"rik",
"er",
"ro",
"tin",
"mel",
"yn",
"ris",
"lene",
"ane",
"as"
],
"first": [
"Ral",
"Na",
"Ard",
"Vald",
"Cal",
"Hy",
"Pan",
"Chies",
"Per",
"Er",
"Hob",
"Harg",
"Win",
"Mar",
"Quarne",
"Ba",
"Er",
"Odas",
"Ka",
"Mold",
"Syn",
"Ro",
"Jast",
"Yal",
"Nap",
"Vard",
"As",
"Binthe",
"Zald",
"Dez",
"Las",
"Uld",
"Nev",
"Haur",
"Bar",
"Das",
"Ty",
"Dar",
"Ost",
"Tral",
"Grave",
"Eth",
"Flar",
"Yal",
"Klab",
"Harab",
"Jar",
"Nor",
"Dain",
"Toc",
"Bay",
"Haith",
"Cal",
"Lar",
"Naut",
"Druc",
"Bar",
"Art",
"For",
"Mart",
"Yar",
"Ha",
"Ny",
"Yar",
"Verd",
"Wy",
"Plag",
"Ter",
"Haur",
"Var",
"Ar",
"Dar",
"Val",
"Mar",
"Car",
"Loc",
"Wearn",
"Dras",
"Bel",
"Har",
"Jar",
"For",
"Kil",
"Oc",
"Al",
"Skal",
"Nun",
"Az",
"Kop",
"Houl",
"Lab",
"Jar",
"Vast",
"Claune",
"Tes",
"Ob",
"Nist",
"El",
"Est",
"Zol",
"Brow",
"Pulg",
"Star",
"Kren",
"Crac",
"Scaun",
"Wal",
"Quer",
"Ry",
"Cyn",
"Rusk",
"Del",
"Lab",
"Mel",
"Sep",
"Lor",
"Ros",
"Jar",
"Daf",
"Hal",
"Kol",
"In",
"Ael",
"Sald",
"Kuv",
"Ym",
"Ca",
"Keld",
"Bar",
"Tarl",
"Shot",
"Pes",
"Quer",
"Lor",
"Geld",
"Ar",
"Har",
"Bae",
"Vad",
"Pas",
"Ur",
"Nor",
"Kir",
"Var",
"Mel",
"Ar",
"Shy",
"I",
"Rald",
"Cor",
"Sar",
"Kor",
"Rol",
"Har",
"Ash",
"Dir",
"Las",
"Vab",
"Ald",
"Par",
"Ob",
"Hor",
"Chy",
"Jar",
"Ryle",
"Char",
"Hab",
"Sar",
"Vart",
"Nist",
"Obr",
"Jar",
"Ge",
"Yas",
"Pav",
"Jes",
"Shot",
"Mar",
"Hor",
"Er",
"Ki",
"Har",
"Cal",
"And"
]
}
}

View File

@ -1,190 +0,0 @@
{
"name": "Fantasy female names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"beth",
"cia",
"cien",
"clya",
"de",
"dia",
"dda",
"dien",
"dith",
"dia",
"lind",
"lith",
"lia",
"lian",
"lla",
"llan",
"lle",
"ma",
"mma",
"mwen",
"meth",
"n",
"n",
"n",
"nna",
"ndra",
"ng",
"ni",
"nia",
"niel",
"rith",
"rien",
"ria",
"ri",
"rwen",
"sa",
"sien",
"ssa",
"ssi",
"swen",
"thien",
"thiel",
"viel",
"via",
"ven",
"veth",
"wen",
"wen",
"wen",
"wen",
"wia",
"weth",
"wien",
"wiel"
],
"mid": [
"a",
"a",
"a",
"ae",
"ae",
"au",
"ao",
"are",
"ale",
"ali",
"ay",
"ardo",
"e",
"e",
"e",
"ei",
"ea",
"ea",
"eri",
"era",
"ela",
"eli",
"enda",
"erra",
"i",
"i",
"i",
"ia",
"ie",
"ire",
"ira",
"ila",
"ili",
"ira",
"igo",
"o",
"oa",
"oi",
"oe",
"ore",
"u",
"y"
],
"first": [
"A",
"Ab",
"Ac",
"Ad",
"Af",
"Agr",
"Ast",
"As",
"Al",
"Adw",
"Adr",
"Ar",
"B",
"Br",
"C",
"C",
"C",
"Cr",
"Ch",
"Cad",
"D",
"Dr",
"Dw",
"Ed",
"Eth",
"Et",
"Er",
"El",
"Eow",
"F",
"Fr",
"G",
"Gr",
"Gw",
"Gw",
"Gal",
"Gl",
"H",
"Ha",
"Ib",
"Jer",
"K",
"Ka",
"Ked",
"L",
"Loth",
"Lar",
"Leg",
"M",
"Mir",
"N",
"Nyd",
"Ol",
"Oc",
"On",
"P",
"Pr",
"Q",
"R",
"Rh",
"S",
"Sev",
"T",
"Tr",
"Th",
"Th",
"Ul",
"Um",
"Un",
"V",
"Y",
"Yb",
"Z",
"W",
"W",
"Wic"
]
}
}

View File

@ -1,199 +0,0 @@
{
"name": "Generic names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"a",
"and",
"b",
"bwyn",
"baen",
"bard",
"c",
"ctred",
"cred",
"ch",
"can",
"d",
"dan",
"don",
"der",
"dric",
"dfrid",
"dus",
"f",
"g",
"gord",
"gan",
"l",
"li",
"lgrin",
"lin",
"lith",
"lath",
"loth",
"ld",
"ldric",
"ldan",
"m",
"mas",
"mos",
"mar",
"mond",
"n",
"nydd",
"nidd",
"nnon",
"nwan",
"nyth",
"nad",
"nn",
"nnor",
"nd",
"p",
"r",
"ron",
"rd",
"s",
"sh",
"seth",
"sean",
"t",
"th",
"th",
"tha",
"tlan",
"trem",
"tram",
"v",
"vudd",
"w",
"wan",
"win",
"win",
"wyn",
"wyn",
"wyr",
"wyr",
"wyth"
],
"mid": [
"a",
"ae",
"ae",
"au",
"ao",
"are",
"ale",
"ali",
"ay",
"ardo",
"e",
"ei",
"ea",
"ea",
"eri",
"era",
"ela",
"eli",
"enda",
"erra",
"i",
"ia",
"ie",
"ire",
"ira",
"ila",
"ili",
"ira",
"igo",
"o",
"oa",
"oi",
"oe",
"ore",
"u",
"y"
],
"first": [
"A",
"Ab",
"Ac",
"Ad",
"Af",
"Agr",
"Ast",
"As",
"Al",
"Adw",
"Adr",
"Ar",
"B",
"Br",
"C",
"C",
"C",
"Cr",
"Ch",
"Cad",
"D",
"Dr",
"Dw",
"Ed",
"Eth",
"Et",
"Er",
"El",
"Eow",
"F",
"Fr",
"G",
"Gr",
"Gw",
"Gw",
"Gal",
"Gl",
"H",
"Ha",
"Ib",
"Jer",
"K",
"Ka",
"Ked",
"L",
"Loth",
"Lar",
"Leg",
"M",
"Mir",
"N",
"Nyd",
"Ol",
"Oc",
"On",
"P",
"Pr",
"R",
"Rh",
"S",
"Sev",
"T",
"Tr",
"Th",
"Th",
"V",
"Y",
"Yb",
"Z",
"W",
"W",
"Wic"
]
}
}

View File

@ -1,38 +0,0 @@
{
"name": "Tolkien hobbit names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"bo",
"do",
"doc",
"go",
"grin",
"m"
],
"mid": [
"a",
"e",
"i",
"ia",
"o",
"oi",
"u"
],
"first": [
"B",
"Dr",
"Fr",
"Mer",
"Per",
"S"
]
}
}

View File

@ -1,124 +0,0 @@
{
"name": "Inn/Tavern/Bar/Pub Names",
"author": "Kimmo \"Arkhan\" Kulovesi",
"templates": {
"default": "{start} {end}"
},
"default_templates": [
"default"
],
"parts": {
"end": [
"Axe",
"Barrel",
"Basilisk",
"Belly",
"Blade",
"Boar",
"Breath",
"Brew",
"Busom",
"Claw",
"Coin",
"Delight",
"Den",
"Dragon",
"Drum",
"Dwarf",
"Fist",
"Flea",
"Flower",
"Gem",
"Gryphon",
"Hand",
"Head",
"Inn",
"Lady",
"Maiden",
"Lantern",
"Lips",
"Monk",
"Mug",
"Nest",
"Orc",
"Pearl",
"Pig",
"Pit",
"Place",
"Tavern",
"Portal",
"Ranger",
"Rest",
"Sailor",
"Sleep",
"Song",
"Stool",
"Swan",
"Swords",
"Tree",
"Unicorn",
"Whale",
"Wish",
"Wizard",
"Rain"
],
"start": [
"Bent",
"Black",
"Blind",
"Blue",
"Bob's",
"Joe's",
"Broken",
"Buxom",
"Cat's",
"Crow's",
"Dirty",
"Dragon",
"Dragon's",
"Drunken",
"Eagle's",
"Eastern",
"Falcon's",
"Fawning",
"Fiend's",
"Flaming",
"Frosty",
"Frozen",
"Gilded",
"Genie's",
"Golden",
"Golden",
"Gray",
"Green",
"King's",
"Licked",
"Lion's",
"Mended",
"Octopus",
"Old",
"Old",
"Orc's",
"Otik's",
"Tika's",
"Pink",
"Pot",
"Puking",
"Queen's",
"Red",
"Ruby",
"Delicate",
"Sea",
"Sexy",
"Shining",
"Silver",
"Singing",
"Strange",
"Thirsty",
"Violet",
"White",
"Wild",
"Yawing "
]
}
}

View File

@ -1,166 +0,0 @@
{
"name": "Fantasy Item Names",
"author": "Luke Rogers",
"website": "http://www.dempltr.com/",
"templates": {
"default": "{type} of {power}",
"default_stat": "{stats} {type} of {power}",
"prefix": "{prefix} {type} of {power}",
"both": "{prefix} {material} {type}",
"both_stat": "{stats} {prefix} {material} {type}",
"material": "{material} {type} of {power}",
"animal": "{prefix} {type} of the {animal}",
"short": "{prefix} {type}",
"short_m": "{material} {type}",
"short_m_stat": "{stats} {material} {type}"
},
"default_templates": ["default","short","prefix","material","both","both_stat","short_m","short_m_stat","default_stat"],
"parts": {
"type": [
"Sword",
"Wand",
"Cloak",
"Robe",
"Stick",
"Staff",
"Ring",
"Amulet",
"Axe",
"Hammer",
"Shield",
"Greataxe",
"Halberd",
"Scythe",
"Scroll",
"Book",
"Armor",
"Dagger",
"Bow",
"Lance",
"Mace",
"Flail",
"Javelin",
"Dart",
"Spear",
"Sling",
"Rapier",
"Coin",
"Trident",
"Whip",
"Crown",
"Jewel",
"Jem",
"Hoopak",
"Orb",
"Platemail",
"Needle",
"Pin",
"Token",
"Helm",
"Battleaxe",
"Longsword"
],
"animal": [
"Bear",
"Horse",
"Chicken",
"Wolf",
"Eagle"
],
"stats": [
"+3",
"+2",
"+1",
"-2",
"-1"
],
"prefix": [
"Carved",
"Fragile",
"Heavy",
"Worn",
"Arcane",
"Intricate",
"Enchanted",
"Weathered",
"Damaged",
"Spiked",
"Strengthened",
"Fitted",
"Cursed",
"Charred",
"Reinforced"
],
"material": [
"Wooden",
"Stone",
"Glass",
"Diamond",
"Iron",
"Icy",
"Ebony",
"Steel",
"Paper",
"Adamantite",
"Obsidian",
"Mythril",
"Granite",
"Metal",
"Dwarven",
"Orcish"
],
"power": [
"Valor",
"Magic",
"Power",
"Light",
"Kings",
"Knights",
"Shadows",
"Chaos",
"Flame",
"Faith",
"Fire",
"Death",
"Sorcery",
"Stoning",
"Hope",
"Healing",
"Pain",
"Hurting",
"Belar",
"Slaying",
"Haste",
"Avatar",
"Virtue",
"the Way",
"Angels",
"Devils",
"Speed",
"Flying",
"Seeing",
"Blocking",
"Battle",
"Love",
"Hatred",
"Sorcery",
"Nagash",
"Sauron",
"Regeneration",
"Arthur",
"Ending",
"Torak",
"Aldur",
"Time",
"Evil",
"Notch",
"Destruction",
"Morgoth",
"Lucifer",
"Allure",
"Arkhan",
"Protection"
]
}
}

View File

@ -1,217 +0,0 @@
{
"name": "Male fantasy names",
"author": "Johan Danforth",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"a",
"and",
"b",
"bwyn",
"baen",
"bard",
"c",
"ch",
"can",
"d",
"dan",
"don",
"der",
"dric",
"dus",
"f",
"g",
"gord",
"gan",
"han",
"har",
"jar",
"jan",
"k",
"kin",
"kith",
"kath",
"koth",
"kor",
"kon",
"l",
"li",
"lin",
"lith",
"lath",
"loth",
"ld",
"ldan",
"m",
"mas",
"mos",
"mar",
"mond",
"n",
"nydd",
"nidd",
"nnon",
"nwan",
"nyth",
"nad",
"nn",
"nnor",
"nd",
"p",
"r",
"red",
"ric",
"rid",
"rin",
"ron",
"rd",
"s",
"sh",
"seth",
"sean",
"t",
"th",
"th",
"tha",
"tlan",
"trem",
"tram",
"v",
"vudd",
"w",
"wan",
"win",
"win",
"wyn",
"wyn",
"wyr",
"wyr",
"wyth"
],
"mid": [
"a",
"ae",
"ae",
"au",
"ao",
"are",
"ale",
"ali",
"ay",
"ardo",
"e",
"edri",
"ei",
"ea",
"ea",
"eri",
"era",
"ela",
"eli",
"enda",
"erra",
"i",
"ia",
"ie",
"ire",
"ira",
"ila",
"ili",
"ira",
"igo",
"o",
"oha",
"oma",
"oa",
"oi",
"oe",
"ore",
"u",
"y"
],
"first": [
"A",
"Ab",
"Ac",
"Ad",
"Af",
"Agr",
"Ast",
"As",
"Al",
"Adw",
"Adr",
"Ar",
"B",
"Br",
"C",
"C",
"C",
"Cr",
"Ch",
"Cad",
"D",
"Dr",
"Dw",
"Ed",
"Eth",
"Et",
"Er",
"El",
"Eow",
"F",
"Fr",
"G",
"Gr",
"Gw",
"Gw",
"Gal",
"Gl",
"H",
"Ha",
"Ib",
"J",
"Jer",
"K",
"Ka",
"Ked",
"L",
"Loth",
"Lar",
"Leg",
"M",
"Mir",
"N",
"Nyd",
"Ol",
"Oc",
"On",
"P",
"Pr",
"Q",
"R",
"Rh",
"S",
"Sev",
"T",
"Tr",
"Th",
"Th",
"Ul",
"Um",
"Un",
"V",
"Y",
"Yb",
"Z",
"W",
"W",
"Wic"
]
}
}

View File

@ -1,81 +0,0 @@
{
"name": "Babylon 5 Narn names",
"author": "Kevin G. Nunn",
"templates": {
"default": "{first}{mid}{final}"
},
"default_templates": [
"default"
],
"parts": {
"final": [
"ch",
"k",
"kk",
"l",
"n",
"r",
"th",
"s"
],
"mid": [
"Ba",
"Bo",
"Da",
"Do",
"Ga",
"Ge",
"Go",
"Ka",
"Ko",
"La",
"Le",
"Lo",
"Ma",
"Mo",
"Na",
"No",
"Oo",
"Pa",
"Po",
"Qua",
"Quo",
"Ra",
"Rala",
"Ro",
"Sha",
"Shali",
"Ska",
"Skali",
"Sta",
"Ste",
"Sto",
"Ta",
"Te",
"Tee",
"To",
"Tha",
"Tho",
"Va",
"Vo",
"Vy",
"Wa"
],
"first": [
"Ch'",
"Do'",
"G'",
"Gre'",
"Mak'",
"Na'",
"Re'",
"Sh'",
"So'",
"T'",
"Ta'",
"Th'",
"Thu'",
"Tu'"
]
}
}

View File

@ -1,304 +0,0 @@
{
"name": "Warrior Cats - Cat Names",
"author": "Kenyania",
"templates": {
"default": "{start}{end}"
},
"default_templates": [
"default"
],
"parts": {
"end": [
"tail",
"shine",
"shade",
"breeze",
"foot",
"cloud",
"petal",
"thorn",
"heart",
"streak",
"stripe",
"dapple",
"spot",
"blaze",
"blossom",
"hawk",
"step",
"gaze",
"dapple",
"berry",
"soul",
"swirl",
"scar",
"snow",
"fall",
"flight",
"whisper",
"walker",
"leaf",
"wish",
"fur",
"pelt",
"leg",
"tooth",
"whisker",
"nose",
"stump",
"scale",
"wing",
"feather",
"spark",
"flame",
"willow",
"leaf",
"storm",
"back",
"head",
"ear",
"shard",
"eye",
"drift",
"strike",
"wave",
"ripple",
"flare",
"scratch",
"stone",
"stream",
"shine",
"shimmer",
"beak",
"stalk",
"moon",
"dusk",
"cloud",
"spirit",
"pool",
"dawn"
],
"start": [
"Misty",
"Mist",
"Blossom",
"Ebony",
"Breeze",
"Wind",
"Thunder",
"River",
"Stream",
"Rat",
"Mouse",
"Hazel",
"Kestrel",
"Serval",
"Snow",
"Blue",
"Red",
"Birch",
"Willow",
"Grass",
"Maple",
"Dawn",
"Shimmer",
"Creek",
"Poppy",
"Fox",
"Badger",
"Grass",
"Shade",
"Shaded",
"Swift",
"Huge",
"Small",
"Big",
"Tiny",
"Little",
"Tall",
"Vine",
"Lion",
"Jay",
"Holly",
"Berry",
"Dove",
"Leaf",
"Squirrel",
"Bent",
"Crooked",
"Bracken",
"Long",
"Grace",
"Song",
"Melody",
"Shine",
"Moss",
"Algae",
"Beetle",
"Spotted",
"Dappled",
"Leaf",
"Yellow",
"Red",
"Bristle",
"Stem",
"Lily",
"Petal",
"Flower",
"Pip",
"Seed",
"Brown",
"Sparkle",
"Gust",
"Flight",
"Pool",
"Lake",
"Forest",
"Fawn",
"Mole",
"Vole",
"Shrew",
"Apple",
"Bark",
"Dog",
"Fallen",
"Bramble",
"Lavender",
"Lilac",
"Lynx",
"Rain",
"Patch",
"Shell",
"Vole",
"Dream",
"Flake",
"Cardinal",
"Splash",
"Puddle",
"Bee",
"Bumble",
"Fire",
"Berry",
"Water",
"Cloud",
"Green",
"Storm",
"Gale",
"Hail",
"Broken",
"Sky",
"Mystic",
"Mystical",
"Log",
"Tree",
"Branch",
"Twig",
"Icicle",
"Ruby",
"Red",
"Rose",
"Fox",
"Rat",
"Badger",
"Nettle",
"Cave",
"Shore",
"Ginger",
"Sun",
"Moon",
"Kink",
"Mink",
"Cherry",
"Weed",
"Breeze",
"Panther",
"Ocelot",
"Ocean",
"Sea",
"Tawny",
"Aqua",
"Gentle",
"Fuzzy",
"Striped",
"Heat",
"Magma",
"Lava",
"Volcano",
"Kestrel",
"Dust",
"Dusk",
"Dawn",
"Marsh",
"Swift",
"Echo",
"Frozen",
"Burrow",
"Topaz",
"Sapphire",
"Speckle",
"Egg",
"Shining",
"Blazing",
"Burning",
"Scorch",
"Burnt",
"Clover",
"One",
"Mud",
"Dirt",
"Blend",
"Heather",
"Daisy",
"Juniper",
"Sparrow",
"Brave",
"Murky",
"Sunny",
"Silver",
"Golden",
"Bright",
"Raven",
"Adder",
"Snake",
"Owl",
"Aspen",
"Maple",
"Feather",
"Briar",
"Loud",
"Swirl",
"Swirled",
"Thistle",
"Spiky",
"Bush",
"Blizzard",
"Coral",
"Pebble",
"Rock",
"Stone",
"Light",
"Dark",
"Lightning",
"Vine",
"Fish",
"Minnow",
"Salmon",
"Trout",
"Bubble",
"Smoke",
"Steam",
"Wave",
"Eclipse",
"Twilight",
"Meadow",
"Torn",
"Mallow",
"Faded",
"Dead",
"Half",
"Sharp",
"Skunk",
"Thorn"
]
}
}

View File

@ -1,269 +0,0 @@
//Minecraft Recipes List
//Created by _303
//Obtained from https://github.com/ClouDev/CloudBot/blob/develop/plugins/data/recipes.txt
//Edited by CHCMATT for Minecraft version: 1.7.4
//
//Summary of Use: Each column is seperated by a comma (,) and rows by a vertical bar (|). Order of Recipes & Categories taken from
//www.minecraftwiki.net/wiki/Crafting for easier updating in the future (The Future!)
//
//Basic Recipes
//
4x Wooden Planks: Wood
4x Stick: Wooden Planks | Wooden Planks
4x Torch: Coal | Stick
4x Torch: Charcoal | Stick
1x Crafting Table: Wooden Planks, Wooden Planks | Wooden Planks, Wooden Planks
1x Furnace: Cobblestone, Cobblestone, Cobblestone | Cobblestone, None, Cobblestone | Cobblestone, Cobblestone, Cobblestone
1x Chest: Wooden Planks, Wooden Planks, Wooden Planks | Wooden Planks, None, Wooden Planks | Wooden Planks, Wooden Planks, Wooden Planks
//
//Block Recipes
//
1x Block of Gold: Gold Ingot, Gold Ingot, Gold Ingot | Gold Ingot, Gold Ingot, Gold Ingot | Gold Ingot, Gold Ingot, Gold Ingot
1x Block of Iron: Iron Ingot, Iron Ingot, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot
1x Block of Diamond: Diamond, Diamond, Diamond | Diamond, Diamond, Diamond | Diamond, Diamond, Diamond
1x Block of Coal: Coal, Coal, Coal | Coal, Coal, Coal | Coal, Coal, Coal
1x Block of Redstone: Redstone Dust, Redstone Dust, Redstone Dust | Redstone Dust, Redstone Dust, Redstone Dust | Redstone Dust, Redstone Dust, Redstone Dust
1x Lapis Lazuli Block: Lapis Lazuli, Lapis Lazuli, Lapis Lazuli | Lapis Lazuli, Lapis Lazuli, Lapis Lazuli | Lapis Lazuli, Lapis Lazuli, Lapis Lazuli
1x Emerald Block: Emerald, Emerald, Emerald | Emerald, Emerald, Emerald | Emerald, Emerald, Emerald
1x Glowstone: Glowstone Dust, Glowstone Dust | Glowstone Dust, Glowstone Dust
1x Wool: String, String | String, String
1x TNT: Gunpowder, Sand, Gunpowder | Sand, Gunpowder, Sand | Gunpowder, Sand, Gunpowder
3x Cobblestone Slab: Cobblestone, Cobblestone, Cobblestone
3x Stone Slab: Stone, Stone, Stone
3x Sandstone Slab: Sandstone, Sandstone, Sandstone
3x Wooden Slab: Wooden Planks, Wooden Planks, Wooden Planks
3x Stone Bricks Slab: Stone Bricks, Stone Bricks, Stone Bricks
3x Bricks Slab: Bricks, Bricks, Bricks
4x Wooden Stairs: Wooden Planks, None, None | Wooden Planks, Wooden Planks, None | Wooden Planks, Wooden Planks, Wooden Planks
4x Stone Stairs: Cobblestone, None, None | Cobblestone, Cobblestone, None | Cobblestone, Cobblestone, Cobblestone
4x Brick Stairs: Bricks, None, None | Bricks, Bricks, None | Bricks, Bricks, Bricks
4x Nether Brick Stairs: Nether Bricks, None, None | Nether Bricks, Nether Bricks, None | Nether Bricks, Nether Bricks, Nether Bricks
4x Stone Brick Stairs: Stone Bricks, None, None | Stone Bricks, Stone Bricks, None | Stone Bricks, Stone Bricks, Stone Bricks
1x Snow: Snowball, Snowball | Snowball, Snowball
1x Clay Block: Clay, Clay | Clay, Clay
1x Brick Block: Brick, Brick | Brick, Brick
4x Stone Bricks: Stone, Stone | Stone, Stone
1x Bookshelf: Wooden Planks, Wooden Planks, Wooden Planks | Book, Book, Book | Wooden Planks, Wooden Planks, Wooden Planks
1x Sandstone: Sand, Sand | Sand, Sand
1x Jack 'o' Lantern: Pumpkin | Torch
//
//Tool Recipes
//
1x Wooden Pickaxe: Wooden Planks, Wooden Planks, Wooden Planks | None, Stick, None | None, Stick, None
1x Wooden Axe: Wooden Planks, Wooden Planks | Wooden Planks, Stick | None, Stick
1x Wooden Hoe: Wooden Planks, Wooden Planks | None, Stick | None, Stick
1x Wooden Shovel: Wooden Planks | Stick | Stick
1x Stone Pickaxe: Cobblestone, Cobblestone, Cobblestone | None, Stick, None | None, Stick, None
1x Stone Axe: Cobblestone, Cobblestone | Cobblestone, Stick | None, Stick
1x Stone Hoe: Cobblestone, Cobblestone | None, Stick | None, Stick
1x Stone Shovel: Cobblestone | Stick | Stick
1x Iron Pickaxe: Iron Ingot, Iron Ingot, Iron Ingot | None, Stick, None | None, Stick, None
1x Iron Axe: Iron Ingot, Iron Ingot | Iron Ingot, Stick | None, Stick
1x Iron Hoe: Iron Ingot, Iron Ingot | None, Stick | None, Stick
1x Iron Shovel: Iron Ingot | Stick | Stick
1x Diamond Pickaxe: Diamond, Diamond, Diamond | None, Stick, None | None, Stick, None
1x Diamond Axe: Diamond, Diamond | Diamond, Stick | None, Stick
1x Diamond Hoe: Diamond, Diamond | None, Stick | None, Stick
1x Diamond Shovel: Diamond | Stick | Stick
1x Golden Pickaxe: Gold Ingot, Gold Ingot, Gold Ingot | None, Stick, None | None, Stick, None
1x Golden Axe: Gold Ingot, Gold Ingot | Gold Ingot, Stick | None, Stick
1x Golden Hoe: Gold Ingot, Gold Ingot | None, Stick | None, Stick
1x Golden Shovel: Gold Ingot | Stick | Stick
1x Flint and Steel: Iron Ingot, None | None, Flint
1x Bucket: Iron Ingot, None, Iron Ingot | None, Iron Ingot, None
1x Compass: None, Iron Ingot, None | Iron Ingot, Redstone, Iron Ingot | None, Iron Ingot, None
1x Map: Paper, Paper, Paper | Paper, Compass, Paper | Paper, Paper, Paper
1x Clock: None, Gold Ingot, None | Gold Ingot, Redstone, Gold Ingot | None, Gold Ingot, None
1x Fishing Rod: None, None, Stick | None, Stick, String | Stick, None, String
1x Shears: None, Iron Ingot | Iron Ingot, None
3x Fire Charge: Gunpowder, None, None | Blaze Powder, Coal/Charcoal, None
//
//Weapon Recipes
//
1x Wooden Sword: Wooden Planks | Wooden Planks | Stick
1x Stone Sword: Cobblestone | Cobblestone | Stick
1x Iron Sword: Iron Ingot | Iron Ingot | Stick
1x Diamond Sword: Diamond | Diamond | Stick
1x Golden Sword: Gold Ingot | Gold Ingot | Stick
1x Bow: None, Stick, String | Stick, None, String | None, Stick, String
4x Arrow: Flint | Stick | Feather
//
//Armor Recipes
//
1x Leather Tunic: Leather, None, Leather | Leather, Leather, Leather | Leather, Leather, Leather
1x Leather Pants: Leather, Leather, Leather | Leather, None, Leather | Leather, None, Leather
1x Leather Cap: Leather, Leather, Leather | Leather, None, Leather
1x Leather Boots: Leather, None, Leather | Leather, None, Leather
1x Chain Chestplate: Fire, None, Fire | Fire, Fire, Fire | Fire, Fire, Fire
1x Chain Leggings: Fire, Fire, Fire | Fire, None, Fire | Fire, None, Fire
1x Chain Helmet: Fire, Fire, Fire | Fire, None, Fire
1x Chain Boots: Fire, None, Fire | Fire, None, Fire
1x Iron Chestplate: Iron Ingot, None, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot
1x Iron Leggings: Iron Ingot, Iron Ingot, Iron Ingot | Iron Ingot, None, Iron Ingot | Iron Ingot, None, Iron Ingot
1x Iron Helmet: Iron Ingot, Iron Ingot, Iron Ingot | Iron Ingot, None, Iron Ingot
1x Iron Boots: Iron Ingot, None, Iron Ingot | Iron Ingot, None, Iron Ingot
1x Diamond Chestplate: Diamond, None, Diamond | Diamond, Diamond, Diamond | Diamond, Diamond, Diamond
1x Diamond Leggings: Diamond, Diamond, Diamond | Diamond, None, Diamond | Diamond, None, Diamond
1x Diamond Helmet: Diamond, Diamond, Diamond | Diamond, None, Diamond
1x Diamond Boots: Diamond, None, Diamond | Diamond, None, Diamond
1x Golden Chestplate: Gold Ingot, None, Gold Ingot | Gold Ingot, Gold Ingot, Gold Ingot | Gold Ingot, Gold Ingot, Gold Ingot
1x Golden Leggings: Gold Ingot, Gold Ingot, Gold Ingot | Gold Ingot, None, Gold Ingot | Gold Ingot, None, Gold Ingot
1x Golden Helmet: Gold Ingot, Gold Ingot, Gold Ingot | Gold Ingot, None, Gold Ingot
1x Golden Boots: Gold Ingot, None, Gold Ingot | Gold Ingot, None, Gold Ingot
//
//Transportation Recipes
//
1x Minecart: Iron Ingot, None, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot
1x Minecart with Chest: Chest | Minecart
1x Minecart with Furnace: Furnace | Minecart
16x Rail: Iron Ingot, None, Iron Ingot | Iron Ingot, Stick, Iron Ingot | Iron Ingot, None, Iron Ingot
6x Powered Rail: Gold Ingot, None, Gold Ingot | Gold Ingot, Stick, Gold Ingot | Gold Ingot, Redstone, Gold Ingot
6x Detector Rail: Iron Ingot, None, Iron Ingot | Iron Ingot, Pressure Plate, Iron Ingot | Iron Ingot, Redstone, Iron Ingot
1x Boat: Wooden Planks, None, Wooden Planks | Wooden Planks, Wooden Planks, Wooden Planks
1x Carrot On A Stick: Fishing Rod | None, Carrot
//
//Mechanism Recipes
//
1x Wooden Door: Wooden Planks, Wooden Planks | Wooden Planks, Wooden Planks | Wooden Planks, Wooden Planks
1x Iron Door: Iron Ingot, Iron Ingot | Iron Ingot, Iron Ingot | Iron Ingot, Iron Ingot
2x Trapdoor: Wooden Planks, Wooden Planks, Wooden Planks | Wooden Planks, Wooden Planks, Wooden Planks
1x Stone Pressure Plate: Stone, Stone
1x Wooden Pressure Plate: Wooden Planks, Wooden Planks
1x Stone Button: Stone
1x Wooden Button: Wooden Planks
1x Redstone Torch: Redstone | Stick
1x Lever: Stick | Cobblestone
1x Note Block: Wooden Planks, Wooden Planks, Wooden Planks | Wooden Planks, Redstone, Wooden Planks | Wooden Planks, Wooden Planks, Wooden Planks
1x Jukebox: Wooden Planks, Wooden Planks, Wooden Planks | Wooden Planks, Diamond, Wooden Planks | Wooden Planks, Wooden Planks, Wooden Planks
1x Dispenser: Cobblestone, Cobblestone, Cobblestone | Cobblestone, Bow, Cobblestone | Cobblestone, Redstone, Cobblestone
1x Redstone Repeater: Redstone Torch, Redstone, Redstone Torch | Stone, Stone, Stone
1x Piston: Wooden Planks, Wooden Planks, Wooden Planks | Cobblestone, Iron Ingot, Cobblestone | Cobblestone, Redstone, Cobblestone
1x Sticky Piston: Slime Ball | Piston
1x Redstone Lamp: None, Redstone Dust, None | Redstone Dust, Glowstone Block, Redstone Dust | None, Redstone Dust, None
1x Trapped Chest: Chest, Tripwire Hook
1x Dropper: Cobblestone, Cobblestone, Cobblestone | Cobblestone, None, Cobblestone | Cobblestone, Redstone Dust, Cobblestone
1x Weighted Pressure Plate (Heavy): Iron Ingot, Iron Ingot
1x Weighted Pressure Plate (Light): Gold Ingot, Gold Ingot
2x Tripwire Hook: Iron Ingot | Stick | Wooden Planks
//
//Food Recipes
//
4x Bowl: Wooden Planks, None, Wooden Planks | None, Wooden Planks, None
1x Mushroom Stew: Brown Mushroom, Red Mushroom | Bowl
1x Bread: Wheat, Wheat, Wheat
1x Sugar: Sugar Canes
1x Cake: Milk, Milk, Milk | Sugar, Egg, Sugar | Wheat, Wheat, Wheat
8x Cookie: Wheat, Cocoa Beans, Wheat
1x Golden Apple: Gold Nugget, Gold Nugget, Gold Nugget | Gold Nugget, Apple, Gold Nugget | Gold Nugget, Gold Nugget, Gold Nugget
1x Melon Block: Melon, Melon, Melon | Melon, Melon, Melon | Melon, Melon, Melon
1x Melon Seeds: Melon Slice
4x Pumpkin Seeds: Pumpkin
//
//Miscellaneous Recipes
//
9x Gold Ingot: Block of Gold
9x Iron Ingot: Block of Iron
9x Diamond: Block of Diamond
9x Lapis Lazuli: Lapis Lazuli Block
2x Ladder: Stick, None, Stick | Stick, Stick, Stick | Stick, None, Stick
1x Sign: Wooden Planks, Wooden Planks, Wooden Planks | Wooden Planks, Wooden Planks, Wooden Planks | None, Stick, None
1x Painting: Stick, Stick, Stick | Stick, Black Wool, Stick | Stick, Stick, Stick
16x Iron Bars: Iron Ingot, Iron Ingot, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot
16x Glass Pane: Glass, Glass, Glass | Glass, Glass, Glass
3x Paper: Sugar Canes, Sugar Canes, Sugar Canes
1x Book: Paper | Paper | Paper
2x Fence: Stick, Stick, Stick | Stick, Stick, Stick
2x Nether Brick Fence: Nether Brick, Nether Brick, Nether Brick | Nether Brick, Nether Brick, Nether Brick
1x Fence Gate: Stick, Wooden Planks, Stick | Stick, Wooden Planks, Stick
1x Bed: Wool, Wool, Wool | Wooden Planks, Wooden Planks, Wooden Planks
9x Gold Nugget: Gold Ingot
1x Gold Ingot: Gold Nugget, Gold Nugget, Gold Nugget | Gold Nugget, Gold Nugget, Gold Nugget | Gold Nugget, Gold Nugget, Gold Nugget
1x Eye of Ender: Ender Pearl | Blaze Powder
1x Item Frame: Stick, Stick, Stick | Stick, Leather, Stick | Stick, Stick, Stick
1x Anvil: Block of Iron, Block of Iron, Block of Iron | None, Iron Ingot, None | Iron Ingot, Iron Ingot, Iron Ingot
1x Ender Chest: Obsidian, Obsidian, Obsidian | Osbidian, Eye of Ender, Obsidian | Obsidian, Obsidian, Obsidian
1x Flower Pot: Brick, None, Brick | None, Brick, None
2x Lead: None, String, String | None, Slime Ball, String | String, None, None
//
//Dye Recipes
//
3x Bone Meal: Bone
2x Light Gray Dye: Gray Dye, Bone Meal
2x Gray Dye: Ink Sac, Bone Meal
2x Rose Red: Rose
2x Orange Dye: Rose Red, Dandelion Yellow
2x Dandelion Yellow: Flower
2x Lime Dye: Cactus Green, Bone Meal
2x Light Blue Dye: Lapis Lazuli, Bone Meal
2x Cyan Dye: Lapis Lazuli, Cactus Green
2x Purple Dye: Lapis Lazuli, Rose Red
4x Magenta Dye: Lapis Lazuli, Rose Red, Rose Red, Bone Meal
2x Pink Dye: Rose Red, Bone Meal
//
//Wool Recipes
//
1x Light Gray Wool: Light Gray Dye, Wool
1x Gray Wool: Gray Dye, Wool
1x Black Wool: Ink Sac, Wool
1x Red Wool: Rose Red, Wool
1x Orange Wool: Orange Dye, Wool
1x Yellow Wool: Dandelion Yellow, Wool
1x Lime Wool: Lime Dye, Wool
1x Green Wool: Cactus Green, Wool
1x Light Blue Wool: Light Blue Dye, Wool
1x Cyan Wool: Cyan Dye, Wool
1x Blue Wool: Lapis Lazuli, Wool
1x Purple Wool: Purple Dye, Wool
1x Magenta Wool: Magenta Dye, Wool
1x Pink Wool: Pink Dye, Wool
1x Brown Wool: Cocoa Beans, Wool
1x Wool: Bone Meal, Wool
//
//Enchancement & Brewing Recipes
//
3x Glass Bottle: Glass, None, Glass | None, Glass, None
1x Cauldron: Iron Ingot, None, Iron Ingot | Iron Ingot, None, Iron Ingot | Iron Ingot, Iron Ingot, Iron Ingot
1x Brewing Stand: None, Blaze Rod, None | Cobblestone, Cobblestone, Cobblestone
2x Blaze Powder: Blaze Rod
1x Magma Cream: Slimeball | Blaze Powder
1x Fermented Spider Eye: Spider Eye | Brown Mushroom, Sugar
1x Glistering Melon: Melon Slice, Gold Nugget
9x Gold Nugget: Gold Ingot
1x Enchantment Table: None, Book, None | Diamond, Obsidian, Diamond | Obsidian, Obsidian, Obsidian
//
//Stained Glass Recipes
//
8x White Stained Glass: Glass, Glass, Glass | Glass, Bone Meal, Glass | Glass, Glass, Glass
8x Orange Stained Glass: Glass, Glass, Glass | Glass, Orange Dye, Glass | Glass, Glass, Glass
8x Magenta Stained Glass: Glass, Glass, Glass | Glass, Magenta Dye, Glass | Glass, Glass, Glass
8x Light Blue Stained Glass: Glass, Glass, Glass | Glass, Light Blue Dye, Glass | Glass, Glass, Glass
8x Yellow Stained Glass: Glass, Glass, Glass | Glass, Dandelion Yellow, Glass | Glass, Glass, Glass
8x Lime Stained Glass: Glass, Glass, Glass | Glass, Lime Dye, Glass | Glass, Glass, Glass
8x Pink Stained Glass: Glass, Glass, Glass | Glass, Pink Dye, Glass | Glass, Glass, Glass
8x Gray Stained Glass: Glass, Glass, Glass | Glass, Gray Dye, Glass | Glass, Glass, Glass
8x Light Gray Stained Glass: Glass, Glass, Glass | Glass, Light Gray Dye, Glass | Glass, Glass, Glass
8x Cyan Stained Glass: Glass, Glass, Glass | Glass, Cyan Dye, Glass | Glass, Glass, Glass
8x Purple Stained Glass: Glass, Glass, Glass | Glass, Purple Dye, Glass | Glass, Glass, Glass
8x Blue Stained Glass: Glass, Glass, Glass | Glass, Lapis Lazuli, Glass | Glass, Glass, Glass
8x Brown Stained Glass: Glass, Glass, Glass | Glass, Cocoa Beans, Glass | Glass, Glass, Glass
8x Green Stained Glass: Glass, Glass, Glass | Glass, Cactus Green, Glass | Glass, Glass, Glass
8x Red Stained Glass: Glass, Glass, Glass | Glass, Rose Red, Glass | Glass, Glass, Glass
8x Black Stained Glass: Glass, Glass, Glass | Glass, Inc Sac, Glass | Glass, Glass, Glass
//
//Stained Glass Panes
//
16x White Stained Glass Panes: White Stained Glass, White Stained Glass, White Stained Glass | White Stained Glass, White Stained Glass, White Stained Glass
16x Orange Stained Glass Panes: Orange Stained Glass, Orange Stained Glass, Orange Stained Glass | Orange Stained Glass, Orange Stained Glass, Orange Stained Glass
16x Magenta Stained Glass Panes: Magenta Stained Glass, Magenta Stained Glass, Magenta Stained Glass | Magenta Stained Glass, Magenta Stained Glass, Magenta Stained Glass
16x Light Blue Stained Glass Panes: Light Blue Stained Glass, Light Blue Stained Glass, Light Blue Stained Glass | Light Blue Stained Glass, Light Blue Stained Glass, Light Blue Stained Glass
16x Yellow Stained Glass Panes: Yellow Stained Glass, Yellow Stained Glass, Yellow Stained Glass | Yellow Stained Glass, Yellow Stained Glass, Yellow Stained Glass
16x Lime Stained Glass Panes: Lime Stained Glass, Lime Stained Glass, Lime Stained Glass | Lime Stained Glass, Lime Stained Glass, Lime Stained Glass
16x Pink Stained Glass Panes: Pink Stained Glass, Pink Stained Glass, Pink Stained Glass | Pink Stained Glass, Pink Stained Glass, Pink Stained Glass
16x Gray Stained Glass Panes: Gray Stained Glass, Gray Stained Glass, Gray Stained Glass | Gray Stained Glass, Gray Stained Glass, Gray Stained Glass
16x Light Gray Stained Glass Panes: Light Gray Stained Glass, Light Gray Stained Glass, Light Gray Stained Glass | Light Gray Stained Glass, Light Gray Stained Glass, Light Gray Stained Glass
16x Cyan Stained Glass Panes: Cyan Stained Glass, Cyan Stained Glass, Cyan Stained Glass | Cyan Stained Glass, Cyan Stained Glass, Cyan Stained Glass
16x Purple Stained Glass Panes: Purple Stained Glass, Purple Stained Glass, Purple Stained Glass | Purple Stained Glass, Purple Stained Glass, Purple Stained Glass
16x Blue Stained Glass Panes: Blue Stained Glass, Blue Stained Glass, Blue Stained Glass | Blue Stained Glass, Blue Stained Glass, Blue Stained Glass
16x Brown Stained Glass Panes: Brown Stained Glass, Brown Stained Glass, Brown Stained Glass | Brown Stained Glass, Brown Stained Glass, Brown Stained Glass
16x Green Stained Glass Panes: Green Stained Glass, Green Stained Glass, Green Stained Glass | Green Stained Glass, Green Stained Glass, Green Stained Glass
16x Black Stained Glass Panes: Black Stained Glass, Black Stained Glass, Black Stained Glass | Black Stained Glass, Black Stained Glass, Black Stained Glass

View File

@ -1,69 +0,0 @@
{
"templates":[
"{hits} {user} with a {item}.",
"{hits} {user} around a bit with a {item}.",
"{throws} a {item} at {user}.",
"{throws} a few {item}s at {user}.",
"grabs a {item} and {throws} it in {user}'s face.",
"launches a {item} in {user}'s general direction.",
"sits on {user}'s face while slamming a {item} into their crotch.",
"starts slapping {user} silly with a {item}.",
"holds {user} down and repeatedly {hits} them with a {item}.",
"prods {user} with a {item}.",
"picks up a {item} and {hits} {user} with it.",
"ties {user} to a chair and {throws} a {item} at them.",
"{hits} {user} {where} with a {item}.",
"ties {user} to a pole and whips them with a {item}."
],
"parts": {
"item":[
"cast iron skillet",
"large trout",
"baseball bat",
"wooden cane",
"nail",
"printer",
"shovel",
"pair of trousers",
"CRT monitor",
"diamond sword",
"baguette",
"physics textbook",
"toaster",
"portrait of Richard Stallman",
"television",
"mau5head",
"five ton truck",
"roll of duct tape",
"book",
"laptop",
"old television",
"sack of rocks",
"rainbow trout",
"cobblestone block",
"lava bucket",
"rubber chicken",
"spiked bat",
"gold block",
"fire extinguisher",
"heavy rock",
"chunk of dirt"
],
"throws": [
"throws",
"flings",
"chucks"
],
"hits": [
"hits",
"whacks",
"slaps",
"smacks"
],
"where": [
"in the chest",
"on the head",
"on the bum"
]
}
}

View File

@ -1,197 +0,0 @@
<text> - get ready.
Everyone should believe in <text>.
<text>, where success is at home.
<text>, your way!
<text>, this is it!
And on the eighth day, god created <text>.
<text> innovate your world.
Are you ready for <text>?
See you at <text>.
<text>'s got it all!
<text> makes your day.
<text>rific.
The queen buys <text>.
Where's your <text>?
<text> groove.
There's lots of fun in <text>.
<text>, you'll love it!
I'd do anything for <text>.
Go to heaven with <text>.
<text> on the outside, tasty on the inside.
<text> - a safe place in an unsafe world!
World's finest <text>.
<text> is your friend.
<text>, it's as simple as that!
Free <text>.
<text> - Just do it.
The age of <text>.
The <text> spirit.
Let's talk about <text>.
Do it with <text>.
<text> brings out the best.
Take what you want, but leave <text> alone!
<text> for your health.
<text> is my passion.
The best <text> in the world.
Follow your <text>.
A day with <text>.
The American Way of <text>.
Enjoy <text>.
The Power of <text>.
Every <text> has a story.
<text> - it's like heaven!
Endless possibilities with <text>.
Go farther with <text>.
<text> is my world.
<text> evolution.
<text> - now!
For the love of <text>.
When you say <text> you've said it all.
<text>, pure lust.
Who is <text>?
<text> empowers you.
Don't worry, <text> takes care.
My <text> beats everything.
Share moments, share <text>.
<text> it's a kind of magic.
<text> - living innovation
<text> - a class of it's own
<text>. We build smiles.
I believe in <text>.
<text> - Think different.
Let your <text> flow.
Heal the world with <text>.
I'd sleep with <text>.
Bigger. Better. <text>.
You can't beat <text>.
Say it with <text>.
<text>, there's no better way.
<text>, stay in touch.
<text> never lies.
Play <text>, start living.
Don't forget your <text>.
The <text> effect.
<text> - what more could you want?
Kick ass with <text>!
You know when it's <text>.
Good to know <text>.
My <text> and me.
<text> - be prepared.
Oh my gods, it's a <text>.
There is no life without <text>.
<text> - You see this name, you think dirty.
<text> is my sport.
<text>, one for all.
<text> is a never ending story.
<text> for you!
Everyone loves <text>.
<text>, better than sex.
<text> only.
Inspired by <text>.
<text>. Making people sucessful in a changing world.
Who wouldn't fight for <text>?
Lucky <text>.
Think. Feel. <text>.
<text> rocks.
Think <text>.
<text> is the sound of the future.
I want <text> and I want it now.
<text>, the real thing.
The gods made <text>.
With a name like <text>, it has to be good.
Discover the world of <text>.
Live <text>.
You don't want <text> as your enemy!
<text> - enjoy the difference.
Buy <text> now!
Don't mess with <text>.
Made by <text>.
Be alive with <text>.
<text> values.
High life with <text>.
<text>, whiter than the whitest!
<text> - play it!
Can you feel <text>?
Simply <text>!
<text>? You bet.
<text> - The Revolution.
<text> - your game.
<text> is your safe place in an unsafe world!
Go far with <text>.
God made <text>.
<text> keeps going, and going, and going...
The <text> universe.
I can't believe it's <text>.
<text> moments.
I lost weight with <text>.
There's only one true <text>!
The Future of <text>.
<text> - If you love <text>.
<text> beat.
My way is <text>.
Think different, think <text>.
Nonstop <text>.
All you need is <text>.
<text> is what the world was waiting for.
<text> for the masses.
<text>, the smart choice.
<text> forever.
<text> - Your personal entertainer.
<text> makes me hot.
<text> kicks ass.
There's only one thing in the world I want and that is <text>.
<text> will be for you what you want it to be.
<text> for everyone.
<text> - once you have it, you love it.
Break through with <text>.
The original <text>.
3... 2... 1... <text>.
The goddess made <text>.
Halleluja, it's a <text>.
<text> is rolling, the others are stoned.
My <text>, your <text>, <text> for all!
<text> for a professional image.
<text> for president.
Make yourself at home with <text>.
<text>, just the best.
You can't stop <text>.
<text> extra dry.
Call a friend, call <text>.
Don't get in the way of <text>.
<text>, your family will love you.
<text> is a female force.
Feel good with <text>.
You wouldn't want to miss <text>.
<text> Dreamteam.
I wish i was a <text>.
Where's <text>?
Jesus loves <text>.
The Queen of <text>.
Life's beautiful with <text>.
Swing your <text>.
The one and only <text>.
<text>? Yes please.
<text>, your specialist.
<text> is good for you.
Feel the magic of <text>.
<text> rules.
It's time to think about <text>.
<text>, so what!
<text> inside you.
The Spirit of <text>.
Up, up and away with <text>.
<text> - first class!
It's my <text>!
The secret of <text>.
Easy <text>.
Just <text>.
<text> never die.
<text> - be ready.
Say <text>.
Feel it - <text>!
I trust <text>.
<text>, to hell with the rest.
<text>, the original.
<text> is the only way to be happy.
<text> - One name. One legend.
The ideal <text>.

View File

@ -1,90 +0,0 @@
# Written by Scaevolus, updated by Lukeroge
import re
import random
from util import hook
whitespace_re = re.compile(r'\s+')
valid_diceroll = r'^([+-]?(?:\d+|\d*d(?:\d+|F))(?:[+-](?:\d+|\d*d(?:\d+|' \
'F)))*)( .+)?$'
valid_diceroll_re = re.compile(valid_diceroll, re.I)
sign_re = re.compile(r'[+-]?(?:\d*d)?(?:\d+|F)', re.I)
split_re = re.compile(r'([\d+-]*)d?(F|\d*)', re.I)
def n_rolls(count, n):
"""roll an n-sided die count times"""
if n == "F":
return [random.randint(-1, 1) for x in xrange(min(count, 100))]
if n < 2: # it's a coin
if count < 100:
return [random.randint(0, 1) for x in xrange(count)]
else: # fake it
return [int(random.normalvariate(.5 * count, (.75 * count) ** .5))]
else:
if count < 100:
return [random.randint(1, n) for x in xrange(count)]
else: # fake it
return [int(random.normalvariate(.5 * (1 + n) * count,
(((n + 1) * (2 * n + 1) / 6. -
(.5 * (1 + n)) ** 2) * count) ** .5))]
@hook.command('roll')
#@hook.regex(valid_diceroll, re.I)
@hook.command
def dice(inp):
"""dice <dice roll> -- Simulates dice rolls. Example of <dice roll>:
'dice 2d20-d5+4 roll 2'. D20s, subtract 1D5, add 4"""
try: # if inp is a re.match object...
(inp, desc) = inp.groups()
except AttributeError:
(inp, desc) = valid_diceroll_re.match(inp).groups()
if "d" not in inp:
return
spec = whitespace_re.sub('', inp)
if not valid_diceroll_re.match(spec):
return "Invalid dice roll"
groups = sign_re.findall(spec)
total = 0
rolls = []
for roll in groups:
count, side = split_re.match(roll).groups()
count = int(count) if count not in " +-" else 1
if side.upper() == "F": # fudge dice are basically 1d3-2
for fudge in n_rolls(count, "F"):
if fudge == 1:
rolls.append("\x033+\x0F")
elif fudge == -1:
rolls.append("\x034-\x0F")
else:
rolls.append("0")
total += fudge
elif side == "":
total += count
else:
side = int(side)
try:
if count > 0:
d = n_rolls(count, side)
rolls += map(str, d)
total += sum(d)
else:
d = n_rolls(-count, side)
rolls += [str(-x) for x in d]
total -= sum(d)
except OverflowError:
# I have never seen this happen. If you make this happen, you win a cookie
return "Thanks for overflowing a float, jerk >:["
if desc:
return "{}: {} ({})".format(desc.strip(), total, ", ".join(rolls))
else:
return "{} ({})".format(total, ", ".join(rolls))

View File

@ -1,89 +0,0 @@
# Plugin by GhettoWizard and Scaevolus
import re
from util import hook
from util import http
@hook.command('dictionary')
@hook.command
def define(inp):
"""define <word> -- Fetches definition of <word>."""
url = 'http://ninjawords.com/'
h = http.get_html(url + http.quote_plus(inp))
definition = h.xpath('//dd[@class="article"] | '
'//div[@class="definition"] |'
'//div[@class="example"]')
if not definition:
return u'No results for {} :('.format(inp)
def format_output(show_examples):
result = u'{}: '.format(h.xpath('//dt[@class="title-word"]/a/text()')[0])
correction = h.xpath('//span[@class="correct-word"]/text()')
if correction:
result = 'Definition for "{}": '.format(correction[0])
sections = []
for section in definition:
if section.attrib['class'] == 'article':
sections += [[section.text_content() + ': ']]
elif section.attrib['class'] == 'example':
if show_examples:
sections[-1][-1] += ' ' + section.text_content()
else:
sections[-1] += [section.text_content()]
for article in sections:
result += article[0]
if len(article) > 2:
result += u' '.join(u'{}. {}'.format(n + 1, section)
for n, section in enumerate(article[1:]))
else:
result += article[1] + ' '
synonyms = h.xpath('//dd[@class="synonyms"]')
if synonyms:
result += synonyms[0].text_content()
result = re.sub(r'\s+', ' ', result)
result = re.sub('\xb0', '', result)
return result
result = format_output(True)
if len(result) > 450:
result = format_output(False)
if len(result) > 450:
result = result[:result.rfind(' ', 0, 450)]
result = re.sub(r'[^A-Za-z]+\.?$', '', result) + ' ...'
return result
@hook.command('e')
@hook.command
def etymology(inp):
"""etymology <word> -- Retrieves the etymology of <word>."""
url = 'http://www.etymonline.com/index.php'
h = http.get_html(url, term=inp)
etym = h.xpath('//dl')
if not etym:
return u'No etymology found for {} :('.format(inp)
etym = etym[0].text_content()
etym = ' '.join(etym.split())
if len(etym) > 400:
etym = etym[:etym.rfind(' ', 0, 400)] + ' ...'
return etym

View File

@ -1,18 +0,0 @@
from util import hook, http
@hook.command
def domainr(inp):
"""domainr <domain> - Use domain.nr's API to search for a domain, and similar domains."""
try:
data = http.get_json('http://domai.nr/api/json/search?q=' + inp)
except (http.URLError, http.HTTPError) as e:
return "Unable to get data for some reason. Try again later."
if data['query'] == "":
return "An error occurred: {status} - {message}".format(**data['error'])
domains = ""
for domain in data['results']:
domains += ("\x034" if domain['availability'] == "taken" else (
"\x033" if domain['availability'] == "available" else "\x031")) + domain['domain'] + "\x0f" + domain[
'path'] + ", "
return "Domains: " + domains

View File

@ -1,20 +0,0 @@
import urlparse
from util import hook, http
@hook.command
def down(inp):
"""down <url> -- Checks if the site at <url> is up or down."""
if 'http://' not in inp:
inp = 'http://' + inp
inp = 'http://' + urlparse.urlparse(inp).netloc
# http://mail.python.org/pipermail/python-list/2006-December/589854.html
try:
http.get(inp, get_method='HEAD')
return '{} seems to be up'.format(inp)
except http.URLError:
return '{} seems to be down'.format(inp)

View File

@ -1,31 +0,0 @@
import re
from util import hook, http, text
api_url = "http://encyclopediadramatica.se/api.php?action=opensearch"
ed_url = "http://encyclopediadramatica.se/"
@hook.command
def drama(inp):
"""drama <phrase> -- Gets the first paragraph of
the Encyclopedia Dramatica article on <phrase>."""
j = http.get_json(api_url, search=inp)
if not j[1]:
return "No results found."
article_name = j[1][0].replace(' ', '_').encode('utf8')
url = ed_url + http.quote(article_name, '')
page = http.get_html(url)
for p in page.xpath('//div[@id="bodyContent"]/p'):
if p.text_content():
summary = " ".join(p.text_content().splitlines())
summary = re.sub("\[\d+\]", "", summary)
summary = text.truncate_str(summary, 220)
return "{} :: {}".format(summary, url)
return "Unknown Error."

View File

@ -1,23 +0,0 @@
import random
from util import hook, text
color_codes = {
"<r>": "\x02\x0305",
"<g>": "\x02\x0303",
"<y>": "\x02"
}
with open("plugins/data/8ball_responses.txt") as f:
responses = [line.strip() for line in
f.readlines() if not line.startswith("//")]
@hook.command('8ball')
def eightball(inp, action=None):
"""8ball <question> -- The all knowing magic eight ball,
in electronic form. Ask and it shall be answered!"""
magic = text.multiword_replace(random.choice(responses), color_codes)
action("shakes the magic 8 ball... {}".format(magic))

View File

@ -1,105 +0,0 @@
import os
import base64
import json
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
from util import hook
# helper functions to pad and unpad a string to a specified block size
# <http://stackoverflow.com/questions/12524994/encrypt-decrypt-using-pycrypto-aes-256>
BS = AES.block_size
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s: s[0:-ord(s[-1])]
# helper functions to encrypt and encode a string with AES and base64
encode_aes = lambda c, s: base64.b64encode(c.encrypt(pad(s)))
decode_aes = lambda c, s: unpad(c.decrypt(base64.b64decode(s)))
db_ready = False
def db_init(db):
"""check to see that our db has the the encryption table."""
global db_ready
if not db_ready:
db.execute("create table if not exists encryption(encrypted, iv, "
"primary key(encrypted))")
db.commit()
db_ready = True
def get_salt(bot):
"""generate an encryption salt if none exists, then returns the salt"""
if not bot.config.get("random_salt", False):
bot.config["random_salt"] = hashlib.md5(os.urandom(16)).hexdigest()
json.dump(bot.config, open('config', 'w'), sort_keys=True, indent=2)
return bot.config["random_salt"]
@hook.command
def encrypt(inp, bot=None, db=None, notice=None):
"""encrypt <pass> <string> -- Encrypts <string> with <pass>. (<string> can only be decrypted using this bot)"""
db_init(db)
split = inp.split(" ")
# if there is only one argument, return the help message
if len(split) == 1:
notice(encrypt.__doc__)
return
# generate the key from the password and salt
password = split[0]
salt = get_salt(bot)
key = PBKDF2(password, salt)
# generate the IV and encode it to store in the database
iv = Random.new().read(AES.block_size)
iv_encoded = base64.b64encode(iv)
# create the AES cipher and encrypt/encode the text with it
text = " ".join(split[1:])
cipher = AES.new(key, AES.MODE_CBC, iv)
encoded = encode_aes(cipher, text)
# store the encoded text and IV in the DB for decoding later
db.execute("insert or replace into encryption(encrypted, iv)"
"values(?,?)", (encoded, iv_encoded))
db.commit()
return encoded
@hook.command
def decrypt(inp, bot=None, db=None, notice=None):
"""decrypt <pass> <string> -- Decrypts <string> with <pass>. (can only decrypt strings encrypted on this bot)"""
if not db_ready:
db_init(db)
split = inp.split(" ")
# if there is only one argument, return the help message
if len(split) == 1:
notice(decrypt.__doc__)
return
# generate the key from the password and salt
password = split[0]
salt = get_salt(bot)
key = PBKDF2(password, salt)
text = " ".join(split[1:])
# get the encoded IV from the database and decode it
iv_encoded = db.execute("select iv from encryption where"
" encrypted=?", (text,)).fetchone()[0]
iv = base64.b64decode(iv_encoded)
# create AES cipher, decode text, decrypt text, and unpad it
cipher = AES.new(key, AES.MODE_CBC, iv)
return decode_aes(cipher, text)

View File

@ -1,37 +0,0 @@
from util import hook, http, web
@hook.command(autohelp=False)
def fact(inp):
"""fact -- Gets a random fact from OMGFACTS."""
attempts = 0
# all of this is because omgfacts is fail
while True:
try:
soup = http.get_soup('http://www.omg-facts.com/random')
except:
if attempts > 2:
return "Could not find a fact!"
else:
attempts += 1
continue
response = soup.find('a', {'class': 'surprise'})
link = response['href']
fact_data = ''.join(response.find(text=True))
if fact_data:
fact_data = fact_data.strip()
break
else:
if attempts > 2:
return "Could not find a fact!"
else:
attempts += 1
continue
url = web.try_isgd(link)
return "{} - {}".format(fact_data, url)

View File

@ -1,162 +0,0 @@
# Written by Scaevolus 2010
import string
import re
from util import hook, http, text, pyexec
re_lineends = re.compile(r'[\r\n]*')
db_ready = False
# some simple "shortcodes" for formatting purposes
shortcodes = {
'[b]': '\x02',
'[/b]': '\x02',
'[u]': '\x1F',
'[/u]': '\x1F',
'[i]': '\x16',
'[/i]': '\x16'}
def db_init(db):
global db_ready
if not db_ready:
db.execute("create table if not exists mem(word, data, nick,"
" primary key(word))")
db.commit()
db_ready = True
def get_memory(db, word):
row = db.execute("select data from mem where word=lower(?)",
[word]).fetchone()
if row:
return row[0]
else:
return None
@hook.command("r", permissions=["addfactoid"])
@hook.command(permissions=["addfactoid"])
def remember(inp, nick='', db=None, notice=None):
"""remember <word> [+]<data> -- Remembers <data> with <word>. Add +
to <data> to append."""
db_init(db)
append = False
try:
word, data = inp.split(None, 1)
except ValueError:
return remember.__doc__
old_data = get_memory(db, word)
if data.startswith('+') and old_data:
append = True
# remove + symbol
new_data = data[1:]
# append new_data to the old_data
if len(new_data) > 1 and new_data[1] in (string.punctuation + ' '):
data = old_data + new_data
else:
data = old_data + ' ' + new_data
db.execute("replace into mem(word, data, nick) values"
" (lower(?),?,?)", (word, data, nick))
db.commit()
if old_data:
if append:
notice("Appending \x02{}\x02 to \x02{}\x02".format(new_data, old_data))
else:
notice('Remembering \x02{}\x02 for \x02{}\x02. Type ?{} to see it.'.format(data, word, word))
notice('Previous data was \x02{}\x02'.format(old_data))
else:
notice('Remembering \x02{}\x02 for \x02{}\x02. Type ?{} to see it.'.format(data, word, word))
@hook.command("f", permissions=["delfactoid"])
@hook.command(permissions=["delfactoid"])
def forget(inp, db=None, notice=None):
"""forget <word> -- Forgets a remembered <word>."""
db_init(db)
data = get_memory(db, inp)
if data:
db.execute("delete from mem where word=lower(?)",
[inp])
db.commit()
notice('"%s" has been forgotten.' % data.replace('`', "'"))
return
else:
notice("I don't know about that.")
return
@hook.command
def info(inp, notice=None, db=None):
"""info <factoid> -- Shows the source of a factoid."""
db_init(db)
# attempt to get the factoid from the database
data = get_memory(db, inp.strip())
if data:
notice(data)
else:
notice("Unknown Factoid.")
@hook.regex(r'^\? ?(.+)')
def factoid(inp, message=None, db=None, bot=None, action=None, conn=None, input=None):
"""?<word> -- Shows what data is associated with <word>."""
try:
prefix_on = bot.config["plugins"]["factoids"].get("prefix", False)
except KeyError:
prefix_on = False
db_init(db)
# split up the input
split = inp.group(1).strip().split(" ")
factoid_id = split[0]
if len(split) >= 1:
arguments = " ".join(split[1:])
else:
arguments = ""
data = get_memory(db, factoid_id)
if data:
# factoid preprocessors
if data.startswith("<py>"):
code = data[4:].strip()
variables = 'input="""{}"""; nick="{}"; chan="{}"; bot_nick="{}";'.format(arguments.replace('"', '\\"'),
input.nick, input.chan,
input.conn.nick)
result = pyexec.eval_py(variables + code)
else:
result = data
# factoid postprocessors
result = text.multiword_replace(result, shortcodes)
if result.startswith("<act>"):
result = result[5:].strip()
action(result)
elif result.startswith("<url>"):
url = result[5:].strip()
try:
message(http.get(url))
except http.HttpError:
message("Could not fetch URL.")
else:
if prefix_on:
message("\x02[{}]:\x02 {}".format(factoid_id, result))
else:
message(result)

View File

@ -1,57 +0,0 @@
from urllib import quote_plus
from util import hook, http
api_url = "http://api.fishbans.com/stats/{}/"
@hook.command("bans")
@hook.command
def fishbans(inp):
"""fishbans <user> -- Gets information on <user>s minecraft bans from fishbans"""
user = inp.strip()
try:
request = http.get_json(api_url.format(quote_plus(user)))
except (http.HTTPError, http.URLError) as e:
return "Could not fetch ban data from the Fishbans API: {}".format(e)
if not request["success"]:
return "Could not fetch ban data for {}.".format(user)
user_url = "http://fishbans.com/u/{}/".format(user)
ban_count = request["stats"]["totalbans"]
return "The user \x02{}\x02 has \x02{}\x02 ban(s). See detailed info " \
"at {}".format(user, ban_count, user_url)
@hook.command
def bancount(inp):
"""bancount <user> -- Gets a count of <user>s minecraft bans from fishbans"""
user = inp.strip()
try:
request = http.get_json(api_url.format(quote_plus(user)))
except (http.HTTPError, http.URLError) as e:
return "Could not fetch ban data from the Fishbans API: {}".format(e)
if not request["success"]:
return "Could not fetch ban data for {}.".format(user)
user_url = "http://fishbans.com/u/{}/".format(user)
services = request["stats"]["service"]
out = []
for service, ban_count in services.items():
if ban_count != 0:
out.append("{}: \x02{}\x02".format(service, ban_count))
else:
pass
if not out:
return "The user \x02{}\x02 has no bans.".format(user)
else:
return "Bans for \x02{}\x02: ".format(user) + ", ".join(out) + ". More info " \
"at {}".format(user_url)

View File

@ -1,29 +0,0 @@
from util import hook, http
fml_cache = []
def refresh_cache():
""" gets a page of random FMLs and puts them into a dictionary """
soup = http.get_soup('http://www.fmylife.com/random/')
for e in soup.find_all('div', {'class': 'post article'}):
fml_id = int(e['id'])
text = ''.join(e.find('p').find_all(text=True))
fml_cache.append((fml_id, text))
# do an initial refresh of the cache
refresh_cache()
@hook.command(autohelp=False)
def fml(inp, reply=None):
"""fml -- Gets a random quote from fmyfife.com."""
# grab the last item in the fml cache and remove it
fml_id, text = fml_cache.pop()
# reply with the fml we grabbed
reply('(#{}) {}'.format(fml_id, text))
# refresh fml cache if its getting empty
if len(fml_cache) < 3:
refresh_cache()

View File

@ -1,14 +0,0 @@
import random
from util import hook
with open("plugins/data/fortunes.txt") as f:
fortunes = [line.strip() for line in f.readlines()
if not line.startswith("//")]
@hook.command(autohelp=False)
def fortune(inp):
"""fortune -- Fortune cookies on demand."""
return random.choice(fortunes)

View File

@ -1,13 +0,0 @@
from util import hook, http, web
from subprocess import check_output, CalledProcessError
@hook.command
def freddycode(inp):
"""freddycode <code> - Check if the Freddy Fresh code is correct."""
try:
return "Freddy: '%s' ist %s" % (inp, \
check_output(["/bin/freddycheck", inp]))
except CalledProcessError as err:
return "Freddy: Skript returned %s" % (str(err))

View File

@ -1,54 +0,0 @@
import os.path
import json
import gzip
from StringIO import StringIO
import pygeoip
from util import hook, http
# load region database
with open("./plugins/data/geoip_regions.json", "rb") as f:
regions = json.loads(f.read())
if os.path.isfile(os.path.abspath("./plugins/data/GeoLiteCity.dat")):
# initialise geolocation database
geo = pygeoip.GeoIP(os.path.abspath("./plugins/data/GeoLiteCity.dat"))
else:
download = http.get("http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz")
string_io = StringIO(download)
geoip_file = gzip.GzipFile(fileobj=string_io, mode='rb')
output = open(os.path.abspath("./plugins/data/GeoLiteCity.dat"), 'wb')
output.write(geoip_file.read())
output.close()
geo = pygeoip.GeoIP(os.path.abspath("./plugins/data/GeoLiteCity.dat"))
@hook.command
def geoip(inp):
"""geoip <host/ip> -- Gets the location of <host/ip>"""
try:
record = geo.record_by_name(inp)
except:
return "Sorry, I can't locate that in my database."
data = {}
if "region_name" in record:
# we try catching an exception here because the region DB is missing a few areas
# it's a lazy patch, but it should do the job
try:
data["region"] = ", " + regions[record["country_code"]][record["region_name"]]
except:
data["region"] = ""
else:
data["region"] = ""
data["cc"] = record["country_code"] or "N/A"
data["country"] = record["country_name"] or "Unknown"
data["city"] = record["city"] or "Unknown"
return u"\x02Country:\x02 {country} ({cc}), \x02City:\x02 {city}{region}".format(**data)

View File

@ -1,120 +0,0 @@
import json
import urllib2
from util import hook, http
shortcuts = {"cloudbot": "ClouDev/CloudBot"}
def truncate(msg):
nmsg = msg.split()
out = None
x = 0
for i in nmsg:
if x <= 7:
if out:
out = out + " " + nmsg[x]
else:
out = nmsg[x]
x += 1
if x <= 7:
return out
else:
return out + "..."
@hook.command
def ghissues(inp):
"""ghissues username/repo [number] - Get specified issue summary, or open issue count """
args = inp.split(" ")
try:
if args[0] in shortcuts:
repo = shortcuts[args[0]]
else:
repo = args[0]
url = "https://api.github.com/repos/{}/issues".format(repo)
except IndexError:
return "Invalid syntax. .github issues username/repo [number]"
try:
url += "/%s" % args[1]
number = True
except IndexError:
number = False
try:
data = json.loads(http.open(url).read())
print url
if not number:
try:
data = data[0]
except IndexError:
print data
return "Repo has no open issues"
except ValueError:
return "Invalid data returned. Check arguments (.github issues username/repo [number]"
fmt = "Issue: #%s (%s) by %s: %s | %s %s" # (number, state, user.login, title, truncate(body), gitio.gitio(data.url))
fmt1 = "Issue: #%s (%s) by %s: %s %s" # (number, state, user.login, title, gitio.gitio(data.url))
number = data["number"]
if data["state"] == "open":
state = u"\x033\x02OPEN\x02\x0f"
else:
state = u"\x034\x02CLOSED\x02\x0f by {}".format(data["closed_by"]["login"])
user = data["user"]["login"]
title = data["title"]
summary = truncate(data["body"])
gitiourl = gitio(data["html_url"])
if "Failed to get URL" in gitiourl:
gitiourl = gitio(data["html_url"] + " " + repo.split("/")[1] + number)
if summary == "":
return fmt1 % (number, state, user, title, gitiourl)
else:
return fmt % (number, state, user, title, summary, gitiourl)
@hook.command
def gitio(inp):
"""gitio <url> [code] -- Shorten Github URLs with git.io. [code] is
a optional custom short code."""
split = inp.split(" ")
url = split[0]
try:
code = split[1]
except:
code = None
# if the first 8 chars of "url" are not "https://" then append
# "https://" to the url, also convert "http://" to "https://"
if url[:8] != "https://":
if url[:7] != "http://":
url = "https://" + url
else:
url = "https://" + url[7:]
url = 'url=' + str(url)
if code:
url = url + '&code=' + str(code)
req = urllib2.Request(url='http://git.io', data=url)
# try getting url, catch http error
try:
f = urllib2.urlopen(req)
except urllib2.HTTPError:
return "Failed to get URL!"
urlinfo = str(f.info())
# loop over the rows in urlinfo and pick out location and
# status (this is pretty odd code, but urllib2.Request is weird)
for row in urlinfo.split("\n"):
if row.find("Status") != -1:
status = row
if row.find("Location") != -1:
location = row
print status
if not "201" in status:
return "Failed to get URL!"
# this wont work for some reason, so lets ignore it ^
# return location, minus the first 10 chars
return location[10:]

View File

@ -1,51 +0,0 @@
import random
from util import hook, http, text
def api_get(kind, query):
"""Use the RESTful Google Search API"""
url = 'http://ajax.googleapis.com/ajax/services/search/%s?' \
'v=1.0&safe=moderate'
return http.get_json(url % kind, q=query)
@hook.command('image')
@hook.command('gis')
@hook.command
def googleimage(inp):
"""gis <query> -- Returns first Google Image result for <query>."""
parsed = api_get('images', inp)
if not 200 <= parsed['responseStatus'] < 300:
raise IOError('error searching for images: {}: {}'.format(parsed['responseStatus'], ''))
if not parsed['responseData']['results']:
return 'no images found'
return random.choice(parsed['responseData']['results'][:10])['unescapedUrl']
@hook.command('search')
@hook.command('g')
@hook.command
def google(inp):
"""google <query> -- Returns first google search result for <query>."""
parsed = api_get('web', inp)
if not 200 <= parsed['responseStatus'] < 300:
raise IOError('error searching for pages: {}: {}'.format(parsed['responseStatus'], ''))
if not parsed['responseData']['results']:
return 'No results found.'
result = parsed['responseData']['results'][0]
title = http.unescape(result['titleNoFormatting'])
title = text.truncate_str(title, 60)
content = http.unescape(result['content'])
if not content:
content = "No description available."
else:
content = http.html.fromstring(content).text_content()
content = text.truncate_str(content, 150)
return u'{} -- \x02{}\x02: "{}"'.format(result['unescapedUrl'], title, content)

View File

@ -1,168 +0,0 @@
"""
A Google API key is required and retrieved from the bot config file.
Since December 1, 2011, the Google Translate API is a paid service only.
"""
import htmlentitydefs
import re
from util import hook, http
max_length = 100
########### from http://effbot.org/zone/re-sub.htm#unescape-html #############
def unescape(text):
def fixup(m):
text = m.group(0)
if text[:2] == "&#":
# character reference
try:
if text[:3] == "&#x":
return unichr(int(text[3:-1], 16))
else:
return unichr(int(text[2:-1]))
except ValueError:
pass
else:
# named entity
try:
text = unichr(htmlentitydefs.name2codepoint[text[1:-1]])
except KeyError:
pass
return text # leave as is
return re.sub("&#?\w+;", fixup, text)
##############################################################################
def goog_trans(api_key, text, slang, tlang):
url = 'https://www.googleapis.com/language/translate/v2'
if len(text) > max_length:
return "This command only supports input of less then 100 characters."
if slang:
parsed = http.get_json(url, key=api_key, q=text, source=slang, target=tlang, format="text")
else:
parsed = http.get_json(url, key=api_key, q=text, target=tlang, format="text")
#if not 200 <= parsed['responseStatus'] < 300:
# raise IOError('error with the translation server: %d: %s' % (
# parsed['responseStatus'], parsed['responseDetails']))
if not slang:
return unescape('(%(detectedSourceLanguage)s) %(translatedText)s' %
(parsed['data']['translations'][0]))
return unescape('%(translatedText)s' % parsed['data']['translations'][0])
def match_language(fragment):
fragment = fragment.lower()
for short, _ in lang_pairs:
if fragment in short.lower().split():
return short.split()[0]
for short, full in lang_pairs:
if fragment in full.lower():
return short.split()[0]
return None
@hook.command
def translate(inp, bot=None):
"""translate [source language [target language]] <sentence> -- translates
<sentence> from source language (default autodetect) to target
language (default English) using Google Translate"""
api_key = bot.config.get("api_keys", {}).get("googletranslate", None)
if not api_key:
return "This command requires a paid API key."
args = inp.split(u' ', 2)
try:
if len(args) >= 2:
sl = match_language(args[0])
if not sl:
return goog_trans(api_key, inp, '', 'en')
if len(args) == 2:
return goog_trans(api_key, args[1], sl, 'en')
if len(args) >= 3:
tl = match_language(args[1])
if not tl:
if sl == 'en':
return 'unable to determine desired target language'
return goog_trans(api_key, args[1] + ' ' + args[2], sl, 'en')
return goog_trans(api_key, args[2], sl, tl)
return goog_trans(api_key, inp, '', 'en')
except IOError, e:
return e
lang_pairs = [
("no", "Norwegian"),
("it", "Italian"),
("ht", "Haitian Creole"),
("af", "Afrikaans"),
("sq", "Albanian"),
("ar", "Arabic"),
("hy", "Armenian"),
("az", "Azerbaijani"),
("eu", "Basque"),
("be", "Belarusian"),
("bg", "Bulgarian"),
("ca", "Catalan"),
("zh-CN zh", "Chinese"),
("hr", "Croatian"),
("cs", "Czech"),
("da", "Danish"),
("nl", "Dutch"),
("en", "English"),
("et", "Estonian"),
("tl", "Filipino"),
("fi", "Finnish"),
("fr", "French"),
("gl", "Galician"),
("ka", "Georgian"),
("de", "German"),
("el", "Greek"),
("ht", "Haitian Creole"),
("iw", "Hebrew"),
("hi", "Hindi"),
("hu", "Hungarian"),
("is", "Icelandic"),
("id", "Indonesian"),
("ga", "Irish"),
("it", "Italian"),
("ja jp jpn", "Japanese"),
("ko", "Korean"),
("lv", "Latvian"),
("lt", "Lithuanian"),
("mk", "Macedonian"),
("ms", "Malay"),
("mt", "Maltese"),
("no", "Norwegian"),
("fa", "Persian"),
("pl", "Polish"),
("pt", "Portuguese"),
("ro", "Romanian"),
("ru", "Russian"),
("sr", "Serbian"),
("sk", "Slovak"),
("sl", "Slovenian"),
("es", "Spanish"),
("sw", "Swahili"),
("sv", "Swedish"),
("th", "Thai"),
("tr", "Turkish"),
("uk", "Ukrainian"),
("ur", "Urdu"),
("vi", "Vietnamese"),
("cy", "Welsh"),
("yi", "Yiddish")
]

View File

@ -1,22 +0,0 @@
from util import hook
from urllib import unquote
@hook.command(autohelp=False)
def googleurl(inp, db=None, nick=None):
"""googleurl [nickname] - Converts Google urls (google.com/url) to normal urls
where possible, in the specified nickname's last message. If nickname isn't provided,
action will be performed on user's last message"""
if not inp:
inp = nick
last_message = db.execute("select name, quote from seen_user where name"
" like ? and chan = ?", (inp.lower(), input.chan.lower())).fetchone()
if last_message:
msg = last_message[1]
out = ", ".join([(unquote(a[4:]) if a[:4] == "url=" else "") for a in msg.split("&")])\
.replace(", ,", "").strip()
return out if out else "No matches in your last message."
else:
if inp == nick:
return "You haven't said anything in this channel yet!"
else:
return "That user hasn't said anything in this channel yet!"

View File

@ -1,89 +0,0 @@
from collections import deque
from util import hook, timesince
import time
import re
db_ready = []
def db_init(db, conn_name):
"""check to see that our db has the the seen table (connection name is for caching the result per connection)"""
global db_ready
if db_ready.count(conn_name) < 1:
db.execute("create table if not exists seen_user(name, time, quote, chan, host, "
"primary key(name, chan))")
db.commit()
db_ready.append(conn_name)
def track_seen(input, message_time, db, conn):
""" Tracks messages for the .seen command """
db_init(db, conn)
# keep private messages private
if input.chan[:1] == "#" and not re.findall('^s/.*/.*/$', input.msg.lower()):
db.execute("insert or replace into seen_user(name, time, quote, chan, host)"
"values(?,?,?,?,?)", (input.nick.lower(), message_time, input.msg,
input.chan, input.mask))
db.commit()
def track_history(input, message_time, conn):
try:
history = conn.history[input.chan]
except KeyError:
conn.history[input.chan] = deque(maxlen=100)
history = conn.history[input.chan]
data = (input.nick, message_time, input.msg)
history.append(data)
@hook.singlethread
@hook.event('PRIVMSG', ignorebots=False)
def chat_tracker(paraml, input=None, db=None, conn=None):
message_time = time.time()
track_seen(input, message_time, db, conn)
track_history(input, message_time, conn)
@hook.command(autohelp=False)
def resethistory(inp, input=None, conn=None):
"""resethistory - Resets chat history for the current channel"""
try:
conn.history[input.chan].clear()
return "Reset chat history for current channel."
except KeyError:
# wat
return "There is no history for this channel."
"""seen.py: written by sklnd in about two beers July 2009"""
@hook.command
def seen(inp, nick='', chan='', db=None, input=None, conn=None):
"""seen <nick> <channel> -- Tell when a nickname was last in active in one of this bot's channels."""
if input.conn.nick.lower() == inp.lower():
return "You need to get your eyes checked."
if inp.lower() == nick.lower():
return "Have you looked in a mirror lately?"
if not re.match("^[A-Za-z0-9_|.\-\]\[]*$", inp.lower()):
return "I can't look up that name, its impossible to use!"
db_init(db, conn.name)
last_seen = db.execute("select name, time, quote from seen_user where name"
" like ? and chan = ?", (inp, chan)).fetchone()
if last_seen:
reltime = timesince.timesince(last_seen[1])
if last_seen[0] != inp.lower(): # for glob matching
inp = last_seen[0]
if last_seen[2][0:1] == "\x01":
return '{} was last seen {} ago: * {} {}'.format(inp, reltime, inp,
last_seen[2][8:-1])
else:
return '{} was last seen {} ago saying: {}'.format(inp, reltime, last_seen[2])
else:
return "I've never seen {} talking in this channel.".format(inp)

View File

@ -1,56 +0,0 @@
# Plugin by Infinity - <https://github.com/infinitylabs/UguuBot>
from util import hook, http, text
db_ready = False
def db_init(db):
"""check to see that our db has the horoscope table and return a connection."""
global db_ready
if not db_ready:
db.execute("create table if not exists horoscope(nick primary key, sign)")
db.commit()
db_ready = True
@hook.command(autohelp=False)
def horoscope(inp, db=None, notice=None, nick=None):
"""horoscope <sign> -- Get your horoscope."""
db_init(db)
# check if the user asked us not to save his details
dontsave = inp.endswith(" dontsave")
if dontsave:
sign = inp[:-9].strip().lower()
else:
sign = inp
db.execute("create table if not exists horoscope(nick primary key, sign)")
if not sign:
sign = db.execute("select sign from horoscope where nick=lower(?)",
(nick,)).fetchone()
if not sign:
notice("horoscope <sign> -- Get your horoscope")
return
sign = sign[0]
url = "http://my.horoscope.com/astrology/free-daily-horoscope-{}.html".format(sign)
soup = http.get_soup(url)
title = soup.find_all('h1', {'class': 'h1b'})[1]
horoscope_text = soup.find('div', {'class': 'fontdef1'})
result = u"\x02%s\x02 %s" % (title, horoscope_text)
result = text.strip_html(result)
#result = unicode(result, "utf8").replace('flight ','')
if not title:
return "Could not get the horoscope for {}.".format(inp)
if inp and not dontsave:
db.execute("insert or replace into horoscope(nick, sign) values (?,?)",
(nick.lower(), sign))
db.commit()
return result

View File

@ -1,30 +0,0 @@
from urllib import urlencode
import re
from util import hook, http, timeformat
hulu_re = (r'(.*://)(www.hulu.com|hulu.com)(.*)', re.I)
@hook.regex(*hulu_re)
def hulu_url(match):
data = http.get_json("http://www.hulu.com/api/oembed.json?url=http://www.hulu.com" + match.group(3))
showname = data['title'].split("(")[-1].split(")")[0]
title = data['title'].split(" (")[0]
return "{}: {} - {}".format(showname, title, timeformat.format_time(int(data['duration'])))
@hook.command('hulu')
def hulu_search(inp):
"""hulu <search> - Search Hulu"""
result = http.get_soup(
"http://m.hulu.com/search?dp_identifier=hulu&{}&items_per_page=1&page=1".format(urlencode({'query': inp})))
data = result.find('results').find('videos').find('video')
showname = data.find('show').find('name').text
title = data.find('title').text
duration = timeformat.format_time(int(float(data.find('duration').text)))
description = data.find('description').text
rating = data.find('content-rating').text
return "{}: {} - {} - {} ({}) {}".format(showname, title, description, duration, rating,
"http://www.hulu.com/watch/" + str(data.find('id').text))

View File

@ -1,59 +0,0 @@
# IMDb lookup plugin by Ghetto Wizard (2011) and blha303 (2013)
import re
from util import hook, http, text
id_re = re.compile("tt\d+")
imdb_re = (r'(.*:)//(imdb.com|www.imdb.com)(:[0-9]+)?(.*)', re.I)
@hook.command
def imdb(inp):
"""imdb <movie> -- Gets information about <movie> from IMDb."""
strip = inp.strip()
if id_re.match(strip):
content = http.get_json("http://www.omdbapi.com/", i=strip)
else:
content = http.get_json("http://www.omdbapi.com/", t=strip)
if content.get('Error', None) == 'Movie not found!':
return 'Movie not found!'
elif content['Response'] == 'True':
content['URL'] = 'http://www.imdb.com/title/{}'.format(content['imdbID'])
out = '\x02%(Title)s\x02 (%(Year)s) (%(Genre)s): %(Plot)s'
if content['Runtime'] != 'N/A':
out += ' \x02%(Runtime)s\x02.'
if content['imdbRating'] != 'N/A' and content['imdbVotes'] != 'N/A':
out += ' \x02%(imdbRating)s/10\x02 with \x02%(imdbVotes)s\x02' \
' votes.'
out += ' %(URL)s'
return out % content
else:
return 'Unknown error.'
@hook.regex(*imdb_re)
def imdb_url(match):
imdb_id = match.group(4).split('/')[-1]
if imdb_id == "":
imdb_id = match.group(4).split('/')[-2]
content = http.get_json("http://www.omdbapi.com/", i=imdb_id)
if content.get('Error', None) == 'Movie not found!':
return 'Movie not found!'
elif content['Response'] == 'True':
content['URL'] = 'http://www.imdb.com/title/%(imdbID)s' % content
content['Plot'] = text.truncate_str(content['Plot'], 50)
out = '\x02%(Title)s\x02 (%(Year)s) (%(Genre)s): %(Plot)s'
if content['Runtime'] != 'N/A':
out += ' \x02%(Runtime)s\x02.'
if content['imdbRating'] != 'N/A' and content['imdbVotes'] != 'N/A':
out += ' \x02%(imdbRating)s/10\x02 with \x02%(imdbVotes)s\x02' \
' votes.'
return out % content
else:
return 'Unknown error.'

View File

@ -1,82 +0,0 @@
import re
import random
from util import hook, http, web
base_url = "http://reddit.com/r/{}/.json"
imgur_re = re.compile(r'http://(?:i\.)?imgur\.com/(a/)?(\w+\b(?!/))\.?\w?')
album_api = "https://api.imgur.com/3/album/{}/images.json"
def is_valid(data):
if data["domain"] in ["i.imgur.com", "imgur.com"]:
return True
else:
return False
@hook.command(autohelp=False)
def imgur(inp):
"""imgur [subreddit] -- Gets the first page of imgur images from [subreddit] and returns a link to them.
If [subreddit] is undefined, return any imgur images"""
if inp:
# see if the input ends with "nsfw"
show_nsfw = inp.endswith(" nsfw")
# remove "nsfw" from the input string after checking for it
if show_nsfw:
inp = inp[:-5].strip().lower()
url = base_url.format(inp.strip())
else:
url = "http://www.reddit.com/domain/imgur.com/.json"
show_nsfw = False
try:
data = http.get_json(url, user_agent=http.ua_chrome)
except Exception as e:
return "Error: " + str(e)
data = data["data"]["children"]
random.shuffle(data)
# filter list to only have imgur links
filtered_posts = [i["data"] for i in data if is_valid(i["data"])]
if not filtered_posts:
return "No images found."
items = []
headers = {
"Authorization": "Client-ID b5d127e6941b07a"
}
# loop over the list of posts
for post in filtered_posts:
if post["over_18"] and not show_nsfw:
continue
match = imgur_re.search(post["url"])
if match.group(1) == 'a/':
# post is an album
url = album_api.format(match.group(2))
images = http.get_json(url, headers=headers)["data"]
# loop over the images in the album and add to the list
for image in images:
items.append(image["id"])
elif match.group(2) is not None:
# post is an image
items.append(match.group(2))
if not items:
return "No images found (use .imgur <subreddit> nsfw to show explicit content)"
if show_nsfw:
return "{} \x02NSFW\x02".format(web.isgd("http://imgur.com/" + ','.join(items)))
else:
return web.isgd("http://imgur.com/" + ','.join(items))

View File

@ -1,28 +0,0 @@
import urlparse
from util import hook, http, urlnorm
@hook.command
def isup(inp):
"""isup -- uses isup.me to see if a site is up or not"""
# slightly overcomplicated, esoteric URL parsing
scheme, auth, path, query, fragment = urlparse.urlsplit(inp.strip())
domain = auth.encode('utf-8') or path.encode('utf-8')
url = urlnorm.normalize(domain, assume_scheme="http")
try:
soup = http.get_soup('http://isup.me/' + domain)
except http.HTTPError, http.URLError:
return "Could not get status."
content = soup.find('div').text.strip()
if "not just you" in content:
return "It's not just you. {} looks \x02\x034down\x02\x0f from here!".format(url)
elif "is up" in content:
return "It's just you. {} is \x02\x033up\x02\x0f.".format(url)
else:
return "Huh? That doesn't look like a site on the interweb."

View File

@ -1,15 +0,0 @@
import re
from util import hook, http
@hook.command(autohelp=False)
def kernel(inp, reply=None):
contents = http.get("https://www.kernel.org/finger_banner")
contents = re.sub(r'The latest(\s*)', '', contents)
contents = re.sub(r'version of the Linux kernel is:(\s*)', '- ', contents)
lines = contents.split("\n")
message = "Linux kernel versions: "
message += ", ".join(line for line in lines[:-1])
reply(message)

View File

@ -1,33 +0,0 @@
import json
from util import hook, textgen
def get_generator(_json, variables):
data = json.loads(_json)
return textgen.TextGenerator(data["templates"],
data["parts"], variables=variables)
@hook.command
def kill(inp, action=None, nick=None, conn=None, notice=None):
"""kill <user> -- Makes the bot kill <user>."""
target = inp.strip()
if " " in target:
notice("Invalid username!")
return
# if the user is trying to make the bot kill itself, kill them
if target.lower() == conn.nick.lower() or target.lower() == "itself":
target = nick
variables = {
"user": target
}
with open("plugins/data/kills.json") as f:
generator = get_generator(f.read(), variables)
# act out the message
action(generator.generate_string())

View File

@ -1,83 +0,0 @@
from datetime import datetime
from util import hook, http, timesince
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"
@hook.command('l', autohelp=False)
@hook.command(autohelp=False)
def lastfm(inp, nick='', db=None, bot=None, notice=None):
"""lastfm [user] [dontsave] -- Displays the now playing (or last played)
track of LastFM user [user]."""
api_key = bot.config.get("api_keys", {}).get("lastfm")
if not api_key:
return "error: no api key set"
# check if the user asked us not to save his details
dontsave = inp.endswith(" dontsave")
if dontsave:
user = inp[:-9].strip().lower()
else:
user = inp
db.execute("create table if not exists lastfm(nick primary key, acc)")
if not user:
user = db.execute("select acc from lastfm where nick=lower(?)",
(nick,)).fetchone()
if not user:
notice(lastfm.__doc__)
return
user = user[0]
response = http.get_json(api_url, method="user.getrecenttracks",
api_key=api_key, user=user, limit=1)
if 'error' in response:
return u"Error: {}.".format(response["message"])
if not "track" in response["recenttracks"] or len(response["recenttracks"]["track"]) == 0:
return u'No recent tracks for user "{}" found.'.format(user)
tracks = response["recenttracks"]["track"]
if type(tracks) == list:
# if the user is listening to something, the tracks entry is a list
# the first item is the current track
track = tracks[0]
status = 'is listening to'
ending = '.'
elif type(tracks) == dict:
# otherwise, they aren't listening to anything right now, and
# the tracks entry is a dict representing the most recent track
track = tracks
status = 'last listened to'
# lets see how long ago they listened to it
time_listened = datetime.fromtimestamp(int(track["date"]["uts"]))
time_since = timesince.timesince(time_listened)
ending = ' ({} ago)'.format(time_since)
else:
return "error: could not parse track listing"
title = track["name"]
album = track["album"]["#text"]
artist = track["artist"]["#text"]
out = u'{} {} "{}"'.format(user, status, title)
if artist:
out += u" by \x02{}\x0f".format(artist)
if album:
out += u" from the album \x02{}\x0f".format(album)
# append ending based on what type it was
out += ending
if inp and not dontsave:
db.execute("insert or replace into lastfm(nick, acc) values (?,?)",
(nick.lower(), user))
db.commit()
return out

View File

@ -1,14 +0,0 @@
from util import hook, web, http
@hook.command('gfy')
@hook.command
def lmgtfy(inp):
"""lmgtfy [phrase] - Posts a google link for the specified phrase"""
link = u"http://lmgtfy.com/?q={}".format(http.quote_plus(inp))
try:
return web.isgd(link)
except (web.ShortenError, http.HTTPError):
return link

View File

@ -1,113 +0,0 @@
"""
log.py: written by Scaevolus 2009
"""
import os
import codecs
import time
import re
from util import hook
log_fds = {} # '%(net)s %(chan)s': (filename, fd)
timestamp_format = '%H:%M:%S'
formats = {
'PRIVMSG': '<%(nick)s> %(msg)s',
'PART': '-!- %(nick)s [%(user)s@%(host)s] has left %(chan)s',
'JOIN': '-!- %(nick)s [%(user)s@%(host)s] has joined %(param0)s',
'MODE': '-!- mode/%(chan)s [%(param_tail)s] by %(nick)s',
'KICK': '-!- %(param1)s was kicked from %(chan)s by %(nick)s [%(msg)s]',
'TOPIC': '-!- %(nick)s changed the topic of %(chan)s to: %(msg)s',
'QUIT': '-!- %(nick)s has quit [%(msg)s]',
'PING': '',
'NOTICE': '-%(nick)s- %(msg)s'
}
ctcp_formats = {
'ACTION': '* %(nick)s %(ctcpmsg)s',
'VERSION': '%(nick)s has requested CTCP %(ctcpcmd)s from %(chan)s: %(ctcpmsg)s',
'PING': '%(nick)s has requested CTCP %(ctcpcmd)s from %(chan)s: %(ctcpmsg)s',
'TIME': '%(nick)s has requested CTCP %(ctcpcmd)s from %(chan)s: %(ctcpmsg)s',
'FINGER': '%(nick)s has requested CTCP %(ctcpcmd)s from %(chan)s: %(ctcpmsg)s'
}
irc_color_re = re.compile(r'(\x03(\d+,\d+|\d)|[\x0f\x02\x16\x1f])')
def get_log_filename(dir, server, chan):
return os.path.join(dir, 'log', gmtime('%Y'), server, chan,
(gmtime('%%s.%m-%d.log') % chan).lower())
def gmtime(format):
return time.strftime(format, time.gmtime())
def beautify(input):
format = formats.get(input.command, '%(raw)s')
args = dict(input)
leng = len(args['paraml'])
for n, p in enumerate(args['paraml']):
args['param' + str(n)] = p
args['param_' + str(abs(n - leng))] = p
args['param_tail'] = ' '.join(args['paraml'][1:])
args['msg'] = irc_color_re.sub('', args['msg'])
if input.command == 'PRIVMSG' and input.msg.count('\x01') >= 2:
ctcp = input.msg.split('\x01', 2)[1].split(' ', 1)
if len(ctcp) == 1:
ctcp += ['']
args['ctcpcmd'], args['ctcpmsg'] = ctcp
format = ctcp_formats.get(args['ctcpcmd'],
'%(nick)s [%(user)s@%(host)s] requested unknown CTCP '
'%(ctcpcmd)s from %(chan)s: %(ctcpmsg)s')
return format % args
def get_log_fd(dir, server, chan):
fn = get_log_filename(dir, server, chan)
cache_key = '%s %s' % (server, chan)
filename, fd = log_fds.get(cache_key, ('', 0))
if fn != filename: # we need to open a file for writing
if fd != 0: # is a valid fd
fd.flush()
fd.close()
dir = os.path.split(fn)[0]
if not os.path.exists(dir):
os.makedirs(dir)
fd = codecs.open(fn, 'a', 'utf-8')
log_fds[cache_key] = (fn, fd)
return fd
@hook.singlethread
@hook.event('*')
def log(paraml, input=None, bot=None):
timestamp = gmtime(timestamp_format)
fd = get_log_fd(bot.persist_dir, input.server, 'raw')
fd.write(timestamp + ' ' + input.raw + '\n')
if input.command == 'QUIT': # these are temporary fixes until proper
input.chan = 'quit' # presence tracking is implemented
if input.command == 'NICK':
input.chan = 'nick'
beau = beautify(input)
if beau == '': # don't log this
return
if input.chan:
fd = get_log_fd(bot.persist_dir, input.server, input.chan)
fd.write(timestamp + ' ' + beau + '\n')
print timestamp, input.chan, beau.encode('utf8', 'ignore')

View File

@ -1,43 +0,0 @@
from util import hook, http, web
url = "http://search.azlyrics.com/search.php?q="
@hook.command
def lyrics(inp):
"""lyrics <search> - Search AZLyrics.com for song lyrics"""
if "pastelyrics" in inp:
dopaste = True
inp = inp.replace("pastelyrics", "").strip()
else:
dopaste = False
soup = http.get_soup(url + inp.replace(" ", "+"))
if "Try to compose less restrictive search query" in soup.find('div', {'id': 'inn'}).text:
return "No results. Check spelling."
div = None
for i in soup.findAll('div', {'class': 'sen'}):
if "/lyrics/" in i.find('a')['href']:
div = i
break
if div:
title = div.find('a').text
link = div.find('a')['href']
if dopaste:
newsoup = http.get_soup(link)
try:
lyrics = newsoup.find('div', {'style': 'margin-left:10px;margin-right:10px;'}).text.strip()
pasteurl = " " + web.haste(lyrics)
except Exception as e:
pasteurl = " (\x02Unable to paste lyrics\x02 [{}])".format(str(e))
else:
pasteurl = ""
artist = div.find('b').text.title()
lyricsum = div.find('div').text
if "\r\n" in lyricsum.strip():
lyricsum = " / ".join(lyricsum.strip().split("\r\n")[0:4]) # truncate, format
else:
lyricsum = " / ".join(lyricsum.strip().split("\n")[0:4]) # truncate, format
return "\x02{}\x02 by \x02{}\x02 {}{} - {}".format(title, artist, web.try_isgd(link), pasteurl,
lyricsum[:-3])
else:
return "No song results. " + url + inp.replace(" ", "+")

View File

@ -1,104 +0,0 @@
# metacritic.com scraper
import re
from urllib2 import HTTPError
from util import hook, http
@hook.command('mc')
@hook.command
def metacritic(inp):
"""mc [all|movie|tv|album|x360|ps3|pc|gba|ds|3ds|wii|vita|wiiu|xone|ps4] <title>
Gets rating for <title> from metacritic on the specified medium."""
args = inp.strip()
game_platforms = ('x360', 'ps3', 'pc', 'gba', 'ds', '3ds', 'wii',
'vita', 'wiiu', 'xone', 'ps4')
all_platforms = game_platforms + ('all', 'movie', 'tv', 'album')
try:
plat, title = args.split(' ', 1)
if plat not in all_platforms:
# raise the ValueError so that the except block catches it
# in this case, or in the case of the .split above raising the
# ValueError, we want the same thing to happen
raise ValueError
except ValueError:
plat = 'all'
title = args
cat = 'game' if plat in game_platforms else plat
title_safe = http.quote_plus(title)
url = 'http://www.metacritic.com/search/{}/{}/results'.format(cat, title_safe)
try:
doc = http.get_html(url)
except HTTPError:
return 'error fetching results'
# get the proper result element we want to pull data from
result = None
if not doc.find_class('query_results'):
return 'No results found.'
# if they specified an invalid search term, the input box will be empty
if doc.get_element_by_id('search_term').value == '':
return 'Invalid search term.'
if plat not in game_platforms:
# for [all] results, or non-game platforms, get the first result
result = doc.find_class('result first_result')[0]
# find the platform, if it exists
result_type = result.find_class('result_type')
if result_type:
# if the result_type div has a platform div, get that one
platform_div = result_type[0].find_class('platform')
if platform_div:
plat = platform_div[0].text_content().strip()
else:
# otherwise, use the result_type text_content
plat = result_type[0].text_content().strip()
else:
# for games, we want to pull the first result with the correct
# platform
results = doc.find_class('result')
for res in results:
result_plat = res.find_class('platform')[0].text_content().strip()
if result_plat == plat.upper():
result = res
break
if not result:
return 'No results found.'
# get the name, release date, and score from the result
product_title = result.find_class('product_title')[0]
name = product_title.text_content()
link = 'http://metacritic.com' + product_title.find('a').attrib['href']
try:
release = result.find_class('release_date')[0]. \
find_class('data')[0].text_content()
# strip extra spaces out of the release date
release = re.sub(r'\s{2,}', ' ', release)
except IndexError:
release = None
try:
score = result.find_class('metascore_w')[0].text_content()
except IndexError:
score = None
return '[{}] {} - \x02{}/100\x02, {} - {}'.format(plat.upper(), name, score or 'no score',
'release: \x02%s\x02' % release if release else 'unreleased',
link)

View File

@ -1,154 +0,0 @@
import time
import random
from util import hook, http, web, text
## CONSTANTS
base_url = "http://api.bukget.org/3/"
search_url = base_url + "search/plugin_name/like/{}"
random_url = base_url + "plugins/bukkit/?start={}&size=1"
details_url = base_url + "plugins/bukkit/{}"
categories = http.get_json("http://api.bukget.org/3/categories")
count_total = sum([cat["count"] for cat in categories])
count_categories = {cat["name"].lower(): int(cat["count"]) for cat in categories} # dict comps!
class BukgetError(Exception):
def __init__(self, code, text):
self.code = code
self.text = text
def __str__(self):
return self.text
## DATA FUNCTIONS
def plugin_search(term):
""" searches for a plugin with the bukget API and returns the slug """
term = term.lower().strip()
search_term = http.quote_plus(term)
try:
results = http.get_json(search_url.format(search_term))
except (http.HTTPError, http.URLError) as e:
raise BukgetError(500, "Error Fetching Search Page: {}".format(e))
if not results:
raise BukgetError(404, "No Results Found")
for result in results:
if result["slug"] == term:
return result["slug"]
return results[0]["slug"]
def plugin_random():
""" gets a random plugin from the bukget API and returns the slug """
results = None
while not results:
plugin_number = random.randint(1, count_total)
print "trying {}".format(plugin_number)
try:
results = http.get_json(random_url.format(plugin_number))
except (http.HTTPError, http.URLError) as e:
raise BukgetError(500, "Error Fetching Search Page: {}".format(e))
return results[0]["slug"]
def plugin_details(slug):
""" takes a plugin slug and returns details from the bukget API """
slug = slug.lower().strip()
try:
details = http.get_json(details_url.format(slug))
except (http.HTTPError, http.URLError) as e:
raise BukgetError(500, "Error Fetching Details: {}".format(e))
return details
## OTHER FUNCTIONS
def format_output(data):
""" takes plugin data and returns two strings representing information about that plugin """
name = data["plugin_name"]
description = text.truncate_str(data['description'], 30)
url = data['website']
authors = data['authors'][0]
authors = authors[0] + u"\u200b" + authors[1:]
stage = data['stage']
current_version = data['versions'][0]
last_update = time.strftime('%d %B %Y %H:%M',
time.gmtime(current_version['date']))
version_number = data['versions'][0]['version']
bukkit_versions = ", ".join(current_version['game_versions'])
link = web.try_isgd(current_version['link'])
if description:
line_a = u"\x02{}\x02, by \x02{}\x02 - {} - ({}) \x02{}".format(name, authors, description, stage, url)
else:
line_a = u"\x02{}\x02, by \x02{}\x02 ({}) \x02{}".format(name, authors, stage, url)
line_b = u"Last release: \x02v{}\x02 for \x02{}\x02 at {} \x02{}\x02".format(version_number, bukkit_versions,
last_update, link)
return line_a, line_b
## HOOK FUNCTIONS
@hook.command('plugin')
@hook.command
def bukget(inp, reply=None, message=None):
"""bukget <slug/name> - Look up a plugin on dev.bukkit.org"""
# get the plugin slug using search
try:
slug = plugin_search(inp)
except BukgetError as e:
return e
# get the plugin info using the slug
try:
data = plugin_details(slug)
except BukgetError as e:
return e
# format the final message and send it to IRC
line_a, line_b = format_output(data)
reply(line_a)
message(line_b)
@hook.command(autohelp=None)
def randomplugin(inp, reply=None, message=None):
"""randomplugin - Gets a random plugin from dev.bukkit.org"""
# get a random plugin slug
try:
slug = plugin_random()
except BukgetError as e:
return e
# get the plugin info using the slug
try:
data = plugin_details(slug)
except BukgetError as e:
return e
# format the final message and send it to IRC
line_a, line_b = format_output(data)
reply(line_a)
message(line_b)

View File

@ -1,100 +0,0 @@
""" plugin by _303 (?)
"""
import re
from util import hook
pattern = re.compile(r'^(?P<count>\d+)x (?P<name>.+?): (?P<ingredients>.*)$')
recipelist = []
class Recipe(object):
__slots__ = 'output', 'count', 'ingredients', 'line'
def __init__(self, output, count, ingredients, line):
self.output = output
self.count = count
self.ingredients = ingredients
self.line = line
def __str__(self):
return self.line
with open("plugins/data/recipes.txt") as f:
for line in f.readlines():
if line.startswith("//"):
continue
line = line.strip()
match = pattern.match(line)
if not match:
continue
recipelist.append(Recipe(line=line,
output=match.group("name").lower(),
ingredients=match.group("ingredients"),
count=match.group("count")))
ids = []
with open("plugins/data/itemids.txt") as f:
for line in f.readlines():
if line.startswith("//"):
continue
parts = line.strip().split()
itemid = parts[0]
name = " ".join(parts[1:])
ids.append((itemid, name))
@hook.command("mcid")
@hook.command
def mcitem(inp, reply=None):
"""mcitem <item/id> -- gets the id from an item or vice versa"""
inp = inp.lower().strip()
if inp == "":
reply("error: no input.")
return
results = []
for item_id, item_name in ids:
if inp == item_id:
results = ["\x02[{}]\x02 {}".format(item_id, item_name)]
break
elif inp in item_name.lower():
results.append("\x02[{}]\x02 {}".format(item_id, item_name))
if not results:
return "No matches found."
if len(results) > 12:
reply("There are too many options, please narrow your search. ({})".format(str(len(results))))
return
out = ", ".join(results)
return out
@hook.command("mccraft")
@hook.command
def mcrecipe(inp, reply=None):
"""mcrecipe <item> -- gets the crafting recipe for an item"""
inp = inp.lower().strip()
results = [recipe.line for recipe in recipelist
if inp in recipe.output]
if not results:
return "No matches found."
if len(results) > 3:
reply("There are too many options, please narrow your search. ({})".format(len(results)))
return
for result in results:
reply(result)

View File

@ -1,232 +0,0 @@
import socket
import struct
import json
import traceback
from util import hook
try:
import DNS
has_dns = True
except ImportError:
has_dns = False
mc_colors = [(u'\xa7f', u'\x0300'), (u'\xa70', u'\x0301'), (u'\xa71', u'\x0302'), (u'\xa72', u'\x0303'),
(u'\xa7c', u'\x0304'), (u'\xa74', u'\x0305'), (u'\xa75', u'\x0306'), (u'\xa76', u'\x0307'),
(u'\xa7e', u'\x0308'), (u'\xa7a', u'\x0309'), (u'\xa73', u'\x0310'), (u'\xa7b', u'\x0311'),
(u'\xa71', u'\x0312'), (u'\xa7d', u'\x0313'), (u'\xa78', u'\x0314'), (u'\xa77', u'\x0315'),
(u'\xa7l', u'\x02'), (u'\xa79', u'\x0310'), (u'\xa7o', u'\t'), (u'\xa7m', u'\x13'),
(u'\xa7r', u'\x0f'), (u'\xa7n', u'\x15')]
## EXCEPTIONS
class PingError(Exception):
def __init__(self, text):
self.text = text
def __str__(self):
return self.text
class ParseError(Exception):
def __init__(self, text):
self.text = text
def __str__(self):
return self.text
## MISC
def unpack_varint(s):
d = 0
i = 0
while True:
b = ord(s.recv(1))
d |= (b & 0x7F) << 7 * i
i += 1
if not b & 0x80:
return d
pack_data = lambda d: struct.pack('>b', len(d)) + d
pack_port = lambda i: struct.pack('>H', i)
## DATA FUNCTIONS
def mcping_modern(host, port):
""" pings a server using the modern (1.7+) protocol and returns data """
try:
# connect to the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((host, port))
except socket.gaierror:
raise PingError("Invalid hostname")
except socket.timeout:
raise PingError("Request timed out")
# send handshake + status request
s.send(pack_data("\x00\x00" + pack_data(host.encode('utf8')) + pack_port(port) + "\x01"))
s.send(pack_data("\x00"))
# read response
unpack_varint(s) # Packet length
unpack_varint(s) # Packet ID
l = unpack_varint(s) # String length
if not l > 1:
raise PingError("Invalid response")
d = ""
while len(d) < l:
d += s.recv(1024)
# Close our socket
s.close()
except socket.error:
raise PingError("Socket Error")
# Load json and return
data = json.loads(d.decode('utf8'))
try:
version = data["version"]["name"]
try:
desc = u" ".join(data["description"]["text"].split())
except TypeError:
desc = u" ".join(data["description"].split())
max_players = data["players"]["max"]
online = data["players"]["online"]
except Exception as e:
# TODO: except Exception is bad
traceback.print_exc(e)
raise PingError("Unknown Error: {}".format(e))
output = {
"motd": format_colors(desc),
"motd_raw": desc,
"version": version,
"players": online,
"players_max": max_players
}
return output
def mcping_legacy(host, port):
""" pings a server using the legacy (1.6 and older) protocol and returns data """
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((host, port))
sock.send('\xfe\x01')
response = sock.recv(1)
except socket.gaierror:
raise PingError("Invalid hostname")
except socket.timeout:
raise PingError("Request timed out")
if response[0] != '\xff':
raise PingError("Invalid response")
length = struct.unpack('!h', sock.recv(2))[0]
values = sock.recv(length * 2).decode('utf-16be')
data = values.split(u'\x00') # try to decode data using new format
if len(data) == 1:
# failed to decode data, server is using old format
data = values.split(u'\xa7')
output = {
"motd": format_colors(" ".join(data[0].split())),
"motd_raw": data[0],
"version": None,
"players": data[1],
"players_max": data[2]
}
else:
# decoded data, server is using new format
output = {
"motd": format_colors(" ".join(data[3].split())),
"motd_raw": data[3],
"version": data[2],
"players": data[4],
"players_max": data[5]
}
sock.close()
return output
## FORMATTING/PARSING FUNCTIONS
def check_srv(domain):
""" takes a domain and finds minecraft SRV records """
DNS.DiscoverNameServers()
srv_req = DNS.Request(qtype='srv')
srv_result = srv_req.req('_minecraft._tcp.{}'.format(domain))
for getsrv in srv_result.answers:
if getsrv['typename'] == 'SRV':
data = [getsrv['data'][2], getsrv['data'][3]]
return data
def parse_input(inp):
""" takes the input from the mcping command and returns the host and port """
inp = inp.strip().split(" ")[0]
if ":" in inp:
# the port is defined in the input string
host, port = inp.split(":", 1)
try:
port = int(port)
if port > 65535 or port < 0:
raise ParseError("The port '{}' is invalid.".format(port))
except ValueError:
raise ParseError("The port '{}' is invalid.".format(port))
return host, port
if has_dns:
# the port is not in the input string, but we have PyDNS so look for a SRV record
srv_data = check_srv(inp)
if srv_data:
return str(srv_data[1]), int(srv_data[0])
# return default port
return inp, 25565
def format_colors(motd):
for original, replacement in mc_colors:
motd = motd.replace(original, replacement)
motd = motd.replace(u"\xa7k", "")
return motd
def format_output(data):
if data["version"]:
return u"{motd}\x0f - {version}\x0f - {players}/{players_max}" \
u" players.".format(**data).replace("\n", u"\x0f - ")
else:
return u"{motd}\x0f - {players}/{players_max}" \
u" players.".format(**data).replace("\n", u"\x0f - ")
@hook.command
@hook.command("mcp")
def mcping(inp):
"""mcping <server>[:port] - Ping a Minecraft server to check status."""
try:
host, port = parse_input(inp)
except ParseError as e:
return "Could not parse input ({})".format(e)
try:
data = mcping_modern(host, port)
except PingError:
try:
data = mcping_legacy(host, port)
except PingError as e:
return "Could not ping server, is it offline? ({})".format(e)
return format_output(data)

View File

@ -1,44 +0,0 @@
import json
from util import hook, http
@hook.command(autohelp=False)
def mcstatus(inp):
"""mcstatus -- Checks the status of various Mojang (the creators of Minecraft) servers."""
try:
request = http.get("http://status.mojang.com/check")
except (http.URLError, http.HTTPError) as e:
return "Unable to get Minecraft server status: {}".format(e)
# lets just reformat this data to get in a nice format
data = json.loads(request.replace("}", "").replace("{", "").replace("]", "}").replace("[", "{"))
out = []
# use a loop so we don't have to update it if they add more servers
green = []
yellow = []
red = []
for server, status in data.items():
if status == "green":
green.append(server)
elif status == "yellow":
yellow.append(server)
else:
red.append(server)
if green:
out = "\x033\x02Online\x02\x0f: " + ", ".join(green)
if yellow:
out += " "
if yellow:
out += "\x02Issues\x02: " + ", ".join(yellow)
if red:
out += " "
if red:
out += "\x034\x02Offline\x02\x0f: " + ", ".join(red)
return "\x0f" + out.replace(".mojang.com", ".mj") \
.replace(".minecraft.net", ".mc")

View File

@ -1,101 +0,0 @@
import json
from util import hook, http
NAME_URL = "https://account.minecraft.net/buy/frame/checkName/{}"
PAID_URL = "http://www.minecraft.net/haspaid.jsp"
class McuError(Exception):
pass
def get_status(name):
""" takes a name and returns status """
try:
name_encoded = http.quote_plus(name)
response = http.get(NAME_URL.format(name_encoded))
except (http.URLError, http.HTTPError) as e:
raise McuError("Could not get name status: {}".format(e))
if "OK" in response:
return "free"
elif "TAKEN" in response:
return "taken"
elif "invalid characters" in response:
return "invalid"
def get_profile(name):
profile = {}
# form the profile request
request = {
"name": name,
"agent": "minecraft"
}
# submit the profile request
try:
headers = {"Content-Type": "application/json"}
r = http.get_json(
'https://api.mojang.com/profiles/page/1',
post_data=json.dumps(request),
headers=headers
)
except (http.URLError, http.HTTPError) as e:
raise McuError("Could not get profile status: {}".format(e))
user = r["profiles"][0]
profile["name"] = user["name"]
profile["id"] = user["id"]
profile["legacy"] = user.get("legacy", False)
try:
response = http.get(PAID_URL, user=name)
except (http.URLError, http.HTTPError) as e:
raise McuError("Could not get payment status: {}".format(e))
if "true" in response:
profile["paid"] = True
else:
profile["paid"] = False
return profile
@hook.command("haspaid")
@hook.command("mcpaid")
@hook.command
def mcuser(inp):
"""mcpaid <username> -- Gets information about the Minecraft user <account>."""
user = inp.strip()
try:
# get status of name (does it exist?)
name_status = get_status(user)
except McuError as e:
return e
if name_status == "taken":
try:
# get information about user
profile = get_profile(user)
except McuError as e:
return "Error: {}".format(e)
profile["lt"] = ", legacy" if profile["legacy"] else ""
if profile["paid"]:
return u"The account \x02{name}\x02 ({id}{lt}) exists. It is a \x02paid\x02" \
u" account.".format(**profile)
else:
return u"The account \x02{name}\x02 ({id}{lt}) exists. It \x034\x02is NOT\x02\x0f a paid" \
u" account.".format(**profile)
elif name_status == "free":
return u"The account \x02{}\x02 does not exist.".format(user)
elif name_status == "invalid":
return u"The name \x02{}\x02 contains invalid characters.".format(user)
else:
# if you see this, panic
return "Unknown Error."

View File

@ -1,51 +0,0 @@
import re
from util import hook, http, text
api_url = "http://minecraft.gamepedia.com/api.php?action=opensearch"
mc_url = "http://minecraft.gamepedia.com/"
@hook.command
def mcwiki(inp):
"""mcwiki <phrase> -- Gets the first paragraph of
the Minecraft Wiki article on <phrase>."""
try:
j = http.get_json(api_url, search=inp)
except (http.HTTPError, http.URLError) as e:
return "Error fetching search results: {}".format(e)
except ValueError as e:
return "Error reading search results: {}".format(e)
if not j[1]:
return "No results found."
# we remove items with a '/' in the name, because
# gamepedia uses sub-pages for different languages
# for some stupid reason
items = [item for item in j[1] if not "/" in item]
if items:
article_name = items[0].replace(' ', '_').encode('utf8')
else:
# there are no items without /, just return a / one
article_name = j[1][0].replace(' ', '_').encode('utf8')
url = mc_url + http.quote(article_name, '')
try:
page = http.get_html(url)
except (http.HTTPError, http.URLError) as e:
return "Error fetching wiki page: {}".format(e)
for p in page.xpath('//div[@class="mw-content-ltr"]/p'):
if p.text_content():
summary = " ".join(p.text_content().splitlines())
summary = re.sub("\[\d+\]", "", summary)
summary = text.truncate_str(summary, 200)
return u"{} :: {}".format(summary, url)
# this shouldn't happen
return "Unknown Error."

View File

@ -1,34 +0,0 @@
# Plugin by Infinity - <https://github.com/infinitylabs/UguuBot>
import random
from util import hook, http
mlia_cache = []
def refresh_cache():
"""gets a page of random MLIAs and puts them into a dictionary """
url = 'http://mylifeisaverage.com/{}'.format(random.randint(1, 11000))
soup = http.get_soup(url)
for story in soup.find_all('div', {'class': 'story '}):
mlia_id = story.find('span', {'class': 'left'}).a.text
mlia_text = story.find('div', {'class': 'sc'}).text.strip()
mlia_cache.append((mlia_id, mlia_text))
# do an initial refresh of the cache
refresh_cache()
@hook.command(autohelp=False)
def mlia(inp, reply=None):
"""mlia -- Gets a random quote from MyLifeIsAverage.com."""
# grab the last item in the mlia cache and remove it
mlia_id, text = mlia_cache.pop()
# reply with the mlia we grabbed
reply('({}) {}'.format(mlia_id, text))
# refresh mlia cache if its getting empty
if len(mlia_cache) < 3:
refresh_cache()

View File

@ -1,183 +0,0 @@
import re
from util import hook, http
@hook.command
def mtg(inp):
".mtg <name> -- Gets information about Magic the Gathering card <name>."
url = 'http://magiccards.info/query?v=card&s=cname'
h = http.get_html(url, q=inp)
name = h.find('body/table/tr/td/span/a')
if name is None:
return "No cards found :("
card = name.getparent().getparent().getparent()
type = card.find('td/p').text.replace('\n', '')
# this is ugly
text = http.html.tostring(card.xpath("//p[@class='ctext']/b")[0])
text = text.replace('<br>', '$')
text = http.html.fromstring(text).text_content()
text = re.sub(r'(\w+\s*)\$+(\s*\w+)', r'\1. \2', text)
text = text.replace('$', ' ')
text = re.sub(r'\(.*?\)', '', text) # strip parenthetical explanations
text = re.sub(r'\.(\S)', r'. \1', text) # fix spacing
printings = card.find('td/small').text_content()
printings = re.search(r'Editions:(.*)Languages:', printings).group(1)
printings = re.findall(r'\s*(.+?(?: \([^)]+\))*) \((.*?)\)',
' '.join(printings.split()))
printing_out = ', '.join('%s (%s)' % (set_abbrevs.get(x[0], x[0]),
rarity_abbrevs.get(x[1], x[1]))
for x in printings)
name.make_links_absolute(base_url=url)
link = name.attrib['href']
name = name.text_content().strip()
type = type.strip()
text = ' '.join(text.split())
return ' | '.join((name, type, text, printing_out, link))
set_abbrevs = {
'15th Anniversary': '15ANN',
'APAC Junior Series': 'AJS',
'Alara Reborn': 'ARB',
'Alliances': 'AI',
'Anthologies': 'AT',
'Antiquities': 'AQ',
'Apocalypse': 'AP',
'Arabian Nights': 'AN',
'Arena League': 'ARENA',
'Asia Pacific Land Program': 'APAC',
'Battle Royale': 'BR',
'Battle Royale Box Set': 'BRB',
'Beatdown': 'BTD',
'Beatdown Box Set': 'BTD',
'Betrayers of Kamigawa': 'BOK',
'Celebration Cards': 'UQC',
'Champions of Kamigawa': 'CHK',
'Champs': 'CP',
'Chronicles': 'CH',
'Classic Sixth Edition': '6E',
'Coldsnap': 'CS',
'Coldsnap Theme Decks': 'CSTD',
'Conflux': 'CFX',
'Core Set - Eighth Edition': '8E',
'Core Set - Ninth Edition': '9E',
'Darksteel': 'DS',
'Deckmasters': 'DM',
'Dissension': 'DI',
'Dragon Con': 'DRC',
'Duel Decks: Divine vs. Demonic': 'DVD',
'Duel Decks: Elves vs. Goblins': 'EVG',
'Duel Decks: Garruk vs. Liliana': 'GVL',
'Duel Decks: Jace vs. Chandra': 'JVC',
'Eighth Edition': '8ED',
'Eighth Edition Box Set': '8EB',
'European Land Program': 'EURO',
'Eventide': 'EVE',
'Exodus': 'EX',
'Fallen Empires': 'FE',
'Fifth Dawn': '5DN',
'Fifth Edition': '5E',
'Fourth Edition': '4E',
'Friday Night Magic': 'FNMP',
'From the Vault: Dragons': 'FVD',
'From the Vault: Exiled': 'FVE',
'Future Sight': 'FUT',
'Gateway': 'GRC',
'Grand Prix': 'GPX',
'Guildpact': 'GP',
'Guru': 'GURU',
'Happy Holidays': 'HHO',
'Homelands': 'HL',
'Ice Age': 'IA',
'Introductory Two-Player Set': 'ITP',
'Invasion': 'IN',
'Judge Gift Program': 'JR',
'Judgment': 'JU',
'Junior Series': 'JSR',
'Legend Membership': 'DCILM',
'Legends': 'LG',
'Legions': 'LE',
'Limited Edition (Alpha)': 'LEA',
'Limited Edition (Beta)': 'LEB',
'Limited Edition Alpha': 'LEA',
'Limited Edition Beta': 'LEB',
'Lorwyn': 'LW',
'MTGO Masters Edition': 'MED',
'MTGO Masters Edition II': 'ME2',
'MTGO Masters Edition III': 'ME3',
'Magic 2010': 'M10',
'Magic Game Day Cards': 'MGDC',
'Magic Player Rewards': 'MPRP',
'Magic Scholarship Series': 'MSS',
'Magic: The Gathering Launch Parties': 'MLP',
'Media Inserts': 'MBP',
'Mercadian Masques': 'MM',
'Mirage': 'MR',
'Mirrodin': 'MI',
'Morningtide': 'MT',
'Multiverse Gift Box Cards': 'MGBC',
'Nemesis': 'NE',
'Ninth Edition Box Set': '9EB',
'Odyssey': 'OD',
'Onslaught': 'ON',
'Planar Chaos': 'PC',
'Planechase': 'PCH',
'Planeshift': 'PS',
'Portal': 'PO',
'Portal Demogame': 'POT',
'Portal Second Age': 'PO2',
'Portal Three Kingdoms': 'P3K',
'Premium Deck Series: Slivers': 'PDS',
'Prerelease Events': 'PTC',
'Pro Tour': 'PRO',
'Prophecy': 'PR',
'Ravnica: City of Guilds': 'RAV',
'Release Events': 'REP',
'Revised Edition': 'RV',
'Saviors of Kamigawa': 'SOK',
'Scourge': 'SC',
'Seventh Edition': '7E',
'Shadowmoor': 'SHM',
'Shards of Alara': 'ALA',
'Starter': 'ST',
'Starter 1999': 'S99',
'Starter 2000 Box Set': 'ST2K',
'Stronghold': 'SH',
'Summer of Magic': 'SOM',
'Super Series': 'SUS',
'Tempest': 'TP',
'Tenth Edition': '10E',
'The Dark': 'DK',
'Time Spiral': 'TS',
'Time Spiral Timeshifted': 'TSTS',
'Torment': 'TR',
'Two-Headed Giant Tournament': 'THGT',
'Unglued': 'UG',
'Unhinged': 'UH',
'Unhinged Alternate Foils': 'UHAA',
'Unlimited Edition': 'UN',
"Urza's Destiny": 'UD',
"Urza's Legacy": 'UL',
"Urza's Saga": 'US',
'Visions': 'VI',
'Weatherlight': 'WL',
'Worlds': 'WRL',
'WotC Online Store': 'WOTC',
'Zendikar': 'ZEN'}
rarity_abbrevs = {
'Land': 'L',
'Common': 'C',
'Uncommon': 'UC',
'Rare': 'R',
'Special': 'S',
'Mythic Rare': 'MR'}

View File

@ -1,115 +0,0 @@
# BING translation plugin by Lukeroge and neersighted
from util import hook
from util import http
import re
import htmlentitydefs
import mygengo
gengo = mygengo.MyGengo(
public_key='PlwtF1CZ2tu27IdX_SXNxTFmfN0j|_-pJ^Rf({O-oLl--r^QM4FygRdt^jusSSDE',
private_key='wlXpL=SU[#JpPu[dQaf$v{S3@rg[=95$$TA(k$sb3_6~B_zDKkTbd4#hXxaorIae',
sandbox=False,
)
def gengo_translate(text, source, target):
try:
translation = gengo.postTranslationJob(job={
'type': 'text',
'slug': 'Translating '+source+' to '+target+' with the myGengo API',
'body_src': text,
'lc_src': source,
'lc_tgt': target,
'tier': 'machine',
})
translated = translation['response']['job']['body_tgt']
return u"(%s > %s) %s" % (source, target, translated)
except mygengo.MyGengoError:
return "error: could not translate"
def match_language(fragment):
fragment = fragment.lower()
for short, _ in lang_pairs:
if fragment in short.lower().split():
return short.split()[0]
for short, full in lang_pairs:
if fragment in full.lower():
return short.split()[0]
return None
@hook.command
def translate(inp):
".translate <source language> <target language> <sentence> -- Translates <sentence> from <source language> to <target language> using MyGengo."
args = inp.split(' ')
sl = match_language(args[0])
tl = match_language(args[1])
txt = unicode(" ".join(args[2:]))
if sl and tl:
return unicode(gengo_translate(txt, sl, tl))
else:
return "error: translate could not reliably determine one or both languages"
languages = 'ja fr de ko ru zh'.split()
language_pairs = zip(languages[:-1], languages[1:])
lang_pairs = [
("no", "Norwegian"),
("it", "Italian"),
("ht", "Haitian Creole"),
("af", "Afrikaans"),
("sq", "Albanian"),
("ar", "Arabic"),
("hy", "Armenian"),
("az", "Azerbaijani"),
("eu", "Basque"),
("be", "Belarusian"),
("bg", "Bulgarian"),
("ca", "Catalan"),
("zh-CN zh", "Chinese"),
("hr", "Croatian"),
("cs cz", "Czech"),
("da dk", "Danish"),
("nl", "Dutch"),
("en", "English"),
("et", "Estonian"),
("tl", "Filipino"),
("fi", "Finnish"),
("fr", "French"),
("gl", "Galician"),
("ka", "Georgian"),
("de", "German"),
("el", "Greek"),
("ht", "Haitian Creole"),
("iw", "Hebrew"),
("hi", "Hindi"),
("hu", "Hungarian"),
("is", "Icelandic"),
("id", "Indonesian"),
("ga", "Irish"),
("it", "Italian"),
("ja jp jpn", "Japanese"),
("ko", "Korean"),
("lv", "Latvian"),
("lt", "Lithuanian"),
("mk", "Macedonian"),
("ms", "Malay"),
("mt", "Maltese"),
("no", "Norwegian"),
("fa", "Persian"),
("pl", "Polish"),
("pt", "Portuguese"),
("ro", "Romanian"),
("ru", "Russian"),
("sr", "Serbian"),
("sk", "Slovak"),
("sl", "Slovenian"),
("es", "Spanish"),
("sw", "Swahili"),
("sv", "Swedish"),
("th", "Thai"),
("tr", "Turkish"),
("uk", "Ukrainian"),
("ur", "Urdu"),
("vi", "Vietnamese"),
("cy", "Welsh"),
("yi", "Yiddish")
]

View File

@ -1,60 +0,0 @@
import json
import os
from util import hook, text, textgen
GEN_DIR = "./plugins/data/name_files/"
def get_generator(_json):
data = json.loads(_json)
return textgen.TextGenerator(data["templates"],
data["parts"], default_templates=data["default_templates"])
@hook.command(autohelp=False)
def namegen(inp, notice=None):
"""namegen [generator] -- Generates some names using the chosen generator.
'namegen list' will display a list of all generators."""
# clean up the input
inp = inp.strip().lower()
# get a list of available name generators
files = os.listdir(GEN_DIR)
all_modules = []
for i in files:
if os.path.splitext(i)[1] == ".json":
all_modules.append(os.path.splitext(i)[0])
all_modules.sort()
# command to return a list of all available generators
if inp == "list":
message = "Available generators: "
message += text.get_text_list(all_modules, 'and')
notice(message)
return
if inp:
selected_module = inp.split()[0]
else:
# make some generic fantasy names
selected_module = "fantasy"
# check if the selected module is valid
if not selected_module in all_modules:
return "Invalid name generator :("
# load the name generator
with open(os.path.join(GEN_DIR, "{}.json".format(selected_module))) as f:
try:
generator = get_generator(f.read())
except ValueError as error:
return "Unable to read name file: {}".format(error)
# time to generate some names
name_list = generator.generate_strings(10)
# and finally return the final message :D
return "Some names to ponder: {}.".format(text.get_text_list(name_list, 'and'))

View File

@ -1,95 +0,0 @@
import json
import re
from util import hook, http, text, web
## CONSTANTS
ITEM_URL = "http://www.newegg.com/Product/Product.aspx?Item={}"
API_PRODUCT = "http://www.ows.newegg.com/Products.egg/{}/ProductDetails"
API_SEARCH = "http://www.ows.newegg.com/Search.egg/Advanced"
NEWEGG_RE = (r"(?:(?:www.newegg.com|newegg.com)/Product/Product\.aspx\?Item=)([-_a-zA-Z0-9]+)", re.I)
## OTHER FUNCTIONS
def format_item(item, show_url=True):
""" takes a newegg API item object and returns a description """
title = text.truncate_str(item["Title"], 50)
# format the rating nicely if it exists
if not item["ReviewSummary"]["TotalReviews"] == "[]":
rating = "Rated {}/5 ({} ratings)".format(item["ReviewSummary"]["Rating"],
item["ReviewSummary"]["TotalReviews"][1:-1])
else:
rating = "No Ratings"
if not item["FinalPrice"] == item["OriginalPrice"]:
price = "{FinalPrice}, was {OriginalPrice}".format(**item)
else:
price = item["FinalPrice"]
tags = []
if item["Instock"]:
tags.append("\x02Stock Available\x02")
else:
tags.append("\x02Out Of Stock\x02")
if item["FreeShippingFlag"]:
tags.append("\x02Free Shipping\x02")
if item["IsFeaturedItem"]:
tags.append("\x02Featured\x02")
if item["IsShellShockerItem"]:
tags.append(u"\x02SHELL SHOCKER\u00AE\x02")
# join all the tags together in a comma separated string ("tag1, tag2, tag3")
tag_text = u", ".join(tags)
if show_url:
# create the item URL and shorten it
url = web.try_isgd(ITEM_URL.format(item["NeweggItemNumber"]))
return u"\x02{}\x02 ({}) - {} - {} - {}".format(title, price, rating,
tag_text, url)
else:
return u"\x02{}\x02 ({}) - {} - {}".format(title, price, rating,
tag_text)
## HOOK FUNCTIONS
@hook.regex(*NEWEGG_RE)
def newegg_url(match):
item_id = match.group(1)
item = http.get_json(API_PRODUCT.format(item_id))
return format_item(item, show_url=False)
@hook.command
def newegg(inp):
"""newegg <item name> -- Searches newegg.com for <item name>"""
# form the search request
request = {
"Keyword": inp,
"Sort": "FEATURED"
}
# submit the search request
r = http.get_json(
'http://www.ows.newegg.com/Search.egg/Advanced',
post_data=json.dumps(request)
)
# get the first result
if r["ProductListItems"]:
return format_item(r["ProductListItems"][0])
else:
return "No results found."

View File

@ -1,59 +0,0 @@
import re
from util import hook, http
newgrounds_re = (r'(.*:)//(www.newgrounds.com|newgrounds.com)(:[0-9]+)?(.*)', re.I)
valid = set('0123456789')
def test(s):
return set(s) <= valid
@hook.regex(*newgrounds_re)
def newgrounds_url(match):
location = match.group(4).split("/")[-1]
if not test(location):
print "Not a valid Newgrounds portal ID. Example: http://www.newgrounds.com/portal/view/593993"
return None
soup = http.get_soup("http://www.newgrounds.com/portal/view/" + location)
title = "\x02{}\x02".format(soup.find('title').text)
# get author
try:
author_info = soup.find('ul', {'class': 'authorlinks'}).find('img')['alt']
author = " - \x02{}\x02".format(author_info)
except:
author = ""
# get rating
try:
rating_info = soup.find('dd', {'class': 'star-variable'})['title'].split("Stars &ndash;")[0].strip()
rating = u" - rated \x02{}\x02/\x025.0\x02".format(rating_info)
except:
rating = ""
# get amount of ratings
try:
ratings_info = soup.find('dd', {'class': 'star-variable'})['title'].split("Stars &ndash;")[1].replace("Votes",
"").strip()
numofratings = " ({})".format(ratings_info)
except:
numofratings = ""
# get amount of views
try:
views_info = soup.find('dl', {'class': 'contentdata'}).findAll('dd')[1].find('strong').text
views = " - \x02{}\x02 views".format(views_info)
except:
views = ""
# get upload data
try:
date = "on \x02{}\x02".format(soup.find('dl', {'class': 'sidestats'}).find('dd').text)
except:
date = ""
return title + rating + numofratings + views + author + date

View File

@ -1,191 +0,0 @@
import re
from util import hook
db_ready = False
def clean_sql(sql):
return re.sub(r'\s+', " ", sql).strip()
def db_init(db):
global db_ready
if db_ready:
return
exists = db.execute("""
select exists (
select * from sqlite_master where type = "table" and name = "todos"
)
""").fetchone()[0] == 1
if not exists:
db.execute(clean_sql("""
create virtual table todos using fts4(
user,
text,
added,
tokenize=porter
)"""))
db.commit()
db_ready = True
def db_getall(db, nick, limit=-1):
return db.execute("""
select added, text
from todos
where lower(user) = lower(?)
order by added desc
limit ?
""", (nick, limit))
def db_get(db, nick, note_id):
return db.execute("""
select added, text from todos
where lower(user) = lower(?)
order by added desc
limit 1
offset ?
""", (nick, note_id)).fetchone()
def db_del(db, nick, limit='all'):
row = db.execute("""
delete from todos
where rowid in (
select rowid from todos
where lower(user) = lower(?)
order by added desc
limit ?
offset ?)
""", (nick,
-1 if limit == 'all' else 1,
0 if limit == 'all' else limit))
db.commit()
return row
def db_add(db, nick, text):
db.execute("""
insert into todos (user, text, added)
values (?, ?, CURRENT_TIMESTAMP)
""", (nick, text))
db.commit()
def db_search(db, nick, query):
return db.execute("""
select added, text
from todos
where todos match ?
and lower(user) = lower(?)
order by added desc
""", (query, nick))
@hook.command("notes")
@hook.command
def note(inp, nick='', chan='', db=None, notice=None, bot=None):
"""note(s) <add|del|list|search> args -- Manipulates your list of notes."""
db_init(db)
parts = inp.split()
cmd = parts[0].lower()
args = parts[1:]
# code to allow users to access each others factoids and a copy of help
# ".note (add|del|list|search) [@user] args -- Manipulates your list of todos."
#if len(args) and args[0].startswith("@"):
# nick = args[0][1:]
# args = args[1:]
if cmd == 'add':
if not len(args):
return "no text"
text = " ".join(args)
db_add(db, nick, text)
notice("Note added!")
return
elif cmd == 'get':
if len(args):
try:
index = int(args[0])
except ValueError:
notice("Invalid number format.")
return
else:
index = 0
row = db_get(db, nick, index)
if not row:
notice("No such entry.")
return
notice("[{}]: {}: {}".format(index, row[0], row[1]))
elif cmd == 'del' or cmd == 'delete' or cmd == 'remove':
if not len(args):
return "error"
if args[0] == 'all':
index = 'all'
else:
try:
index = int(args[0])
except ValueError:
notice("Invalid number.")
return
rows = db_del(db, nick, index)
notice("Deleted {} entries".format(rows.rowcount))
elif cmd == 'list':
limit = -1
if len(args):
try:
limit = int(args[0])
limit = max(-1, limit)
except ValueError:
notice("Invalid number.")
return
rows = db_getall(db, nick, limit)
found = False
for (index, row) in enumerate(rows):
notice("[{}]: {}: {}".format(index, row[0], row[1]))
found = True
if not found:
notice("{} has no entries.".format(nick))
elif cmd == 'search':
if not len(args):
notice("No search query given!")
return
query = " ".join(args)
rows = db_search(db, nick, query)
found = False
for (index, row) in enumerate(rows):
notice("[{}]: {}: {}".format(index, row[0], row[1]))
found = True
if not found:
notice("{} has no matching entries for: {}".format(nick, query))
else:
notice("Unknown command: {}".format(cmd))

View File

@ -1,29 +0,0 @@
from bs4 import BeautifulSoup
from util import hook, http, web
user_url = "http://osrc.dfm.io/{}"
@hook.command
def osrc(inp):
"""osrc <github user> -- Gets an Open Source Report Card for <github user>"""
user_nick = inp.strip()
url = user_url.format(user_nick)
try:
soup = http.get_soup(url)
except (http.HTTPError, http.URLError):
return "Couldn't find any stats for this user."
report = soup.find("div", {"id": "description"}).find("p").get_text()
# Split and join to remove all the excess whitespace, slice the
# string to remove the trailing full stop.
report = " ".join(report.split())[:-1]
short_url = web.try_isgd(url)
return "{} - {}".format(report, short_url)

View File

@ -1,50 +0,0 @@
# TODO: Add some kind of pronounceable password generation
# TODO: Improve randomness
import string
import random
from util import hook
@hook.command
def password(inp, notice=None):
"""password <length> [types] -- Generates a password of <length> (default 10).
[types] can include 'alpha', 'no caps', 'numeric', 'symbols' or any combination of the inp, eg. 'numbers symbols'"""
okay = []
# find the length needed for the password
numb = inp.split(" ")
try:
length = int(numb[0])
except ValueError:
length = 10
# add alpha characters
if "alpha" in inp or "letter" in inp:
okay = okay + list(string.ascii_lowercase)
#adds capital characters if not told not to
if "no caps" not in inp:
okay = okay + list(string.ascii_uppercase)
# add numbers
if "numeric" in inp or "number" in inp:
okay = okay + [str(x) for x in xrange(0, 10)]
# add symbols
if "symbol" in inp:
sym = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', '_', '+', '[', ']', '{', '}', '\\', '|', ';',
':', "'", '.', '>', ',', '<', '/', '?', '`', '~', '"']
okay += okay + sym
# defaults to lowercase alpha password if the okay list is empty
if not okay:
okay = okay + list(string.ascii_lowercase)
pw = ""
# generates password
for x in range(length):
pw = pw + random.choice(okay)
notice(pw)

View File

@ -1,12 +0,0 @@
from util import hook, web
@hook.command(adminonly=True)
def plpaste(inp):
if "/" in inp and inp.split("/")[0] != "util":
return "Invalid input"
try:
with open("plugins/%s.py" % inp) as f:
return web.haste(f.read(), ext='py')
except IOError:
return "Plugin not found (must be in plugins folder)"

View File

@ -1,56 +0,0 @@
# coding=utf-8
import re
import random
from util import hook
potatoes = ['AC Belmont', 'AC Blue Pride', 'AC Brador', 'AC Chaleur', 'AC Domino', 'AC Dubuc', 'AC Glacier Chip',
'AC Maple Gold', 'AC Novachip', 'AC Peregrine Red', 'AC Ptarmigan', 'AC Red Island', 'AC Saguenor',
'AC Stampede Russet', 'AC Sunbury', 'Abeille', 'Abnaki', 'Acadia', 'Acadia Russet', 'Accent',
'Adirondack Blue', 'Adirondack Red', 'Adora', 'Agria', 'All Blue', 'All Red', 'Alpha', 'Alta Russet',
'Alturas Russet', 'Amandine', 'Amisk', 'Andover', 'Anoka', 'Anson', 'Aquilon', 'Arran Consul', 'Asterix',
'Atlantic', 'Austrian Crescent', 'Avalanche', 'Banana', 'Bannock Russet', 'Batoche', 'BeRus',
'Belle De Fonteney', 'Belleisle', 'Bintje', 'Blossom', 'Blue Christie', 'Blue Mac', 'Brigus',
'Brise du Nord', 'Butte', 'Butterfinger', 'Caesar', 'CalWhite', 'CalRed', 'Caribe', 'Carlingford',
'Carlton', 'Carola', 'Cascade', 'Castile', 'Centennial Russet', 'Century Russet', 'Charlotte', 'Cherie',
'Cherokee', 'Cherry Red', 'Chieftain', 'Chipeta', 'Coastal Russet', 'Colorado Rose', 'Concurrent',
'Conestoga', 'Cowhorn', 'Crestone Russet', 'Crispin', 'Cupids', 'Daisy Gold', 'Dakota Pearl', 'Defender',
'Delikat', 'Denali', 'Desiree', 'Divina', 'Dundrod', 'Durango Red', 'Early Rose', 'Elba', 'Envol',
'Epicure', 'Eramosa', 'Estima', 'Eva', 'Fabula', 'Fambo', 'Fremont Russet', 'French Fingerling',
'Frontier Russet', 'Fundy', 'Garnet Chile', 'Gem Russet', 'GemStar Russet', 'Gemchip', 'German Butterball',
'Gigant', 'Goldrush', 'Granola', 'Green Mountain', 'Haida', 'Hertha', 'Hilite Russet', 'Huckleberry',
'Hunter', 'Huron', 'IdaRose', 'Innovator', 'Irish Cobbler', 'Island Sunshine', 'Ivory Crisp',
'Jacqueline Lee', 'Jemseg', 'Kanona', 'Katahdin', 'Kennebec', "Kerr's Pink", 'Keswick', 'Keuka Gold',
'Keystone Russet', 'King Edward VII', 'Kipfel', 'Klamath Russet', 'Krantz', 'LaRatte', 'Lady Rosetta',
'Latona', 'Lemhi Russet', 'Liberator', 'Lili', 'MaineChip', 'Marfona', 'Maris Bard', 'Maris Piper',
'Matilda', 'Mazama', 'McIntyre', 'Michigan Purple', 'Millenium Russet', 'Mirton Pearl', 'Modoc', 'Mondial',
'Monona', 'Morene', 'Morning Gold', 'Mouraska', 'Navan', 'Nicola', 'Nipigon', 'Niska', 'Nooksack',
'NorValley', 'Norchip', 'Nordonna', 'Norgold Russet', 'Norking Russet', 'Norland', 'Norwis', 'Obelix',
'Ozette', 'Peanut', 'Penta', 'Peribonka', 'Peruvian Purple', 'Pike', 'Pink Pearl', 'Prospect', 'Pungo',
'Purple Majesty', 'Purple Viking', 'Ranger Russet', 'Reba', 'Red Cloud', 'Red Gold', 'Red La Soda',
'Red Pontiac', 'Red Ruby', 'Red Thumb', 'Redsen', 'Rocket', 'Rose Finn Apple', 'Rose Gold', 'Roselys',
'Rote Erstling', 'Ruby Crescent', 'Russet Burbank', 'Russet Legend', 'Russet Norkotah', 'Russet Nugget',
'Russian Banana', 'Saginaw Gold', 'Sangre', 'Sant<EFBFBD>', 'Satina', 'Saxon', 'Sebago', 'Shepody', 'Sierra',
'Silverton Russet', 'Simcoe', 'Snowden', 'Spunta', "St. John's", 'Summit Russet', 'Sunrise', 'Superior',
'Symfonia', 'Tolaas', 'Trent', 'True Blue', 'Ulla', 'Umatilla Russet', 'Valisa', 'Van Gogh', 'Viking',
'Wallowa Russet', 'Warba', 'Western Russet', 'White Rose', 'Willamette', 'Winema', 'Yellow Finn',
'Yukon Gold']
@hook.command
def potato(inp, action=None):
"""potato <user> - Makes <user> a tasty little potato."""
inp = inp.strip()
if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):
return "I cant make a tasty potato for that user!"
potato_type = random.choice(potatoes)
size = random.choice(['small', 'little', 'mid-sized', 'medium-sized', 'large', 'gigantic'])
flavor = random.choice(['tasty', 'delectable', 'delicious', 'yummy', 'toothsome', 'scrumptious', 'luscious'])
method = random.choice(['bakes', 'fries', 'boils', 'roasts'])
side_dish = random.choice(['side salad', 'dollop of sour cream', 'piece of chicken', 'bowl of shredded bacon'])
action("{} a {} {} {} potato for {} and serves it with a small {}!".format(method, flavor, size, potato_type, inp,
side_dish))

View File

@ -1,38 +0,0 @@
import datetime
from util import hook, http, timesince
@hook.command("scene")
@hook.command
def pre(inp):
"""pre <query> -- searches scene releases using orlydb.com"""
try:
h = http.get_html("http://orlydb.com/", q=inp)
except http.HTTPError as e:
return 'Unable to fetch results: {}'.format(e)
results = h.xpath("//div[@id='releases']/div/span[@class='release']/..")
if not results:
return "No results found."
result = results[0]
date = result.xpath("span[@class='timestamp']/text()")[0]
section = result.xpath("span[@class='section']//text()")[0]
name = result.xpath("span[@class='release']/text()")[0]
# parse date/time
date = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
date_string = date.strftime("%d %b %Y")
since = timesince.timesince(date)
size = result.xpath("span[@class='inforight']//text()")
if size:
size = ' - ' + size[0].split()[0]
else:
size = ''
return '{} - {}{} - {} ({} ago)'.format(section, name, size, date_string, since)

View File

@ -1,9 +0,0 @@
from util import hook
from util.pyexec import eval_py
@hook.command
def python(inp):
"""python <prog> -- Executes <prog> as Python code."""
return eval_py(inp)

View File

@ -1,18 +0,0 @@
# Plugin by https://github.com/Mu5tank05
from util import hook, web, http
@hook.command('qr')
@hook.command
def qrcode(inp):
"""qrcode [link] returns a link for a QR code."""
args = {
"cht": "qr", # chart type (QR)
"chs": "200x200", # dimensions
"chl": inp # data
}
link = http.prepare_url("http://chart.googleapis.com/chart", args)
return web.try_isgd(link)

View File

@ -1,149 +0,0 @@
import random
import re
import time
from util import hook
def format_quote(q, num, n_quotes):
"""Returns a formatted string of a quote"""
ctime, nick, msg = q
return "[{}/{}] <{}> {}".format(num, n_quotes,
nick, msg)
def create_table_if_not_exists(db):
"""Creates an empty quote table if one does not already exist"""
db.execute("create table if not exists quote"
"(chan, nick, add_nick, msg, time real, deleted default 0, "
"primary key (chan, nick, msg))")
db.commit()
def add_quote(db, chan, nick, add_nick, msg):
"""Adds a quote to a nick, returns message string"""
try:
db.execute('''INSERT OR FAIL INTO quote
(chan, nick, add_nick, msg, time)
VALUES(?,?,?,?,?)''',
(chan, nick, add_nick, msg, time.time()))
db.commit()
except db.IntegrityError:
return "Message already stored, doing nothing."
return "Quote added."
def del_quote(db, chan, nick, add_nick, msg):
"""Deletes a quote from a nick"""
db.execute('''UPDATE quote SET deleted = 1 WHERE
chan=? AND lower(nick)=lower(?) AND msg=msg''')
db.commit()
def get_quote_num(num, count, name):
"""Returns the quote number to fetch from the DB"""
if num: # Make sure num is a number if it isn't false
num = int(num)
if count == 0: # Error on no quotes
raise Exception("No quotes found for {}.".format(name))
if num and num < 0: # Count back if possible
num = count + num + 1 if num + count > -1 else count + 1
if num and num > count: # If there are not enough quotes, raise an error
raise Exception("I only have {} quote{} for {}.".format(count, ('s', '')[count == 1], name))
if num and num == 0: # If the number is zero, set it to one
num = 1
if not num: # If a number is not given, select a random one
num = random.randint(1, count)
return num
def get_quote_by_nick(db, nick, num=False):
"""Returns a formatted quote from a nick, random or selected by number"""
count = db.execute('''SELECT COUNT(*) FROM quote WHERE deleted != 1
AND lower(nick) = lower(?)''', [nick]).fetchall()[0][0]
try:
num = get_quote_num(num, count, nick)
except Exception as error_message:
return error_message
quote = db.execute('''SELECT time, nick, msg
FROM quote
WHERE deleted != 1
AND lower(nick) = lower(?)
ORDER BY time
LIMIT ?, 1''', (nick, (num - 1))).fetchall()[0]
return format_quote(quote, num, count)
def get_quote_by_nick_chan(db, chan, nick, num=False):
"""Returns a formatted quote from a nick in a channel, random or selected by number"""
count = db.execute('''SELECT COUNT(*)
FROM quote
WHERE deleted != 1
AND chan = ?
AND lower(nick) = lower(?)''', (chan, nick)).fetchall()[0][0]
try:
num = get_quote_num(num, count, nick)
except Exception as error_message:
return error_message
quote = db.execute('''SELECT time, nick, msg
FROM quote
WHERE deleted != 1
AND chan = ?
AND lower(nick) = lower(?)
ORDER BY time
LIMIT ?, 1''', (chan, nick, (num - 1))).fetchall()[0]
return format_quote(quote, num, count)
def get_quote_by_chan(db, chan, num=False):
"""Returns a formatted quote from a channel, random or selected by number"""
count = db.execute('''SELECT COUNT(*)
FROM quote
WHERE deleted != 1
AND chan = ?''', (chan,)).fetchall()[0][0]
try:
num = get_quote_num(num, count, chan)
except Exception as error_message:
return error_message
quote = db.execute('''SELECT time, nick, msg
FROM quote
WHERE deleted != 1
AND chan = ?
ORDER BY time
LIMIT ?, 1''', (chan, (num - 1))).fetchall()[0]
return format_quote(quote, num, count)
@hook.command('q')
@hook.command
def quote(inp, nick='', chan='', db=None, notice=None):
"""quote [#chan] [nick] [#n]/.quote add <nick> <msg>
Gets random or [#n]th quote by <nick> or from <#chan>/adds quote."""
create_table_if_not_exists(db)
add = re.match(r"add[^\w@]+(\S+?)>?\s+(.*)", inp, re.I)
retrieve = re.match(r"(\S+)(?:\s+#?(-?\d+))?$", inp)
retrieve_chan = re.match(r"(#\S+)\s+(\S+)(?:\s+#?(-?\d+))?$", inp)
if add:
quoted_nick, msg = add.groups()
notice(add_quote(db, chan, quoted_nick, nick, msg))
return
elif retrieve:
select, num = retrieve.groups()
by_chan = True if select.startswith('#') else False
if by_chan:
return get_quote_by_chan(db, select, num)
else:
return get_quote_by_nick(db, select, num)
elif retrieve_chan:
chan, nick, num = retrieve_chan.groups()
return get_quote_by_nick_chan(db, chan, nick, num)
notice(quote.__doc__)

Some files were not shown because too many files have changed in this diff Show More