Compare commits

...

5 Commits

3 changed files with 98 additions and 44 deletions

View File

@ -1,3 +1,5 @@
# rct-guest
rct-guest looks too intense for me!
The information in `data.json` was obtained from [the RCT wiki](https://rct.fandom.com/wiki/RollerCoaster_Tycoon_Wiki). `data.json` is available under a [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/) license. The information was compiled from multiple pages and reorganised into the JSON format.

View File

@ -48,10 +48,15 @@
"I want to go on something more thrilling than {}."
],
"items": [
"I've already got a {}.",
"I can't afford {}.",
"I'm not paying that much for {}!"
],
"items-edible": [
"I've not finished my {} yet."
],
"items-other": [
"I've already got a {}."
],
"stalls": [
"I can't find {}!"
],
@ -143,48 +148,52 @@
"Submarine Ride"
],
"stalls": {
"Fruity Ices Stall": "Fruity Ice",
"Chip Shop": "Chips",
"Pizza Stall": "Pizza",
"Burger Bar": "Burger",
"Drinks Stall": "Drink",
"Candyfloss Stall": "Candyfloss",
"Popcorn Stall": "Popcorn",
"Balloon Stall": "Balloon",
"Souvenir Stall": "Cuddly Toy",
"Information Kiosk": "Park Map",
"Hot Dog Stall": "Hot Dog",
"Sea Food Stall": "Fried Tentacle",
"Toffee Apple Stall": "Toffee Apple",
"Hat Stall": "Hat",
"Fried Chicken Stall": "Fried Chicken",
"Coffee Shop": "Coffee",
"Lemonade Stall": "Lemonade",
"Doughnut Shop": "Doughnut",
"T-Shirt Stall": "T-Shirt",
"Beef Noodles Stall": "Beef Noodles",
"Chicken Nuggets Stall": "Chicken Nuggets",
"Fried Rice Noodles Stall": "Fried Rice Noodles",
"Funnel Cake Shop": "Funnel Cake",
"Ice Cream Cone Stall": "Ice Cream Cone",
"Meatball Soup Stall": "Meatball Soup",
"Pretzel Stall": "Pretzel",
"Roast Sausage Stall": "Roast Sausage",
"Sub Sandwich Stall": "Sub Sandwich",
"Wonton Soup Stall": "Wonton Soup",
"Hot Chocolate Stall": "Hot Chocolate",
"Iced Tea Stall": "Iced Tea",
"Soybean Milk Stall": "Soybean Milk",
"Star Fruit Drink Stall": "Star Fruit Drink",
"Sujeonggwa Stall": "Sujeonggwa",
"Sunglasses Stall": "Sunglasses",
"Art Deco Food Stall": "Noodles",
"Neptune's Seafood Stall": "Tentacles",
"Toffee Apple Market Stall": "Toffee Apple",
"Witches Brew Soup": "Wonton Soup",
"Lemonade Market Stall": "Lemonade",
"Moon Juice": "Moon Juice",
"Soft Toy Stall": "Cuddly Toy"
"edible": {
"Fruity Ices Stall": "Fruity Ice",
"Chip Shop": "Chips",
"Pizza Stall": "Pizza",
"Burger Bar": "Burger",
"Drinks Stall": "Drink",
"Candyfloss Stall": "Candyfloss",
"Popcorn Stall": "Popcorn",
"Hot Dog Stall": "Hot Dog",
"Sea Food Stall": "Fried Tentacle",
"Toffee Apple Stall": "Toffee Apple",
"Fried Chicken Stall": "Fried Chicken",
"Coffee Shop": "Coffee",
"Lemonade Stall": "Lemonade",
"Doughnut Shop": "Doughnut",
"Beef Noodles Stall": "Beef Noodles",
"Chicken Nuggets Stall": "Chicken Nuggets",
"Fried Rice Noodles Stall": "Fried Rice Noodles",
"Funnel Cake Shop": "Funnel Cake",
"Ice Cream Cone Stall": "Ice Cream Cone",
"Meatball Soup Stall": "Meatball Soup",
"Pretzel Stall": "Pretzel",
"Roast Sausage Stall": "Roast Sausage",
"Sub Sandwich Stall": "Sub Sandwich",
"Wonton Soup Stall": "Wonton Soup",
"Hot Chocolate Stall": "Hot Chocolate",
"Iced Tea Stall": "Iced Tea",
"Soybean Milk Stall": "Soybean Milk",
"Star Fruit Drink Stall": "Star Fruit Drink",
"Sujeonggwa Stall": "Sujeonggwa",
"Art Deco Food Stall": "Noodles",
"Neptune's Seafood Stall": "Tentacles",
"Toffee Apple Market Stall": "Toffee Apple",
"Witches Brew Soup": "Wonton Soup",
"Lemonade Market Stall": "Lemonade",
"Moon Juice": "Moon Juice"
},
"other": {
"Balloon Stall": "Balloon",
"Souvenir Stall": "Cuddly Toy",
"Information Kiosk": "Park Map",
"Hat Stall": "Hat",
"T-Shirt Stall": "T-Shirt",
"Sunglasses Stall": "Sunglasses",
"Soft Toy Stall": "Cuddly Toy"
}
}
}
}

45
post.py Normal file → Executable file
View File

@ -31,4 +31,47 @@ client = Mastodon(
api_base_url=cfg['site'])
# make a post!
# if you delete this line, you can also remove the random module from the imports list.
data = json.load(open('data.json', 'r'))
def get_object(kind):
num = random.choice([1, 1, 1, 1, 1, 2, 2, 3])
if kind == "rides":
return "{} {}".format(random.choice(data['objects']['thrilling-rides'] + data['objects']['gentle-rides']), num)
elif kind in ["gentle-rides", "thrilling-rides"]:
return "{} {}".format(random.choice(data['objects'][kind]), num)
elif kind == "items":
return random.choice(list(data['objects']['stalls']['edible'].values()) + list(data['objects']['stalls']['other'].values()))
elif kind == "items-edible":
return random.choice(list(data['objects']['stalls']['edible'].values()))
elif kind == "items-other":
return random.choice(list(data['objects']['stalls']['other'].values()))
elif kind == "stalls":
return "{} {}".format(random.choice(list(data['objects']['stalls']['edible'].keys()) + list(data['objects']['stalls']['other'].keys())), num)
elif kind == "item-stall":
stalls_weighted = []
for key in data['objects']['stalls']:
for i in range(len(data['objects']['stalls'][key])):
stalls_weighted.append(key)
stall_type = random.choice(stalls_weighted)
choice = random.choice(list(data['objects']['stalls'][stall_type].items()))[::-1]
stall = "{} {}".format(choice[1], num)
return (choice[0], stall)
thoughts_weighted = []
for key in data['thoughts']:
for i in range(len(data['thoughts'][key])):
thoughts_weighted.append(key)
thought_type = random.choice(thoughts_weighted)
thought = random.choice(data['thoughts'][thought_type])
if thought_type == "plain":
pass
elif thought_type == "item-stall":
objects = get_object(thought_type)
thought = thought.format(objects[0], objects[1])
else:
thought = thought.format(get_object(thought_type))
client.status_post(thought)