hopeful fixes

This commit is contained in:
Mute 2024-07-10 02:23:08 +00:00
parent 43463171e2
commit 5a62ce3274

View File

@ -12,6 +12,10 @@
// @match https://www.bondage-europe.com/*
// @match http://localhost:*/*
// ==/UserScript==
// checklist:
// ? OOC blocked
// ? custom lenses aren't updated
// ? custom lenses wrong colour
(async function() {
'use strict';
@ -44,7 +48,7 @@
roll_rgb() {this.next_rgb() && W.ChatRoomCharacterItemUpdate(W.Player, 'Mask')},
start() {return Boolean(this.check('Mask')) && !this.timeout && Boolean(this.timeout = setInterval(() => this.roll_rgb(), 1000))},
stop() {return Boolean(this.check('Mask')) && Boolean(this.timeout) && !(this.timeout = void clearInterval(this.timeout))},
dim() {return !this.check('ItemHead') && Boolean(W.InventoryWear(W.Player, 'AnimeLenses', 'ItemHead', undefined, undefined, 71_240, this.craft) && !void W.ChatRoomCharacterUpdate(W.Player))},
dim() {return !this.check('ItemHead') && !void W.InventoryWear(W.Player, 'AnimeLenses', 'ItemHead', ['#FFFFFF', 'Default', '#FFFFFF', 'Default'], undefined, 71_240, this.craft) && !void W.ChatRoomCharacterUpdate(W.Player)},
clear() {return Boolean(this.check('ItemHead')) && !void W.InventoryRemove(W.Player, 'ItemHead') && !void W.ChatRoomCharacterUpdate(W.Player)},
check(zone) {return U.with(this.item, item => (item && item.Asset.Group.Name === zone) ? item : undefined)},
get item() {return this.zones.map(z => W.InventoryGet(W.Player, z)).find(item => item && item.Asset.Name === 'AnimeLenses') || undefined},
@ -71,11 +75,12 @@
return U.with(cmd(...tokens), r => typeof r === 'boolean' ? (r ? 'success' : 'fail') : String(r))
},
receive(data) { if (!data.Sender) return undefined
W.ChatRoomSendLocal(`<span style="color: #666">${data.Content}</span>`)
const reply = this.admins.includes(data.Sender) ? this.run(data.Content.split(' ')) : 'access denied'
return void W.ChatRoomSendWhisper(data.Sender, `LILY: ${reply}`)
},
}
SDK.hookFunction('SpeechTransformGagGarble', 0, ([text]) => text) // disable garbling
SDK.hookFunction('ChatRoomSendChatMessage', 0, (na, n) => Box.enabled ? n(na) : Boolean(W.ChatRoomSendLocal('<span style="color: red">You try to talk, but nothing comes out.</span>')))
SDK.hookFunction('ChatRoomSendChatMessage', 0, (na, n) => Box.enabled || na[0].startsWith('(') ? n(na) : Boolean(W.ChatRoomSendLocal('<span style="color: red">You try to talk, but nothing comes out.</span>')))
W.ChatRoomRegisterMessageHandler({Priority: -169, Description: 'LILY', Callback: data => data.Type === 'Whisper' && data.Content.startsWith('#LILY') && (Belt.receive(data) || true)})
})()