Add printer stuff

This commit is contained in:
jimmy 2022-09-24 12:53:32 +12:00
parent c996650414
commit 74d7354593
6 changed files with 100 additions and 5 deletions

55
printer/actions.txt Normal file
View File

@ -0,0 +1,55 @@
ask a stranger for a dance
ask a stranger what their biggest fear is
smell a strangers hair
show off your impression of a duck
spank a consenting individual
kiss a consenting individual
reveal a secret
tell a creative story
compliment someone on their smile
hold Tanos hands
request a 20 second eye gaze
serve a drink for someone from another faction
ask a stranger for a dance
ask a stranger what their biggest fear is
smell a strangers hair
spank a consenting individual
kiss a consenting individualas
reveal a secret
do a handstand across the dance floor
tell a creative story
compliment someone on their smile
request a 20 second eye gaze
change character
find an animal to stroke
make an instrument out of something odd
tell a stranger that you love them
tell a stranger that you love yourself
start a game of leapfrog
hold someones hand
bow to someone respectable
embrace yo-ur spirit animal
give someone a foot massage
learn to code
warn someone of a grave danger
ask a question with no answer
be a fairy
find the snail
press any key to continue
swap an object with a stranger
go for an adventure
find sally the snail
find something furry and appreciate it
introduce two strangers to each other
nominate a stranger to be your friends
wingman someone that could use your help
give someone a shoulder rub
make it a party
serve someone a drink from another faction
run on the spot for 1 minute
find the pharoah
hug a consenting stranger
hug 3 consenting people in a row
strut around
consetually give someone a hug
tell someone they are the most beautiful person you have ever seen

29
printer/adverbs.txt Normal file
View File

@ -0,0 +1,29 @@
graciously
heroically
confidently
ferociously
happily
emotionally
spritely
majestically
boldly
brightly
cheerfully
eagerly
elegantly
gleefully
innocently
politely
powerfully
victoriously
boastfully
occasionally
casually
mysteriously
seriously
dramatically
flamboyantly
sexually
flirtatiously
awkwardly
saintly

BIN
printer/image.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

BIN
printer/image2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

7
printer/locations.txt Normal file
View File

@ -0,0 +1,7 @@
on the steps
outdoors
in the boiler room
by the DJ
in a dark area
in the auditorium
by a window

View File

@ -3,6 +3,7 @@ from PIL import Image, ImageDraw, ImageFont, ImageOps
import textwrap
import random
print("Print")
with open("printer/locations.txt") as locations:
lines = locations.read().splitlines()
location = random.choice(lines)
@ -15,7 +16,10 @@ with open("printer/adverbs.txt") as adverb:
lines = adverb.read().splitlines()
adverb = random.choice(lines)
im=Image.open("printer/image2.jpg")
if random.randint(0,1):
im=Image.open("printer/image.jpg")
else:
im=Image.open("printer/image2.jpg")
# f = ImageFont.load_default()
f = ImageFont.truetype("printer/SilkRemington-Regular.otf", 40)
@ -28,7 +32,7 @@ text_long = "In the outdoor area, ask someone would you rather be known for alwa
lines = textwrap.wrap(text, width=23)
if len(lines) > 2:
if random.randint(0,1) == 0:
im=Image.open("printer/image.jpg")
else:
im=Image.open("printer/image2.jpg")
@ -44,10 +48,10 @@ w=txt.rotate(-90, expand=1)
print(n)
im.paste( ImageOps.colorize(w, (0,0,0), (0,0,0)), ( (n-5)*20 + 127, 5), w)
im.show()
im.save("image_tmp.jpg")
# im.show()
# im.save("image_tmp.jpg")
raster = StarTSPImage.imageToRaster(im, cut=True)
printer = open('/dev/usb/lp0', "wb")
#printer.write(raster)
printer.write(raster)