Click here to Skip to main content
15,918,808 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Bot.send ("Hi my name is lexi");
Bot.send ("I a travel suggestor bot");
Bot.send ("You have to write an activity and I will tell you what you need to do the activity and where you can go to do it");

async function respond(inputText){
var thing = await CampK12.classify("Travel Suggestor Bot AI model", inputText);
Bot.send("The thing which you will need for the activity is " + thing);


var mountainList = [
    "Nepal",
    "Kashmir",
    "Nainital",
    "Summer Hill",
    "Ooty"
];

var snowList = [
    "Jammu Kashmir",
    "Himachal Pradesh",
    "Uttarkhand",
    "Europe",
    "Switzerland"
];

var beachList = [
    "Goa",
    "Calangute",
    "Kerala",
    "Andhra Pradesh",
];

var riverList = [
    "Uttar Pradesh",
    "Bangladesh",
    "Punjab",
    "Rajasthan",
    "Maharashtra",
];

    var forestList = [
        "Arunachal Pradesh",
        "Assam",
        "Bihar",
        "Chhattisgarh",
        "brazil",
    ];

var i = 0;
var j = 0;
var k = 0;
var l = 0;
var m = 0;

if (thing == 'Mountain'){
Bot.send ("You should visit "+ mountainList[i]+" for " + inputText) ;
i++;
}

else if(thing == 'Forest'){
Bot.send ("You should visit " + forestList[j]+"for" + inputText);
j ++;
}

else if (thing == 'River'){
	Bot.send ("You can visit" + riverList[k]+"for" + inputText);
	k ++;
}

else if (thing == 'Snow'){
	Bot.send ("You can visit" + snowList[l]+"for" + inputText);
	l++;
}

else (thing == 'beach'){
	Bot.send ("You can visit" + beachList[m]+"for" + inputText);
	m++;
}

}

When I have tried running this game, It is comming Cannot load the project. I want that it to be load and when a person will write an activity (eg-Parachuting) It should not just show mountain even the mountain name as mentioned above randomly which means any mountain any time (Same with river,beach,snow,forest)

What I have tried:

var i = 0;
    var j = 0;
    var k = 0;
    var l = 0;
    var m = 0;

    if (thing == 'Mountain'){
    Bot.send ("You should visit "+ mountainList[i]+" for " + inputText) ;
    i++;
    }

    else if(thing == 'Forest'){
    Bot.send ("You should visit " + forestList[i]+"for" + inputText);
    j ++;
    }

    else if (thing == 'River'){
        Bot.send ("You can visit" + riverList[i]+"for" + inputText);
        k ++;
    }

    else if (thing == 'Snow'){
        Bot.send ("You can visit" + snowList[i]+"for" + inputText);
        l++;
    }

    else (thing == 'beach'){
        Bot.send ("You can visit" + beachList[i]+"for" + inputText);
        m++;
}

I have tried putting different varable but still not workingx
Posted
Updated 9-Aug-22 0:57am

1 solution

add semicolon in line 76 then it will work
 
Share this answer
 
Comments
Richard Deeming 9-Aug-22 8:33am    
Line 76 already has a semi-colon.

Try again, and this time explain your solution clearly. You're answering a question that was posted over a year ago, so an unclear suggestion to do something that has already been done is likely to be seen as trolling.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900