Скрипт во фрейме - Форум
Страница 1 из 11
Форум » Форум веб мастеров » uCoz » Скрипт во фрейме (как сделать ??)
Скрипт во фрейме

Максим
Пользователи
Сообщений 20
+
0
-
Ваши награды 0
Максим написал: В ответ пользователя Максим Написано 16 Января 2013 в 15:26
Сообщение № 1
Я уже более 10 раз пытался это сделать и загружал и что только не делал ,обьясните подробно как же во фрейм ставиться скрипт  
и можно ли вот такой скрипт поставить :

Код
(function(){
     if ((location.hostname !== "wap.teeda.ru") && (location.hostname !== "teeda.play.tegos.ru") && (location.hostname !== "teeda.my.mgates.spaces.ru"))
         return;
     var unsafeWindow= this.unsafeWindow;
     (function(){
         var test_scr= document.createElement("script");
         var tid= ("t" + Math.random() + +(new Date())).replace(/\./g, "");
         test_scr.text= "window."+tid+"=true";
         document.querySelector("body").appendChild(test_scr);
         if (typeof(unsafeWindow) == "undefined" || !unsafeWindow[tid]) {
             if (window[tid]) {
                 unsafeWindow= window;
             } else {
                 var scr= document.createElement("script");
                 scr.text= "(" +
                     (function() {
                         var el= document.createElement('unsafeWindow');
                         el.style.display= 'none';
                         el.onclick=function(){return window};
                         document.body.appendChild(el);
                     }).toString() + ")()";
                 document.querySelector("body").appendChild(scr);
                 this.unsafeWindow= document.querySelector("unsafeWindow").onclick();
                 unsafeWindow= window.unsafeWindow;
             };
         }
     })();
     
     // начиная отсюда, можно писать код
    debugger;
var Host = 'http://' + location.hostname + '/';

//Init Links, Divs, Sound, Buttons
{
    function QLink(name, link)
    {
       this.name = name;
       this.link = Host + link;
    }

    var Links = [
   new QLink('Главная', 'game'),
   new QLink('Торговля','game/trade'),
   new QLink('Таверна', 'tavern'),
   new QLink('Охота', 'hunting'),
   new QLink('Штурм', 'assault'),
   new QLink('Поход', 'hike'),
   new QLink('Аванпост', 'outpost'),
   new QLink('Территории', 'territory'),
   new QLink('Гильдия', 'clan/main'),
   new QLink('Чат Гильдии', 'chat/clan'),
   new QLink('Форум Гильдии', 'forum_clan'),
   new QLink('Скупщик', 'knacker'),
   new QLink('Работа', 'craft'),
       new QLink('Настройки бота', 'users/info/127717')
    ];
     
    var MyDIVLinks = '<div id="QLinks" style="position:fixed;top:5px;right:5px;text-color:#FFF">';
    for (var i = 0; i < Links.length; ++i)
       MyDIVLinks += '<p><a href="'+Links[i].link+'">'+Links[i].name+'</a></p>';
    MyDIVLinks += '</div>';

    var DivStyle = "height:200px;position:fixed;bottom:5px;right:5px;opacity:0.7;";

    var button1Name = "Disable";
    var button1OnClick = "{localStorage.setItem('type', '0');window.location.reload();}";
    var button1 = '<p><input type="button" value="'+button1Name+'" onclick="'+button1OnClick+'"></p>';
     
    var button2Name = "Work";
    var button2OnClick = "{localStorage.setItem('type', '1');window.location.reload();}";
    var button2 = '<p><input type="button" value="'+button2Name+'" onclick="'+button2OnClick+'"></p>';
     
    var button3Name = "Attack";
    var button3OnClick = "{localStorage.setItem('type', '2');window.location.reload();}";
    var button3 = '<p><input type="button" value="'+button3Name+'" onclick="'+button3OnClick+'"></p>';
     
    var button4Name = "Knacker";
    var button4OnClick = "{localStorage.setItem('type', '3');window.location.reload();}";
    var button4 = '<p><input type="button" value="'+button4Name+'" onclick="'+button4OnClick+'"></p>';

    var button5Name = "Reload";
    var button5OnClick = "{localStorage.setItem('type', '9');window.location.reload();}";
    var button5 = '<p><input type="button" value="'+button5Name+'" onclick="'+button5OnClick+'"></p>';
     
    var SoundOn = localStorage.getItem('sound');
    if (!SoundOn)
       localStorage.setItem('sound', '1');
    SoundOn = localStorage.getItem('sound');
    var NewSound = (SoundOn == '1') ? '0' : '1';
    var button6Name = "Sound is " + (SoundOn != '1' ? 'Off' : 'On');
    var button6OnClick = "{debugger;localStorage.setItem('sound',"+ NewSound+");window.location.reload();}";
    var button6 = '<p><input type="button" value="'+button6Name+'" onclick="'+button6OnClick+'"></p>';
     
    var button7Name = "DeleteLastMessage";
    var button7OnClick = "{var ss = document.getElementsByClassName('b2')[1].childNodes[1].childNodes[2].href;ss = ss.replace('details','remove');location.href=ss;}";
    var button7 = '<p><input type="button" value="'+button7Name+'" onclick="'+button7OnClick+'"></p>';
     
     

     
    var MyDIV = '<div id="MyDIV" style="' + DivStyle + '"><form action="">' + button1 + button2 + button3 + button6 + ((location.href.indexOf("/mail/") + 1)?button7:" ") + '</form></div>'
    document.body.innerHTML = document.body.innerHTML + MyDIV + MyDIVLinks;
        
    var imgTag = document.getElementsByTagName('img');
    for (var i=0; i<imgTag.length; ++i)
    if (imgTag[i].src == (Host + 'img/icons/g2.gif') || imgTag[i].src == (Host + 'img/icons/g4.gif') )
    {
       var audioOrig = new Audio();
       audioOrig.src = 'http://cafe.bevocal.com/libraries/audio/female1/en_us/common/beep_end.wav';
       if (SoundOn == '1')
       audioOrig.play();
    }
}
     
    var type = localStorage.getItem('type');
    if (!type)
       localStorage.setItem('type', '0');
    //alert("aa");
    var BotType = 'Disable';
    if (type == 1) BotType = 'Work';
    if (type == 2) BotType = 'Attack';
    if (type == 3) BotType = 'Knacker';
    if (type == 9) BotType = 'Reload';
    document.getElementById('MyDIV').innerHTML += '<p>' + BotType + '</p>';
     

    /*
    //DEMO
    var DemoStart = localStorage.getItem('DS998');
    var NowTime = new Date().getTime();
    if (!DemoStart)
       localStorage.setItem('DS998',NowTime.toString());
     
    DemoStart = localStorage.getItem('DS998');
    DemoStart = parseInt(DemoStart);
     
    document.getElementById('MyDIV').innerHTML += '<p>DemoTime: ' + ((NowTime - DemoStart)/1000) + '</p>';
     
    if ((NowTime - DemoStart) > 1000*60*20)
    {
       document.getElementById('MyDIV').innerHTML = '<p style="font-size:72px">DemoEND</p>';
       return;
    }
    */
    if (document.title == "Герои Тиды")
    {
       setTimeout(function() {window.location.reload()}, 7*1000);
    }
    if (location.href.indexOf('chat')+1) // Chat Reload
    {
       var ChatMessage = document.getElementsByClassName("box_inter")[0].getElementsByClassName("body")[0].getElementsByClassName("b2")[1].getElementsByTagName("p")[0].getElementsByTagName("span")[2].innerText;
       //alert(ChatMessage);
       if (localStorage.getItem("LastChatMessage") != ChatMessage)
       {
          localStorage.setItem("LastChatMessage",ChatMessage);
          var audioOrig = new Audio();
          audioOrig.src = 'http://cafe.bevocal.com/libraries/audio/female1/en_us/common/beep_end.wav';
          if (SoundOn == '1')
          audioOrig.play();
       }
       setTimeout(function() { if (!document.getElementsByClassName('inp')[0].value)window.location.reload()}, 7*1000);
       return;
    }
    if (location.href == (Host + 'users/info/127717') ) // Bot Menu
    {
       document.body.innerHTML = '<div>' + '<p><input type="button" value="Горняк" onclick="{localStorage.setItem(\'profession\', \'0\');window.location.reload();}"></p>' + '<p><input type="button" value="Рыбак" onclick="{localStorage.setItem(\'profession\', \'1\');window.location.reload();}"></p>' + '<p><input type="button" value="Лесоруб" onclick="{localStorage.setItem(\'profession\', \'2\');window.location.reload();}"></p>' + '<p><input type="button" value="Каменщик" onclick="{localStorage.setItem(\'profession\', \'3\');window.location.reload();}"></p>' + '<br />' + '<p><input type="button" value="Бить в работе" onclick="{localStorage.setItem(\'WorkAttack\',\''+ ((parseInt(localStorage.getItem('WorkAttack')) + 1) % 2).toString() + '\');window.location.reload();}"></p>' + '</div>';
           
       document.body.innerHTML += MyDIV + MyDIVLinks;
       var profes = localStorage.getItem('profession');
       if (profes == '0') profes = 'Горняк';else
       if (profes == '1') profes = 'Рыбак';else
       if (profes == '2') profes = 'Лесоруб';else
       if (profes == '3') profes = 'Каменщик';
       document.getElementById('MyDIV').innerHTML += '<p>' + profes + '</p>';
       document.getElementById('MyDIV').innerHTML += '<p>' + localStorage.getItem('WorkAttack') + '</p>';
       return;
    }    
     
    if (type == '9' )//Reload
    {
       setTimeout(function() {window.location.reload();}, 3000);
    }
    else
    if (type == '1' )//Work
    {
       if (document.getElementsByTagName("form").length > 0)
       if (document.forms[0].Time)
       {
          debugger;
          var profession = localStorage.getItem('profession');
          if (!profession)
             localStorage.setItem('profession', '2');
          profession = parseInt(localStorage.getItem('profession'));
          /*
          0 - Горняк
          1 - Рыбак
          2 - Лесоруб
          3 - Каменщик
          */
          document.forms[0].Prof[profession].checked = true;
          document.forms[0].Time.selectedIndex = 0;
                    /*
                    0 - 5 min
                    1 - 15 min
                    2 - 30 min
                    3 - 1 hour
                    */
          document.forms[0].submit();
          return;
       }
       var text;
       if (document.getElementsByTagName("h1").length)
       text = document.getElementsByTagName("h1")[0].innerHTML;
       else
       text = document.getElementsByTagName("h2")[1].innerHTML;
       TagA = document.getElementsByTagName("a");
       if ((location.href.indexOf('craft')+1) && !(location.href.indexOf('user/craft')+1))
       {
          var link;
          var t;
           
          for (var i = 0; i < TagA.length; ++i)
             if (TagA[i].innerHTML == "Обновить")
             {
                link = TagA[i].href;
                t = 10;
                break;
             }
              
          for (var i = 0; i < TagA.length; ++i)
             if (TagA[i].innerHTML == "вернуться")
             {
                t = 1;
                link = TagA[i].href;
                break;
             }
          for (var i = 0; i < TagA.length; ++i)
             if (TagA[i].innerHTML == "убить монстров")
             {
                t = 1;
                link = TagA[i].href;
                break;
             }
          setTimeout(function() { location.href = link}, t*1000);
       }else
       if (location.href.indexOf('battle')+1)
       {
          var link = location.href;
          for (var i = 0; i < TagA.length; ++i)
                if (TagA[i].innerHTML == "покинуть бой")
                {
                   link = TagA[i].href;
                   t = 1;
                   break;
                }
                 
          TagA = document.getElementsByClassName("active_s");
          var HP = document.getElementsByClassName("h1b brt")[0].childNodes[1].childNodes[2].innerText;
           
          if (document.getElementsByClassName("disable_s").length)
             link = document.getElementsByClassName("disable_s")[0].href;
          var t = 3;
          var d = new Date().getTime();
           
          var timestr = localStorage.getItem('time');
          if (!timestr)
             localStorage.setItem('time',d.toString());
          timestr = localStorage.getItem('time');
          t = parseInt(timestr);
           
           
          debugger;
           
          document.getElementById('MyDIV').innerHTML += '<p>' + HP + '</p>';
          if ((d-t >= 5000) && (localStorage.getItem('WorkAttack') == '1'))
          {
             localStorage.setItem('time',d.toString());
             setTimeout(function() {location.href = TagA[0].href}, 500);
          }
          else
          {
             t = 3;
             for (var i = TagA.length-1; i > 0; --i)
                if (TagA[i].childNodes[2])
                if (TagA[i].childNodes[2].wholeText)
                if (TagA[i].childNodes[2].wholeText.indexOf('сфера') + 1)
                if (TagA[i].childNodes[3].innerHTML == "")
                {
                   link = TagA[i].href;
                   t = 0.25;
                }
                 
             setTimeout(function() {location.href = link}, t * 1000);
          }
       }
    }
    else
    if (type == '2' )//Attack
    {
       var TagA = document.getElementsByClassName("active_s");
       var HP = document.getElementsByClassName("h1b brt")[0].childNodes[1].childNodes[2].innerText;
       var link = location.href;
       if (document.getElementsByClassName("disable_s").length)
          link = document.getElementsByClassName("disable_s")[0].href;
       var t = 3;
       var d = new Date().getTime();
        
       var timestr = localStorage.getItem('time');
       if (!timestr)
          localStorage.setItem('time',d.toString());
       timestr = localStorage.getItem('time');
       t = parseInt(timestr);
        
        
       debugger;
        
       document.getElementById('MyDIV').innerHTML += '<p>' + HP + '</p>';
       if ((d-t >= 10000))
       {
       if (TagA[0].childNodes[2])
       {
          localStorage.setItem('time',d.toString());
          setTimeout(function() {location.href = TagA[0].href}, 250);
       }else    setTimeout(function() {window.location.reload();}, 300);
       }else
       {
          t = 3;
          for (var i = TagA.length-1; i > 0; --i)
          if (TagA[i].childNodes[2]){
          if (TagA[i].childNodes[2].wholeText){
          if (TagA[i].childNodes[2].wholeText.indexOf('сфера') + 1)
          {
             if (TagA[i].childNodes[3].innerHTML == "")
             {
                link = TagA[i].href;
                t = 0.25;
             }
          }}}
          setTimeout(function() {if (location.href == link) window.refresh(); else location.href = link}, t * 1000);
       }
        
    }
    else
    if (type == '3')//Knacker
    {
    debugger;
       var TagWh = document.getElementsByClassName("white");
        
       for (var i = 12; i>0; --i)
       if (TagWh[0].previousSibling.src.indexOf(i.toString()) + 1)
       {
          var loc = 'http://wap.teeda.ru/knacker/sell/'+i.toString()+'/'+TagWh[0].innerText;
          location.href = loc;
          return;
       }
    }
     
     
     
     
})();


«Пред. тема След. тема»

S@Nek
VIP
Сообщений 678
+
+1349
-
Ваши награды 18
S@Nek написал: В ответ пользователя S@Nek Написано 16 Января 2013 в 19:25
Сообщение № 2
Что этот скрипт делает?)
подпись: S@Nek

Максим
Пользователи
Сообщений 20
+
0
-
Ваши награды 0
Максим написал: В ответ пользователя Максим Написано 16 Января 2013 в 21:23
Сообщение № 3
Это бот на игру я просто хочу чтобы типо бот в режиме онлайн роботал
Форум » Форум веб мастеров » uCoz » Скрипт во фрейме (как сделать ??)
Страница 1 из 11
Поиск:
Топ пользователей: