![]() |
script logic |
Sorry to bother you again... i'm trying to script a little more complex version of the geolocation script... my problem is that i can't in any way reach the latest state! What am I doing wrong? i paste the code below... Entering "translate the post code XXXX" returns correctly the output of the g1() function... but if I add the country like "translate the post code XXXX in germany" the bot can't reach the "tPCWCState" state... please help! thanks 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 state GeoNames { case input goto sentenceState for each #word of sentence; state sentenceState { case "can" goto sentenceState; case "you" goto sentenceState; case "translate" goto tState; var numeral { meaning : number; } function g1() { res = Http.requestXML("http://api.geonames.org/postalCodeSearch?username=botlibre&maxRows=1&postalcode=" + numeral); if (res.totalResultsCount == "0") { return "i know no place with that code"; } if (res.totalResultsCount != "1") { return "there are more than one result, specify a country"; } return res.code.name; } |
|
|
|
|