hello,
i have some problems to register some events in c#.
For now i want to use the OnMenue Event and OnGumpIncome Event.
As I understand, the On Menue Event will be fired when the ContextMenue ist shown.
The OnGumpIncome is hopefully able to parse and awenser to an opened gump.
I have the following code and dont know how how to register the function.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ScriptSDK;
using ScriptSDK.API;
using ScriptSDK.Attributes;
using ScriptSDK.Configuration;
using ScriptSDK.ContextMenus;
using ScriptSDK.Data;
using ScriptSDK.Engines;
using ScriptSDK.Gumps;
using ScriptSDK.Items;
using ScriptSDK.Mobiles;
using ScriptSDK.Targets;
using ScriptSDK.Utils;
using ScriptDotNet2;
using System.Threading;
namespace Event
{
class Program
{
static void OnMenuHandler(uint DialogID, ushort MenuID)
{
Console.WriteLine("Menue Opened");
}
private static void TimerCallback(Object o)
{
Console.WriteLine("In TimerCallback: " + DateTime.Now);
GC.Collect();
}
static void Main(string[] args)
{
Console.WriteLine("Program Started");
ScriptSDK.OnMenuEvent += OnMenuHandler;
ScriptDotNet2.Stealth.Script_EnableEvent(TPacketEvent.evMenu);
Timer t = new Timer(TimerCallback, null, 0, 1000);
Console.WriteLine("Waiting for event fire, Press any key to stop");
Console.ReadKey();
}
}
}
regards