• General
  • Accounts
  • FAQ
  • Getting Started
  • Getting Started
  • Home
  • Tutorials
  • Usage & Requirements
  • Usage Requirements
  • Preview Program
  • Uninstall
  • Platforms
  • YouTube Overlay Widget
  • Twitch
  • Twitch Action
  • Twitch Channel Point Commands
  • Twitch Bits Commands
  • Kick
  • Kick Action
  • Kick Channel Point Commands
  • Kick Kicks Commands
  • Integrations
  • Microsoft Azure Speech
  • Lumia Stream
  • TTS.Monster
  • Pulsoid
  • Tiltify
  • TipeeeStream
  • XSplit
  • Streamlabs
  • Streamlabs
  • Streamlabs Desktop (Streamlabs OBS)
  • Infinite Album
  • Patreon
  • Streamloots
  • Streamloots Card Commands
  • Streamloots
  • mtion studio
  • OvrStream
  • VTube Studio
  • VTS P.O.G.
  • Loupedeck
  • Amazon Polly
  • Discord
  • Rainmaker
  • Responsive Voice
  • Crowd Control
  • Crowd Control Commands
  • Crowd Control
  • OBS Studio
  • JustGiving
  • Stream Deck
  • Twitter
  • Twitch Interactive Throwing System
  • StreamElements
  • TreatStream
  • SAMMI
  • Pixel Chat
  • PolyPop
  • Stream Avatars
  • IFTTT
  • Donor Drive
  • Voicemod
  • Google Cloud TTS
  • Meld Studio
  • Features
  • Moderation
  • Inventory
  • Consumables
  • Overlays
  • Custom Overlay Widget
  • End Credits Overlay Widget
  • Chat Overlay Widget
  • Video Overlay Widget
  • Label Overlay Widget
  • Image Overlay Widget
  • Stream Boss Overlay Widget
  • Overlays & Alerts
  • Overlay Widgets
  • Wheel Overlay Widget
  • Persistent Timer Overlay Widget
  • Leaderboard Overlay Widget
  • Poll Overlay Widget
  • Text Overlay Widget
  • Overlay
  • Event List Overlay Widget
  • Game Queue Overlay Widget
  • Persistent Emote Effect Overlay Widget
  • Goal Overlay Widget
  • HTML Overlay Widget
  • Quotes
  • Stream Pass
  • Giveaways
  • Chat
  • Rank
  • Actions
  • Counter Action
  • Action Groups
  • Input Action
  • Sound Action
  • Special Identifier Action
  • Script Action
  • Streaming Software Action
  • Actions
  • Group Action
  • Web Request Action
  • Text To Speech Action
  • Conditional Action
  • Random Action
  • Repeat Action
  • Wait Action
  • Serial Action
  • Consumable Action
  • File Action
  • External Program Action
  • Game Queue
  • Users
  • Events & Triggers
  • Statistics
  • Redemption Store
  • Commands
  • Command History
  • Command Action
  • Community Commands
  • Timer Commands
  • Game Commands
  • Chat Commands
  • Pre-Made Chat Commands
  • Webhook Commands
  • Commands
  • Event Commands
  • Timers
  • Currency
  • Music Player
  • Reference
  • Special Identifiers
  • Mix It Up Ambassadors
  • Services
  • Developer API
  • Integrations
  • scriptaction.png

    The Script action allows you to add code scripts to your commands that will be run when the action is triggered. This allows you to build more complex logic that can be done within regular actions, but without needing to write an entirely separate program. Scripts can be written in either C#, Python, or Javascript.

    There is no unique functionality provided in the Script action to directly interact with Mix It Up, the Script action simply is a means to perform more complex logic in a simpler form for experienced users. However, you are able to leverage the Mix It Up Developer API from inside your Script action to perform some operations within Mix It Up.

    Special Identifier replacement is supported within the text of the script.

    Any value returned from the script when it is run will be stored in the Special Identifier $scriptresult which can be leveraged in subsequent action.

    scriptactionusage.png

    C#

    C# code is compiled and run natively within Mix It Up using the System.CodeDom.Compiler.CompilerResults class and the System.Reflection classes. In the event of a compilation or run-time error, the resulting error message will be saved to the $scriptresult Special Identifier. Using statements are allowed for .NET native namespace, but leveraging libraries outside of those are not possible. A dedicated application would need to be written and run with the External Program Action

    The C# code template provided must be adhered to, but you can add additional functions or change the code within the Run() function. The code must return a result at the end of the Run() function, but you do not need to use the result if you do not wish to. Just ensure that some value is returned at the end. Whatever is returned from the Run() function is what will be stored within the $scriptresult Special Identifier.

    Python

    Python scripts are run directly via the Python interpreter and require a local installation of Python on your PC by running directly via the Python interpreter. You must set the Executable location for Python before any Python scripts can be used under Settings -> Commands. In the event of a compilation or run-time error, the resulting error message will be saved to the $scriptresult Special Identifier.

    Because Python scripts are run using the Python interpretter, you can reference any external libraries you wish. However unlike running a Python script via the External Program Action where there is a physical file location, Python scripts via the Script Action will have it’s working directoy default to the Mix It Up installation folder. So it is important that any files or libraries you reference must use absolute file paths to avoid issues.

    Python console output and errors are parsed and used to populate the $scriptresult Special Identifier. Any result you wish to return much be written to standard output using the print() function in Python.

    Javascript

    Javascript scripts are run using the Mix It Up Overlay. You to leverage external libraries by including them in the Overlay Endpoint via customization under Settings -> Overlay. In the event of a compilation or run-time error, there are no error messages logged. As such, you will need to leverage the F12 Developer Console in a regular web browser (Edge, Chrome, Firefox) to diagnose any issues that might exist in your code.

    The Javascript code template provided must be adhered to, but you can add additional functions or change the code within the run() function. The code must return a result at the end of the run() function, but you do not need to use the result if you do not wish to. Just ensure that some value is returned at the end. Whatever is returned from the run() function is what will be stored within the $scriptresult Special Identifier.

    Choose which cookies to allow. Your preference is saved for 6 months.

    Necessary
    Required for the site to function correctly. Cannot be disabled.
    Analytics
    Helps us understand how visitors use the site. No personal data is shared with third parties.