Resource icon

Standalone Discord bot. 1.0

No permission to buy ($20.00)
Requirements
ServUo Pub57 / Pub 56.1
This is a Discord bot to get messages from your shard into your Discord channel.
Installation:
Drop DiscordWebhookInterface.dll and Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll in your Servuo executable folder.
Drop Standalone Discord bot.cs in your scripts or custom scripts folder.
Add these lines in your ServUo executable folder/Data/Assemblies.cfg:
C#:
System.Net.Http.dll
DiscordWebhookInterface.dll
Here my Assemblies.cfg
C#:
System.dll
System.Core.dll
System.Data.dll
System.Data.DataSetExtensions.dll
System.Drawing.dll
System.Web.dll
System.Windows.Forms.dll
System.Xml.dll
Ultima.dll
PowerCollections.dll
System.Net.Http.dll
DiscordWebhookInterface.dll
In Standalone Discord bot.cs,LINE 52:
C#:
var WebhookUrl = "Your Discord webhook key"; //Here Discord webhook url.
Make sure you add at top of scripts you integrate the bot message:
C#:
using DiscordWebhookInterface;
Invoke method:
C#:
DiscordWebhookInterface.WebhookInterface.SendMessage("Your message");
There is a script modified to work with the bot:
C#:
using System;
using System.Collections;
using Server.Network;
using Server.Mobiles;
using DiscordWebhookInterface;

namespace Server
{
    public class AnnounceDeath
    {
        public static void Initialize()
        {
            EventSink.PlayerDeath += new PlayerDeathEventHandler( OnDeath );
        }

        public static void OnDeath( PlayerDeathEventArgs args )
        {
            Mobile from = args.Mobile;
            Mobile c = from.LastKiller;
            string victim = from.Name;
            string killer = "";
            if ( c != null )
            {
                killer = c.Name + " " + c.Title;
                BaseCreature bc = c as BaseCreature;
                if ( bc != null && bc.ControlMaster != null )
                {
                    killer = bc.ControlMaster.Name;
                    if ( from == bc.ControlMaster )
                        killer = "their own pet";
                }
            }

            if ( c == null )
                DiscordWebhookInterface.WebhookInterface.SendMessage(from.Name+" has been killed in a freak accident!");
            else if ( c is BaseCreature )
                DiscordWebhookInterface.WebhookInterface.SendMessage(from.Name+" has been killed by "+from.LastKiller.Name );
            else if ( c == from )
                DiscordWebhookInterface.WebhookInterface.SendMessage(from.Name+" has committed suicide!");
            else if ( c is PlayerMobile )
                DiscordWebhookInterface.WebhookInterface.SendMessage(from.Name+" has been murdered by "+from.LastKiller.Name );
            else
                DiscordWebhookInterface.WebhookInterface.SendMessage(from.Name+" has been killed by "+from.LastKiller.Name );*/
        }
    }
}
On buy note: Send me private message when buy with your credentials or paypal account you used to buy,and i will send it to you via e-mail,or here.As you want.please,if you buy it,use send money as a friend/family.And please,dont share it for free,thank you so much!
Tested in pub57,and pub 56.1.
Author
Lemke
Views
1,137
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Lemke

Back