Advertisement
Armandur

Yxa

Jan 26th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.88 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. ###
  4. # Copyright (c) 2016, Rasmus Pettersson Vik
  5. # All rights reserved.
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions are met:
  9. #
  10. #   * Redistributions of source code must retain the above copyright notice,
  11. #     this list of conditions, and the following disclaimer.
  12. #   * Redistributions in binary form must reproduce the above copyright notice,
  13. #     this list of conditions, and the following disclaimer in the
  14. #     documentation and/or other materials provided with the distribution.
  15. #   * Neither the name of the author of this software nor the name of
  16. #     contributors to this software may be used to endorse or promote products
  17. #     derived from this software without specific prior written consent.
  18. #
  19. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  20. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. # ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  23. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  29. # POSSIBILITY OF SUCH DAMAGE.
  30.  
  31. ###
  32.  
  33. import supybot.utils as utils
  34. from supybot.commands import *
  35. import supybot.plugins as plugins
  36. import supybot.ircutils as ircutils
  37. import supybot.callbacks as callbacks
  38. import random
  39.  
  40.  
  41. class Yxa(callbacks.Plugin):
  42.     """Skriv !yxa <nick>"""
  43.     def __init__(self, irc):
  44.         print "initialized"
  45.  
  46.     yxfabrikat = ["Gränsfors Bruk", "Wetterlings", "Husqvarna", "Hjärtum", "Billnäs Bruk", "Jonsered", "Stihl", "John Neeman", "Hultafors", "Säter", "Collins", "Hudson Bay"]
  47.     yxtyp = ["amerikansk ", "svensknackad ", "vikinga", "japansk ", "finsk ", "norsk ", "dubbeleggad ", "skarv", "knut", "tjäckel"]
  48.     kroppsdel = ["huvudet", "benet", "bröstet", "högerarmen", "vänsterarmen", "högerbenet", "vänsterbenet", "skrevet", "axeln", "ryggen", "magen", "låret"]
  49.  
  50.      def yxa(self, irc, msg, args, nick):
  51.          fab = random.choice(self.yxfabrikat)
  52.          typ = random.choice(self.yxtyp)
  53.          krp = random.choice(self.kroppsdel)
  54.    
  55.          s = "tar en " + typ + "yxa tillverkad av " + fab + " och hugger den i " + krp + " på " + nick + ".\n"
  56.    
  57.          print "s"
  58.    
  59.          irc.reply(s, action=True)
  60.      yxa = wrap(yxa, [additional('text')])
  61.  
  62. Class = Yxa
  63.  
  64.  
  65. # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement