Squiso adalah alat otomatisasi gratis dan canggih yang memungkinkan Anda menyesuaikan aliran Twitch Anda menggunakan skrip sederhana.

Cara Membuat Penghitung Kematian dengan Efek Suara di Obrolan Twitch

Contoh skrip ini mendengarkan peningkatan (atau penurunan) penghitung kematian dan memainkan efek suara audio dengan mendengarkan perintah obrolan Twitch tertentu. Penghitung kematian disimpan dalam sebuah berkas sehingga OBS Studio dapat dengan mudah menampilkannya saat streaming.

Tonton Videonya

Contoh Skrip

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 { // Create a death counter integer variable, assign it to 0 as default SquisoInteger deathCounter = new SquisoInteger(0); // When the script is initiated @Override public void onInitiated(API api) throws SquisoException { // If the file "death_counter_value.txt" exists if (FileUtil.exists("death_counter_value.txt")) { // Get the numeric value from the file "counter.txt" deathCounter = SquisoInteger.readFromFile("death_counter_value.txt"); } } @Override public void onTwitchChatMessage(OnTwitchChatMessageData data, API api) throws SquisoException { // If the user is NOT the broadcaster and is NOT a moderator // End here by doing a return if (!data.isUserBroadcaster() && !data.isUserModerator()) { return; } // If the message is "!dc" or "!dc up" if (data.getMessageText().equals("!dc") || data.getMessageText().equals("!dc up")) { // Increase the counter deathCounter.increment(); // Play a dramatic death sound api.playAudio("mario_death.mp3"); } // If the message is "!dc down" if (data.getMessageText().equals("!dc down")) { // Decrease the counter deathCounter.decrement(); } // Write the numeric file in case we restart Squiso deathCounter.writeToFile("death_counter_value.txt"); // Compose what should be in the file for OBS Studio SquisoString contents = new SquisoString("Deaths: " + deathCounter); // Write the file that is displayed to OBS Studio contents.writeToFile("death_counter_obs.txt"); } }