I hate humanity
This commit is contained in:
parent
9d96d1ecd8
commit
f63826a1b0
90
ambient.d.ts
vendored
90
ambient.d.ts
vendored
|
@ -1,45 +1,45 @@
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
||||||
/* eslint-disable @typescript-eslint/member-delimiter-style */
|
/* eslint-disable @typescript-eslint/member-delimiter-style */
|
||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
/* eslint-disable @typescript-eslint/semi */
|
/* eslint-disable @typescript-eslint/semi */
|
||||||
|
|
||||||
declare namespace LILY {
|
declare namespace LILY {
|
||||||
interface Utils {
|
interface Utils {
|
||||||
with<V, R>(value: V, callback: (v: V) => R): R // A silly helper to kinda curry values
|
with<V, R>(value: V, callback: (v: V) => R): R // A silly helper to kinda curry values
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Box {
|
interface Box {
|
||||||
enable(): void
|
enable(): void
|
||||||
disable(): void
|
disable(): void
|
||||||
get equipped(): boolean
|
get equipped(): boolean
|
||||||
get enabled(): boolean
|
get enabled(): boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Eyes {
|
interface Eyes {
|
||||||
zones: AssetGroupName[]
|
zones: AssetGroupName[]
|
||||||
craft: CraftingItem
|
craft: CraftingItem
|
||||||
rgb: string[]
|
rgb: string[]
|
||||||
timeout: NodeJS.Timeout | undefined
|
timeout: NodeJS.Timeout | undefined
|
||||||
set_rgb(item: Item, index: number): boolean
|
set_rgb(item: Item, index: number): boolean
|
||||||
next_rgb(): boolean | undefined
|
next_rgb(): boolean | undefined
|
||||||
roll_rgb(): void
|
roll_rgb(): void
|
||||||
start(): boolean
|
start(): boolean
|
||||||
stop(): boolean
|
stop(): boolean
|
||||||
dim(): boolean
|
dim(): boolean
|
||||||
clear(): boolean
|
clear(): boolean
|
||||||
check(zone: AssetGroupName): Item | undefined
|
check(zone: AssetGroupName): Item | undefined
|
||||||
get item(): Item | undefined
|
get item(): Item | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommandCB = (...arguments: string[]) => unknown
|
type CommandCB = (...arguments: string[]) => unknown
|
||||||
type Command<T> = Record<string, T | CommandCB>
|
type Command<T> = Record<string, T | CommandCB>
|
||||||
interface Commands extends Command<Commands> {}
|
interface Commands extends Command<Commands> {}
|
||||||
interface Belt {
|
interface Belt {
|
||||||
admins: number[]
|
admins: number[]
|
||||||
cli: Commands
|
cli: Commands
|
||||||
is_cb(subject: Commands | CommandCB): subject is CommandCB
|
is_cb(subject: Commands | CommandCB): subject is CommandCB
|
||||||
run(tokens: string[]): string
|
run(tokens: string[]): string
|
||||||
receive(data: ServerChatRoomMessage): undefined
|
receive(data: ServerChatRoomMessage): undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
164
lily.user.js
164
lily.user.js
|
@ -1,82 +1,82 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name LILY
|
// @name LILY
|
||||||
// @namespace https://code.fleshless.org/mute
|
// @namespace https://code.fleshless.org/mute
|
||||||
// @version 0.0.1
|
// @version 0.0.1
|
||||||
// @description Lily's Integrated Logic Yoke
|
// @description Lily's Integrated Logic Yoke
|
||||||
// @grant none
|
// @grant none
|
||||||
// @author Mute
|
// @author Mute
|
||||||
// @require https://code.fleshless.org/mute/LILY/raw/branch/mistress/bcmodsdk-1.2.0.mjs
|
// @require https://code.fleshless.org/mute/LILY/raw/branch/mistress/bcmodsdk-1.2.0.mjs
|
||||||
// @match https://bondageprojects.elementfx.com/*
|
// @match https://bondageprojects.elementfx.com/*
|
||||||
// @match https://www.bondageprojects.elementfx.com/*
|
// @match https://www.bondageprojects.elementfx.com/*
|
||||||
// @match https://bondage-europe.com/*
|
// @match https://bondage-europe.com/*
|
||||||
// @match https://www.bondage-europe.com/*
|
// @match https://www.bondage-europe.com/*
|
||||||
// @match http://localhost:*/*
|
// @match http://localhost:*/*
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const W = /** @type {Window & typeof globalThis & {bcModSdk: import('bondage-club-mod-sdk').ModSDKGlobalAPI}} */ (window)
|
const W = /** @type {Window & typeof globalThis & {bcModSdk: import('bondage-club-mod-sdk').ModSDKGlobalAPI}} */ (window)
|
||||||
const SDK = W.bcModSdk.registerMod({name: GM_info.script.name, fullName: GM_info.script.description || '', version: GM_info.script.version, repository: 'finger://your.mom'})
|
const SDK = W.bcModSdk.registerMod({name: GM_info.script.name, fullName: GM_info.script.description || '', version: GM_info.script.version, repository: 'finger://your.mom'})
|
||||||
/** @type {LILY.Utils} */ const U = {
|
/** @type {LILY.Utils} */ const U = {
|
||||||
with: (v, f) => f(v),
|
with: (v, f) => f(v),
|
||||||
}
|
}
|
||||||
/** @type {LILY.Box} */ const Box = {
|
/** @type {LILY.Box} */ const Box = {
|
||||||
enable() {},
|
enable() {},
|
||||||
disable() {},
|
disable() {},
|
||||||
get equipped() {return false},
|
get equipped() {return false},
|
||||||
get enabled() {return this.equipped && false},
|
get enabled() {return this.equipped && false},
|
||||||
}
|
}
|
||||||
/** @type {LILY.Eyes} */ const Eyes = { // #9C0000 156 0 0
|
/** @type {LILY.Eyes} */ const Eyes = { // #9C0000 156 0 0
|
||||||
rgb: [
|
rgb: [
|
||||||
'#990000', '#990f00', '#991f00', '#992e00', '#993d00', '#994d00', '#995c00', '#996b00', '#997a00', '#998a00',
|
'#990000', '#990f00', '#991f00', '#992e00', '#993d00', '#994d00', '#995c00', '#996b00', '#997a00', '#998a00',
|
||||||
'#999900', '#8a9900', '#7a9900', '#6b9900', '#5c9900', '#4d9900', '#3d9900', '#2e9900', '#1f9900', '#0f9900',
|
'#999900', '#8a9900', '#7a9900', '#6b9900', '#5c9900', '#4d9900', '#3d9900', '#2e9900', '#1f9900', '#0f9900',
|
||||||
'#009900', '#00990f', '#00991f', '#00992e', '#00993d', '#00994d', '#00995c', '#00996b', '#00997a', '#00998a',
|
'#009900', '#00990f', '#00991f', '#00992e', '#00993d', '#00994d', '#00995c', '#00996b', '#00997a', '#00998a',
|
||||||
'#009999', '#008a99', '#007a99', '#006b99', '#005c99', '#004d99', '#003d99', '#002e99', '#001f99', '#000f99',
|
'#009999', '#008a99', '#007a99', '#006b99', '#005c99', '#004d99', '#003d99', '#002e99', '#001f99', '#000f99',
|
||||||
'#000099', '#0f0099', '#1f0099', '#2e0099', '#3d0099', '#4d0099', '#5c0099', '#6b0099', '#7a0099', '#8a0099',
|
'#000099', '#0f0099', '#1f0099', '#2e0099', '#3d0099', '#4d0099', '#5c0099', '#6b0099', '#7a0099', '#8a0099',
|
||||||
'#990099', '#99008a', '#99007a', '#99006b', '#99005c', '#99004d', '#99003d', '#99002e', '#99001f', '#99000f',
|
'#990099', '#99008a', '#99007a', '#99006b', '#99005c', '#99004d', '#99003d', '#99002e', '#99001f', '#99000f',
|
||||||
],
|
],
|
||||||
timeout: undefined,
|
timeout: undefined,
|
||||||
craft: {Item: 'AnimeLenses', Name: 'Akihabara souvenir', Description: 'you will never be the same uwu', Color: '#FFFFFF,Default,#FFFFFF,Default', Property: 'Thick', Lock: '', Private: true, ItemProperty: {}, Type: null, TypeRecord: null, MemberNumber: 71_240, MemberName: 'Mute'},
|
craft: {Item: 'AnimeLenses', Name: 'Akihabara souvenir', Description: 'you will never be the same uwu', Color: '#FFFFFF,Default,#FFFFFF,Default', Property: 'Thick', Lock: '', Private: true, ItemProperty: {}, Type: null, TypeRecord: null, MemberNumber: 71_240, MemberName: 'Mute'},
|
||||||
zones: ['ItemHead', 'Mask'],
|
zones: ['ItemHead', 'Mask'],
|
||||||
set_rgb(item, n) {item.Color = [this.rgb[n], 'Default', this.rgb[n], 'Default']; return true},
|
set_rgb(item, n) {item.Color = [this.rgb[n], 'Default', this.rgb[n], 'Default']; return true},
|
||||||
next_rgb() {return !this.check('ItemHead') && U.with(this.check('Mask'), i => i && U.with(this.rgb.indexOf(i.Color?.[0] || this.rgb[0]) + 1, n => this.set_rgb(i, n)))},
|
next_rgb() {return !this.check('ItemHead') && U.with(this.check('Mask'), i => i && U.with(this.rgb.indexOf(i.Color?.[0] || this.rgb[0]) + 1, n => this.set_rgb(i, n)))},
|
||||||
roll_rgb() {this.next_rgb() && W.ChatRoomCharacterItemUpdate(W.Player, 'Mask')},
|
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))},
|
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))},
|
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') && Boolean(W.InventoryWear(W.Player, 'AnimeLenses', 'ItemHead', undefined, 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)},
|
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)},
|
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},
|
get item() {return this.zones.map(z => W.InventoryGet(W.Player, z)).find(item => item && item.Asset.Name === 'AnimeLenses') || undefined},
|
||||||
}
|
}
|
||||||
/** @type {LILY.Belt} */ const Belt = {
|
/** @type {LILY.Belt} */ const Belt = {
|
||||||
admins: [71_240, 67_994],
|
admins: [71_240, 67_994],
|
||||||
cli: {'!LILY': {
|
cli: {'!LILY': {
|
||||||
status: _ => '200 OK',
|
status: _ => '200 OK',
|
||||||
box: {
|
box: {
|
||||||
on: _ => Box.enable(),
|
on: _ => Box.enable(),
|
||||||
off: _ => Box.disable(),
|
off: _ => Box.disable(),
|
||||||
},
|
},
|
||||||
eyes: {
|
eyes: {
|
||||||
start: _ => Eyes.start(),
|
start: _ => Eyes.start(),
|
||||||
stop: _ => Eyes.stop(),
|
stop: _ => Eyes.stop(),
|
||||||
dim: _ => Eyes.dim(),
|
dim: _ => Eyes.dim(),
|
||||||
clear: _ => Eyes.clear(),
|
clear: _ => Eyes.clear(),
|
||||||
},
|
},
|
||||||
}},
|
}},
|
||||||
/** @type {LILY.Belt['is_cb']} */ is_cb: s => typeof s === 'function',
|
/** @type {LILY.Belt['is_cb']} */ is_cb: s => typeof s === 'function',
|
||||||
run(tokens) { /** @type {string | undefined} */ let t, /** @type {LILY.Commands | LILY.CommandCB} */ cmd = this.cli
|
run(tokens) { /** @type {string | undefined} */ let t, /** @type {LILY.Commands | LILY.CommandCB} */ cmd = this.cli
|
||||||
while (t = tokens.shift()) if (U.with(cmd[t], next => !next || this.is_cb(cmd = next))) break // eslint-disable-line no-cond-assign
|
while (t = tokens.shift()) if (U.with(cmd[t], next => !next || this.is_cb(cmd = next))) break // eslint-disable-line no-cond-assign
|
||||||
// either t is undefined, or cmd[t] is undefined or cmd is a function
|
// either t is undefined, or cmd[t] is undefined or cmd is a function
|
||||||
if (!this.is_cb(cmd)) return t ? `unknown token ${t}` : `subcommands: [${Object.keys(cmd).join(', ')}]`
|
if (!this.is_cb(cmd)) return t ? `unknown token ${t}` : `subcommands: [${Object.keys(cmd).join(', ')}]`
|
||||||
return U.with(cmd(...tokens), r => typeof r === 'boolean' ? (r ? 'success' : 'fail') : String(r))
|
return U.with(cmd(...tokens), r => typeof r === 'boolean' ? (r ? 'success' : 'fail') : String(r))
|
||||||
},
|
},
|
||||||
receive(data) { if (!data.Sender) return undefined
|
receive(data) { if (!data.Sender) return undefined
|
||||||
const reply = this.admins.includes(data.Sender) ? this.run(data.Content.split(' ')) : 'access denied'
|
const reply = this.admins.includes(data.Sender) ? this.run(data.Content.split(' ')) : 'access denied'
|
||||||
return void W.ChatRoomSendWhisper(data.Sender, `LILY: ${reply}`)
|
return void W.ChatRoomSendWhisper(data.Sender, `LILY: ${reply}`)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
SDK.hookFunction('SpeechTransformGagGarble', 0, ([text]) => text) // disable garbling
|
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 ? 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)})
|
W.ChatRoomRegisterMessageHandler({Priority: -169, Description: 'LILY', Callback: data => data.Type === 'Whisper' && data.Content.startsWith('!LILY') && (Belt.receive(data) || true)})
|
||||||
})()
|
})()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user