• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Twitch Chat Integration

Zeak6464

Zeak #3205 - Discord
  • 1,101
    Posts
    12
    Years
    Twitch Chat Integration

    Requirements:
    1. Streamlabs Chatbot Program
    2. Chatbot Twitch Account
    3. Pokemon Essentials

    Script:
    Code:
    module Graphics
      @old_update = method(:update)
      module_function
      def update
        if File.exist?('twitch.txt') && File.size('twitch.txt') > 0
          data = nil
          File.open('twitch.txt') do |f| data = f.read end
          File.delete('twitch.txt')
          begin
            eval(data)
          rescue Exception
            p $!.message
          end
        end
        @old_update.call
      end
    end

    Bot Example: (this is done in "Streamlabs Chatbot")
    1. Go to Commands
    2. Make a new command called "!additem"
    3. Edit everything else for the command
    4. in Response put $overwritefile("D:\Pokemon Assets\Essentials\17\twitch.txt","(0) rescue nil;Kernel.pbItemBall(:POTION)")

    D:\Pokemon Assets\Essentials\17\twitch.txt is where the game reads the text file

    (0) rescue nil; must be put before each code you want to run

    Kernel.pbItemBall(:POTION) is the code for the game to run

    Documentation:
    P.E Wiki
    Chatbot PDF


    From Mcgriffin big WARNING!!:
    To people reading this thread, please be very careful what you put in twitch.txt. Don't let any text from the Twitch chat end up in that file or you'll run the risk of letting people run harmful commands on your computer (e.g. formatting the disk, installing a keylogger, etc). To a first approximation eval is only safe for commands that you 100% wrote yourself.
     
    Last edited:
    To other people reading this thread, please be very careful what you put in twitch.txt. Don't let any text from the Twitch chat end up in that file or you'll run the risk of letting people run harmful commands on your computer (e.g. formatting the disk, installing a keylogger, etc). To a first approximation eval is only safe for commands that you 100% wrote yourself.
     
    Back
    Top