Minecraft-Console-Client icon indicating copy to clipboard operation
Minecraft-Console-Client copied to clipboard

[BUG] Regular Expressions

Open Art0sh opened this issue 3 years ago • 2 comments

Prerequisites

  • [X] I made sure I am running the latest development build
  • [X] I tried to look for similar issues before opening a new one
  • [X] I have set debugmessages=true in config to diagnose my issue
  • [X] I have redacted session tokens and passwords before attaching screenshots

Minecraft Version

1.19.2

Console Client Version

Latest

Expected Behavior

Regular expression in chatbot should work

Actual Behavior

Compiling/Loading a script using regex gives an error.

23:10:22 [MCC] Starting compilation of: '98025518-a3f9-4b4c-bc31-7be554933cf6' 23:10:22 [MCC] Compilation done with error. 23:10:22 [MCC] [Script] Script 'scripts/wiki.cs' failed to run (LoadError). 23:10:22 [MCC] [Script] System.InvalidOperationException: The type or namespace name 'RegularExpressions' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)

I tried loading it with and without manual/extra imports for System/System.Text.RegularExpressions in the script file. Same error.

Steps to Reproduce the bug

  1. Use example script with chatbot
  2. Write code with regex
  3. Compile/Load with error

Attach screenshot here (If applicable)

No response

Anythings that could help diagnosing the bug

No response

Device

VPS

Operating System

Linux

Server Address (If applicable)

No response

Art0sh avatar Sep 20 '22 23:09 Art0sh

@breadbyte How this can be solved, started happening after .NET 5 update?

milutinke avatar Sep 23 '22 18:09 milutinke

A temporary workaround that you can do for now is to build the entire project alongside your script (use the ChatBots folder for reference) and call it here.

I'm not sure what's causing this issue as there is already a reference for System.Text.RegularExpressions (and System.Text too), so the assembly is being referenced correctly in most cases... except this one.

breadbyte avatar Sep 24 '22 04:09 breadbyte

This should be fixed now.

milutinke avatar Nov 05 '22 13:11 milutinke