From 9d0e704eae83db8df9b6ed2ebed4ded6a5bf52e4 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Mon, 26 Mar 2012 21:59:02 +1300 Subject: [PATCH] Random tweaks --- plugins/data/kills.txt | 9 ++++----- plugins/data/larts.txt | 1 - plugins/fortune.py | 11 +++-------- plugins/time.py | 13 +++++-------- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/plugins/data/kills.txt b/plugins/data/kills.txt index 6ff53d1..c644ea4 100755 --- a/plugins/data/kills.txt +++ b/plugins/data/kills.txt @@ -10,14 +10,13 @@ shivs in the . rams a rocket launcher up 's ass and lets off a few rounds. crushes 's skull in with a spiked mace. unleashes the armies of Isengard on . -packs into a SVN repo. slices 's off with a Katana. -throws to Cthulu! -feeds to an owlbear. +throws to Cthulu and watches them get ripped to shreads. +feeds to an owlbear, who proceeds to maul them. turns into a snail and salts them. snacks on 's . puts into a sack, throws the sack in the river, and hurls the river into space. -goes bowling with 's head. +goes bowling with 's disembodied head. uses 's as a back-scratcher. sends to /dev/null! -feeds coke and mentos till they pop! +feeds coke and mentos till they violently explode. diff --git a/plugins/data/larts.txt b/plugins/data/larts.txt index bf2f0f1..b4a831c 100755 --- a/plugins/data/larts.txt +++ b/plugins/data/larts.txt @@ -102,5 +102,4 @@ dances upon the grave of 's ancestors. farts in 's general direction. flogs with stinging nettle. intoduces to the Knights who say Ni. -assigns all of the permissions tickets on the BeastNode support system to . hands a poison ivy joint. diff --git a/plugins/fortune.py b/plugins/fortune.py index 81136f4..c31a17d 100755 --- a/plugins/fortune.py +++ b/plugins/fortune.py @@ -11,12 +11,7 @@ with open("plugins/data/fortunes.txt") as f: fortunes.append(line.strip()) -@hook.command(autohelp=False) -def fortune(inp, nick=None, say=None, input=None): +@hook.command +def fortune(inp): ".fortune -- Fortune cookies on demand." - - msg = "(" + nick + ") " + random.choice(fortunes) - if inp: - msg = "(@" + inp + ") " + random.choice(fortunes) - - say(msg) + return random.choice(fortunes) diff --git a/plugins/time.py b/plugins/time.py index 4c6c5ea..1bb9f1f 100755 --- a/plugins/time.py +++ b/plugins/time.py @@ -9,6 +9,8 @@ import locale import datetime from BeautifulSoup import BeautifulSoup +tags_re = re.compile(r'<[^<]*?>') + TimeZones = {'KST': 9, 'CADT': 10.5, 'EETDST': 3, 'MESZ': 2, 'WADT': 9, 'EET': 2, 'MST': -7, 'WAST': 8, 'IST': 5.5, 'B': 2, 'MSK': 3, 'X': -11, 'MSD': 4, 'CETDST': 2, 'AST': -4, @@ -224,21 +226,16 @@ def get_time(tz): @hook.command("time") -def timecommand(inp, say=None): +def time_command(inp): ".time -- Gets the time in " - tags_re = re.compile(r'<[^<]*?>') - - page = http.get('http://www.google.com/search', q="time in " + inp) - - soup = BeautifulSoup(page) - + request = http.get('http://www.google.com/search', q="time in " + inp) + soup = BeautifulSoup(request) response = soup.find('td', {'style': 'font-size:medium'}) if response: output = response.renderContents() output = tags_re.sub('\x02', output.strip()) - return output else: try: