Squiso on ilmainen, tehokas automaatiotyökalu, jonka avulla voit mukauttaa Twitch-streamiasi yksinkertaisilla skripteillä.
Kuinka mykistää OBS Studio -mikrofonisi 10 sekunniksi Twitch-kanavapisteillä
Tämä skriptiesimerkki kuuntelee Twitch-kanavapistepalkintoa ja käskee sitten OBS Studiota mykistämään mikrofonisi 10 sekunniksi.
Esimerkki skriptistä
import com.squiso.*;
import com.squiso.exception.*;
import com.squiso.scripting.*;
import com.squiso.scripting.data.*;
import com.squiso.keyboard.*;
import com.squiso.twitch.*;
import com.squiso.datatypes.*;
import com.squiso.utils.*;
import com.squiso.sysinfo.*;
// Important - Please do not change the row below - otherwise you will get a compilation error!
public class Script_Example extends SquisoScript {
    
    @Override
    public void onTwitchChannelPointRedeem(OnTwitchChannelPointRedeemData data, API api) throws SquisoException {
        // If the reward is "Mute my mic"
        if (data.getRewardName().equals("Mute my mic")) {
            // Compose a TTS message
            SquisoString ttsMessageMuting = new SquisoString(data.getUserName() + " just muted the microphone for 10 seconds!");
            // Play the TTS - all voices can be found here: https://www.squiso.com/voices/
            api.speak("jkzmt8kn", ttsMessageMuting);
            // Specify which OBS input we should mute
            SquisoString inputName = new SquisoString("Mic/Aux");
            // Mute the input
            api.setOBSInputMuted(inputName, true);
            // Specify the 10 seconds wait time (10 seconds is 10*1000=10000 milliseconds)
            SquisoInteger waitDuration = new SquisoInteger(10 * 1000);
            // Do this 10 seconds later
            api.doLater(waitDuration, () -> {
                // Unmute the input
                api.setOBSInputMuted(inputName, false);
                // Compose a new TS message
                SquisoString ttsMessageUnmuted = new SquisoString("Hurray - The microphone enabled again!");
                // Play the TTS - all voices can be found here: https://www.squiso.com/voices/
                api.speak("jkzmt8kn", ttsMessageUnmuted);
            });
        }
    }
}
    