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.
| Function | Effect |
|---|---|
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()
alert("Absorption " + round(size), { sound: "fill", key: "abs", cooldown: 3000 })
| Option | Meaning | Default |
|---|---|---|
sound | Sound name (see below) | None |
speak | true to speak the message, or a string to speak instead | Off |
key | Alerts with the same key share one cooldown | The message text |
cooldown | Minimum time in ms between alerts with the same key; minimum 1,000 | 5,000 |
telegram | For a script with a // @telegram line: false to not send this alert, or a string with the Telegram message in HTML | The alert text |
- Returns
trueif the alert was shown,falseif 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()
sound("fill")
| Name | Sound |
|---|---|
place | Short light tick |
fill | Strong click |
partial | Lighter click |
close | Low click |
cancel | Soft tick |
reject | Short double buzz |
arm | High tick |
disarm | Lower tick |
Any other name is an error.
speak()
speak("Wall pulled at " + round(price))
Speaks up to 100 characters in the terminal's language.
log()
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 | |
|---|---|
| Sounds | 1 per 150 ms |
| Voice | 1 per 2 s |
| Alerts | 30 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:
| Setting | Effect |
|---|---|
| Alert sounds | Turns script sounds on or off |
| Voice alerts | Turns script voice on or off |
| Volume | Volume 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.