openbullet / OpenBullet2

OpenBullet reinvented
https://docs.openbullet.dev/
MIT License
1.8k stars 479 forks source link

[Bug]: Execute Specific JS on Jint not working in version 0.3.0 and above #1109

Closed daywalkers closed 2 months ago

daywalkers commented 2 months ago

This issue respects the following points:

Description of the bug

The Execute method on the Jint Engine, which was working in version 0.2.5, is no longer functioning in version 0.3.0 and above. When attempting to use this method, a MissingMethodException is thrown, indicating that the method cannot be found.

Reproduction steps

Example Loliscript: BEGIN SCRIPT function generateRandomUsername() { const length = Math.floor(Math.random() (11 - 7 + 1)) + 7; const charsLowercase = 'abcdefghijklmnopqrstuvwxyz'; const vowels = 'aiueo'; const numbers = '0123456789'; let username = charsLowercase.charAt(Math.floor(Math.random() charsLowercase.length)); let consecutiveWithoutVowel = (vowels.includes(username[0])) ? 0 : 1; for (let i = 1; i < length; i++) { let nextChar = charsLowercase.charAt(Math.floor(Math.random() charsLowercase.length)); if (consecutiveWithoutVowel >= 2 && !vowels.includes(nextChar)) { nextChar = vowels.charAt(Math.floor(Math.random() vowels.length)); consecutiveWithoutVowel = 0; } consecutiveWithoutVowel = vowels.includes(nextChar) ? 0 : consecutiveWithoutVowel + 1; username += nextChar; } if (!vowels.includes(username[username.length - 1]) && Math.random() < 0.5) { username = username.slice(0, -1) + numbers.charAt(Math.floor(Math.random() * numbers.length)); } return username;}return generated = generateRandomUsername() END SCRIPT OUTPUT String @generated ENDBLOCK

Come with error; [Executing block Random username] MissingMethodException: Method not found: 'Jint.Engine Jint.Engine.Execute(System.String)'.

What is the current bug behavior?

[Executing block Random username] MissingMethodException: Method not found: 'Jint.Engine Jint.Engine.Execute(System.String)'.

What is the expected correct behavior?

come desired output

Version of the client

0.3.1

Type of client

Native client

Environment

Environment

version: 0.3.1 (not working)
Last known working version: 0.2.5
Operating System: windows 10 and windows 11

OpenBullet2 logs

No response

Client / Browser logs

No response

Relevant screenshots or videos

No response

Relevant LoliCode if needed

BEGIN SCRIPT
function generateRandomUsername() { const length = Math.floor(Math.random() * (11 - 7 + 1)) + 7; const charsLowercase = 'abcdefghijklmnopqrstuvwxyz'; const vowels = 'aiueo'; const numbers = '0123456789'; let username = charsLowercase.charAt(Math.floor(Math.random() * charsLowercase.length)); let consecutiveWithoutVowel = (vowels.includes(username[0])) ? 0 : 1; for (let i = 1; i < length; i++) { let nextChar = charsLowercase.charAt(Math.floor(Math.random() * charsLowercase.length)); if (consecutiveWithoutVowel >= 2 && !vowels.includes(nextChar)) { nextChar = vowels.charAt(Math.floor(Math.random() * vowels.length)); consecutiveWithoutVowel = 0; } consecutiveWithoutVowel = vowels.includes(nextChar) ? 0 : consecutiveWithoutVowel + 1; username += nextChar; } if (!vowels.includes(username[username.length - 1]) && Math.random() < 0.5) { username = username.slice(0, -1) + numbers.charAt(Math.floor(Math.random() * numbers.length)); } return username;}return generated = generateRandomUsername()
END SCRIPT
OUTPUT String @generated
ENDBLOCK

Additional information

No response

openbullet commented 2 months ago

I tried and it's working for me, I cannot reproduce your issue. Please try to download a clean build of OB2, maybe this is the result of a bad update.

Image