Click here to Skip to main content
13,090,672 members (43,618 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to create and impliment a Custom Tag using the steps below.
I am having trouble with # 8.
Could someone show me how and where to create a method and call the LoadCustomTagHandlers(string pathToDLL)
Any help will be greatly appreciated

(1) Create a new library project to contain your Custom tag Classes.
(2) Add the AIMLbot dll as reference to your project.
(3) Create a public class with the same name as the tag you wish to handle.
(4) Reference System.Xml and AIMLbot.Utils.
(5) Add the [CustomTag] attribute to the class.
(6) Create a default Constructor that puts something in the “this.inputString” attribute.
(7) Override the ProcessChance() method.
(8) Finally to load the dll into your bot call the loadCustomTagHandlers(string pathToDLL) method of the object that is your bot. An exception will be raised if you attempt to duplicate tag handling.

(This is the Custom Tag)
using system;
using system.Xml;
using Aimlbot.utils;

namespace SearchWebTags
public class searchWeb : AIMLTagHandler
public searchWeb()
this.inputString = "searchWeb";
protected override string ProcessChange()
if (this.templateNode.Name.ToLower() == "searchWeb")

string uri;
string searchString = this.Text1.Text;
uri = "" + searchString;
return String.Empty;

(The code below is my App)

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

using AIMLbot;
using AIMLbot.AIMLTagHandlers;
using AIMLbot.Normalize;
using AIMLbot.Utils;

using System.Speech.Synthesis;
using SpeechLib;
using SearchWebTags;

namespace MyAimlBot1

public partial class MyAimlBot1: System.Windows.Forms.Form
SpeechLib.SpVoice say;

private cBot myBot;

public MyAimlBot1()
pictureBox1.Image = Properties.Resources.Mth_0;
say = new SpeechLib.SpVoice();

myBot = new cBot(false);

this.textBox1.KeyPress += new KeyPressEventHandler(this.textBox1_KeyPress);

private void MyAimlBot1_Load(object sender, EventArgs e)


private void textBox1_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
say = new SpeechLib.SpVoice();

if (e.KeyChar == 13)

cResponse reply =, "user");
this.richTextBox1.Text= reply.getOutput();

say.Speak(this.richTextBox1.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync);
say.Viseme += new
this.textBox1.Text = "";
Posted 21-Oct-12 13:46pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 21 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100