aboutsummaryrefslogtreecommitdiff
path: root/scenario/client.js
blob: 38412c57575d29b1e2ee56e1f7c51db99b4a2496 (plain)
1
2
3
4
5
6
7
8
9
function scenar(ns, emote, cb) {
    if (!require('@electron/remote').getCurrentWindow().voice) { return; };

    min = 0;
    max = lang.scenario[ns].length - 1;
    id = Math.floor(Math.random() * (max - min + 1) + min);

    require('@electron/remote').getCurrentWindow().webContents.send("scenario", {message:lang.scenario[ns][id],lang:lp,namespace:ns,id:id,emote:emote,callback:cb});
}