Files
Bubberstation/tgui/packages/tgui-say/timers.ts
MrMelbert ce50179f7c Mind readers can read what people are typing (#93059)
## About The Pull Request

When a Mind Reader examines someone who is typing, it will show them
what they are actively typing

<img width="518" height="97" alt="image"
src="https://github.com/user-attachments/assets/8d54aa56-85fc-4e03-b0a3-bfb8e475beff"
/>

No, it won't read OOC messages.

## Why It's Good For The Game

Your next line is, "This sounds really funny for gimmicks like security
interrogations or fortune telling, or for getting the jump on someone as
they try to get the jump on you, or just to be a badass by finishing
people sentences"

## Changelog

🆑 Melbert
add: When a mind reader examines a mob, they'll get a glimpse into what
that mob is currently typing, before they even send the message.
qol: Mind Reader now groups up all the information it gives you in a box
admin: Mind Reader now logs everything the reader gleamed from the
read-ee
/🆑
2025-10-04 01:29:31 +02:00

29 lines
825 B
TypeScript

import { debounce, throttle } from 'tgui-core/timer';
import type { Channel } from './ChannelIterator';
const SECONDS = 1000;
/** Timers: Prevents overloading the server, throttles messages */
export const byondMessages = {
// Debounce: Prevents spamming the server
channelIncrementMsg: debounce(
(visible: boolean) => Byond.sendMessage('thinking', { visible }),
0.4 * SECONDS,
),
forceSayMsg: debounce(
(entry: string, channel: Channel) =>
Byond.sendMessage('force', { entry, channel }),
1 * SECONDS,
true,
),
saveText: debounce(
(entry: string, channel: Channel) =>
Byond.sendMessage('save', { entry, channel }),
1 * SECONDS,
true,
),
// Throttle: Prevents spamming the server
typingMsg: throttle(() => Byond.sendMessage('typing'), 4 * SECONDS),
} as const;