Code Monkey home page Code Monkey logo

psychbot's Introduction

PsychBot

Mastodon bot posting quotes from Psychonauts. The script to post quotes is quite simple, see psychbot.py. The actual complexity is in creating the quote database.

This script is repsonsible for the quotes posted at https://botsin.space/@psychonauts

Generating the quote database

To generate the quote database from the game files (the PC release) you first need to use the the GNU "strings" utility on the localization files. From the directory Psychonauts/WorkResource/Localization/English

strings -eS *.lub > strings_en.txt

The generated file is fed to extract-quotes.py script, which will generate the quotes.db file that is used by psychbot.py.

./extract-quotes.py strings_en.txt

The strings command simply extracts all C-style strings from the compiled lua files. This includes some garbage, but that will be filtered out by the extract-quotes.py script.

Every quote starts with a 9 character long identifier, followed by a single line of text. The identifier looks like this: ASBV005RA. The first 4 characters are a level, area, or cinematic identifier. Followed by 3 digit number. Which all are not really interesting. The last 2 characters however are interesting. They identify the speaker, this is probably used to show a portrait next to the text. There is no lookup table for the 2 character speaker ID to the full name, a lookup table for this was created in the extract-quotes.py script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.