Docs·TapeScript

Alerts, sound & voice

TapeScript alerts with trade sounds, voice and Telegram — alert(), sound(), speak(), log(), cooldowns, rate limits, the Sound tab and your own Telegram bot.

FunctionEffect
alert(text, options)Writes the message to the Console; can play a sound and speak
sound(name)Plays a sound
speak(text)Speaks the text
log(...values)Writes a line to the Console

The sounds are the same as the terminal's order sounds.

alert()

JavaScript
alert("Absorption " + round(size), { sound: "fill", key: "abs", cooldown: 3000 })
OptionMeaningDefault
soundSound name (see below)None
speaktrue to speak the message, or a string to speak insteadOff
keyAlerts with the same key share one cooldownThe message text
cooldownMinimum time in ms between alerts with the same key; minimum 1,0005,000
telegramFor a script with a // @telegram line: false to not send this alert, or a string with the Telegram message in HTMLThe alert text
  • Returns true if the alert was shown, false if a cooldown or rate limit blocked it.
  • The message is cut to 140 characters. Emoji are removed.
  • If the message contains a changing number, set key. Without it, every different message has its own cooldown.

sound()

JavaScript
sound("fill")
NameSound
placeShort light tick
fillStrong click
partialLighter click
closeLow click
cancelSoft tick
rejectShort double buzz
armHigh tick
disarmLower tick

Any other name is an error.

speak()

JavaScript
speak("Wall pulled at " + round(price))

Speaks up to 100 characters in the terminal's language.

log()

JavaScript
log("avg print", round(avg.mean * 100) / 100, "buy 5s", round(buyVol.sum))

Writes the values to the Console, separated by spaces. The Console keeps the latest 500 lines.

Rate limits

Limit
Sounds1 per 150 ms
Voice1 per 2 s
Alerts30 per minute per script

Blocked alerts are counted in the Console as +N alerts rate-limited.

While a script replays stored data (@history), alert returns false and sound and speak do nothing. log still writes to the Console.

Sound tab

The Sound tab in the widget applies to TapeScript only:

SettingEffect
Alert soundsTurns script sounds on or off
Voice alertsTurns script voice on or off
VolumeVolume of script sounds

Telegram

A script with a // @telegram <bot token> line also sends its alert() messages to that Telegram bot, formatted with HTML. Each script can use its own bot. Setup, the message template and examples: Telegram.