导航:首页 > 源码编译 > qq机器人java脚本源码分享

qq机器人java脚本源码分享

发布时间:2023-08-19 03:58:10

‘壹’ 求QQ 智能 自动聊天 机器人 易语言源码 !最好是能在QQ群里用的 ,能自动...

梦真机器人注册码的,软件你自己下吧 刚才加你了,我这就发你邮箱吧 不用加我了

‘贰’ 易语言做的QQ机器人源码 简单一点的 把那个模拟按键的什么的弄出来就可以

QQ机器人就是通过webQQ网页版QQ,进行程序模拟登陆,例如抓取他的post包。得到吧群里面的信息,然后通过自己的语言库判断或者直接网络聊天助手进行计算回答就行了。
推荐你下载酷Q软件目前做的比较不错的QQ机器人,你可以用易语言写插件给QQ机器人使用,目前市面上的QQ机器人都是通过这个程序开源的源码修改的。

‘叁’ qq聊天机器人的原理

QQ聊天机器人(QQ chatterbot)是一个用来模拟人类对话或聊天的程序。“Eliza”和 “Parry”是早期非常着名的聊天机器人。它试图建立这样的程序:至少暂时性地让一个真正的人类认为他们正在和另一个人聊天。
qq聊天机器人的php原理
<?php

include"http_no_cookie.class.php";

classqq {

public$sid;
public$http;
public$qq_num;

function__construct() {
$this->http =newhttp_no_cookie;
}

functionlogin($qq_num,$qq_pwd) {
echo $data=$this->http->get("http://pt.3g.qq.com/");
$action= preg_match("/action=\"(.+)?\"/",$data,$matches);
$action=$matches[1];
$params=array();
$params["login_url"] ="http://pt.3g.qq.com/s?aid=nLogin";
$params["sidtype"] = 1;
$params["loginTitle"] ="手机腾讯网";
$params["bid"] = 0;
$params["qq"] =$qq_num;
$params["pwd"] =$qq_pwd;
$params["loginType"] =1;
echo$data=$this->http->post($action, http_build_query($params));
if(preg_match("/http:\/\/vc.gtimg.com\//",$data,$matches)){
echo"需要输入验证码";
return0;
exit;
}

if(preg_match("/密码错误/",$data,$matches)){
echo"密码错误";
return1;
exit;
}
$action= preg_match("/sid=(.+?)&/",$data,$matches);
$this->sid =$matches[1];
return$this->sid;
}

functionsendMsg($to_num,$msg,$sid= 0) {
$sid=$sid?$sid:$this->sid;
if(!$sid)
exit("sid值未传入进去");
$params=array();
$params["msg"] =$msg;
$params["u"] =$to_num;
$params["saveURL"] = 0;
$params["do"] ="send";
$params["on"] = 1;
$params["aid"] ="发送";
$url="http://q16.3g.qq.com/g/s?sid=".$sid;
echo$data=$this->http->post($url, http_build_query($params));
return$data;
}

functiongetMsg($qq_num= 0,$sid= 0) {
$qq_num=$qq_num?$qq_num:$this->qq_num;
if(!$qq_num)
exit("qq_num值未传入进去");
$sid=$sid?$sid:$this->sid;
if(!$sid)
exit("sid值未传入进去");
$url="http://q16.3g.qq.com/g/s?sid=".$sid."&3G_UIN=".$qq_num."&saveURL=0&aid=nqqChat";
$data=$this->http->get($url);
preg_match("/name=\"u\" value=\"(\d+)\"/",$data,$matches);
$result["qq"] =$matches[1];
$data=explode("<form",$data);
$data=$data[0];
preg_match_all("/<p>(.+)?<\/p>/",$data,$matches);
unset($matches[1][0]);
$result["content"] =$matches[1];
return$result;
}
functionlogout($sid){
$url="http://pt.3g.qq.com/s?sid=".$sid."&aid=nLogout";
echo$url;
echo$this->http->get($url);
}
functiongetFriendsList($qq_num= 0,$sid= 0){
$result=array();

$qq_num=$qq_num?$qq_num:$this->qq_num;
if(!$qq_num)
exit("qq_num值未传入进去");
$sid=$sid?$sid:$this->sid;
if(!$sid)
exit("sid值未传入进去");
$url="http://q16.3g.qq.com/g/s?aid=nqqchatMain&sid=".$sid."&myqq=".$qq_num;
while(true){
$i=1;
$url.="&p=".$i;
$data=$this->http->get($url);
preg_match_all("/u=(.+?)&/",$data,$matches);
foreach($matches[1]as$key=>$value){
$result[]=$value;
}
if(count($matches[1])<13)
break;
$i++;
}
return$result;
}
}

<?php
//PHP代码
classhttp_no_cookie {

private$curl;
public$user_agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13";

publicfunctionget($url) {
$this->curl = curl_init();
curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 8);
curl_setopt($this->curl, CURLOPT_URL,$url);
curl_setopt($this->curl, CURLOPT_HEADER, 0);
curl_setopt($this->curl, CURLOPT_USERAGENT,$this->user_agent);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
$data= curl_exec($this->curl);
curl_close($this->curl);
return$data;
}

publicfunctionpost($url,$params) {
$this->curl = curl_init();
curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 8);
curl_setopt($this->curl, CURLOPT_URL,$url);
curl_setopt($this->curl, CURLOPT_HEADER, 1);
curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->curl, CURLOPT_POST, 1);
curl_setopt($this->curl, CURLOPT_USERAGENT,$this->user_agent);
curl_setopt($this->curl, CURLOPT_POSTFIELDS,$params);
curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);
$data= curl_exec($this->curl);
curl_close($this->curl);
return$data;
}

}

?>

‘肆’ QQ机器人怎么弄啊

制作QQ机器人步骤如下:

1、网络搜索“第十代QQ机器人”。见下图:

阅读全文

与qq机器人java脚本源码分享相关的资料

热点内容
程序员网上接单能挣多少钱 浏览:175
稀有传奇手游源码 浏览:547
u盘里的cd驱动加密是什么 浏览:414
遗传算法编码长度 浏览:974
pe装服务器需要注意什么 浏览:320
foreach计数php 浏览:525
php自连接 浏览:296
程序员被喷了怎么办 浏览:708
android消息数 浏览:261
为什么在服务器里输不了指令 浏览:29
程序员那么可爱前女友剧情介绍 浏览:104
centosjava环境变量配置 浏览:555
服务器主板被锁如何恢复 浏览:132
xpc语言编程软件 浏览:823
光遇安卓怎么解限制 浏览:302
元气骑士老版源码 浏览:106
助眠解压音频小姐姐口腔音 浏览:236
sql加密身份证号解码 浏览:164
解压玩法视频 浏览:466
苹果xls如何设置加密 浏览:208