Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8469373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:12:35+00:00 2026-06-10T16:12:35+00:00

Total noob when it comes to using AIML and having a really hard time

  • 0

Total noob when it comes to using AIML and having a really hard time getting this set up for an asp.net mvc webpage. I have a basic view setup that the user can enter a message in a textbox and I’m trying to get the chatbot to return a response. I’ve gotten that interaction to work with my text case so I know the function is correctly getting the users response and that I can send back a response and show it in the chatbox, my problem is trying to setup the chatbot to create dynamic responses. Right now in my controller I have:

    String filePath = Server.MapPath("~/aimlBot/aiml/");
    ChatBot catbot = new ChatBot(filePath);
    string ReturnText = catbot.GetOutput(text); //text is just a string no html or fancy stuff in it

and my ChatBot class

    Public class ChatBot : Bot
    {
        private Bot myBot;
        private User myUser;

        public ChatBot(string filepath)
        {
            myBot = new Bot();
            myUser = new User("Human", myBot);
            Initialize(filepath);
        }

        private void Initialize(string filepath)
        {
            AIMLbot.Utils.AIMLLoader loader = new AIMLbot.Utils.AIMLLoader(this.myBot);
            myBot.isAcceptingUserInput = false;
            loader.loadAIML(filepath);          
            myBot.isAcceptingUserInput = true;
        }

        public String GetOutput(String input)
        {
            Request r = new Request(input, myUser, myBot);
            Result res = myBot.Chat(r); //breaks here
            string response = "Bot: " + res.Output;
            return (response);
        }
    }

the problem I’m getting is at the
Result res = myBot.Chat(r);
the program throws a FormatException

    System.FormatException was unhandled by user code
    Message=Input string was not in a correct format.
    Source=mscorlib
    StackTrace:
    at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
    at System.Convert.ToDouble(String value)
    at AIMLbot.Bot.get_TimeOut()
    at AIMLbot.Utils.Node.evaluate(String path, SubQuery query, Request request, MatchState matchstate, StringBuilder wildcard)
    at AIMLbot.Bot.Chat(Request request)
    at Ira.aimlBot.ChatBot.GetOutput(String input) in C:\Users\Ira\Documents\Visual Studio 2010\Projects\Ira\Ira\aimlBot\ChatBot.cs:line 36
    at Ira.Controllers.ARGController.Speak(String text) in C:\Users\Ira\Documents\Visual Studio 2010\Projects\Ira\Ira\Controllers\ARGController.cs:line 35
    at lambda_method(Closure , ControllerBase , Object[] )
    at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
    at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
    at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
    InnerException: 

I have No idea what is wrong with my code. I’ve tried even changing it from the variable string to just a hardcode case like “Hello how are you” which still caused the same exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:12:37+00:00Added an answer on June 10, 2026 at 4:12 pm

    You have everything perfect except the loadSettings function. Please refer the below snippet to clear your problem!

    public ChatBot(string filepath)
    {
                myBot = new Bot();
                myBot.loadSettings(); // <----- You have to insert this line to fix the error!
                myUser = new User("Human", myBot);
                Initialize(filepath);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a total noob to android and really have very hard time understanding
I'm a total noob when it comes to C but i found this curl
Total noob, having trouble using a variable to loop through row. I'd like to
Total noob question on DotNetNuke, using it for first time. My client gave me
First timer here, and total noob when it comes to PHP and JavaScript. I
Total noob here with javascript. I'm trying to alter a function. This is the
Total noob here. This is my first c# attempt, its a console application that
I'm a total noob at EE. We are using version 1.6.6 and I need
I'm a total noob when it comes to iPhone development and have been tasked
This is surely a total noob question... I'm switching to a new VPS host,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.