disabled many plugins

This commit is contained in:
ChChBot admin 2015-02-18 22:49:55 +01:00
parent 0ba2001b62
commit 7cce9bf27e
119 changed files with 0 additions and 20 deletions

72
disabled_stuff/attacks.py Normal file
View file

@ -0,0 +1,72 @@
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

@ -0,0 +1,89 @@
"""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')

18
disabled_stuff/choose.py Normal file
View file

@ -0,0 +1,18 @@
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()

25
disabled_stuff/coin.py Normal file
View file

@ -0,0 +1,25 @@
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

@ -0,0 +1,37 @@
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

@ -0,0 +1,60 @@
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']))

39
disabled_stuff/cypher.py Normal file
View file

@ -0,0 +1,39 @@
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

@ -0,0 +1,26 @@
<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

@ -0,0 +1,54 @@
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

@ -0,0 +1,57 @@
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

@ -0,0 +1,30 @@
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

@ -0,0 +1,620 @@
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

@ -0,0 +1,79 @@
{
"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

@ -0,0 +1,22 @@
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

@ -0,0 +1,99 @@
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

@ -0,0 +1,170 @@
{
"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

@ -0,0 +1,54 @@
{
"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

@ -0,0 +1,85 @@
{
"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

@ -0,0 +1,86 @@
{
"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

@ -0,0 +1,554 @@
{
"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

@ -0,0 +1,190 @@
{
"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

@ -0,0 +1,199 @@
{
"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

@ -0,0 +1,38 @@
{
"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

@ -0,0 +1,124 @@
{
"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

@ -0,0 +1,166 @@
{
"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

@ -0,0 +1,217 @@
{
"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

@ -0,0 +1,81 @@
{
"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

@ -0,0 +1,304 @@
{
"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

@ -0,0 +1,269 @@
//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

@ -0,0 +1,69 @@
{
"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

@ -0,0 +1,197 @@
<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>.

90
disabled_stuff/dice.py Normal file
View file

@ -0,0 +1,90 @@
# 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

@ -0,0 +1,89 @@
# 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

18
disabled_stuff/domainr.py Normal file
View file

@ -0,0 +1,18 @@
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

20
disabled_stuff/down.py Normal file
View file

@ -0,0 +1,20 @@
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)

31
disabled_stuff/drama.py Normal file
View file

@ -0,0 +1,31 @@
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

@ -0,0 +1,23 @@
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))

105
disabled_stuff/encrypt.py Normal file
View file

@ -0,0 +1,105 @@
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)

37
disabled_stuff/fact.py Normal file
View file

@ -0,0 +1,37 @@
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)

162
disabled_stuff/factoids.py Normal file
View file

@ -0,0 +1,162 @@
# 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

@ -0,0 +1,57 @@
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)

29
disabled_stuff/fmylife.py Normal file
View file

@ -0,0 +1,29 @@
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()

14
disabled_stuff/fortune.py Normal file
View file

@ -0,0 +1,14 @@
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)

54
disabled_stuff/geoip.py Normal file
View file

@ -0,0 +1,54 @@
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)

120
disabled_stuff/github.py Normal file
View file

@ -0,0 +1,120 @@
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:]

51
disabled_stuff/google.py Normal file
View file

@ -0,0 +1,51 @@
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

@ -0,0 +1,168 @@
"""
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

@ -0,0 +1,22 @@
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!"

89
disabled_stuff/history.py Normal file
View file

@ -0,0 +1,89 @@
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

@ -0,0 +1,56 @@
# 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

30
disabled_stuff/hulu.py Normal file
View file

@ -0,0 +1,30 @@
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))

59
disabled_stuff/imdb.py Normal file
View file

@ -0,0 +1,59 @@
# 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.'

82
disabled_stuff/imgur.py Normal file
View file

@ -0,0 +1,82 @@
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))

28
disabled_stuff/isup.py Normal file
View file

@ -0,0 +1,28 @@
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."

15
disabled_stuff/kernel.py Normal file
View file

@ -0,0 +1,15 @@
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)

33
disabled_stuff/kill.py Normal file
View file

@ -0,0 +1,33 @@
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())

83
disabled_stuff/lastfm.py Normal file
View file

@ -0,0 +1,83 @@
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

14
disabled_stuff/lmgtfy.py Normal file
View file

@ -0,0 +1,14 @@
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

113
disabled_stuff/log.py Normal file
View file

@ -0,0 +1,113 @@
"""
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')

43
disabled_stuff/lyrics.py Normal file
View file

@ -0,0 +1,43 @@
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

@ -0,0 +1,104 @@
# 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

@ -0,0 +1,154 @@
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

@ -0,0 +1,100 @@
""" 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

@ -0,0 +1,232 @@
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

@ -0,0 +1,44 @@
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

@ -0,0 +1,101 @@
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

@ -0,0 +1,51 @@
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."

34
disabled_stuff/mlia.py Normal file
View file

@ -0,0 +1,34 @@
# 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()

60
disabled_stuff/namegen.py Normal file
View file

@ -0,0 +1,60 @@
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'))

95
disabled_stuff/newegg.py Normal file
View file

@ -0,0 +1,95 @@
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

@ -0,0 +1,59 @@
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

191
disabled_stuff/notes.py Normal file
View file

@ -0,0 +1,191 @@
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))

29
disabled_stuff/osrc.py Normal file
View file

@ -0,0 +1,29 @@
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

@ -0,0 +1,50 @@
# 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)

12
disabled_stuff/plpaste.py Normal file
View file

@ -0,0 +1,12 @@
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)"

56
disabled_stuff/potato.py Normal file
View file

@ -0,0 +1,56 @@
# 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))

38
disabled_stuff/pre.py Normal file
View file

@ -0,0 +1,38 @@
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)

9
disabled_stuff/python.py Normal file
View file

@ -0,0 +1,9 @@
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)

18
disabled_stuff/qrcode.py Normal file
View file

@ -0,0 +1,18 @@
# 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)

149
disabled_stuff/quote.py Normal file
View file

@ -0,0 +1,149 @@
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__)

131
disabled_stuff/rdio.py Normal file
View file

@ -0,0 +1,131 @@
import urllib
import json
import re
import oauth2 as oauth
from util import hook
def getdata(inp, types, api_key, api_secret):
consumer = oauth.Consumer(api_key, api_secret)
client = oauth.Client(consumer)
response = client.request('http://api.rdio.com/1/', 'POST',
urllib.urlencode({'method': 'search', 'query': inp, 'types': types, 'count': '1'}))
data = json.loads(response[1])
return data
@hook.command
def rdio(inp, bot=None):
""" rdio <search term> - alternatives: .rdiot (track), .rdioar (artist), .rdioal (album) """
api_key = bot.config.get("api_keys", {}).get("rdio_key")
api_secret = bot.config.get("api_keys", {}).get("rdio_secret")
if not api_key:
return "error: no api key set"
data = getdata(inp, "Track,Album,Artist", api_key, api_secret)
try:
info = data['result']['results'][0]
except IndexError:
return "No results."
if 'name' in info:
if 'artist' in info and 'album' in info: # Track
name = info['name']
artist = info['artist']
album = info['album']
url = info['shortUrl']
return u"\x02{}\x02 by \x02{}\x02 - {} {}".format(name, artist, album, url)
elif 'artist' in info and not 'album' in info: # Album
name = info['name']
artist = info['artist']
url = info['shortUrl']
return u"\x02{}\x02 by \x02{}\x02 - {}".format(name, artist, url)
else: # Artist
name = info['name']
url = info['shortUrl']
return u"\x02{}\x02 - {}".format(name, url)
@hook.command
def rdiot(inp, bot=None):
""" rdiot <search term> - Search for tracks on rdio """
api_key = bot.config.get("api_keys", {}).get("rdio_key")
api_secret = bot.config.get("api_keys", {}).get("rdio_secret")
if not api_key:
return "error: no api key set"
data = getdata(inp, "Track", api_key, api_secret)
try:
info = data['result']['results'][0]
except IndexError:
return "No results."
name = info['name']
artist = info['artist']
album = info['album']
url = info['shortUrl']
return u"\x02{}\x02 by \x02{}\x02 - {} - {}".format(name, artist, album, url)
@hook.command
def rdioar(inp, bot=None):
""" rdioar <search term> - Search for artists on rdio """
api_key = bot.config.get("api_keys", {}).get("rdio_key")
api_secret = bot.config.get("api_keys", {}).get("rdio_secret")
if not api_key:
return "error: no api key set"
data = getdata(inp, "Artist", api_key, api_secret)
try:
info = data['result']['results'][0]
except IndexError:
return "No results."
name = info['name']
url = info['shortUrl']
return u"\x02{}\x02 - {}".format(name, url)
@hook.command
def rdioal(inp, bot=None):
""" rdioal <search term> - Search for albums on rdio """
api_key = bot.config.get("api_keys", {}).get("rdio_key")
api_secret = bot.config.get("api_keys", {}).get("rdio_secret")
if not api_key:
return "error: no api key set"
data = getdata(inp, "Album", api_key, api_secret)
try:
info = data['result']['results'][0]
except IndexError:
return "No results."
name = info['name']
artist = info['artist']
url = info['shortUrl']
return u"\x02{}\x02 by \x02{}\x02 - {}".format(name, artist, url)
rdio_re = (r'(.*:)//(rd.io|www.rdio.com|rdio.com)(:[0-9]+)?(.*)', re.I)
@hook.regex(*rdio_re)
def rdio_url(match, bot=None):
api_key = bot.config.get("api_keys", {}).get("rdio_key")
api_secret = bot.config.get("api_keys", {}).get("rdio_secret")
if not api_key:
return None
url = match.group(1) + "//" + match.group(2) + match.group(4)
consumer = oauth.Consumer(api_key, api_secret)
client = oauth.Client(consumer)
response = client.request('http://api.rdio.com/1/', 'POST',
urllib.urlencode({'method': 'getObjectFromUrl', 'url': url}))
data = json.loads(response[1])
info = data['result']
if 'name' in info:
if 'artist' in info and 'album' in info: # Track
name = info['name']
artist = info['artist']
album = info['album']
return u"Rdio track: \x02{}\x02 by \x02{}\x02 - {}".format(name, artist, album)
elif 'artist' in info and not 'album' in info: # Album
name = info['name']
artist = info['artist']
return u"Rdio album: \x02{}\x02 by \x02{}\x02".format(name, artist)
else: # Artist
name = info['name']
return u"Rdio artist: \x02{}\x02".format(name)

106
disabled_stuff/recipe.py Normal file
View file

@ -0,0 +1,106 @@
import random
from util import hook, http, web
metadata_url = "http://omnidator.appspot.com/microdata/json/?url={}"
base_url = "http://www.cookstr.com"
search_url = base_url + "/searches"
random_url = search_url + "/surprise"
# set this to true to censor this plugin!
censor = True
phrases = [
u"EAT SOME FUCKING \x02{}\x02",
u"YOU WON'T NOT MAKE SOME FUCKING \x02{}\x02",
u"HOW ABOUT SOME FUCKING \x02{}?\x02",
u"WHY DON'T YOU EAT SOME FUCKING \x02{}?\x02",
u"MAKE SOME FUCKING \x02{}\x02",
u"INDUCE FOOD COMA WITH SOME FUCKING \x02{}\x02"
]
clean_key = lambda i: i.split("#")[1]
class ParseError(Exception):
pass
def get_data(url):
""" Uses the omnidator API to parse the metadata from the provided URL """
try:
omni = http.get_json(metadata_url.format(url))
except (http.HTTPError, http.URLError) as e:
raise ParseError(e)
schemas = omni["@"]
for d in schemas:
if d["a"] == "<http://schema.org/Recipe>":
data = {clean_key(key): value for (key, value) in d.iteritems()
if key.startswith("http://schema.org/Recipe")}
return data
raise ParseError("No recipe data found")
@hook.command(autohelp=False)
def recipe(inp):
"""recipe [term] - Gets a recipe for [term], or ets a random recipe if [term] is not provided"""
if inp:
# get the recipe URL by searching
try:
search = http.get_soup(search_url, query=inp.strip())
except (http.HTTPError, http.URLError) as e:
return "Could not get recipe: {}".format(e)
# find the list of results
result_list = search.find('div', {'class': 'found_results'})
if result_list:
results = result_list.find_all('div', {'class': 'recipe_result'})
else:
return "No results"
# pick a random front page result
result = random.choice(results)
# extract the URL from the result
url = base_url + result.find('div', {'class': 'image-wrapper'}).find('a')['href']
else:
# get a random recipe URL
try:
page = http.open(random_url)
except (http.HTTPError, http.URLError) as e:
return "Could not get recipe: {}".format(e)
url = page.geturl()
# use get_data() to get the recipe info from the URL
try:
data = get_data(url)
except ParseError as e:
return "Could not parse recipe: {}".format(e)
name = data["name"].strip()
return u"Try eating \x02{}!\x02 - {}".format(name, web.try_isgd(url))
@hook.command(autohelp=False)
def dinner(inp):
"""dinner - WTF IS FOR DINNER"""
try:
page = http.open(random_url)
except (http.HTTPError, http.URLError) as e:
return "Could not get recipe: {}".format(e)
url = page.geturl()
try:
data = get_data(url)
except ParseError as e:
return "Could not parse recipe: {}".format(e)
name = data["name"].strip().upper()
text = random.choice(phrases).format(name)
if censor:
text = text.replace("FUCK", "F**K")
return u"{} - {}".format(text, web.try_isgd(url))

79
disabled_stuff/reddit.py Normal file
View file

@ -0,0 +1,79 @@
from datetime import datetime
import re
import random
from util import hook, http, text, timesince
reddit_re = (r'.*(((www\.)?reddit\.com/r|redd\.it)[^ ]+)', re.I)
base_url = "http://reddit.com/r/{}/.json"
short_url = "http://redd.it/{}"
@hook.regex(*reddit_re)
def reddit_url(match):
thread = http.get_html(match.group(0))
title = thread.xpath('//title/text()')[0]
upvotes = thread.xpath("//span[@class='upvotes']/span[@class='number']/text()")[0]
downvotes = thread.xpath("//span[@class='downvotes']/span[@class='number']/text()")[0]
author = thread.xpath("//div[@id='siteTable']//a[contains(@class,'author')]/text()")[0]
timeago = thread.xpath("//div[@id='siteTable']//p[@class='tagline']/time/text()")[0]
comments = thread.xpath("//div[@id='siteTable']//a[@class='comments']/text()")[0]
return u'\x02{}\x02 - posted by \x02{}\x02 {} ago - {} upvotes, {} downvotes - {}'.format(
title, author, timeago, upvotes, downvotes, comments)
@hook.command(autohelp=False)
def reddit(inp):
"""reddit <subreddit> [n] -- Gets a random post from <subreddit>, or gets the [n]th post in the subreddit."""
id_num = None
if inp:
# clean and split the input
parts = inp.lower().strip().split()
# find the requested post number (if any)
if len(parts) > 1:
url = base_url.format(parts[0].strip())
try:
id_num = int(parts[1]) - 1
except ValueError:
return "Invalid post number."
else:
url = base_url.format(parts[0].strip())
else:
url = "http://reddit.com/.json"
try:
data = http.get_json(url, user_agent=http.ua_chrome)
except Exception as e:
return "Error: " + str(e)
data = data["data"]["children"]
# get the requested/random post
if id_num is not None:
try:
item = data[id_num]["data"]
except IndexError:
length = len(data)
return "Invalid post number. Number must be between 1 and {}.".format(length)
else:
item = random.choice(data)["data"]
item["title"] = text.truncate_str(item["title"], 50)
item["link"] = short_url.format(item["id"])
raw_time = datetime.fromtimestamp(int(item["created_utc"]))
item["timesince"] = timesince.timesince(raw_time)
if item["over_18"]:
item["warning"] = " \x02NSFW\x02"
else:
item["warning"] = ""
return u"\x02{title} : {subreddit}\x02 - posted by \x02{author}\x02" \
" {timesince} ago - {ups} upvotes, {downs} downvotes -" \
" {link}{warning}".format(**item)

View file

@ -0,0 +1,128 @@
from util import hook
# Default value.
# If True, all channels without a setting will have regex enabled
# If False, all channels without a setting will have regex disabled
default_enabled = True
db_ready = False
def db_init(db):
global db_ready
if not db_ready:
db.execute("CREATE TABLE IF NOT EXISTS regexchans(channel PRIMARY KEY, status)")
db.commit()
db_ready = True
def get_status(db, channel):
row = db.execute("SELECT status FROM regexchans WHERE channel = ?", [channel]).fetchone()
if row:
return row[0]
else:
return None
def set_status(db, channel, status):
row = db.execute("REPLACE INTO regexchans (channel, status) VALUES(?, ?)", [channel, status])
db.commit()
def delete_status(db, channel):
row = db.execute("DELETE FROM regexchans WHERE channel = ?", [channel])
db.commit()
def list_status(db):
row = db.execute("SELECT * FROM regexchans").fetchall()
result = None
for values in row:
if result:
result += u", {}: {}".format(values[0], values[1])
else:
result = u"{}: {}".format(values[0], values[1])
return result
@hook.sieve
def sieve_regex(bot, inp, func, kind, args):
db = bot.get_db_connection(inp.conn)
db_init(db)
if kind == 'regex' and inp.chan.startswith("#") and func.__name__ != 'factoid':
chanstatus = get_status(db, inp.chan)
if chanstatus != "ENABLED" and (chanstatus == "DISABLED" or not default_enabled):
print u"Denying input.raw={}, kind={}, args={} from {}".format(inp.raw, kind, args, inp.chan)
return None
print u"Allowing input.raw={}, kind={}, args={} from {}".format(inp.raw, kind, args, inp.chan)
return inp
@hook.command(permissions=["botcontrol"])
def enableregex(inp, db=None, message=None, notice=None, chan=None, nick=None):
db_init(db)
inp = inp.strip().lower()
if not inp:
channel = chan
elif inp.startswith("#"):
channel = inp
else:
channel = u"#{}".format(inp)
message(u"Enabling regex matching (youtube, etc) (issued by {})".format(nick), target=channel)
notice(u"Enabling regex matching (youtube, etc) in channel {}".format(channel))
set_status(db, channel, "ENABLED")
@hook.command(permissions=["botcontrol"])
def disableregex(inp, db=None, message=None, notice=None, chan=None, nick=None):
db_init(db)
inp = inp.strip().lower()
if not inp:
channel = chan
elif inp.startswith("#"):
channel = inp
else:
channel = u"#{}".format(inp)
message(u"Disabling regex matching (youtube, etc) (issued by {})".format(nick), target=channel)
notice(u"Disabling regex matching (youtube, etc) in channel {}".format(channel))
set_status(db, channel, "DISABLED")
@hook.command(permissions=["botcontrol"])
def resetregex(inp, db=None, message=None, notice=None, chan=None, nick=None):
db_init(db)
inp = inp.strip().lower()
if not inp:
channel = chan
elif inp.startswith("#"):
channel = inp
else:
channel = u"#{}".format(inp)
message(u"Resetting regex matching setting (youtube, etc) (issued by {})".format(nick), target=channel)
notice(u"Resetting regex matching setting (youtube, etc) in channel {}".format(channel))
delete_status(db, channel)
@hook.command(permissions=["botcontrol"])
def regexstatus(inp, db=None, chan=None):
db_init(db)
inp = inp.strip().lower()
if not inp:
channel = chan
elif inp.startswith("#"):
channel = inp
else:
channel = u"#{}".format(inp)
return u"Regex status for {}: {}".format(channel, get_status(db, channel))
@hook.command(permissions=["botcontrol"])
def listregex(inp, db=None):
db_init(db)
return list_status(db)

View file

@ -0,0 +1,39 @@
from util import http, hook
api_root = 'http://api.rottentomatoes.com/api/public/v1.0/'
movie_search_url = api_root + 'movies.json'
movie_reviews_url = api_root + 'movies/%s/reviews.json'
@hook.command('rt')
def rottentomatoes(inp, bot=None):
"""rt <title> -- gets ratings for <title> from Rotten Tomatoes"""
api_key = bot.config.get("api_keys", {}).get("rottentomatoes", None)
if not api_key:
return "error: no api key set"
title = inp.strip()
results = http.get_json(movie_search_url, q=title, apikey=api_key)
if results['total'] == 0:
return 'No results.'
movie = results['movies'][0]
title = movie['title']
movie_id = movie['id']
critics_score = movie['ratings']['critics_score']
audience_score = movie['ratings']['audience_score']
url = movie['links']['alternate']
if critics_score == -1:
return
reviews = http.get_json(movie_reviews_url % movie_id, apikey=api_key, review_type='all')
review_count = reviews['total']
fresh = critics_score * review_count / 100
rotten = review_count - fresh
return u"{} - Critics Rating: \x02{}%\x02 ({} liked, {} disliked) " \
"Audience Rating: \x02{}%\x02 - {}".format(title, critics_score, fresh, rotten, audience_score, url)

40
disabled_stuff/rss.py Normal file
View file

@ -0,0 +1,40 @@
from util import hook, http, web, text
@hook.command("feed")
@hook.command
def rss(inp, message=None):
"""rss <feed> -- Gets the first three items from the RSS feed <feed>."""
limit = 3
# preset news feeds
strip = inp.lower().strip()
if strip == "bukkit":
feed = "http://dl.bukkit.org/downloads/craftbukkit/feeds/latest-rb.rss"
limit = 1
elif strip == "xkcd":
feed = "http://xkcd.com/rss.xml"
elif strip == "ars":
feed = "http://feeds.arstechnica.com/arstechnica/index"
else:
feed = inp
query = "SELECT title, link FROM rss WHERE url=@feed LIMIT @limit"
result = web.query(query, {"feed": feed, "limit": limit})
if not result.rows:
return "Could not find/read RSS feed."
for row in result.rows:
title = text.truncate_str(row["title"], 100)
try:
link = web.isgd(row["link"])
except (web.ShortenError, http.HTTPError, http.URLError):
link = row["link"]
message(u"{} - {}".format(title, link))
@hook.command(autohelp=False)
def rb(inp, message=None):
"""rb -- Shows the latest Craftbukkit recommended build"""
rss("bukkit", message)

11
disabled_stuff/shorten.py Normal file
View file

@ -0,0 +1,11 @@
from util import hook, http, web
@hook.command
def shorten(inp):
"""shorten <url> - Makes an is.gd shortlink to the url provided."""
try:
return web.isgd(inp)
except (web.ShortenError, http.HTTPError) as error:
return error

33
disabled_stuff/slap.py Normal file
View file

@ -0,0 +1,33 @@
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 slap(inp, action=None, nick=None, conn=None, notice=None):
"""slap <user> -- Makes the bot slap <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
variables = {
"user": target
}
with open("plugins/data/slaps.json") as f:
generator = get_generator(f.read(), variables)
# act out the message
action(generator.generate_string())

18
disabled_stuff/slogan.py Normal file
View file

@ -0,0 +1,18 @@
import random
from util import hook, text
with open("plugins/data/slogans.txt") as f:
slogans = [line.strip() for line in f.readlines()
if not line.startswith("//")]
@hook.command
def slogan(inp):
"""slogan <word> -- Makes a slogan for <word>."""
out = random.choice(slogans)
if inp.lower() and out.startswith("<text>"):
inp = text.capitalize_first(inp)
return out.replace('<text>', inp)

34
disabled_stuff/snopes.py Normal file
View file

@ -0,0 +1,34 @@
import re
from util import hook, http
search_url = "http://search.atomz.com/search/?sp_a=00062d45-sp00000000"
@hook.command
def snopes(inp):
"""snopes <topic> -- Searches snopes for an urban legend about <topic>."""
search_page = http.get_html(search_url, sp_q=inp, sp_c="1")
result_urls = search_page.xpath("//a[@target='_self']/@href")
if not result_urls:
return "no matching pages found"
snopes_page = http.get_html(result_urls[0])
snopes_text = snopes_page.text_content()
claim = re.search(r"Claim: .*", snopes_text).group(0).strip()
status = re.search(r"Status: .*", snopes_text)
if status is not None:
status = status.group(0).strip()
else: # new-style statuses
status = "Status: %s." % re.search(r"FALSE|TRUE|MIXTURE|UNDETERMINED",
snopes_text).group(0).title()
claim = re.sub(r"[\s\xa0]+", " ", claim) # compress whitespace
status = re.sub(r"[\s\xa0]+", " ", status)
return "{} {} {}".format(claim, status, result_urls[0])

View file

@ -0,0 +1,50 @@
from urllib import urlencode
import re
from util import hook, http, web, text
sc_re = (r'(.*:)//(www.)?(soundcloud.com)(.*)', re.I)
api_url = "http://api.soundcloud.com"
sndsc_re = (r'(.*:)//(www.)?(snd.sc)(.*)', re.I)
def soundcloud(url, api_key):
data = http.get_json(api_url + '/resolve.json?' + urlencode({'url': url, 'client_id': api_key}))
if data['description']:
desc = u": {} ".format(text.truncate_str(data['description'], 50))
else:
desc = ""
if data['genre']:
genre = u"- Genre: \x02{}\x02 ".format(data['genre'])
else:
genre = ""
url = web.try_isgd(data['permalink_url'])
return u"SoundCloud track: \x02{}\x02 by \x02{}\x02 {}{}- {} plays, {} downloads, {} comments - {}".format(
data['title'], data['user']['username'], desc, genre, data['playback_count'], data['download_count'],
data['comment_count'], url)
@hook.regex(*sc_re)
def soundcloud_url(match, bot=None):
api_key = bot.config.get("api_keys", {}).get("soundcloud")
if not api_key:
print "Error: no api key set"
return None
url = match.group(1).split(' ')[-1] + "//" + (match.group(2) if match.group(2) else "") + match.group(3) + \
match.group(4).split(' ')[0]
return soundcloud(url, api_key)
@hook.regex(*sndsc_re)
def sndsc_url(match, bot=None):
api_key = bot.config.get("api_keys", {}).get("soundcloud")
if not api_key:
print "Error: no api key set"
return None
url = match.group(1).split(' ')[-1] + "//" + (match.group(2) if match.group(2) else "") + match.group(3) + \
match.group(4).split(' ')[0]
return soundcloud(http.open(url).url, api_key)

View file

@ -0,0 +1,47 @@
from enchant.checker import SpellChecker
import enchant
from util import hook
locale = "en_US"
@hook.command
def spell(inp):
"""spell <word/sentence> -- Check spelling of a word or sentence."""
if not enchant.dict_exists(locale):
return "Could not find dictionary: {}".format(locale)
if len(inp.split(" ")) > 1:
# input is a sentence
checker = SpellChecker(locale)
checker.set_text(inp)
offset = 0
for err in checker:
# find the location of the incorrect word
start = err.wordpos + offset
finish = start + len(err.word)
# get some suggestions for it
suggestions = err.suggest()
s_string = '/'.join(suggestions[:3])
s_string = "\x02{}\x02".format(s_string)
# calculate the offset for the next word
offset = (offset + len(s_string)) - len(err.word)
# replace the word with the suggestions
inp = inp[:start] + s_string + inp[finish:]
return inp
else:
# input is a word
dictionary = enchant.Dict(locale)
is_correct = dictionary.check(inp)
suggestions = dictionary.suggest(inp)
s_string = ', '.join(suggestions[:10])
if is_correct:
return '"{}" appears to be \x02valid\x02! ' \
'(suggestions: {})'.format(inp, s_string)
else:
return '"{}" appears to be \x02invalid\x02! ' \
'(suggestions: {})'.format(inp, s_string)

106
disabled_stuff/spotify.py Normal file
View file

@ -0,0 +1,106 @@
import re
from urllib import urlencode
from util import hook, http, web
gateway = 'http://open.spotify.com/{}/{}' # http spotify gw address
spuri = 'spotify:{}:{}'
spotify_re = (r'(spotify:(track|album|artist|user):([a-zA-Z0-9]+))', re.I)
http_re = (r'(open\.spotify\.com\/(track|album|artist|user)\/'
'([a-zA-Z0-9]+))', re.I)
def sptfy(inp, sptfy=False):
if sptfy:
shortenurl = "http://sptfy.com/index.php"
data = urlencode({'longUrl': inp, 'shortUrlDomain': 1, 'submitted': 1, "shortUrlFolder": 6, "customUrl": "",
"shortUrlPassword": "", "shortUrlExpiryDate": "", "shortUrlUses": 0, "shortUrlType": 0})
try:
soup = http.get_soup(shortenurl, post_data=data, cookies=True)
except:
return inp
try:
link = soup.find('div', {'class': 'resultLink'}).text.strip()
return link
except:
message = "Unable to shorten URL: %s" % \
soup.find('div', {'class': 'messagebox_text'}).find('p').text.split("<br/>")[0]
return message
else:
return web.try_isgd(inp)
@hook.command('sptrack')
@hook.command
def spotify(inp):
"""spotify <song> -- Search Spotify for <song>"""
try:
data = http.get_json("http://ws.spotify.com/search/1/track.json", q=inp.strip())
except Exception as e:
return "Could not get track information: {}".format(e)
try:
type, id = data["tracks"][0]["href"].split(":")[1:]
except IndexError:
return "Could not find track."
url = sptfy(gateway.format(type, id))
return u"\x02{}\x02 by \x02{}\x02 - {}".format(data["tracks"][0]["name"],
data["tracks"][0]["artists"][0]["name"], url)
@hook.command
def spalbum(inp):
"""spalbum <album> -- Search Spotify for <album>"""
try:
data = http.get_json("http://ws.spotify.com/search/1/album.json", q=inp.strip())
except Exception as e:
return "Could not get album information: {}".format(e)
try:
type, id = data["albums"][0]["href"].split(":")[1:]
except IndexError:
return "Could not find album."
url = sptfy(gateway.format(type, id))
return u"\x02{}\x02 by \x02{}\x02 - {}".format(data["albums"][0]["name"],
data["albums"][0]["artists"][0]["name"], url)
@hook.command
def spartist(inp):
"""spartist <artist> -- Search Spotify for <artist>"""
try:
data = http.get_json("http://ws.spotify.com/search/1/artist.json", q=inp.strip())
except Exception as e:
return "Could not get artist information: {}".format(e)
try:
type, id = data["artists"][0]["href"].split(":")[1:]
except IndexError:
return "Could not find artist."
url = sptfy(gateway.format(type, id))
return u"\x02{}\x02 - {}".format(data["artists"][0]["name"], url)
@hook.regex(*http_re)
@hook.regex(*spotify_re)
def spotify_url(match):
type = match.group(2)
spotify_id = match.group(3)
url = spuri.format(type, spotify_id)
# no error catching here, if the API is down fail silently
data = http.get_json("http://ws.spotify.com/lookup/1/.json", uri=url)
if type == "track":
name = data["track"]["name"]
artist = data["track"]["artists"][0]["name"]
album = data["track"]["album"]["name"]
return u"Spotify Track: \x02{}\x02 by \x02{}\x02 from the album \x02{}\x02 - {}".format(name, artist,
album, sptfy(
gateway.format(type, spotify_id)))
elif type == "artist":
return u"Spotify Artist: \x02{}\x02 - {}".format(data["artist"]["name"],
sptfy(gateway.format(type, spotify_id)))
elif type == "album":
return u"Spotify Album: \x02{}\x02 - \x02{}\x02 - {}".format(data["album"]["artist"],
data["album"]["name"],
sptfy(gateway.format(type, spotify_id)))

75
disabled_stuff/steam.py Normal file
View file

@ -0,0 +1,75 @@
import re
from bs4 import BeautifulSoup, NavigableString, Tag
from util import hook, http, web
from util.text import truncate_str
steam_re = (r'(.*:)//(store.steampowered.com)(:[0-9]+)?(.*)', re.I)
def get_steam_info(url):
page = http.get(url)
soup = BeautifulSoup(page, 'lxml', from_encoding="utf-8")
data = {}
data["name"] = soup.find('div', {'class': 'apphub_AppName'}).text
data["desc"] = truncate_str(soup.find('meta', {'name': 'description'})['content'].strip(), 80)
# get the element details_block
details = soup.find('div', {'class': 'details_block'})
# loop over every <b></b> tag in details_block
for b in details.findAll('b'):
# get the contents of the <b></b> tag, which is our title
title = b.text.lower().replace(":", "")
if title == "languages":
# we have all we need!
break
# find the next element directly after the <b></b> tag
next_element = b.nextSibling
if next_element:
# if the element is some text
if isinstance(next_element, NavigableString):
text = next_element.string.strip()
if text:
# we found valid text, save it and continue the loop
data[title] = text
continue
else:
# the text is blank - sometimes this means there are
# useless spaces or tabs between the <b> and <a> tags.
# so we find the next <a> tag and carry on to the next
# bit of code below
next_element = next_element.find_next('a', href=True)
# if the element is an <a></a> tag
if isinstance(next_element, Tag) and next_element.name == 'a':
text = next_element.string.strip()
if text:
# we found valid text (in the <a></a> tag),
# save it and continue the loop
data[title] = text
continue
data["price"] = soup.find('div', {'class': 'game_purchase_price price'}).text.strip()
return u"\x02{name}\x02: {desc}, \x02Genre\x02: {genre}, \x02Release Date\x02: {release date}," \
u" \x02Price\x02: {price}".format(**data)
@hook.regex(*steam_re)
def steam_url(match):
return get_steam_info("http://store.steampowered.com" + match.group(4))
@hook.command
def steam(inp):
"""steam [search] - Search for specified game/trailer/DLC"""
page = http.get("http://store.steampowered.com/search/?term=" + inp)
soup = BeautifulSoup(page, 'lxml', from_encoding="utf-8")
result = soup.find('a', {'class': 'search_result_row'})
return get_steam_info(result['href']) + " - " + web.isgd(result['href'])

View file

@ -0,0 +1,120 @@
import csv
import StringIO
from util import hook, http, text
gauge_url = "http://www.mysteamgauge.com/search?username={}"
api_url = "http://mysteamgauge.com/user/{}.csv"
steam_api_url = "http://steamcommunity.com/id/{}/?xml=1"
def refresh_data(name):
http.get(gauge_url.format(name), timeout=25, get_method='HEAD')
def get_data(name):
return http.get(api_url.format(name))
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def unicode_dictreader(utf8_data, **kwargs):
csv_reader = csv.DictReader(utf8_data, **kwargs)
for row in csv_reader:
yield dict([(key.lower(), unicode(value, 'utf-8')) for key, value in row.iteritems()])
@hook.command('sc')
@hook.command
def steamcalc(inp, reply=None):
"""steamcalc <username> [currency] - Gets value of steam account and
total hours played. Uses steamcommunity.com/id/<nickname>. """
# check if the user asked us to force reload
force_reload = inp.endswith(" forcereload")
if force_reload:
name = inp[:-12].strip().lower()
else:
name = inp.strip()
if force_reload:
try:
reply("Collecting data, this may take a while.")
refresh_data(name)
request = get_data(name)
do_refresh = False
except (http.HTTPError, http.URLError):
return "Could not get data for this user."
else:
try:
request = get_data(name)
do_refresh = True
except (http.HTTPError, http.URLError):
try:
reply("Collecting data, this may take a while.")
refresh_data(name)
request = get_data(name)
do_refresh = False
except (http.HTTPError, http.URLError):
return "Could not get data for this user."
csv_data = StringIO.StringIO(request) # we use StringIO because CSV can't read a string
reader = unicode_dictreader(csv_data)
# put the games in a list
games = []
for row in reader:
games.append(row)
data = {}
# basic information
steam_profile = http.get_xml(steam_api_url.format(name))
try:
data["name"] = steam_profile.find('steamID').text
online_state = steam_profile.find('stateMessage').text
except AttributeError:
return "Could not get data for this user."
online_state = online_state.replace("<br/>", ": ") # will make this pretty later
data["state"] = text.strip_html(online_state)
# work out the average metascore for all games
ms = [float(game["metascore"]) for game in games if is_number(game["metascore"])]
metascore = float(sum(ms)) / len(ms) if len(ms) > 0 else float('nan')
data["average_metascore"] = "{0:.1f}".format(metascore)
# work out the totals
data["games"] = len(games)
total_value = sum([float(game["value"]) for game in games if is_number(game["value"])])
data["value"] = str(int(round(total_value)))
# work out the total size
total_size = 0.0
for game in games:
if not is_number(game["size"]):
continue
if game["unit"] == "GB":
total_size += float(game["size"])
else:
total_size += float(game["size"]) / 1024
data["size"] = "{0:.1f}".format(total_size)
reply("{name} ({state}) has {games} games with a total value of ${value}"
" and a total size of {size}GB! The average metascore for these"
" games is {average_metascore}.".format(**data))
if do_refresh:
refresh_data(name)

30
disabled_stuff/stock.py Normal file
View file

@ -0,0 +1,30 @@
from util import hook, web
@hook.command
def stock(inp):
"""stock <symbol> -- gets stock information"""
sym = inp.strip().lower()
query = "SELECT * FROM yahoo.finance.quote WHERE symbol=@symbol LIMIT 1"
quote = web.query(query, {"symbol": sym}).one()
# if we don't get a company name back, the symbol doesn't match a company
if quote['Change'] is None:
return "Unknown ticker symbol: {}".format(sym)
change = float(quote['Change'])
price = float(quote['LastTradePriceOnly'])
if change < 0:
quote['color'] = "5"
else:
quote['color'] = "3"
quote['PercentChange'] = 100 * change / (price - change)
print quote
return u"\x02{Name}\x02 (\x02{symbol}\x02) - {LastTradePriceOnly} " \
"\x03{color}{Change} ({PercentChange:.2f}%)\x03 " \
"Day Range: {DaysRange} " \
"MCAP: {MarketCapitalization}".format(**quote)

19
disabled_stuff/suggest.py Normal file
View file

@ -0,0 +1,19 @@
from util import hook, http, text
from bs4 import BeautifulSoup
@hook.command
def suggest(inp):
"""suggest <phrase> -- Gets suggested phrases for a google search"""
suggestions = http.get_json('http://suggestqueries.google.com/complete/search', client='firefox', q=inp)[1]
if not suggestions:
return 'no suggestions found'
out = u", ".join(suggestions)
# defuckify text (might not be needed now, but I'll keep it)
soup = BeautifulSoup(out)
out = soup.get_text()
return text.truncate_str(out, 200)

76
disabled_stuff/system.py Normal file
View file

@ -0,0 +1,76 @@
import os
import re
import time
import platform
from datetime import timedelta
from util import hook
def convert_kilobytes(kilobytes):
if kilobytes >= 1024:
megabytes = kilobytes / 1024
size = '%.2f MB' % megabytes
else:
size = '%.2f KB' % kilobytes
return size
@hook.command(autohelp=False)
def system(inp):
"""system -- Retrieves information about the host system."""
hostname = platform.node()
os = platform.platform()
python_imp = platform.python_implementation()
python_ver = platform.python_version()
architecture = '-'.join(platform.architecture())
cpu = platform.machine()
return "Hostname: \x02{}\x02, Operating System: \x02{}\x02, Python " \
"Version: \x02{} {}\x02, Architecture: \x02{}\x02, CPU: \x02{}" \
"\x02".format(hostname, os, python_imp, python_ver, architecture, cpu)
@hook.command(autohelp=False)
def memory(inp):
"""memory -- Displays the bot's current memory usage."""
if os.name == "posix":
# get process info
status_file = open('/proc/self/status').read()
s = dict(re.findall(r'^(\w+):\s*(.*)\s*$', status_file, re.M))
# get the data we need and process it
data = s['VmRSS'], s['VmSize'], s['VmPeak'], s['VmStk'], s['VmData']
data = [float(i.replace(' kB', '')) for i in data]
strings = [convert_kilobytes(i) for i in data]
# prepare the output
out = "Threads: \x02{}\x02, Real Memory: \x02{}\x02, Allocated Memory: \x02{}\x02, Peak " \
"Allocated Memory: \x02{}\x02, Stack Size: \x02{}\x02, Heap " \
"Size: \x02{}\x02".format(s['Threads'], strings[0], strings[1], strings[2],
strings[3], strings[4])
# return output
return out
elif os.name == "nt":
cmd = 'tasklist /FI "PID eq %s" /FO CSV /NH' % os.getpid()
out = os.popen(cmd).read()
memory = 0
for amount in re.findall(r'([,0-9]+) K', out):
memory += float(amount.replace(',', ''))
memory = convert_kilobytes(memory)
return "Memory Usage: \x02{}\x02".format(memory)
else:
return "Sorry, this command is not supported on your OS."
@hook.command(autohelp=False)
def uptime(inp, bot=None):
"""uptime -- Shows the bot's uptime."""
uptime_raw = round(time.time() - bot.start_time)
uptime = timedelta(seconds=uptime_raw)
return "Uptime: \x02{}\x02".format(uptime)
@hook.command(autohelp=False)
def pid(inp):
"""pid -- Prints the bot's PID."""
return "PID: \x02{}\x02".format(os.getpid())

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