Squiso on tasuta võimas automatiseerimistööriist, mis võimaldab teil kohandada oma Twitchi voogu lihtsate skriptide abil.
Kuidas näidata Jeff Bezose pilti OBS Studios, kui Twitchi reklaamid käivituvad
See skripti näide lülitab Jeff Bezose pildi OBS Studios, kui Twitchi reklaam algab ja lõpeb.
Skripti näide
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.*;
// Important - Please do not change the row below - otherwise you will get a compilation error!
public class Script_Example extends SquisoScript {
@Override
public void onTwitchAd(OnTwitchAdData data, API api) throws SquisoException {
// Get the ad duration in seconds
SquisoInteger durationSeconds = data.getDuration();
// Specify the OBS scene
SquisoString sceneName = new SquisoString("gaming");
// Specify the OBS scene item
SquisoString itemName = new SquisoString("jeff_bezos");
// Show the scene item
api.setOBSSceneItemVisibility(sceneName, itemName, true);
// Send a chat announcement
SquisoString announcementMessageStarted = new SquisoString("Ads started!");
api.sendTwitchChatAnnouncement(announcementMessageStarted);
// Specify the total time the item should be visible
SquisoInteger waitDuration = new SquisoInteger(durationSeconds.get() * 1000);
api.doLater(waitDuration, () -> {
// Hide the scene item
api.setOBSSceneItemVisibility(sceneName, itemName, false);
// Send a chat announcement
SquisoString announcementMessageEnded = new SquisoString("Ads ended!");
api.sendTwitchChatAnnouncement(announcementMessageEnded);
});
}
}