Jump to content

load c# code from different file


sataan1337

Recommended Posts

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
Share on other sites

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/

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...