updated some shit

This commit is contained in:
KungKurt 2025-02-16 03:48:25 +01:00
parent f4e02337b4
commit f07461bbb8
3 changed files with 22 additions and 5 deletions

View File

@ -31,7 +31,7 @@
} }
] ]
}, },
"scripts": [ "esmodules": [
"scripts/puckochat/main.js" "scripts/puckochat/main.js"
], ],
"url": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module", "url": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module",

View File

@ -1,17 +1,17 @@
import "scripts/puckochat/commands" import { puckocommand } from "commands"
Hooks.on("init", function() { Hooks.on("init", async function() {
console.log("[puckoprutt] Hello Init"); console.log("[puckoprutt] Hello Init");
}); });
Hooks.on("ready", function() { Hooks.on("ready", async function() {
console.log("[puckoprutt] Hello Ready"); console.log("[puckoprutt] Hello Ready");
}); });
Hooks.on("chatMessage", (log, message, data) => { Hooks.on("chatMessage", (log, message, data) => {
to_send = ""; to_send = "";
console.log("[puckoprutt] chat!"); console.log("[puckoprutt] chat!");
if(message[0] === "!") to_send = commands.puckocommand(log, message.slice(1).split(" "), data); if(message[0] === "!") to_send = puckocommand(isGM, user, world, log, message.slice(1).split(" "), data);
if(to_send !== "") { if(to_send !== "") {
ChatMessage.create({ ChatMessage.create({

View File

@ -0,0 +1,17 @@
export async function talk_as(idx, name, theatre_idx, message, emote, delay=4500) {
theatre.functions.activateStagedByID(theatre_idx);
theatre._sendTypingEvent();
theatre.setUserTyping(game.user.id, theatre.speakingAs);
await new Promise(r => setTimeout(r, 800));
theatre._sendTypingEvent();
theatre.setUserTyping(game.user.id, theatre.speakingAs);
theatre.setEmoteForInsertById(emote, "theatre-"+idx);
await new Promise(r => setTimeout(r, 700));
ChatMessage.create({
user: game.user.id,
speaker: ChatMessage.getSpeaker({token: canvas.tokens.objects.getChildByName(name)}),
content: message
});
await new Promise(r => setTimeout(r, delay));
theatre.setEmoteForInsertById("none", "theatre-"+idx);
}