大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
{/ //已知BUG interface uses const type var //将本地时间转成QQ服务器时间 function Preprocess(aPassWord, aVerifyCode:string):string; //取得Flash版本 通过GetFlaseVersion得到 IdHTTP Referer的全部字串 //取得验证码 //将汉字转换为unicode码 //将unicode码转换为汉字 //提取字符串 function HashStr2BinStr(Hash: string):string; function Fmd5(str: string):string; //以Web形式登录QQ //登录QQ校友社区 //取自己农场数据 //取好友列表数据 //取好友农场数据 //计算等级 返回等级 //分析仓库商店背包数据 aType 0仓库1商店2背包 //动作类型 0偷取 1杀虫 2浇水 3除草 4收获 //取得farmKey //写日志文件 implementation //将本地时间转成QQ服务器时间 getTime() 方法傳回從 1970 年 1 月 1 日午夜開始計算的毫秒數 //提取字符串 function HashStr2BinStr(Hash:string):string; function Fmd5(str:string):string; function md5_3(str:string):string; function Preprocess(aPassWord, aVerifyCode:string):string; //取得Flash版本 //取得验证码 //转换 //将汉字转换为unicode码 //将unicode码转换为汉字 //以Web形式登录QQ aIdHTTP.Post(‘http://ptlogin2.qq.com/login’, PostData, RespData); tmpStr:= SubString(aIdHTTP.Response.RawHeaders.Text, ‘Set-Cookie: pt2gguin=’, ‘;’); //登录QQ校友社区 aIdHTTP.Request.CustomHeaders.Clear; tmpStr:= SubString(aIdHTTP.Response.RawHeaders.Text, ‘Set-Cookie: pst=’, ‘;’); QQ_Cookie:= QQ_Cookie + ‘ pst=’ + IntToStr(Cookie_pst) + ‘;’; QQ_Cookie:= Format(Const_Cookie, [Cookie_pt2gguin, Cookie_uin, Cookie_skey, Cookie_ptcz, Result:= True; |
//取自己农场数据
function GetMyFarmLandDB(aIdHTTP: TIdHTTP; var aWebStr: string): Boolean;
var
RespData: TStringStream;
begin
RespData:= TStringStream.Create(”);
Result:= False;
try
aIdHTTP.Request.Accept:= ‘*/*’;
aIdHTTP.Request.ContentType:= ”;
aIdHTTP.Request.Host:= ConnHost;
aIdHTTP.Request.Referer:= FlaseVersion;
aIdHTTP.Request.UserAgent:= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 2.0.50727)’;
aIdHTTP.Request.AcceptEncoding:= ‘gzip, deflate’;
aIdHTTP.Request.URL:= ‘/api.php?mod=user&act=run’;
aIdHTTP.Request.ContentVersion:= ‘x-flash-version: 10,0,22,87’;
QQ_Cookie:= Format(Const_Cookie, [Cookie_pt2gguin, Cookie_uin, Cookie_skey, Cookie_ptcz,
Cookie_pvid, Cookie_name, Cookie_pst]);
aIdHTTP.Request.CustomHeaders.Clear;
aIdHTTP.Request.RawHeaders.Values[‘Cookie’] := QQ_Cookie;
try
aIdHTTP.Get(‘http://’+ConnHost+’/api.php?mod=user&act=run’, RespData);
except
end;
Result:= True;
aWebStr:= Utf8ToAnsi(RespData.DataString);
except
end;
RespData.Free;
end;
//取好友列表数据
function GetFriendsListDB(aIdHTTP: TIdHTTP; var aWebStr: string): Boolean;
var
PostData, RespData, tmpRespData: TStringStream;
tmpaWebStr: string;
begin
farmTime:= DateTimeToServerTime(Now());
farmTime:= farmTime – Const_DelayFarmTime;
//取key
GetFarmKey(farmTime, farmTime, farmKey);
PostData:= TStringStream.Create( Format(Const_FriendsRefresh, [farmTime, farmKey]) );
RespData:= TStringStream.Create(”);
Result:= False;
try
aIdHTTP.Request.Accept:= ‘*/*’;
aIdHTTP.Request.ContentType:= ‘application/x-www-form-urlencoded’;
aIdHTTP.Request.Host:= ConnHost;
aIdHTTP.Request.Referer:= FlaseVersion;
aIdHTTP.Request.UserAgent:= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 2.0.50727)’;
aIdHTTP.Request.AcceptEncoding:= ‘gzip, deflate’;
aIdHTTP.Request.URL:= ‘/api.php?mod=friend’;
aIdHTTP.Request.ContentVersion:= ‘x-flash-version: 10,0,22,87’;
QQ_Cookie:= Format(Const_Cookie, [Cookie_pt2gguin, Cookie_uin, Cookie_skey, Cookie_ptcz,
Cookie_pvid, Cookie_name, Cookie_pst]);
aIdHTTP.Request.CustomHeaders.Clear;
aIdHTTP.Request.RawHeaders.Values[‘Cookie’] := QQ_Cookie;
try
aIdHTTP.Post(‘http://’+ConnHost+’/api.php?mod=friend’, PostData, RespData);
except
end;
Result:= True;
aWebStr:= Utf8ToAnsi(RespData.DataString);
if aWebStr=” then
aWebStr:= tmpaWebStr;
except
end;
RespData.Free;
end;
//取好友农场数据
function GetFriendFarmLandDB(aIdHTTP: TIdHTTP; aUserID: integer; var aWebStr: string): Boolean;
var
RespData: TStringStream;
begin
RespData:= TStringStream.Create(”);
Result:= False;
try
aIdHTTP.Request.Accept:= ‘*/*’;
aIdHTTP.Request.ContentType:= ”;
aIdHTTP.Request.Host:= ConnHost;
aIdHTTP.Request.Referer:= FlaseVersion;
aIdHTTP.Request.UserAgent:= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 2.0.50727)’;
aIdHTTP.Request.AcceptEncoding:= ‘gzip, deflate’;
aIdHTTP.Request.URL:= ‘/api.php?mod=user&act=run&flag=1&ownerId=’+IntToStr(aUserID);
aIdHTTP.Request.ContentVersion:= ‘x-flash-version: 10,0,22,87’;
QQ_Cookie:= Format(Const_Cookie, [Cookie_pt2gguin, Cookie_uin, Cookie_skey, Cookie_ptcz,
Cookie_pvid, Cookie_name, Cookie_pst]);
aIdHTTP.Request.CustomHeaders.Clear;
aIdHTTP.Request.RawHeaders.Values[‘Cookie’] := QQ_Cookie;
try
aIdHTTP.Get(‘http://’+ConnHost+’/api.php?mod=user&act=run&flag=1&ownerId=’+IntToStr(aUserID), RespData);
except
end;
Result:= True;
aWebStr:= Utf8ToAnsi(RespData.DataString);
except
end;
RespData.Free;
end;
//计算等级 返回等级
function ResultLevel(aSumExp:integer; var aNowExp, aOutLevelMaxExp: integer): integer;
var
iCount, tmpExp, tmpLevelExp, tmpSumMaxExp: integer;
begin
iCount:= 0;
//当前等级经验
tmpExp:= aSumExp;
//累计升级经验
tmpSumMaxExp:= CONST_OneLevelNum;
//当前等级升级经验
tmpLevelExp:= CONST_OneLevelNum;
if tmpSumMaxExp<aSumExp then
begin
inc(iCount);
tmpExp:= tmpExp – tmpLevelExp;
end;
//如果当前等级升级经验 小于 累计经验
while tmpSumMaxExp<aSumExp do
begin
tmpLevelExp:= tmpLevelExp + CONST_OneLevelNum;
//累计升级经验
tmpSumMaxExp:= tmpSumMaxExp + tmpLevelExp;
if tmpSumMaxExp<aSumExp then
begin
inc(iCount);
tmpExp:= tmpExp – tmpLevelExp;
end;
end;
//返回当前等级经验
aNowExp:= tmpExp;
//返回当前等级升级经验
aOutLevelMaxExp:= (iCount+1)*CONST_OneLevelNum;
Result:= iCount;
end;
//取背包数据
function PostBagsBD(aIdHTTP:TIdHTTP; var aWebStr: string; aType: TBagsType): boolean;
var
PostData, RespData: TStringStream;
tmpStr: string;
begin
farmTime:= DateTimeToServerTime(Now());
farmTime:= farmTime – Const_DelayFarmTime;
//取key
GetFarmKey(farmTime, farmTime, farmKey);
PostData:= TStringStream.Create( Format(Const_farmKey, [farmTime, farmKey]) );
RespData:= TStringStream.Create(”);
Result:= False;
try
aIdHTTP.Request.Accept:= ‘*/*’;
aIdHTTP.Request.ContentType:= ‘application/x-www-form-urlencoded’;
aIdHTTP.Request.Host:= ConnHost;
aIdHTTP.Request.Referer:= FlaseVersion;
aIdHTTP.Request.UserAgent:= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 2.0.50727)’;
aIdHTTP.Request.AcceptEncoding:= ‘gzip, deflate’;
aIdHTTP.Request.ContentVersion:= ‘x-flash-version: 10,0,22,87’;
case aType of
farm_Warehouse : tmpStr:= ‘/api.php?mod=repertory&act=getUserCrop’;
farm_Goods : tmpStr:= ‘/api.php?mod=repertory&act=getSeedInfo’;
farm_Bag : tmpStr:= ‘/api.php?mod=repertory&act=getUserSeed’;
end;
aIdHTTP.Request.URL:= tmpStr;
try
aIdHTTP.Post(‘http://’+ConnHost+tmpStr, PostData, RespData);
except
end;
Result:= True;
aWebStr:= Utf8ToAnsi(RespData.DataString);
except
end;
RespData.Free;
end;
//动作类型 0偷取 1杀虫 2浇水 3除草 4收获
// 5松土 6种植 7全部卖出 8购买种子
// 9查看消息 10所有动作(在PostAction中没有实现义意,不作操作)
//
//aActionType动作类型 是种植\卖出\购买种子还是做什么在此赋值
//aOwnerId是自己的UserID 必须为自己的UserID
//aPlace为地块的序号,从0开始 不用时可为0
//aSeedID 为作物\种子的aID 种植\卖出\购买种子时用到 不用时可为0
function PostAction(aIdHTTP: TIdHTTP; var aWebStr: string; aActionType: TActionType;
aOwnerId, aPlace, aSeedID: integer): boolean;
var
PostData, RespData: TStringStream;
tmpGetStr: string;
begin
farmTime:= DateTimeToServerTime(Now());
farmTime:= farmTime – Const_DelayFarmTime;
//取key
GetFarmKey(farmTime, farmTime, farmKey);
PostData:= TStringStream.Create( Format(Const_Action, [farmKey, Cookie_name, aOwnerId, farmTime, Cookie_name, aPlace]) );
RespData:= TStringStream.Create(”);
Result:= False;
try
aIdHTTP.Request.Accept:= ‘*/*’;
aIdHTTP.Request.ContentType:= ‘application/x-www-form-urlencoded’;
aIdHTTP.Request.Host:= ConnHost;
aIdHTTP.Request.Referer:= FlaseVersion;
aIdHTTP.Request.UserAgent:= ‘Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/; .NET CLR 2.0.50727)’;
aIdHTTP.Request.AcceptEncoding:= ‘gzip, deflate’;
aIdHTTP.Request.ContentVersion:= ‘x-flash-version: 10,0,22,87’;
case aActionType of
//偷取
Action_scrounge : tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=scrounge’;
//喷虫
Action_spraying : begin
tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=spraying’;
PostData:= TStringStream.Create( Format(‘tId=0&’+Const_Action,
[farmKey, Cookie_name, aOwnerId, farmTime, Cookie_name, aPlace]) );
end;
//浇水
Action_water : tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=water’;
//除草
Action_clearWeed: tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=clearWeed’;
//收获
Action_harvest : begin
tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=harvest’;
PostData:= TStringStream.Create( Format(‘place=%d&ownerId=%d&farmTime=%d&farmKey=%s’,
[aPlace, aOwnerId, farmTime, farmKey]) );
end;
//松土
Action_scarify : begin
tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=scarify’;
PostData:= TStringStream.Create( Format(‘place=%d&ownerId=%d&farmTime=%d&farmKey=%s’,
[aPlace, aOwnerId, farmTime, farmKey]) );
end;
//种植
Action_planting : begin
tmpGetStr:= ‘/api.php?mod=farmlandstatus&act=planting’;
PostData:= TStringStream.Create( Format(‘place=%d&cId=%d&ownerId=%d&farmTime=%d&farmKey=%s’,
[aPlace, aSeedID, aOwnerId, farmTime, farmKey]) );
end;
//卖出
Action_Sale: begin
tmpGetStr:= ‘/api.php?mod=repertory&act=sale’;
PostData:= TStringStream.Create( Format(‘cId=%d&farmTime=%d&number=%d&farmKey=%s’,
[aSeedID, farmTime, aPlace, farmKey]) );
end;
//全部卖出
Action_SaleAll : begin
tmpGetStr:= ‘/api.php?mod=repertory&act=saleAll’;
PostData:= TStringStream.Create( Format(‘farmTime=%d&farmKey=%s’,
[farmTime, farmKey]) );
end;
//买东西
Action_Buy : begin
tmpGetStr:= ‘/api.php?mod=repertory&act=buySeed’;
PostData:= TStringStream.Create( Format(‘number=%d&cId=%d&farmTime=%d&farmKey=%s’,
[aPlace, aSeedID, farmTime, farmKey]) );
end;
//查看消息
Action_getAllInfo : begin
tmpGetStr:= ‘/api.php?mod=chat&act=getAllInfo’;
PostData:= TStringStream.Create( Format(‘uId==%d&farmTime=%d&farmKey=%s’,
[aOwnerId, farmTime, farmKey]) );
end;
end;
aIdHTTP.Request.URL:= tmpGetStr;
try
aIdHTTP.Post(‘http://’+ConnHost+tmpGetStr, PostData, RespData);
if aIdHTTP.ResponseCode = 200 then
Result:= True;
aWebStr:= Utf8ToAnsi(RespData.DataString);
except
end;
except
end;
RespData.Free;
end;
//取得farmKey
function GetfarmKey(aInputTimeInt: Int64; var aFarmTime: int64; var aFarmKey: string): Boolean;
var
tmpaIdHTTP: TIdHTTP;
RespData: TStringStream;
tmpStr: string;
tmpTimePos, tmpKeyPos: integer;
begin
Result:= False;
afarmTime:= aInputTimeInt;
afarmKey:= LowerCase(Fmd5( IntToStr(afarmTime) + Copy(‘sdoit78sdopig7w34057’, (afarmTime mod 10)+1, 20) ));
Result:= True;
end;
//写日志文件
procedure WriteLog(aQQnum, aLogStr, aAppPah: String);
var
F : TextFile;
tmpStr: string;
begin
tmpStr:= aAppPah + ‘日志\’;
if not DirectoryExists(tmpStr) then
if not CreateDir(tmpStr) then
begin
//Application.ProcessMessages;
end;
tmpStr:= tmpStr+ aQQnum + ‘\’;
if not DirectoryExists(tmpStr) then
if not CreateDir(tmpStr) then
begin
//Application.ProcessMessages;
end;
tmpStr:= tmpStr+FormatDateTime(‘YYYYMM’, Date())+’\’;
if not DirectoryExists(tmpStr) then
if not CreateDir(tmpStr) then
begin
//Application.ProcessMessages;
end;
tmpStr:= tmpStr+FormatDateTime(‘YYYYMMDD’, Date())+’.Log’;
AssignFile(F, tmpStr);
if FileExists(tmpStr) then
Append(F)
else
ReWrite(F);
Writeln(F, aLogStr);
CloseFile(F);
end;
initialization
DelayedDpikeInt:= 0;
QQ_ServerTime:= DateTimeToServerTime(Now());
Loc_ServerTime:= QQ_ServerTime;
end.
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/194452.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...