Program E的Flash前端
来源:互联网 发布:晋中教育网网络教研 编辑:程序博客网 时间:2024/06/05 07:09
Program E是一个php的aiml解析器. (http://sourceforge.net/projects/programe/)
如果你对机器人聊天很感兴趣, 你肯定知道aiml, alicebox. 反正我是在03年就把这个东西用在了msn上(貌似是第一个).
无废话, 上代码:
php:
- /**
- * Include the guts of the program.
- */
- include "respond.php";
- $numselects=0;
- // Start the session or get the existing session.
- session_start();
- $myuniqueid=session_id();
- //echo 'botresponse='. $_POST['input'];
- //exit;
- // Here is where we get the reply. Make sure you fill in testbot with your bot's name
- if(isset($_POST['input'])){
- //echo 'botresponse='. $_POST['input'];
- $uid = isset($_POST['uid']) ? $_POST['uid'] : $myuniqueid;
- $botresponse=replybotname($_POST['input'], $uid, "ChinaBabel Bot No. 1");
- echo 'botresponse=' . $botresponse->response;
- echo '&myuniqueid=' . $uid;
- }
- // Print the results.
- //print "&bot_name=Test Agent/n";
- //print $botresponse->response;
- //print "&textLoaded=1";
Flash as2:
- var username;
- var keyListener:Object = new Object();
- keyListener.onKeyDown = function() {
- // compare return value of getCode() to constant
- if (Key.getCode() == Key.ENTER) {
- _root.askBot(_root.ask.text);
- _root.ask.text = "";
- }
- else if(Key.getCode()==Key.ESCAPE){
- //clear
- _root.ask.text = "";
- }
- };
- Key.addListener(keyListener);
- var myuniqueid:String = "";
- function askBot(ques:String):Void{
- if(ques == ''){
- return;
- }
- _root.answer.htmlText = "......";
- var botResponse:LoadVars = new LoadVars();
- var result_lv:LoadVars = new LoadVars();
- result_lv.onLoad = function(success:Boolean) {
- if (success) {
- _root.append("机器人", result_lv.botresponse);
- //_root.answer.text = result_lv.botresponse;
- _root.myuniqueid = result_lv.myuniqueid;
- } else {
- _root.answer.text = "Error connecting to server.";
- }
- };
- if(_root.myuniqueid != ""){
- botResponse.uid = _root.myuniqueid;
- }
- botResponse.input = ques;
- botResponse.sendAndLoad("http://www.xxx.com/bot/src/flash.php", result_lv, "POST");
- }
- function append(user, txt){
- var tt = user + ' says: <span>' + txt + "</span>";
- _root.answer.htmlText = tt;
- }
- askBot("I am "+username);
- Program E的Flash前端
- Nand Flash学习笔记2-Program的介绍
- zedboard qspi flash启动时,为什么program flash的加载速度很慢
- nand flash read/program/erase
- Flash erase/program 检查方法
- 微软的Flash杀手WPF/E已经来了
- E:\'Program' 不是内部或者外部命令,也不是可运行的程序
- 'E:\Program' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
- 前端flash视频插入
- how to flash program stb388 stb498 etc.
- xilinx sdk 2016.4 program flash error
- FLASH WEB GAME的前端架构与人事分工
- AS 3的前端flash部分操作(自己看)
- 我写的这段代码提示出错:未能找到路径“E:/Program/demo_ftp/ftp1/admin/”的一部分。
- error PRJ0002 : 错误的结果 1 (从“E:/Program Files/Microsoft Visual Studio 9.0/VC/bin/cl.exe”返回)
- flash---web前端技术之
- 3518e写到flash与挂载nfs方式的区别
- javaFX exit the program(event filters, e.consume())
- Boost的状态机库教程(1)
- NQ51
- asp.net页面回传与js调用服务端事件、PostBack的原理详解(转)
- 思想的落叶
- Java 规则引擎的设置第一步
- Program E的Flash前端
- Struts实现图片上传
- The run order about Loaded event and OnApplyTemplate in custom control of Silverlight 2 beta 2
- Welcome, Kevin & his friends
- informix存储过程中的截取字符串、取当天日期
- 使用CXF时,在Client端用于把 Date 类型转换成 XMLGregorianCalendar
- Java研习计划
- 开发之准备:为目标设备创建映像
- 流行AJAX框架大比拼