Back

Creative Corner

Share your own art and stories, or ask for critique.
TOPIC | Python code for writing hatchery bios
So as I am terrifically lazy and my own hatchery is a bit of a joke, I thought it'd be entertaining to make a program in Python that writes and formats little dragon blurbs for me. The current program asks me to put in the dragon's ID, which it uses to generate the image and links of the dragon. I also have to type in the dragon's primary, secondary, and tertiary, as it uses those to generate the sentences in the bio, give a title for use in the sales quote, and specify whether the dragon's male or female (which changes the gender used in the sentences). After that, it... well, it does this. Note that the purchase button does actually work if you put in a dragon that's on the AH - I just didn't want to be advertising in the creative corner, haha. [quote=LOCAL LADY EXTREMELY IMPRESSED WITH BROMPUTER CODE][center] [img]http://flightrising.com/images/icons/small_female.png[/img] 30kt [emoji=treasure size=1] | 30 [emoji=gem size=1] -------------------- [url=https://www1.flightrising.com/dragon/24773336][img]https://www1.flightrising.com/rendern/350/247734/24773336_350.png[/img][/url] -------------------- This BROYAL lady likes to LIFT WEIGHTS and PUNCH BEARS. It's ALWAYS LEAF TIME with this ABSOLUTE UNIT. Her MANGENTA SHINES BRIGHTLY, EVEN AMONGST MEN. Weights are NO MATCH FOR LEAF. ORDER THIS MANJESTIC DUDE AND RECIEVE A FREE BROFIST! [b]CERULEAN | LEAF | MANGENTA[/b] [url=http://www1.flightrising.com/auction-house/buy-dragon/24773336] [img]http://flightrising.com/images/layout/button_buyauction.png[/img][/url] [/center][/quote] [quote=DUDE! DUUUUUDE][center] [img]http://flightrising.com/images/icons/small_male.png[/img] 30kt [emoji=treasure size=1] | 30 [emoji=gem size=1] -------------------- [url=https://www1.flightrising.com/dragon/68781039][img]https://www1.flightrising.com/rendern/350/687811/68781039_350.png[/img][/url] -------------------- In a word? LARGE. Weights are NO MATCH FOR CERULEAN. This dragon picked THE MANLIEST COLOUR to PUNCH HIS WAY OUT OF THE SHELL WITH: CERULEAN. Only the BEST OF CERULEAN for this LAD! THIS FUNKY MAN WAITS FOR NO-ONE... BUT YOU, BRO. WILL YOU BE HIS BRO? [b]MANGENTA | CERULEAN | RADIPROACTIVE[/b] [url=http://www1.flightrising.com/auction-house/buy-dragon/68781039] [img]http://flightrising.com/images/layout/button_buyauction.png[/img][/url] [/center][/quote] So yeah, that's where I'm at! Just thought I'd use this thread to track what I'm doing with the thing. At the moment I think I wanna add more sentences, maybe have sentences that pick from the genes you put in as well - maybe even have a GUI so I can put dragons in faster, or a means of doing up the bios in batches. The terrifically lazy code can be found [url=https://docs.google.com/document/d/14Cj_J7sA8ntQDO8LGrzD0vmCoIMnfFV1t7ibf9ghgFk/edit]here[/url], just copy it into PyCharm if you want to try it out. It's kind of spaghetti at the moment, soz. -------- edit: Got it doing batches and gender-specific wording, though the implementation on gender could be a whole lot more elegant! I'll fix it down the line.
So as I am terrifically lazy and my own hatchery is a bit of a joke, I thought it'd be entertaining to make a program in Python that writes and formats little dragon blurbs for me.

The current program asks me to put in the dragon's ID, which it uses to generate the image and links of the dragon. I also have to type in the dragon's primary, secondary, and tertiary, as it uses those to generate the sentences in the bio, give a title for use in the sales quote, and specify whether the dragon's male or female (which changes the gender used in the sentences).

After that, it... well, it does this. Note that the purchase button does actually work if you put in a dragon that's on the AH - I just didn't want to be advertising in the creative corner, haha.
LOCAL LADY EXTREMELY IMPRESSED WITH BROMPUTER CODE wrote:
small_female.png

30kt | 30
24773336_350.png

This BROYAL lady likes to LIFT WEIGHTS and PUNCH BEARS. It's ALWAYS LEAF TIME with this ABSOLUTE UNIT. Her MANGENTA SHINES BRIGHTLY, EVEN AMONGST MEN. Weights are NO MATCH FOR LEAF. ORDER THIS MANJESTIC DUDE AND RECIEVE A FREE BROFIST!

CERULEAN | LEAF | MANGENTA

button_buyauction.png
DUDE! DUUUUUDE wrote:
small_male.png

30kt | 30
68781039_350.png

In a word? LARGE. Weights are NO MATCH FOR CERULEAN. This dragon picked THE MANLIEST COLOUR to PUNCH HIS WAY OUT OF THE SHELL WITH: CERULEAN. Only the BEST OF CERULEAN for this LAD! THIS FUNKY MAN WAITS FOR NO-ONE... BUT YOU, BRO. WILL YOU BE HIS BRO?

MANGENTA | CERULEAN | RADIPROACTIVE

button_buyauction.png

So yeah, that's where I'm at! Just thought I'd use this thread to track what I'm doing with the thing. At the moment I think I wanna add more sentences, maybe have sentences that pick from the genes you put in as well - maybe even have a GUI so I can put dragons in faster, or a means of doing up the bios in batches.

The terrifically lazy code can be found here, just copy it into PyCharm if you want to try it out. It's kind of spaghetti at the moment, soz.



edit: Got it doing batches and gender-specific wording, though the implementation on gender could be a whole lot more elegant! I'll fix it down the line.
Dear IKTR: Fandragons are in my den! Sometimes there's a few stragglers in my lair.
mancave_banner.png



MANGENTA.png