Update 'mbchc-local.user.js'

This commit is contained in:
Mute 2022-07-05 01:04:07 +00:00
parent 1f45cb04e0
commit 6663c2eede
1 changed files with 59 additions and 6 deletions

View File

@ -34,8 +34,10 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
RE_PREF_ACTIVITY_ME: /^@/,
RE_PREF_ACTIVITY: /^@@/,
RE_ACT_CHARS: /^<(\d+)?:(\d+)?>/,
RE_TZ: /(?:GMT|UTC)([+-]\d\d?)/,
RGB_MUTE: "#6c2132",
RGB_POLLY: "#81b1e7",
UTC_OFFSET: new Date().getTimezoneOffset() * 60 * 1000,
HAND_PENETRATORS: ["Flogger", "Whip", "TennisRacket", "Gavel", "SmallVibratingWand", "LargeDildo", "Vibrator", "Hairbrush", "SmallDildo", "Baguette", "Spatula", "Broom"],
HIDE_SPECIAL: ["Activity","Emoticon"],
HIDE_BODY: ["Blush","BodyLower","BodyUpper","Eyebrows","Eyes","Eyes2","Face","Fluids","HairBack","HairFront","Hands","Head","Mouth","Nipples","Pussy"],
@ -100,9 +102,11 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
},
"kiss": {
Mouth: {others: "Kiss|GagKiss|GaggedKiss"},
"Arms,Boots,Breast,Hands,Nipples": {self: "Kiss", others: "Kiss|GaggedKiss"},
"Boots,Hands": {self: "PoliteKiss", others: "PoliteKiss|GaggedKiss"},
"Arms,Breast,Nipples": {self: "Kiss", others: "Kiss|GaggedKiss"},
"Butt,Ears,Feet,Head,Legs,Neck,Nose,Pelvis,Torso,Vulva,VulvaPiercings": {others: "Kiss|GaggedKiss"}
},
"smooch": {"Hands,Boots": {all: "Kiss"}},
"nibble|chew": {"Arms,Hands,Boots,Mouth,Nipples": {all: "Nibble"}, "Ears,Feet,Legs,Neck,Nose,Pelvis,Torse,Vulva,VulvaPiercings": {others: "Nibble"}},
"slap|spank": {"Head,Breast,Vulva,VulvaPiercings": {all: "Slap"}, "Arms,Boots,Butt,Feet,Hands,Legs,Pelvis,Torso": {all: "Spank"}},
"tickle": {"Arms,Boots,Breast,Feet,Legs,Neck,Pelvis,Torso": {all: "Tickle"}},
@ -124,8 +128,6 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
"pound": {"Mouth,Vulva,Butt": {others: "PenetrateFast"}},
"tongue": {"Vulva,VulvaPiercings": {others: "MasturbateTongue"}},
"finger": {"Breast,Butt,Vulva,VulvaPiercings": {all: "MasturbateHand"}},
"graze": {"Hands,Boots": {all: "PoliteKiss"}},
},
MAP_ZONES: {
"ItemBoots": ["foot", "feet", "boot", "boots", "shoe", "shoes", "toes", "toenails", "sole", "soles", "heel", "heels"],
@ -153,12 +155,23 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
"<div>/mbchc disappear : become invisible (requires anal hook -> hair)</div>",
"<div>/mbchc donate MEMBERNUMBER : Buy data and send it to recipient</div>",
"<div>/mbchc title TITLE : set a custom title (<b>WIP</b>)</div>",
"<div>/mbchc tz TARGET NUM : set target's UTC offset</div>",
"<div>/mbchc purge! : delete MBCHC online saved data</div>",
],
COMMANDS: [
{ Tag: "mbchc", Description: ": Utility functions (\"/mbchc\" for help)", Action: (argline, cmdline, args) => { window.MBCHC.command_mbchc(argline, cmdline, args) } },
{ Tag: "activity", Description: "[Message]: Send a custom activity (or \"@@Message\", or \"@Message\" as yourself)", Action: (argline, cmdline, args) => { window.MBCHC.command_activity(argline, cmdline, args) } },
{ Tag: "do", Description: ": Do an activity, as if clicked on its button (\"/do\" for help)", Action: (argline, cmdline, args) => { window.MBCHC.command_do(argline, cmdline, args) } },
],
settings: function(setting = null) {
let settings = window.Player.OnlineSettings.MBCHC || {}
return(setting ? settings[setting] : settings)
},
save_settings: function(cb = null) {
if (!window.Player.OnlineSettings.MBCHC) window.Player.OnlineSettings.MBCHC = {}
if (cb) cb.call(this, window.Player.OnlineSettings.MBCHC)
window.ServerAccountUpdate.QueueData({OnlineSettings: window.Player.OnlineSettings})
},
log: function(msg) {return("MBCHC: " + String(msg))},
empty: function(text) {
if (!text) return(true)
@ -277,6 +290,34 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
if (("Character" === module) && ("Login" === screen)) return(true)
return(false)
},
find_timezone: function(char) {
let timezones = this.settings("timezones")
if (timezones && timezones[char.MemberNumber]) return(timezones[char.MemberNumber])
let match = char.Description.match(this.RE_TZ)
if (match) return(Number.parseInt(match[1]))
return(null)
},
player_enters_room: function() {
this.hello()
for (let i in window.ChatRoomCharacter) {
let char = window.ChatRoomCharacter[i]
if (!char.MBCHC_LOCAL) char.MBCHC_LOCAL = {}
if (!char.MBCHC_LOCAL.TZ) {
let tz = this.find_timezone(char)
if (tz) char.MBCHC_LOCAL.TZ = tz
}
}
},
set_timezone: function(args) {
let char = this.id2char(args[0])
if (!char) throw "invalid target"
let tz = Number.parseInt(args[1])
if (isNaN(tz)) throw "invalid offset"
if ((tz < -12) || (tz > 12)) throw "offset should be [-12,12]"
if (!char.MBCHC_LOCAL) char.MBCHC_LOCAL = {}
char.MBCHC_LOCAL.TZ = tz
this.save_settings((s) => { if (!s.timezones) s.timezones = {}; s.timezones[char.MemberNumber] = tz })
},
// Command actions
command_mbchc: function(argline, cmdline, args) { try {
@ -294,6 +335,13 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
var result = this.donate_data(args[0])
window.ChatRoomMessage({Sender: window.Player.MemberNumber, Type: "Action", Content: `You've bought data for $${result.cost} and sent it to ${result.name}.`, Dictionary: [{Tag: "MISSING PLAYER DIALOG: ", Text: ""}]})
break
case "tz": this.set_timezone(args); break
case "purge!":
if (window.Player.OnlineSettings.MBCHC) {
delete window.Player.OnlineSettings.MBCHC
this.save_settings()
}
break
default: throw `unknown subcommand "${cmd}"`
}
} catch (x) { this.report(x) } },
@ -343,7 +391,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
window.MBCHC.NEXT_MESSAGE += 1
if (window.MBCHC.LOG_MESSAGES) console.debug(data)
if (("ReceiveSuitcaseMoney" === data.Content) && ("Hidden" === data.Type)) { window.MBCHC.LAST_HACKED = data.Sender }
if (("ServerEnter" === data.Content) && ("Action" === data.Type) && (data.Sender === window.Player.MemberNumber)) { window.MBCHC.hello() }
if (("ServerEnter" === data.Content) && ("Action" === data.Type) && (data.Sender === window.Player.MemberNumber)) { window.MBCHC.player_enters_room() }
if (("MBCHC" === data.Content) && ("Hidden" === data.Type)) { window.MBCHC.receive(data) }
}
return(next(args))
@ -370,7 +418,12 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
let [C, CharX, CharY, Zoom, Pos] = args
if ((window.ChatRoomHideIconState < 1) && C.MBCHC) {
let colour = (C.MBCHC.VERSION === window.Player.MBCHC.VERSION) ? window.MBCHC.RGB_POLLY : window.MBCHC.RGB_MUTE
window.DrawRect(CharX + 225 * Zoom, CharY, 50 * Zoom, 50 * Zoom, colour)
window.DrawRect(CharX + 175 * Zoom, CharY, 50 * Zoom, 50 * Zoom, colour)
}
if (C.MBCHC_LOCAL && C.MBCHC_LOCAL.TZ) {
let localtime = new Date(window.CommonTime() + window.MBCHC.UTC_OFFSET + C.MBCHC_LOCAL.TZ * 60 * 60 * 1000)
let text = localtime.toLocaleTimeString([], {hourCycle: "h24", hour: "2-digit"})
window.DrawTextFit(text, CharX + 200 * Zoom, CharY + 25 * Zoom, 46 * Zoom, "white", "black")
}
return(next(args))
})
@ -380,7 +433,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER
window.MBCHC.sdk.hookFunction("AsylumGGTSSAddItems", 0, (args, next) => { window.MBCHC.loader(); return(next(args)) })
} else {
window.MBCHC.loader()
if(("Online" === window.CurrentModule) && ("ChatRoom" === window.CurrentScreen)) window.MBCHC.hello()
if(("Online" === window.CurrentModule) && ("ChatRoom" === window.CurrentScreen)) window.MBCHC.player_enters_room()
}
})()