var _autorun;
var str = new Array (' Forward what ', ' share what ', ' forwarded ', ' transferred ', ' forwarding ', ' continue to apply ', ' in no ', ' sent ', ' to forward ', ' to share ', ' shared ', ' yv ', ' bv ', ' gv ', ' PV ', ' RV ', ' Hello ', ' Beauty ', ' ask ', ' Code ', ' I want ', ' Want V ', ' want to add V ';
var isrun = false;
var i=0;
function Start () {
Console.log (' first ' + (++i) + ' secondary refresh ');
var chatlistcolumn =$ (". Chatlistcolumn");
Chatlistcolumn.each (function () {
var _this = this;
var _me = $ (this);
var attr = $ (this). attr (' un ');
if ((attr!= ') && (attr!= ' Filehelper ') && (attr!= ' Weixin ') && (attr!= ' Newsapp ') && ( attr!= ' Fmessage ') {
Console.log ($ (this). attr (' un '));
var disp = _me.find (' P.desc '). html ();
DISP = Disp.tolowercase ();
DISP = Disp.trim ();
for (var i = 0; i < str.length; i++) {
if (Disp.indexof (Str[i])!=-1) {
Isrun=true;break;
}
};
if (Disp.indexof (' You have added ')!=-1| | Disp.indexof (' Through your friend Authentication request ')!=-1| | Disp.indexof (' You add to Address Book ')!=-1) {
_this.click ();
var _input = $ ("#textInput");
var message = _ajax (' You have added ', attr);
_input.val (message);
var _click = document.getelementsbyclassname ("Chatsend");
_click[0].click ();
Isrun=false;
}
else if ((Disp.indexof (' Send buddy authentication request ')!=-1) &&disp!= ') {
Isrun=false;
}
else if ((Disp.indexof (' Read the above message ')!=-1) &&disp!= ') {
Isrun=false;
}
else if (disp!= ') {
Isrun=false;
}
Console.log (disp);
/*if (Isrun) {
_this.click ();
var _input = $ ("#textInput");
var message = _ajax (disp,attr);
_input.val (message);
var _click = document.getelementsbyclassname ("Chatsend");
_click[0].click ();
Isrun=false;
}
else if (Disp.indexof (' You add to Address Book ')!=-1) {
_this.click ();
var _input = $ ("#textInput");
var message = _ajax (' You add to Address Book ', attr);
_input.val (message);
var _click = document.getelementsbyclassname ("Chatsend");
_click[0].click ();
Isrun=false;
}
else if (Disp.indexof (' You have added ')!=-1| | Disp.indexof (' Through your friend Authentication request ')!=-1) {
_this.click ();
var _input = $ ("#textInput");
var message = _ajax (' You have added ', attr);
_input.val (message);
var _click = document.getelementsbyclassname ("Chatsend");
_click[0].click ();
Isrun=false;
}
else if ((Disp.indexof (' Send buddy authentication request ')!=-1) &&disp!= ') {
Isrun=false;
}
else if ((Disp.indexof (' Read the above message ') ==-1) &&disp!= ') {
_this.click ();
var _input = $ ("#textInput");
var message = _ajax (' other ', attr);
_input.val (message);
var _click = document.getelementsbyclassname ("Chatsend");
_click[0].click ();
Isrun=false;
}*/
}
})
}
function _ajax (disp,attr) {
var message= ';
$.ajax ({
URL: ' http://112.124.97.72/Auto_Server/autoserver.php ',
Async:false,
Type: ' Get ',
Data: "message=" +disp+ "&id=" +attr,
Success:function (e) {
if (e) {
message = e;
}
else{
}
}
})
return message;
}
var time= ' 3500 ';
function Run () {
_autorun = SetInterval (' Start () ', time);
}
Alert (1);
var button = "<div id= ' plugin ' ><p id= ' message ' > Note After the left session list is fully loaded, click the following button V1.4.4 only reply to the first version </p>";
button+= "<button id= ' Weixin_button ' > Execute script </button>";
button+= "<button id= ' stop ' > Stop script </button>"
button+= <span> Script Refresh time adjustment: </span><input type= ' number ' id= ' frequ ' value= ' 3.5 ' ><span> sec </ Span><button id= ' Sub ' > OK </button></div>;
$ ("Body"). prepend (button);
$ ("#weixin_button"). Click (function () {
$ (this). css ({' Background ': ' #30DA59 ', ' Color ': ' RGB (253, 248, 248) '});
$ ("#stop"). CSS ({' Background ': ' #BEC7C0 ', ' Color ': ' RGB (14, 9, 9) '})
Run ();
})
$ ("#stop"). Click (function () {
$ (this). css ({' Background ': ' #30DA59 ', ' Color ': ' RGB (253, 248, 248) '});
$ ("#weixin_button"). CSS ({' Background ': ' #BEC7C0 ', ' Color ': ' RGB (14, 9, 9) '})
Window.clearinterval (_autorun);
})
$ ("#sub"). Click (function () {
var _second = parsefloat ($ ("#frequ"). Val ());
if (_second<2) {
Alert (' Refresh time is too short to increase the number of people may have a script crash! ");
$ ("#frequ"). Val (' 3.5 ');
Time = 3500+ "";
}
else if (_second>6) {
var is_true = confirm (' Refresh time is too long, the user may not receive the message for a long time, do you want to set this? ');
if (is_true) {
Time = _second*1000+ "";
Alert (' After modifying the refresh time, stop the script and then click the Execute script to take effect. ');
}
else{
$ ("#frequ"). Val (' 3.5 ');
Time = 3500+ "";
}
}
else{
Time = _second*1000+ "";
Alert (' After modifying the refresh time, stop the script and then click the Execute script to take effect. ');
}
Console.log ("Time modified to:" +time+ "milliseconds");
})