Twitch Plays (Let twitch chat simulate input)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
baconhawka7x
Party member
Posts: 495
Joined: Mon Nov 21, 2011 7:05 am
Location: Oregon, USA
Contact:

Twitch Plays (Let twitch chat simulate input)

Post by baconhawka7x »

Made a fairly simple little app with love2d that simulates keyboard input based on incoming chat messages from your twitch chat.

Github: https://github.com/gagehenderson/Twitch-Plays-Love2d
Example of it in action: https://www.twitch.tv/callgage/clip/Inq ... kDy0aKD1Q_

Image
(On the left is all app logging and communication with the irc. On the right lists all currently pressed keys & their remaining durations).

Only has very simple functionality right now, you can basically define a command, what key that command is associated with and how long it should be pressed for. You can organize these into configs for different games, right now I only have one for trackmania, here's a snipppet:

Code: Select all

return {
    ["!holdgas"] = {
        key = GAS_KEY,
        duration = HOLD
    },
    ["!releasegas"] = {
        key = GAS_KEY,
        release = true
    },
    ["!tinygas"] = {
        key = GAS_KEY,
        duration = TINY
    },
    ["!shortgas"] = {
        key = GAS_KEY,
        duration = SHORT
    },
    ["!mediumgas"] = {
        key = GAS_KEY,
        duration = MEDIUM
    },
    -- ...
 
(GAS_KEY = "w", other constants are set to various small numbers).

In the future I may add some more functionality like mouse input - Also the ability to pause / resume input simulation - And maybe even a stream overlay to tell the chat whether or not they are currently able to play.

I also learned that for very fast chats, messages tend to come in batches, and the input can appear very jittery or like it is only working for a few moments at a time as each batch of messages comes in (instead of a steady stream), so I may also try to account for that.

Tested this out on my small stream with a few people and it was pretty fun! I might try to get in touch with some larger streamers and see if they'd want to try it out. If anyone here ends up using it lmk I would love to see it in action! Instructions for setting it up are in the readme.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests