Squiso 是一款免费且功能强大的自动化工具,可让您使用简单的脚本自定义您的 Twitch 流。

How to Simulate Keyboard Key Presses Using Twitch Channel Points

This script example listens to all Twitch Channel Point redeems and simulates typing "POG" on the keyboard.

脚本示例

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 onTwitchChannelPointRedeem(OnTwitchChannelPointRedeemData data, API api) throws SquisoException { // If the reward name equals "POG" if (data.getRewardName().equals("POG")) { // Wait 5 seconds (5000ms) api.sleep(5000); // Simulate key press SHIFT + p + o + g api.keyPress(KeyboardKey.SHIFT, KeyboardKey.P, KeyboardKey.O, KeyboardKey.G); } } }