Cara Menampilkan Spesifikasi Komputer !memory dan !specs Anda Saat Ini di Twitch Chat
Contoh skrip ini mendengarkan !memory dan !specs dalam obrolan Twitch dan kemudian menuliskan berbagai informasi tentang sistem dan spesifikasi komputer Anda kembali ke pengguna obrolan Twitch.
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 {
@Override
public void onTwitchChatMessage(OnTwitchChatMessageData data, API api) throws SquisoException {
// If the chat message equals "!memory"
if (data.getMessageText().equals("!memory")) {
// Retrieve various information about your system
SystemInfo si = api.getSystemInfo();
// Compose a chat message
SquisoString chatMessage = new SquisoString("@" + data.getUserName() + " - Current memory usage is " + si.getUsedMemoryGB() + " / " + si.getTotalMemoryGB() + " GB");
// Send it to Twitch chat
api.sendTwitchChatMessage(chatMessage);
}
// If the chat message equals "!specs"
if (data.getMessageText().equals("!specs")) {
// Retrieve various information about your system
SystemInfo si = api.getSystemInfo();
// Compose a chat message
SquisoString chatMessage = new SquisoString("");
chatMessage.append("@" + data.getUserName() + " ");
chatMessage.append("OS: " + si.getOS() + " ");
chatMessage.append("CPU: " + si.getCPU() + " ");
chatMessage.append("GPU: " + si.getGPU() + " ");
chatMessage.append("Current memory: " + si.getUsedMemoryGB() + " / " + si.getTotalMemoryGB() + " GB");
// Send it to Twitch chat
api.sendTwitchChatMessage(chatMessage);
}
}
}