sataan1337 0 Posted September 18, 2023 Share Posted September 18, 2023 Hi, im relatively new to this bot and coding c# in general, so please dont mind if the question seems dumb ^^ I'd like to create a utility class for some code i need for multiple FightClasses. Looking up how this would be done in c# i found this: the util: using System; namespace MyNamespace { public class WowUtil { [...] } } and the FightClass: using System; [...] using MyNamespace; public class Main : ICustomClass { } Trying to run this i get the error "The type or namespace 'MyNamespace' could not be found. Missing using directive or assembly reference" is this / something similar possible at all, and if yes what am i doing wrong? ^^ thanks in advance 🙂 Link to comment https://wrobot.eu/forums/topic/15303-load-c-code-from-different-file/ Share on other sites More sharing options...
Droidz 2742 Posted September 18, 2023 Share Posted September 18, 2023 Hello, If you give WRobot a .cs file, you cannot use newer C# features (like 'using MyNamespace;'). To use these new features, give compiled files to WRobot (dll). 'public class Main: ICustomClass' must not have a namespace for WRobot to find the class. For example, you can look at this code to see how to separate your code into several classes : https://wrobot.eu/forums/topic/11961-fightclass-framework-for-243335a-and-more/ sataan1337 1 Link to comment https://wrobot.eu/forums/topic/15303-load-c-code-from-different-file/#findComment-68769 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now