The following is in markdown.

Run the following code in your browser (Chrome) developer console.

const MORSE_CODE_DICT = {
    'A': '·−', 'B': '−···', 'C': '−·−·', 'D': '−··', 'E': '·', 'F': '··−·', 'G': '−−·', 'H': '····',
    'I': '··', 'J': '·−−−', 'K': '−·−', 'L': '·−··', 'M': '−−', 'N': '−·', 'O': '−−−', 'P': '·−−·',
    'Q': '−−·−', 'R': '·−·', 'S': '···', 'T': '−', 'U': '··−', 'V': '···−', 'W': '·−−', 'X': '−··−',
    'Y': '−·−−', 'Z': '−−··', '1': '·−−−−', '2': '··−−−', '3': '···−−', '4': '····−', '5': '·····',
    '6': '−····', '7': '−−···', '8': '−−−··', '9': '−−−−·', '0': '−−−−−'
};

function encryptToMorse(plaintext) {
    const encrypted = [];
    for (const char of plaintext.toUpperCase()) {
        if (char === ' ') {
            encrypted.push('/');
        } else if (MORSE_CODE_DICT[char]) {
            encrypted.push(MORSE_CODE_DICT[char]);
        }
    }
    return encrypted.join(' ');
}

function createNewMessage(text, city, location) {
    const morseCode = encryptToMorse(text);
    const newMessage = {
        morse: morseCode,
        city: city,
        location: location
    };
    console.log(`
const newMessage = {
    morse: "${newMessage.morse}",
    city: "${newMessage.city}",
    location: "${newMessage.location}"
};
`);
    return newMessage;
}

// Example usage
const text = "Hello world"
const city = "Berlin"
const office = "Government Office"
let send = createNewMessage(text, city, office);

Then, in your browser console, to create a message, run the following code.

send = createNewMessage("example message", city, office);

You can reassign the city and office variables to change the location of the message.

city = "Vienna";
office = "Central Post";

To actually send the message, first list the available websockets (again, everything is in the developer console).

queryObjects(WebSocket)

Then, using the array outputted, click the array and find the 0 (meaning first) item. There should only be one item in the array - this is the item which holds the server's websocket. Right click that item (should say something like "https://www.telegraphsimulator.com"), and choose "Store as object as global variable".

Finally, you are able to send message.

To send a message, simply run temp1.send(JSON.stringify(send)).

You can spam this by going in the developer console and pressing the up arrow key to go to your last sent command.

To change the message you send, simply press up a couple more times to find the createNewMessage command, and run it again with new text.

send = createNewMessage("new message", city, office);

Then just send the message you want to again (i.e. temp1.send(JSON.stringify(send))).

And that's it!
ℹ️ Bypass script: : running...

Edit
Pub: 07 Mar 2025 22:40 UTC
Views: 325