winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
92 stars 26 forks source link

on some servers I can't type slash commands in chat so can you make a custom input #366

Closed joep26020 closed 9 months ago

winstxnhdw commented 9 months ago

I've added this. You can change the character on this line to whatever you want.

https://github.com/winstxnhdw/lc-hax/blob/main/lc-hax/Scripts/Patches/ChatPatch.cs#L23

winstxnhdw commented 9 months ago

You can now change the command prefix in runtime by doing !prefix <prefix>

joep26020 commented 9 months ago

You can now change the command prefix in runtime by doing !prefix <prefix>

Ok, this didnt fix it at the moment. I press enter and it highlights all the text even when you change the prefix. it somehow knows when i type a command and doesn't let me do it.

winstxnhdw commented 9 months ago

What do you mean?

joep26020 commented 9 months ago

What do you mean?

its hard to explain ill show a video

joep26020 commented 9 months ago

https://github.com/winstxnhdw/lc-hax/assets/143763241/ae4bc06b-0e3f-4e9d-9032-591bdd3f94db

winstxnhdw commented 9 months ago

Aren't you supposed to use !prefix @ then @players?

joep26020 commented 9 months ago

Aren't you supposed to use !prefix @ then @players?

im confused? this does it with any commands. even like /kill. i ave also changed the prefix to ; and that still doesnt work. i think its the kaoscompany mod. but idk how they detect im inputting a command

winstxnhdw commented 9 months ago

Can you type at all?

joep26020 commented 9 months ago

yes, i can do anything except if it inputs a command for example i cant even type the prefix command, but i can type ;players. but when i change the prefix to ; it doesnt work

winstxnhdw commented 9 months ago

What happens if you just type ;? Can you send a screenshot?

joep26020 commented 9 months ago

if i type / with the prefix set as '/' then it doesnt work. but when i type ; it does type. and also when i type ! it doesnt work either to change the prefix. it still highlights the whole message.

winstxnhdw commented 9 months ago

https://github.com/winstxnhdw/lc-hax/blob/main/lc-hax/Scripts/Static/State.cs#L6

What happens if you change this to ;?

winstxnhdw commented 9 months ago

It shouldn't ever be possible to block the command. It means you are doing something wrong.

joep26020 commented 9 months ago

ok, doing that right now. and i checked in vanilla and it works but with that mod it somehow knows im doing a commands

winstxnhdw commented 9 months ago

Yeah, I don't think a mod can do that. The most it can do is detect command prefixes and block them. But since you said you are able to type ; then you should also be able to do ;players.

joep26020 commented 9 months ago

It shouldn't ever be possible to block the command. It means you are doing something wrong.

yep, same result. it knows i am inputting a command, even if i simply type the ; prefix.

winstxnhdw commented 9 months ago

Okay, send me your lc-hax.log file. It's possible an exception is happening.

joep26020 commented 9 months ago

Okay, send me your lc-hax.log file. It's possible an exception is happening.

where is that

winstxnhdw commented 9 months ago

It's in your Lethal Company folder.

joep26020 commented 9 months ago

It's in your Lethal Company folder.

and where is that lol

winstxnhdw commented 9 months ago

You don't know where your Steam games are stored?

winstxnhdw commented 9 months ago
[11-02-24 11:10:11] System.TypeInitializationException: The type initializer for 'Hax.Chat' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'SpawnCommand' threw an exception. ---> System.ArgumentException: An item with the same key has already been added. Key: RollingGiant
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <787acc3c9a4c471ba7d971300105af24>:IL_015A 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <787acc3c9a4c471ba7d971300105af24>:IL_0000 
  at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x0009e] in <dab7f68612224ba3ae40f651d44f9d4c>:IL_009E 
  at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector) [0x00000] in <dab7f68612224ba3ae40f651d44f9d4c>:IL_0000 
  at SpawnCommand..cctor () [0x00016] in <094e5ad623344065861bc41aef0d6e0d>:IL_0016 

Seems like the spawn command is causing a problem.

joep26020 commented 9 months ago
[11-02-24 11:10:11] System.TypeInitializationException: The type initializer for 'Hax.Chat' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'SpawnCommand' threw an exception. ---> System.ArgumentException: An item with the same key has already been added. Key: RollingGiant
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <787acc3c9a4c471ba7d971300105af24>:IL_015A 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <787acc3c9a4c471ba7d971300105af24>:IL_0000 
  at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x0009e] in <dab7f68612224ba3ae40f651d44f9d4c>:IL_009E 
  at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector) [0x00000] in <dab7f68612224ba3ae40f651d44f9d4c>:IL_0000 
  at SpawnCommand..cctor () [0x00016] in <094e5ad623344065861bc41aef0d6e0d>:IL_0016 

Seems like the spawn command is causing a problem.

interesting. so do you want me to remove it on my files?

winstxnhdw commented 9 months ago

I read it closer. It seems that your modpack has added this enemy called RollingGiant, which is causing the issue.

joep26020 commented 9 months ago

I read it closer. It seems that your modpack has added this enemy called RollingGiant, which is causing the issue.

oh ok yeah thats a new entity we added

winstxnhdw commented 9 months ago

I think I can add a fix for this. Give me a while.

joep26020 commented 9 months ago

I read it closer. It seems that your modpack has added this enemy called RollingGiant, which is causing the issue.

but we like it so should i just remove the spawn command to get it working?

joep26020 commented 9 months ago

I think I can add a fix for this. Give me a while.

this would be a good idea though to be honest as an anticheat for lchax. we could keep it down low so if any of the trusted few want to play modded and dont want annoying hackers we can just do this

winstxnhdw commented 9 months ago

Done.

winstxnhdw commented 9 months ago

this would be a good idea though to be honest as an anticheat for lchax. we could keep it down low so if any of the trusted few want to play modded and dont want annoying hackers we can just do this

Not sure what you mean.

joep26020 commented 9 months ago

Done.

thank you

joep26020 commented 9 months ago

this would be a good idea though to be honest as an anticheat for lchax. we could keep it down low so if any of the trusted few want to play modded and dont want annoying hackers we can just do this

Not sure what you mean.

eh it doesnt matter

joep26020 commented 9 months ago

this would be a good idea though to be honest as an anticheat for lchax. we could keep it down low so if any of the trusted few want to play modded and dont want annoying hackers we can just do this

Not sure what you mean.

its working now thankyou!!!!!!!