SyncSing を起動したとき
app.startスクリプトで使える「きっかけ」「条件」「操作」「制御」の部品を、アプリの画面といっしょに一つずつ説明します。組み立て方は ブロックで組む へ。
スクリプトは「きっかけ」が起きたときに、「手順」を上から順に動かす仕組みです。手順には「操作」と、「もし〜なら」「くり返す」などの「制御」を並べます。「もし〜なら」の中には「条件」を書きます。
図はアプリの画面のまま(見本の値)です。シーン名・効果音の名前などは、使う環境に合わせて変えてください。AI に「こうしたい」と話して作ることもできます(スクリプトアシスタント)。
文字を入れる欄(チャットに送る・読み上げる・OBS のテキストなど)では、きっかけの中身を次の形で差し込めます。
| 書き方 | 中身 |
|---|---|
{user} | 送った人の名前 |
{message} | コメントの本文。クリップボードのきっかけではコピーした文字、投票・予想の終わりでは選ばれた選択肢、別のスクリプトから呼ばれたときは渡された文字 |
{reward} | チャンネルポイントの報酬名 |
{amount} | 金額(スーパーチャット・スーパーステッカー) |
{viewers} | 人数(レイド・同時接続数) |
{song} | 曲名 |
{scene} | シーン名 |
{i} | 「○ 回くり返す」の中で、今が何回目か(1 から) |
{bits} | Bits の個数 |
{gift_count} | ギフトの数 |
{level} | ハイプトレインのレベル |
{title} | 投票・予想の題 |
{seconds} | 広告の秒数 |
{変数の名前} | 変数の中身(例 {カウント}) |
app.startapp.processing_startapp.processing_stopapp.mute_changedmic.loudmic.quietclipboard.copy6 のように 1 つ、または 6-8 のように幅で書きます。空なら何文字でも動きます。A1B2C3 は動き、ABCDEF は動かない)。{message} で使えます。clipboard.wordhttps://discord.gg/ で始まるとき=Discord の招待リンクをコピーしたとき)。{message} で使えます。button.pressobs.stream_startobs.stream_stopobs.record_startobs.record_stopobs.scene_changedchat.command!hello)、「送った人」(だれでも・メンバー・モデレーター・配信者)、「連打よけ(秒)」(同じコマンドが続いても、この秒数のあいだは動かない)。chat.keywordchat.messagetwitch.redeemtwitch.followtwitch.raid{viewers}、来てくれた人は {user}twitch.cheer{bits}。お金ではないtwitch.hype_train_start{level}twitch.hype_train_end{level}twitch.poll_end{message}、題は {title}twitch.prediction_end{message}、題は {title}。取り消したときは動かないtwitch.ad_start{seconds}twitch.ad_endtwitch.sub{gift_count}youtube.superchat{amount}youtube.supersticker{amount}youtube.memberyoutube.member_gift{user}、数は {gift_count}live.viewers{viewers} で使えます。twitch.followerstwitch.subsyoutube.subscriberstime.attime.everysong.startsong.endremote.callhttp://この PC:18490/script/呼び出し名 を呼ぶと動きます。送られた文字は {message}、送った名前は {user} で使えます。script.called{message}「もし」の欄に式を書きます。
==(同じ)!=(違う)>=(以上)<=(以下)> <。含むかどうかは contains(message, "草")。and(かつ)・or(または)・not(ではない)。例 live and time >= 22:00"…" で囲みます。時刻は 22:00 のまま、送った人の種類は引用符なしで書きます(viewer < member < vip < moderator < broadcaster。例 role >= moderator)。カウント >= 5)。一覧には contains(seen, user)・len(names) が使えます。liveliverecordingrecordingscenescene == "参加受付"live_viewerslive_viewers >= 100follower_totalfollower_total >= 1000subscriber_totalsubscriber_total >= 50youtube_subscribersyoutube_subscribers >= 10000timetime >= 21:00weekdayweekday == "土"user_rolerole >= moderatoruseruser == "みか"platformplatform == "twitch"messagecontains(message, "こんにちは")amountamount >= 1000viewersviewers >= 5bitsbits >= 100gift_countgift_count >= 5levellevel >= 3titletitle == "次のゲームは?"secondsseconds >= 60superchat_totalsuperchat_total >= 10000entry_countentry_count >= 10follower_count_todayfollower_count_today >= 10chat_countchat_count(5) >= 30arg1arg1 == "ゲーム"ii == 3varカウント >= 5triggerevent == "chat.command"chat.command)。複数のきっかけを付けたスクリプトで使います。mic_levelmic_level > -10mic.mute_onmic.mute_offapp.estopapp.featureclipboard.setobs.stream_startobs.stream_stopobs.record_startobs.record_stopobs.sceneobs.input_muteobs.input_volumeobs.virtualcamobs.screenshotobs.replay_saveobs.scene_backobs.source_visibleobs.filterobs.textobs.media_restartobs.mediachat.sendchat.deletechat.timeouttwitch.cliptwitch.predictiontwitch.polltwitch.markertwitch.shoutouttts.speaktts.stopoverlay.notice#ff4d4f)、「効果音」(登録した効果音の名前)。overlay.clearbgm.playbgm.stopbgm.volumesound.playsound.stopsong.nextsong.stopnoise.strengtheffect.presetentry.openentry.closeentry.nexttemplate.applypc.shortcutpc.openvar.setvar.addscript.run{message})。script.enablesend.toctrl-waitctrl-ifctrl-repeatctrl-setctrl-forctrl-whilectrl-stopOBS のシーンが「参加受付」のときに、英大文字と数字が混ざった 6 文字(例 A1B2C3)をコピーすると、チャットに「参加コード:A1B2C3」を送ってピン留めします。同じコードは 1 回だけ送ります。
scene == "参加受付" なら送ったコード != message なら(前に送ったコードと違うときだけ){message} を入れる図はアプリの見本の HTML から再現した、見本データによる表示です。実際の表示と異なる場合があります。