Click here to Skip to main content
15,891,864 members
Articles / Programming Languages / C#

Bot Suite

Rate me:
Please Sign up or sign in to vote.
1.35/5 (16 votes)
24 Aug 2008LGPL36 min read 94.3K   877   31  
Bot Suite is a collection of utilities provided to create, schedule and run the chat bots. Bot suite consists of three applications i.e. Bot Studio, Bot Engine & MyMessenger. Bot suite provides the solution for the automated conversation using these applications. We will see their usage here.
using System;
using System.Collections;
namespace BotSuite.MyWebAssembly
{
	public enum ResponseOperator{ 
									Exact, 
									Contains, 
									DoesntContain, 
									BeginWith, 
									EndWith,	
									AnyOfTheWords, 
									NotAnyOfTheWords,
									ContainWords,
									DoesnotContainWords
								};
	/// <summary>
	/// Summary description for Response.
	/// </summary>
	public class Response
	{
		public string FromNode = "";
		public string ToNode = "";
		public string ResponseText = "";
		public ResponseOperator rspOperator = ResponseOperator.Exact;
		public ArrayList events = new ArrayList();
		public ArrayList stats = new ArrayList();
		public double ratio;
		public string id = "";
		public int priority = 1;

		public Response()
		{
		}
		
		public Response(string FromNode, string ToNode,	string ResponseText, ResponseOperator rspOperator,
					double ratio, int priority, string id, ArrayList events, ArrayList stats)
		{
			this.FromNode	= FromNode;
			this.ToNode		= ToNode;
			this.rspOperator	= rspOperator;
			this.events		= events;
			this.stats		= stats;
			this.ResponseText = ResponseText;
			this.id = id;
			this.priority = priority;

			if(ratio != -1)
				this.ratio = ratio;
			else
			{
				System.Random rnd = new Random();
				ratio = rnd.NextDouble();
				int tmp = (int) (ratio * 10);
				ratio = ((double)tmp) / 10;
				if(ratio < 0.2)
					ratio +=0.2;
				else if( ratio > 0.8)
					ratio -= 0.2;
				this.ratio = ratio;
			}

		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Web Developer
Pakistan Pakistan
Mansoor Sarfraz works in a well reputed multinational software development company. Software development is not only his duty but his passion too. In his professional career he was Involved in the development of resource/content management system, workflow based systems, enterprise projects based on MS Windows DNA architecture and .NET framework, web based rich client UI development, Rest based backend web services and windows services for different systems. He was also involved in software designing and architecture. He has expertise in C#.NET, ASP.NET, Sql Server, Adobe Flex, Java, Ajax and JavaScript.

You can reach him through his blog
http://mansoorsarfraz.blogspot.com

Comments and Discussions