Skip to content

Instantly share code, notes, and snippets.

@tetrapus
Created January 6, 2014 21:36
Show Gist options
  • Save tetrapus/8290220 to your computer and use it in GitHub Desktop.
Save tetrapus/8290220 to your computer and use it in GitHub Desktop.
Xchat script that does randomy things.
import xchat
import time
import re
import random
__module_name__ = "Rwarrr"
__module_version__ = "1.21"
__module_description__ = "Rawrabilities."
__module_author__ = "Lion"
items = {"" : """a massive lion hug
a warm, furry cuddle
an emu carcass
a cautious lick""".split("\n"),
r"@nerdfighter\.dftba": """a sloppy wet kiss on the lips
a big warm kiss on the belly
a suggestive rawr
a kiss""".split("\n"),
r"@az\.i\.wuz": ["some corn", "a sliver of lettuce", "trail mix", "a few cubes of apple"],
r"@goes\.rawr": [],
"Jamie!" :
""":3
:3
:3
:3
:3""".split("\n"),
"Sparrow!": [],
"crye!": ["a gentle massage",
"a bro-hug"],
r"@GANNOO\.LEENUCKS": [],
}
replies = {"":
"""rolls around a bit
licks %(nick)s's cheek
nibbles on %(nick)s
%(rawr)ss
tickles %(nick)s
coats %(nick)s in slobber
rubs against %(nick)s
tackles %(nick)s
sucks on %(nick)s's finger
scratches his mane with his hind leg
rests his head on the ground
curls up in the corner
gets out the lube
goes to his cage
swats at %(nick)s with his paw
sniffs %(nick)s
sits on %(nick)s's lap
devours %(nick)s
stares at %(nick)s blankly
pounces on %(nick)s
chases %(nick)s
gnaws on %(nick)s's shirt
gives %(nick)s %(item)s
gives %(item)s to %(nick)s
rolls
tickles %(nick)s with his mane
flails wildly""".split("\n"),
r"@nerdfighter\.dftba":
"""pins %(nick)s to the ground
gives %(nick)s %(item)s
gives %(nick)s %(item)s
snuggles with %(nick)s
gropes %(nick)s's booty
spanks %(nick)s
humps %(nick)s
nibbles on %(nick)s's ear
pounces on %(nick)s
nuzzles %(nick)s
sits on %(nick)s's lap
pisses in %(nick)s's ass
cuddles %(nick)s""".split("\n"),
r"@GANNOO\.LEENUCKS":
"""pins %(nick)s to the ground
snuggles with %(nick)s
gropes %(nick)s
tickles %(nick)s
humps %(nick)s's leg
nibbles on %(nick)s's ear
sucks on %(nick)s's finger
licks %(nick)s's toe
pounces on %(nick)s
rubs against %(nick)s
licks %(nick)s all over
nuzzles %(nick)s
sits on %(nick)s's lap
rolls onto %(nick)s
cuddles %(nick)s
plays with %(nick)s's monads
rolls onto his back with his legs in the air""".split("\n"),
r"@az\.i\.wuz":
"""pushes %(nick)s over with his nose
picks up %(nick)s and drops him into his mane
rubs his whiskers against %(nick)s's
hides %(nick)s under his tail""".split("\n"),
r"@goes\.rawr":
"""collides with %(nick)s and annihilates""".split("\n"),
"Jamie!" :
""":3 <3
:3
:3
<3
:3
:3
:3
:3
<333
:3""".split("\n"),
"Sparrow!":
"""ruffles %(nick)s's feathers
grooms %(nick)s""".split("\n"),
"crye!":["meows"],
}
exclude = {"(Sparrow|Hamster|.*Bunny)!": ["sits on %(nick)s's lap"]}
class Rawr(object):
lasttrigger = 0
def rawrTrigger(self, word, word_eol, userdata=None):
if word[3].lower() == ":!rawr" and "lion" in xchat.get_info("nick").lower() and time.time() - self.lasttrigger > 4:
nick = word[0].split("!")[0][1:]
allitems = []
responses = []
for i in replies:
if re.search(i, word[0]):
allitems.extend(list(items[i]))
responses.extend(list(replies[i]))
for i in exclude:
if re.search(i, word[0]):
for res in exclude[i]:
responses.remove(res)
substitutes = {"nick": nick,
"rawr": "r" +
("a" * random.randrange(1, 4)) +
("w" * random.randrange(1, 5)) +
("r" * random.randrange(2, 7)),
"item": random.choice(allitems)}
response = random.choice(responses) % substitutes
xchat.command("raw PRIVMSG %s :\x01ACTION %s\x01" % (word[2] if word[2][0] == "#" else nick, response))
print xchat.get_info("nick") + " " + response
self.lasttrigger = time.time()
return xchat.EAT_NONE
xchat.hook_server("PRIVMSG", Rawr().rawrTrigger)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment