Skip to content

Commit 3a7448c

Browse files
SamSam
Sam
authored and
Sam
committed
added xbox overlay for achievments and a test achievement
1 parent 230ce30 commit 3a7448c

File tree

6 files changed

+80
-39
lines changed

6 files changed

+80
-39
lines changed

achievChecks.py

+37-33
Original file line numberDiff line numberDiff line change
@@ -9,71 +9,71 @@
99
KV_TRNY = 2
1010
KV_HC_SB = 3
1111
KV_COMPLETE = 4
12-
KV_STRING = '~KateV Wannabe~'
12+
KV_STRING = 'KateV Wannabe'
1313
IMA_TRANNY = 5
14-
IMA_TRANNY_STRING = '~Transthusiast~'
14+
IMA_TRANNY_STRING = 'Transthusiast'
1515
IMA_TRANNY_THRESH = 5
1616
IM_GAY = 6
17-
IM_GAY_THRESH = 5
18-
IM_GAY_STRING = '~You Are Indeed Gay!~'
17+
IM_GAY_THRESH = 40
18+
IM_GAY_STRING = 'You Are Indeed Gay!'
1919
SAME = 7
20-
SAME_THRESH = 5
21-
SAME_STRING = "~Everybody's The Same!~"
20+
SAME_THRESH = 40
21+
SAME_STRING = "Everybody's The Same!"
2222
DORA = 54
23-
DORA_STRING = '~Literally Theodora IRL~'
23+
DORA_STRING = 'Literally Theodora IRL'
2424
IRL = 8
25-
IRL_THRESH = 5
26-
IRL_STRING = "~Reality Check~"
25+
IRL_THRESH = 40
26+
IRL_STRING = "Reality Check"
2727
BUTT = 29
28-
BUTT_THRESH = 5
29-
BUTT_STRING = '~The Posterior Is Superior~'
28+
BUTT_THRESH = 40
29+
BUTT_STRING = 'The Posterior Is Superior'
3030
BLIP_COMPLETE = 30
3131
BLIP_CUTE = 31
3232
BLIP_HOT = 32
3333
BLIP_SHORT = 33
34-
BLIP_STRING = '~Blippy Is Shorter Than You~'
34+
BLIP_STRING = 'Blippy Is Shorter Than You'
3535
GIRL = 34
36-
GIRL_THRESH = 20
37-
GIRL_STRING = "~I'm Not A Girl, Not Yet A Woman~"
36+
GIRL_THRESH = 30
37+
GIRL_STRING = "I'm Not A Girl, Not Yet A Woman"
3838
DICK = 35
39-
DICK_THRESH = 20
40-
DICK_STRING = "~KEEP SAYING DICK~"
39+
DICK_THRESH = 30
40+
DICK_STRING = "KEEP SAYING DICK"
4141
LOLIDK_COMPLETE = 36
4242
LOLIDK_IDK = 37
4343
LOLIDK_LOL = 38
44-
LOLIDK_STRING = '~Ignorant But Laughing About It~'
44+
LOLIDK_STRING = 'Ignorant But Laughing About It'
4545
CRUELTY = 39
46-
CRUELTY_THRESH = 20
47-
CRUELTY_STRING = "~Stop Fucking Laughing At People You Asshole!~"
46+
CRUELTY_THRESH = 40
47+
CRUELTY_STRING = "Stop Fucking Laughing At People You Asshole!"
4848
SAMANTHA = 40
49-
SAMANTHA_THRESH = 10
50-
SAMANTHA_STRING = "~Say My Name Bitch~"
49+
SAMANTHA_THRESH = 40
50+
SAMANTHA_STRING = "Say My Name Bitch"
5151
FML = 41
52-
FML_THRESH = 10
53-
FML_STRING = "~NO FUCK YOUR LIFE ASSHOLE~"
52+
FML_THRESH = 40
53+
FML_STRING = "NO FUCK YOUR LIFE ASSHOLE"
5454
FART = 42
55-
FART_THRESH = 5
56-
FART_STRING = "~Farts Are Always Funny~"
55+
FART_THRESH = 20
56+
FART_STRING = "Farts Are Always Funny"
5757
LINES = 43
58-
LINES_THRESH = 1000
58+
LINES_THRESH = 10000
5959
LINES_COMPLETE = 56
60-
LINES_STRING = "~A Thousand Lines Of Bullshit, Hope You Are Happy!~"
60+
LINES_STRING = "Ten Thousand Lines Of Bullshit"
6161
CREEP_COMPLETE = 44
6262
CREEP_CREEP = 45
6363
CREEP_WIERDO = 46
6464
CREEP_HELL = 47
6565
CREEP_BELONG = 48
66-
CREEP_STRING = '~RADIOHEAD IS THE BEST BAND IN THE WORLD PROBABLY!!!~'
66+
CREEP_STRING = 'RADIOHEAD IS THE BEST BAND IN THE WORLD PROBABLY!!!'
6767
LINK = 49
68-
LINK_THRESH = 10
69-
LINK_STRING = "~I Hope All Those Links Are Funny!~"
68+
LINK_THRESH = 100
69+
LINK_STRING = "100 Links wtf"
7070
MAYHEM_COMPLETE = 50
7171
MAYHEM_ROCKS = 51
7272
MAYHEM_LIFTING = 52
73-
MAYHEM_STRING = '~LIFT ROCKS EVRRDAY -- Mayhem 2012~'
73+
MAYHEM_STRING = 'LIFT ROCKS EVRRDAY -- Mayhem 2012'
7474
TMT = 53
75-
TMT_THRESH = 5
76-
TMT_STRING = "~Stop Reading That Fucking Thread~"
75+
TMT_THRESH = 50
76+
TMT_STRING = "Stop Reading That Fucking Thread"
7777

7878
#next achiev must use 57 or higher
7979

@@ -329,3 +329,7 @@ def checkTMT(nick,host,message):
329329
result = incrementAchiev(TMT,host)
330330
if getAchiev(TMT,host) == TMT_THRESH:
331331
return TMT_STRING
332+
333+
def checkTestAchieve(nick,host,message):
334+
if re.search('.testAchievement',message , re.IGNORECASE) and (re.search('saman',nick,re.IGNORECASE) or re.search('kgc',nick,re.IGNORECASE)) :
335+
return 'Dumb Test Achievement'

achieve.png

68.9 KB
Loading

arial.ttf

359 KB
Binary file not shown.

makeMacro.py

+37
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,40 @@ def makeMacro(imgUrl , text ,fileName):
5454
drawtext(draw, text, font, "white", bbox)
5555
image.save(fileName , 'JPEG')
5656

57+
def drawAchieve(text):
58+
img = Image.open('achieve.png')
59+
draw = ImageDraw.Draw(img)
60+
shadowcolor = "black"
61+
x0 = 218 + 10
62+
y0= 128
63+
y1 = 173
64+
x1 = 884
65+
font = ImageFont.truetype("arial.ttf", 45)
66+
space = draw.textsize(" ", font)[0]
67+
words = text.split()
68+
x = x0; y = y0; h = 0
69+
for word in words:
70+
# check size of this word
71+
w, h = draw.textsize(word, font)
72+
# figure out where to draw it
73+
if x > x0:
74+
x += space
75+
if x + w > x1:
76+
# new line
77+
x = x0
78+
y += h
79+
#text
80+
draw.text((x,y), word, font=font, fill='white')
81+
x += w
82+
return img
83+
84+
def overlayAchieve(text,url):
85+
target = getImageFromUrl(url)
86+
y = drawAchieve(text)
87+
basewidth = target.size[0]
88+
wpercent = basewidth/float(y.size[0])
89+
hsize = int((float(y.size[1])*float(wpercent)))
90+
y = y.resize((basewidth,hsize),Image.ANTIALIAS)
91+
target.paste(y ,(0,0) , y)
92+
target.save('achieved.png','PNG' )
93+
return 'achieved.png'

plugins/achievments.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ def checkAchievs(nick , host , message):
2020
blurb = '~Congratulations %s you unlocked ' %nick
2121
if config.tumblr_tumbling:
2222
dontcare , url , atall = tumble.getLastPost('fuckyeahcutetranschicks')
23-
caption = '%s unlocked the following achievements : ' %nick + results
24-
tumbleUrl = tumble.makePost(config.tumblr_user,config.tumblr_password,config.tumblr_blog,config.tumblr_title,url,caption,caption)
23+
caption = results
24+
t_caption = '%s unlocked the following achievements : ' %nick + results
25+
tumbleUrl = tumble.makePost(config.tumblr_user,config.tumblr_password,config.tumblr_blog,config.tumblr_title,url,caption,t_caption)
2526
return blurb + results + ' - View your amazing achievements here http://%s' %tumbleUrl
2627
else:
2728
return blurb + results

tumble.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import urllib2 , urllib
33
from PIL import Image
44
from cStringIO import StringIO
5-
from makeMacro import makeMacro
5+
from makeMacro import overlayAchieve
66
import pycurl
77
def postToImgur(filename):
88
store = StringIO()
@@ -23,10 +23,9 @@ def postToImgur(filename):
2323
return urlneeded
2424

2525
def makePost(user,password,blog,title,imgUrl,caption,tumblrCaption):
26-
makeMacro(imgUrl,caption,'woot.jpg')
27-
image = open('./woot.jpg')
26+
filename = overlayAchieve(caption,imgUrl)
2827
url = 'http://www.tumblr.com/api/write'
29-
imageurl = postToImgur('./woot.jpg')
28+
imageurl = postToImgur('./%s'%filename)
3029
vals = {
3130
'email': user,
3231
'password': password,

0 commit comments

Comments
 (0)