I wrote a script in C# for daily rewards and on certain days I want to add items to a Naninovel inventory
Is it possible to use the command @additem on a C# script? If so, how?
Thank you so much! <3
How to connect naninovel commands to a C# script?
-
- Posts: 8
- Joined: 17 Jan 2021 10:20
How to connect naninovel commands to a C# script?
-
- admin
- Posts: 538
- Joined: 11 May 2020 18:03
Re: How to connect naninovel commands to a C# script?
Sure, it's possible, check https://naninovel.com/guide/custom-commands
-
- Posts: 8
- Joined: 17 Jan 2021 10:20
Re: How to connect naninovel commands to a C# script?
Elringus wrote: ↑17 Jan 2021 11:29Sure, it's possible, check https://naninovel.com/guide/custom-commands
Hi, thank you for your help! I'm trying to understand the doc but I'm not sure how to practically write the command I want to use in C# haha.
It's a little bit complex for me to understand everything that's written
-
- admin
- Posts: 538
- Joined: 11 May 2020 18:03
Re: How to connect naninovel commands to a C# script?
Sorry, didn't initially get the message right. It's possible to execute any existing command in C# by simply creating instance of that command and manually invoking ExecuteAsync
method. Eg, for additem:
Code: Select all
var addItem = new AddItem { ItemId = "Item", SlotId = "Slot", Amount = 3 };
await addItem.ExecuteAsync();