Results 1 to 1 of 1
  1. #1
    AmejiOrape's Avatar
    Join Date
    Dec 2014
    Gender
    male
    Posts
    184
    Reputation
    27
    Thanks
    99
    My Mood
    Relaxed

    Question Why won't this code work

    So I've been developing a plugin for KRelay, and I don't understand why it won't work.
    Code:
     private void OnText(Client client, Packet packet)
            {
                if (!NotifierConfig.Default.Enabled)
                    return;
                TextPacket textPacket = (TextPacket)packet;
                    foreach (string str in NotifierConfig.Default.Whitelist)
                    {
                        if (textPacket.Text.ToLower().Contains(str.ToLower()))
                        {
                            foreach (string strblack in NotifierConfig.Default.Blacklist)
                            {
                                if (textPacket.Text.ToLower().Contains(strblack.ToLower()))
                                {
                                textPacket.Send = true;
                                }
                            }
                        client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, str + " called!"));
                        }
                    }
            }

    What I want it to do:
    When you get the text packet, search it for keywords(Dungeon Names/Whitelist). If it has keyword, search it again for the blacklist words. If it has blacklist words, do nothing. If it doesn't have blacklist words, create a notification that the dungeon was called.

    When I try it ingame, the notification appears, but it appears even when I have a blacklist word.
    Can anyone fix this?
    Attached Thumbnails Attached Thumbnails
    dnotif.PNG  

    Last edited by AmejiOrape; 07-08-2015 at 11:52 AM.

Similar Threads

  1. [Help] Why does this code work?
    By Nissen1502 is back in forum C++/C Programming
    Replies: 4
    Last Post: 07-16-2013, 09:18 AM
  2. Why won't this simple piece of code not work??
    By Laslod in forum C# Programming
    Replies: 0
    Last Post: 02-13-2013, 08:42 AM
  3. [Help Request] Why won't combat arms work?
    By wello in forum Combat Arms Help
    Replies: 5
    Last Post: 09-05-2011, 02:48 AM
  4. [Help Request] Why won't combat arms work?
    By wello in forum Combat Arms Help
    Replies: 12
    Last Post: 09-03-2011, 10:57 PM

Tags for this Thread