Added binary mode to funbox (#4005) robsassack

* Added binary mode to funbox

* changed description and added punctionation off for binary funbox
This commit is contained in:
Rob Sassack 2023-02-19 07:02:45 -05:00 committed by GitHub
parent 259a36e57a
commit 3deb2809a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 0 deletions

View file

@ -119,6 +119,10 @@ const Funboxes: Record<string, MonkeyTypes.FunboxMetadata> = {
canGetPb: false,
difficultyLevel: 1,
},
binary: {
canGetPb: false,
difficultyLevel: 1,
},
};
export default Funboxes;

View file

@ -203,6 +203,16 @@ const list: MonkeyTypes.FunboxMetadata[] = [
numbers: [false],
},
},
{
name: "binary",
alias: "numbers",
info: "01000010 01100101 01100101 01110000 00100000 01100010 01101111 01101111 01110000 00101110",
properties: ["ignoresLanguage", "ignoresLayout", "noLetters"],
forcedConfig: {
numbers: [false],
punctuation: [false],
},
},
];
export function getAll(): MonkeyTypes.FunboxMetadata[] {

View file

@ -520,6 +520,12 @@ FunboxList.setFunboxFunctions("IPv6", {
},
});
FunboxList.setFunboxFunctions("binary", {
getWord(): string {
return Misc.getBinary();
},
});
export function toggleScript(...params: string[]): void {
FunboxList.get(Config.funbox).forEach((funbox) => {
if (funbox.functions?.toggleScript) funbox.functions.toggleScript(params);

View file

@ -1383,3 +1383,8 @@ export function isLocalhost(): boolean {
location.hostname === ""
);
}
export function getBinary(): string {
const ret = Math.floor(Math.random() * 256).toString(2);
return ret.padStart(8, "0");
}

View file

@ -150,5 +150,10 @@
"alias": "network",
"info": "For sysadmins with a long beard.",
"canGetPb": false
},
{
"name": "binary",
"info": "01000010 01100101 01100101 01110000 00100000 01100010 01101111 01101111 01110000 00101110",
"canGetPb": false
}
]