返回列表 回复 发帖

谁能提供个好用点的挂平叛的脚本

新弄个家将,不知是网络的原因还是脚本的原因,总是挂不住 ,谁有稳定些的平叛脚本,提供个,谢谢!
加我QQ,我给你发个,哈哈
加我QQ,我卖你个,哈哈
这个也不错
附件: 您所在的用户组无法下载或查看附件
1

评分次数

楼上的好东西
这个是开箱子一起的
  1. // 这个脚本在网页幽灵里运行可能会出错,用彗星开发小助手运行吧
  2. // 要是网络卡了也会出错,如果不太卡或许还可以自动恢复
  3. // 机器太卡可能也会出错,具体不清楚
  4. // 背包没药了也会出错
  5. // 出错的定义是3分钟以内没有任何动作,或者动作是无效的死循环
  6. // 最好不要在大地图或者奇奇怪怪的地方上运行脚本
  7. // 如果在打怪界面按开始,就会只打同一个怪(刷怪)
  8. // 如果在一个地图内停留了指定的时间,会被脚本认为是出错了,脚本会尽可能的处理掉
  9. // 如果想要自动买药,最好先跑去打开商店页面再运行,但不能保证一定会成功,别太依赖此功能
  10. // 就算是停止状态,寻路功能还是会使用脚本里的,这样比较方便(比如手动做任务,找NPC等)
  11. // ie崩溃无法处理

  12. var WAITTIME=10;           // 服务器忙,请3秒钟以后再试!
  13. var ERROR_TIME = 30;       // 出错了!怎么都不换地图啊,过段时间处理
  14. var limitHP = 8000;        // 当血量小于这个数值就加血(满血不加),自己根据情况修改
  15. var onlyAddHPThisHero = "";   // 只为这个人加血,根据个人情况修改,不填为全加
  16. var lag = 5;               // 延时,秒,完全加载网页所需时间,太小或太卡就会不停的刷新
  17. var upPathLag = 1.3;       // 过图延时,秒,好像过图太快会被踢
  18. var noClickFinish = 0;     // 如果=1,那就只打怪不按完成。可以自己换上小家将再按,家将比较容易升级
  19. var wrongTime;             // WAITTIME
  20. var keepAttack;
  21. var lastCity;
  22. var worldMapId;
  23. var lastMonsterURL;
  24. var needKillNum;
  25. var targetType = '';     // unknown,monster,ncp,map @ ''=unknown
  26. var stopsign;
  27. var isInit;


  28. init();    // ---大家都去打残卷啊!

  29. function stop(){
  30.   stopsign=1;
  31.   document.title="STOP";
  32.   if(document.frames[0].document.frames[0].atkNeedTime!=undefined)
  33.     document.frames[0].document.frames[0].location.href ='enter-cityImpl.action';
  34. }

  35. function start(){     
  36.   stopsign=0;
  37.   checkEnvironment();
  38.   autoScouringFinish();
  39.   if(keepAttack) document.title="刷怪";
  40.   else document.title="平叛";
  41. }

  42. function init(){
  43.   if(isInit) return;
  44.   isInit=1;
  45.   stopsign=1;
  46.   needKillNum=10;
  47.   wrongTime = 0;
  48.   errTime = ERROR_TIME;
  49.   lastCity = "";
  50. //  createButton();
  51.   setInterval("loopFun()",1000);
  52. }

  53. function createButton(){
  54.   document.body.scroll="yes";
  55.   var   sobj  =  createIfr("222");
  56.   var   ifram   =   document.frames("222");
  57.   ifram.document.write("<body><table align='center'>");
  58.   ifram.document.write("<input type='radio' name='radiobutton' onclick='parent.start()'> 开始");
  59.   ifram.document.write("<input type='radio' name='radiobutton' onclick='parent.stop()' > 停止");
  60.   ifram.document.write("</table></body>");
  61. }

  62. function loopFun(){
  63.   try{checkError()}catch(e){};
  64.   try{myErrorHandler()}catch(e){};
  65.   try{autoAttack()}catch(e){};
  66.   try{document.frames[0].document.frames[0].eval(pickUpPath+'')}catch(e){};
  67. }


  68. function autoAttack(){
  69.   if(stopsign)
  70.     return;
  71.   var ifr = document.frames[0].document.frames[0];
  72.   if(!ifr.codes)
  73.      return;
  74.   lastMonsterURL = ifr.location.href;
  75.   if(ifr.atkNeedTime==undefined)
  76.   {
  77.     ifr.atkNeedTime = ifr.codes.length+3;
  78.     if(ifr.codes[ifr.codes.length-2].targetTeamId>0) ifr.isFail=1;
  79.     else ifr.isFail=0;
  80.     primaryFrame.loadPlayer(1);
  81.     ifr.eval("function setTimeout(){}");
  82.     ifr.eval(LoadJS+'');
  83.     ifr.eval("LoadJS('js/application.js')");
  84.   }
  85.   ifr.atkNeedTime--;
  86.   alert("打怪: "+needKillNum+"</br>时间: "+ifr.atkNeedTime);
  87.   if(ifr.atkNeedTime>0) return;
  88.   var goOut = 0;
  89.   needKillNum -= getMonsterNum();
  90.   if(!keepAttack && needKillNum<=0)
  91.     goOut=1;
  92.   if(ifr.isFail)
  93.     goOut=1;
  94.   if(!goOut && addHP())
  95.   {
  96.     needKillNum += getMonsterNum();
  97.     return;
  98.   }

  99.   ifr.atkNeedTime=9999999;  // 破坏进入条件
  100.   if(goOut)
  101.   {
  102.      ifr.inCity=1;ifr.codes=0;
  103.      ifr.mapHTML=httpPost("enter-cityImpl.action");
  104.      autoScouringFinish();
  105.      return;   
  106.   }
  107.   ifr.location.reload();
  108. //  alert("本轮平叛还有"+needKillNum+"个怪");
  109.   return;
  110. }

  111. function getMonsterNum(){
  112.   try
  113.   {
  114.     var ifr = document.frames[0].document.frames[0];
  115.     if(!ifr.codes)
  116.       return 0;
  117.     var min=1;
  118.     for(var i=0;i<ifr.codes.length;++i)
  119.     {
  120.       if(ifr.codes[i].targetTeamId < min)
  121.         min = ifr.codes[i].targetTeamId;
  122.     }
  123.     return  min*(-1)+1;
  124.   }
  125.   catch(e)
  126.   {
  127.     return 999;
  128.   }
  129. }

  130. function autoScouringFinish(){  
  131.   try
  132.   {  
  133.     if(stopsign)
  134.       return;
  135.     if(keepAttack)
  136.       return;
  137.     var ifr = document.frames[0].document.frames[0];
  138.     if(!ifr.inCity||addHP())
  139.     {
  140.       setTimeout("autoScouringFinish()",lag*500);
  141.       return;
  142.     }
  143.    
  144.     if(isHaveErrorPage())
  145.     {
  146.       setTimeout("autoScouringFinish()",lag*500);
  147.       return;
  148.     }
  149.     offAlert();
  150.     ifr =  getInfoIfr();
  151.     if(!ifr)
  152.     {
  153.       document.frames[0].showScouringTask();
  154.       setTimeout("autoScouringFinish()",lag*500);
  155.       return;
  156.     }
  157.     else if(ifr.location.href.indexOf("manageScouringTask")==-1)
  158.     {
  159.       ifr.location.href = 'manageScouringTask.action';
  160.       setTimeout("autoScouringFinish()",lag*500);
  161.       return;
  162.     }

  163.     if(ifr.$('span').length==0)
  164.     {
  165.       setTimeout("autoScouringFinish()",lag*500);
  166.       return;         
  167.     }

  168.     if(!noClickFinish) ifr.$('span.finished_button').click();
  169.     nextScour();
  170.     return;
  171.   }
  172.   catch(e)
  173.   {
  174.   }
  175. }

  176. function nextScour(){
  177.   try
  178.   {
  179.     if(stopsign)
  180.       return;
  181.     var ifr = document.frames[0].document.frames[0];
  182.     if(isHaveErrorPage())
  183.     {
  184.       setTimeout("nextScour()",lag*500);
  185.       return;
  186.     }
  187.     var ifr = document.frames[0].document.frames[0];
  188.    
  189.     var myObjs = getInfoIfr().document.getElementsByTagName("SPAN");
  190.    
  191.     var monLv = 99999;
  192.     var monsterId = null;
  193.     for(var i=0;i<myObjs.length;++i)
  194.     {
  195.       if(myObjs[i].className=='monster')
  196.       {     
  197.         var strs = myObjs[i+2].innerText.match(/(\d+).(\d+)/);
  198.         needKillNum=strs[2]-strs[1];
  199.         if(needKillNum==0) continue;
  200.         if(myObjs[i].monsterSce == getMapTitle())
  201.         {
  202.           ifr.location.href = "battle-attackMonster.action?sceneId="+getRealSceId(myObjs[i].monsterId);
  203.           return;
  204.         }
  205.         var curLv = eval(myObjs[i].monsterLV);
  206.         if(curLv < monLv)
  207.         {
  208.           monsterId = myObjs[i].monsterId;
  209.           monLv = curLv;
  210.         }
  211.       }
  212.     }
  213.     if(!monsterId) return;
  214.     targetType='monster';
  215.     myPickUpPath(monsterId);
  216.   }
  217.   catch(e)
  218.   {
  219.   }
  220. }

  221. function addHP(){
  222.   try
  223.   {
  224.     offAlert();
  225.     var errorHandlerFunc = function (errMsg){
  226.           if(errMsg.match(/没有金创药/)) buyGoods(60300092,50);
  227.           alert(errMsg);
  228.        };
  229.     var ifr = document.frames[0].document.frames[0];
  230.     var playerObj = primaryFrame.loadPlayer();
  231.     var heroObjs  = [];
  232.     heroObjs.push(playerObj.userProxy);                     
  233.     for(var i=0;i<playerObj.heroList.length;++i)
  234.     {
  235.       if(playerObj.heroList[i].isEquip==1)
  236.         heroObjs.push(playerObj.heroList[i]);
  237.     }   
  238.   
  239.     for(i=0;i<heroObjs.length;++i)
  240.     {
  241.       if(heroObjs[i].curHP>limitHP)
  242.         continue;
  243.       if(onlyAddHPThisHero && heroObjs[i].entName!=onlyAddHPThisHero && heroObjs[i].curHP!=0)
  244.         continue;
  245.       if(heroObjs[i].curHP>=heroObjs[i].HP)
  246.         continue;
  247.       var ifr =  document.frames[0].document.frames[0];
  248.       ifr.dwrAction.fullHeroHp(heroObjs[i].heroId,{errorHandler:errorHandlerFunc});
  249.       return 1;
  250.     }
  251.   }
  252.   catch(e)
  253.   {
  254.   }
  255.   return 0;
  256. }

  257. function continueAttack(){
  258.     if(addHP())
  259.       setTimeout("continueAttack()",lag*500);
  260.     else if(lastMonsterURL)
  261.       document.frames[0].document.frames[0].location.href=lastMonsterURL;
  262. }

  263. function myErrorHandler(){   
  264.     if(stopsign) return;
  265.     var ifr = document.frames[0].document.frames[0];
  266.     if(ifr.codes) retrun;
  267.     if(ifr.bomb==undefined) ifr.bomb=ERROR_TIME;
  268.     if(--ifr.bomb>0) return;
  269.     ifr.bomb=ERROR_TIME;
  270.     ifr.location.href="enter-cityImpl.action";
  271.     if(keepAttack)
  272.       setTimeout("continueAttack()",lag*2000);
  273.     else
  274.       setTimeout("autoScouringFinish()",lag*2000);
  275. }

  276. function checkError(){
  277.   if(stopsign)
  278.     return;
  279.   var errIfr = isHaveErrorPage();
  280.   if(!errIfr)
  281.   {
  282.     wrongTime = WAITTIME;
  283.     retrun ;
  284.   }
  285.   wrongTime--;
  286.   if(wrongTime>0)
  287.     return;
  288.   wrongTime = WAITTIME;
  289.   errIfr.parent.location.reload();
  290. }

  291. function isHaveErrorPage(ifr){
  292.   try
  293.   {
  294.     if(!ifr)
  295.       ifr = top;
  296.     if(ifr.location.href.indexOf("appError.jsp")!=-1)
  297.       return ifr;

  298.     var errPageIfr = null;
  299.     for(var i=0; !errPageIfr&&i<ifr.document.frames.length; ++i)
  300.       errPageIfr = isHaveErrorPage(ifr.document.frames[i]);
  301.     return errPageIfr;
  302.   }
  303.   catch(e)
  304.   {
  305.     return null;
  306.   }
  307. }

  308. function checkEnvironment(){
  309.   var ifr = document.frames[0].document.frames[0];         
  310.   if(ifr.location.href.indexOf("sceneId=")!=-1)
  311.     keepAttack = 1;
  312.   else
  313.     keepAttack = 0;   
  314. }

  315. function getMapTitle(){
  316.   var ifr = document.frames[0].document.frames[0];   
  317.   return ifr.document.title;
  318. }

  319. function offAlert(){
  320.     var ifr =  document.frames[0].document.frames[0];
  321.     var str = "function alert(A){top.alert(A)}";
  322.     ifr.eval(str);
  323. }

  324. /*修改信息显示位置*/
  325. function alert(A){   
  326. //    primaryFrame.document.forms[0].chatText.innerText=A+'';    //聊天处显示
  327. //    var obj = primaryFrame.gongneng_right_button_wrapper;    //right_button_wrapper商城处显示
  328.     var obj = primaryFrame.gongneng_qian;    //qian银子处显示
  329.     obj.style.background="#000000";
  330.     obj.style.color="#FBF582";
  331.     obj.style.fontSize=14;
  332.     obj.innerHTML=A+'';
  333. }

  334. function myPickUpPath(sceid){
  335.   document.frames[0].document.frames[0].eval(pickUpPath+'');
  336.   document.frames[0].document.frames[0].pickUpPath(0,sceid,0);
  337. }

  338. function pickUpPath(curCasId, sceId, pickUpPathType) {
  339.     parent.pathList = [];
  340.     parent.isPickUpPath = false;
  341.     dwrAction.pickUpPath(curCasId, sceId, pickUpPathType, {
  342.       callback:function(data) {
  343.         if(!data) return;
  344.         if(pickUpPathType == 0)
  345.           data.push(sceId);
  346.         if(top.stopsign)
  347.           top.targetType='';
  348.         data.shift();
  349.         top.gotoThis(data);
  350.       },
  351.       errorHandler:top.alert
  352.     });
  353. }

  354. function gotoThis(sceneData){
  355.   if(!sceneData.length) return;
  356.   var ifr = document.frames[0].document.frames[0];
  357.   var sceId = sceneData.shift();
  358.   if(!("targetType" in top)) targetType='';
  359.   if(targetType) targetType = targetType.toLowerCase();
  360.   else targetType = 'unknown';
  361.   var realSceId,url;
  362.   realSceId=getRealSceId(sceId);
  363.   var worldMapIdx=-1;
  364.   for(var i=0;i<sceneData.length;++i)  // 找大地图
  365.   {
  366.     if(!worldMapId) break;             // 如果大地图的真实ID还没有获得,那就不用找了
  367.     if(sceneData[i]%10000==181)
  368.     {
  369.       worldMapIdx=i;
  370.       break;
  371.     }
  372.   }
  373.   for(var i=0;i<=worldMapIdx;++i)      // 如果找到大地图,下次从第一层地图开始,并把本次要过的图改为大地图      
  374.   {
  375.     sceneData.shift();
  376.     realSceId=worldMapId;  
  377.   }
  378.   if(!realSceId)
  379.   {
  380.     upPathErrorHandler(sceId);
  381.     return;
  382.   }
  383.   url = 'transport.action?targetCasId=' + ifr.wrwte(realSceId);
  384.   if(sceneData.length)  // 不是最后一个是目标,那就过图
  385.   {
  386.     if(!worldMapId && sceId%10000==181) worldMapId=realSceId; // 首次获得大地图ID
  387.     ifr.mapHTML=httpPost(url);
  388.     setTimeout(function (){gotoThis(sceneData)},upPathLag*1000);
  389.     return;
  390.   }
  391.   // 处理最后一个目标
  392.   if(targetType == 'monster')
  393.     ifr.location.href = 'battle-attackMonster.action?sceneId=' + realSceId;
  394.   if(targetType == 'npc')
  395.   {
  396.     httpPost('enter-npc.action?sceId=' + realSceId);
  397.     setTimeout("enteredNPC()",1000);
  398.   }
  399.   if(targetType == 'unknown')
  400.   {
  401.     document.frames[0].eval("pathList[pathIndex+1]="+sceId);
  402.     document.frames[0].isPickUpPath=true;
  403.     document.frames[0].document.frames[0].location.reload();
  404.   }
  405.   if(targetType == 'map')
  406.   {
  407.     httpPost(url);
  408.     document.frames[0].document.frames[0].location.reload();
  409.   }
  410. }

  411. function getRealSceId(sceId){
  412.   return sceId+'';
  413. }

  414. function upPathErrorHandler(sceId)
  415. {
  416.   document.frames[0].document.frames[0].location.href="enter-cityImpl.action";
  417. }

  418. function httpPost(urls)
  419. {
  420.   oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  421.   oXmlHttp.open("POST",urls,false);
  422.   oXmlHttp.setRequestHeader("cache-control","no-cache");
  423.   oXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  424.   oXmlHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  425.   oXmlHttp.send(null);
  426.   return oXmlHttp.responseText;
  427. }

  428. function buyGoods(goodsId,num){
  429.   var ifr = document.frames[0].document.frames[0];
  430.   ifr.dwrAction.buyItemFromStoreImpl(10023,goodsId,num);
  431. }

  432. function getInfoIfr()
  433. {
  434.   var ifr = document.frames[0].document.frames[0];
  435.   for(var i=0;i<10;++i)try{if(ifr.document.frames[i].$)return ifr.document.frames[i]}catch(e){};
  436.   return null;
  437. }

  438. function createIfr(id_str){  
  439.   if(!id_str)
  440.     id_str='myifr';
  441.   if(typeof(id_str)!='string') return false;
  442.   if(document.getElementById(id_str)) return document.getElementById(id_str);
  443.   var obj = document.createElement("iframe");  
  444.   obj.id   = id_str;   
  445.   obj.width=220;
  446.   return document.body.appendChild(obj);
  447. }

  448. function LoadJS(file){
  449. var head = document.getElementsByTagName('HEAD').item(0);
  450. var script = document.createElement('SCRIPT');
  451. script.src = file;
  452. script.type = "text/javascript";
  453. head.appendChild(script);
  454. }

  455. //=====================以下为循环捡箱========================
  456. function openBoxes(objName){
  457.     this._main=document.frames[0];
  458.     this._primary=document.frames[0].document.frames[0];
  459.     this.config={
  460.         loopDelay:1800000,    //大循环间隔
  461.         smallLoopDelay:600,    //小循环间隔
  462.         boxFrameName:'getBox' //frame名
  463.     };
  464.     this.stopFlag=0;//0-非结束;1-结束
  465.     this._boxIds=[240112,240211,140110,140207,280109,280213,70106,70204,200104,200206,200305,300109,300502,300207,300308];
  466.     this.delayLoop=null;
  467.     this.index=0;
  468.     this.obj=objName;
  469. }

  470. openBoxes.prototype.toString=function(){
  471.     var str = '';
  472.     str+="<body  style='background-color:transparent;background:url(http://imageRes02.youxigu.com/sword/image/pages/mainFrame/dabeijing.gif);text-align:center;'><table border=1><tr>";
  473.     str+="<th style='color:red;' colspan='2' id= 'tips_click_box'>平叛开箱</th></tr>";
  474.     str+="<tr><td><input type='button' style='CURSOR: hand' onclick='parent."+this.obj+".beginO()' value='开箱'/></td>";
  475.     str+="<td><input type='button' style='CURSOR: hand' onclick='parent."+this.obj+".stopO()' value='停开'/></td>";
  476.     str+="<tr><td><input type='button' style='CURSOR: hand' onclick='parent.start()' value='平叛'/></td>";
  477.     str+="<td><input type='button' style='CURSOR: hand' onclick='parent.stop()' value='停止'/></td></tr>";
  478. //    str+="<tr><th style='color:red;' colspan='2'>加血<input type='text' size='4' value='10000' onchange='this.value=top.limitHP=this.value-0'></th></tr>";
  479.     str+="</tr></table></body>";
  480.     return str;
  481. }

  482. openBoxes.prototype.appendElement=function(id,type,height,width){
  483.   if(!id) id=this.obj+"_"+type;
  484.   if(typeof(id)!='string') id+='';
  485.   this.config.boxFrameName=id;
  486.   if(document.getElementById(id)) return document.getElementById(id);
  487.   var anElement = document.createElement(type);  
  488.   anElement.id   = id;   
  489.   anElement.width=width;
  490.   anElement.height=height;
  491.   return document.body.appendChild(anElement);
  492. }

  493. openBoxes.prototype.showMessage=function(msg){
  494.   var targetObj = primaryFrame.gongneng_qian;
  495.   targetObj.style.color="#FBF582";
  496.   targetObj.style.background="#000000";
  497.   targetObj.style.fontSize=12;
  498.   targetObj.innerHTML=msg;
  499. }

  500. openBoxes.prototype.showMsg=function(msg){
  501.     document.frames(this.config.boxFrameName).document.all.tips_click_box.innerHTML = msg;
  502. }

  503. openBoxes.prototype.hookAlert=function(){
  504.     this._main.showAlert=this.showMessage;
  505.     this._main.alert=this.showMessage;
  506.     this._primary.alert=this.showMessage;
  507.     this._primary.showAlert=this.showMessage;
  508. }

  509. openBoxes.prototype.getSysTime=function(){
  510.     return (new Date()).toLocaleTimeString();
  511. }

  512. openBoxes.prototype.getBoxObj=function(sceId){
  513.         var str = "<div class='funName' funId='172' sceId="+sceId+" onclick='getBoxThings(this)'></div>"
  514.         var thisObj = primaryFrame.$(str).get(0);
  515.         return thisObj;   
  516. }

  517. openBoxes.prototype.beginO=function(){
  518.         this.hookAlert();
  519.         this.index=0;
  520.         this.stopFlag=0;
  521.         try{clearTimeout(this.delayLoop);}catch(e){};
  522.         this.boxCPU();
  523. }

  524. openBoxes.prototype.stopO=function(){
  525.         this.stopFlag=1;
  526.         try{clearTimeout(this.delayLoop);}catch(e){};
  527. }

  528. openBoxes.prototype.boxCPU=function(){
  529.         if(this.stopFlag) return;
  530.         if(this.index>=this._boxIds.length){
  531.             this.showMsg("End At "+this.getSysTime());
  532.             this.index=0;
  533.             this.delayLoop=setTimeout(""+this.obj+".boxCPU()",this.config.loopDelay);
  534.             return;
  535.         }
  536.         var obj=this.getBoxObj(this._boxIds[this.index]);
  537.         this._getBoxThings(obj);
  538. }

  539. openBoxes.prototype._getBoxThings=function(obj){
  540.     this.hookAlert();
  541.     this.index++;
  542.     this._main.getBoxThings(obj);
  543.     setTimeout(""+this.obj+".boxCPU()",this.config.smallLoopDelay);
  544.     this.showMsg("Now At "+this.index);
  545. }


  546. //Main
  547. //运行该脚本;然后再运行别的脚本
  548. var oBox = new openBoxes("oBox");
  549. if(document.body.scroll=='no')  document.body.scroll='yes';
  550. //可以这样设置循环间隔:
  551. //oBox.config.loopDelay=3600*1000;
  552. //oBox.config.smallLoopDelay=500;
  553. var obj = oBox.appendElement('getBox','iframe',160,180);
  554. document.frames("getBox").document.write(oBox);
复制代码
1

评分次数

下载了,谢谢
我来试试看
感谢各位的帮忙
回复的体力.顶
混点体力
迷糊啊。
果真是好东西啊
123
顶,这都是好东西啊···
好贴要顶····
dinga aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
谢谢lytflb的好东西 下了
ZX
ding a
我下了,有没有自动挂评判,倭寇出来后自动打倭寇的?
返回列表