What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Chat events.

SkyHigh

Member
Joined
Apr 15, 2010
Messages
396
Reaction score
4
Hey, trying to fire a method on a chat event but its isn't quite working.

Constructor
Code:
public Test()
        {
            slog("Loaded");
            WoWChat.NewWhisperFromMessage += Whispered;
            
        }

Whisper Method
Code:
private void Whispered(ChatMessageEventArgs e)
        {
            slog("Great Success!");
        }

I read this as: everytime the NewWhisperFromMessage event is fired the Whispered method logs great success!, right? For some reason this is not the case.

What am I doing wrong here? :)
 
Slog function works fine.
When you stop hb and start it again, it seems to print the logs from the previous session.
Really puzzles me, checked out all the chat related plugins, they all do it this way. Downloaded a few hb versions to see if that was the problem, no dice.

Complete Source
Code:
using System;
using Styx.Helpers;
using System.IO;
using System.Xml.Linq;
using System.Linq;
using System.Text;
using Styx.Plugins.PluginClass;
using Styx;
using Styx.WoWInternals;
public class test : HBPlugin
{
    public test()
    {
        WoWChat.NewSayMessage += logChat;
        WoWChat.NewWhisperFromMessage += logChat;
        slog("Loaded");

    }
    ~test()
    {
        WoWChat.NewSayMessage -= logChat;
        WoWChat.NewWhisperFromMessage -= logChat;
    }

    public override void Pulse()
    {

    }


    private void logChat(ChatMessageEventArgs e)
    {
        slog("win");
    }

    public static void slog(string msg)
    {
        Logging.Write("test >" + msg);
    }
  
    public override string Name { get { return "test"; } }

    public override string Author { get { return "SkyHigh"; } }

    public override Version Version { get { return new Version(0, 0, 0); } }

    public override bool WantButton { get { return false; } }

    public override string ButtonText { get { return "blah"; } }
}
 
Last edited:
Problem solved, was testing on an empty profile and HB wasn't pulsing.
 
Back
Top