erri120.UtilityLibrary 1.0.0

A Library with utility functions for NetScriptFramework Plugins

There is a newer version of this package available.
See the version list below for details.
Install-Package erri120.UtilityLibrary -Version 1.0.0
dotnet add package erri120.UtilityLibrary --version 1.0.0
<PackageReference Include="erri120.UtilityLibrary" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add erri120.UtilityLibrary --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Utility Library

Utility Library for developing .NET Script Framework Plugins. This adds additional events, functions, extensions and more for you to work with so you can create plugins more efficient.

Requirements

The JetBrains.Annotations package is used mostly for the [NotNull] attribute because NetScriptFramework is still on .NET Framework 4.x and does not use C# 8.0 that has the new nullable feature. Null checking in the NetScriptFramework is important and this library will not null check most inputs. So when using a function from this library make sure to null check beforehand.

Using the Library

Aside from adding a reference to this in your project, you also need to make sure that the library loads before your plugin. Make sure your Plugin.Initialize function looks like this:

protected override bool Initialize(bool loadedAny)
{
    var utilityLibrary = NetScriptFramework.PluginManager.GetPlugin("utility.library");
    if (utilityLibrary == null) return false;
    if (!utilityLibrary.IsInitialized) return false;
    if (!loadedAny) return false;

    // other stuff...
}

This ensures that your plugin only loads after the library initialized and it will error out when the library is not loaded or initialized.

Functions

The UtilityLibrary class has multiple convenience functions like UtilityLibrary.IsInGame or UtilityLibrary.TryGetFormFromFile&lt;T&gt; to reduce the amount of duplicate code you often write.

Events

The UtilityLibrary.Events class contains new events that are (not yet) in the main framework.

Extensions

Extensions are static functions that have a this T argument, this library features multiple extensions for Actor and ItemEntry objects.

AddressLibrary

The Address Library UtilityLibrary.AddressLibrary is a collection of addresses that you can use without having to do any reverse engineering.

Utility Library

Utility Library for developing .NET Script Framework Plugins. This adds additional events, functions, extensions and more for you to work with so you can create plugins more efficient.

Requirements

The JetBrains.Annotations package is used mostly for the [NotNull] attribute because NetScriptFramework is still on .NET Framework 4.x and does not use C# 8.0 that has the new nullable feature. Null checking in the NetScriptFramework is important and this library will not null check most inputs. So when using a function from this library make sure to null check beforehand.

Using the Library

Aside from adding a reference to this in your project, you also need to make sure that the library loads before your plugin. Make sure your Plugin.Initialize function looks like this:

protected override bool Initialize(bool loadedAny)
{
    var utilityLibrary = NetScriptFramework.PluginManager.GetPlugin("utility.library");
    if (utilityLibrary == null) return false;
    if (!utilityLibrary.IsInitialized) return false;
    if (!loadedAny) return false;

    // other stuff...
}

This ensures that your plugin only loads after the library initialized and it will error out when the library is not loaded or initialized.

Functions

The UtilityLibrary class has multiple convenience functions like UtilityLibrary.IsInGame or UtilityLibrary.TryGetFormFromFile&lt;T&gt; to reduce the amount of duplicate code you often write.

Events

The UtilityLibrary.Events class contains new events that are (not yet) in the main framework.

Extensions

Extensions are static functions that have a this T argument, this library features multiple extensions for Actor and ItemEntry objects.

AddressLibrary

The Address Library UtilityLibrary.AddressLibrary is a collection of addresses that you can use without having to do any reverse engineering.

Dependencies

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 95 5/18/2020
1.0.0 93 5/18/2020