Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*______________________________________________________________________________
- ********************************************************************************
- WriterScriptIs : Salim Fadhil *
- VersionScript : 1.0 *
- DateWroteScript : 22-04-2020 *
- URL : https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/*
- _______________________________________________________________________________*
- ********************************************************************************
- ######## ## ######### $$ $$ ## *
- ## ## ## ## ## ###### $$ $$ ## *
- ## ## ## ## ## # ## *
- ########## ## #### ## ## ## ## ######## ## ## ####### *
- ## ## ### ## ## ## ######## ## ## ## ## ## ## *
- ## ## ## ## ## ## ## ## ## ## ## ## ## ## *
- ## ## ## ## ## ## $$ ## ## ## ## ## ## ## ## *
- ## ## ###### ##### $$ ## ## ###### # ## ## ## ## *
- ## *
- ## ## *
- #### *
- _______________________________________________________________________________*
- *******************************************************************************/
- javascript:
- if (format === undefined) { var format = " {coord}"; }
- var win = (window.frames.length > 0) ? window.main : window;
- var index = 0;
- var outputID = 'villageList';
- let $ = window.jQuery;
- $(document).ready(function () {
- if ($('#' + outputID).length <= 0) {
- if (window.game_data.screen == 'map') {
- var srcHTML = `<center> <link href="https://fonts.googleapis.com/css2?family=Comic+Neue&display=swap" rel="stylesheet"> <table id = 'table'> <tr> <th id = 'th' colspan= '3'><b style='font-family: "Comic Neue", cursive;font-size:16px;text-align:center;'>Developed by</b></th> </tr> <tr> <td id = 'td' colspan= '3'><a id="Salim" title = 'Abu.Rajih' href="https://forum.tribalwars.ae/index.php?members/abu-rajih.40926/" target="_blank">Abu.Rajih</a></td> </tr> <tr> <th id = 'th' colspan= '3'> <textarea id='` + outputID + `' cols='50' rows='8' style='text-align:center;background:#111;color:#9f9;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;' disabled></textarea> </th> </tr> <tr> <th id='th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_axe.png" title="مقاتل الفأس" alt="" class=""></th> <th id='th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_spy.png" title="كشافة" alt="" class=""></th> <th id='th'><img src="https://dsae.innogamescdn.com/asset/2ed32c7/graphic/unit/unit_light.png" title="فارس خفيف" alt="" class=""></th> </tr> <tr> <td id='td'><input type='text' value='0' onclick='this.select()' style='text-align:center;background:#111;color:#9f9;border:none;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;width:80px;height:20px;font-size:14px;' id='Axe'/></th> <td id='td'><input type='text' value='0' onclick='this.select()' style='text-align:center;background:#111;color:#99f;border:none;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;width:80px;height:20px;font-size:14px;' id='Spy'/></th> <td id='td'><input type='text' value='0' onclick='this.select()' style='text-align:center;background:#111;color:#f99;border:none;font-weight:bold;font-family: "Comic Neue", cursive; font-size:11px;width:80px;height:20px;font-size:14px;' id='Light'/></th> </tr> <tr> <th id = 'th' colspan= '2'> <input type = 'button' value = ' حفظ المزارع المحدده' id = 'saveFarm' style = 'width:100%;' class = 'btn btn-confirm-yes' /> </th> <th id = 'th'> <input type = 'button' value = 'نقطة التجمع' id = 'GoToPlace' style = 'width:100%;' class = 'btn btn-confirm-no' /> </th> </tr> <tr><td id='td' colspan='3'><input type='button' id='reset' value='اعادة ضبط السكربت' class='btn btn-confirm-no' style='width:99%;' /></td></tr> </table> </center> <style> #table,#th,#td { border:1px solid black; font-family:times new roman; font-size:16px; text-align:center; width:300px; } #Salim { font-family: "Comic Neue", cursive; font-size: 20px; animation: salim 2s linear infinite; } @keyframes salim { 0% {text-shadow:0 0 3px #000;} 15% {text-shadow:0 0 9px #000;} 30% {text-shadow:0 0 3px #000;} 45% {color:rgba(80,80,80,.1);} 60% {text-shadow:0 0 3px #7d5d11;color:#222;} 80% {text-shadow:0 0 9px #000;} 100%{text-shadow:0 0 3px #000;} } </style>`;
- var ele = win.$('#map_whole').after(win.$(srcHTML));
- win.TWMap.map._handleClick = function (e) {
- index++;
- var pos = this.coordByEvent(e);
- var x = pos[0];
- var y = pos[1];
- var coord = pos.join("|");
- var ID = x * 1000 + y;
- var village = window.TWMap.villages[ID];
- var ownername, ownerpoints, tribetag, tribename, tribepoints, ownerally;
- if (village.owner === 0) {
- ownername = "";
- ownerpoints = 0;
- }
- else {
- var owner = window.TWMap.players[village.owner];
- if (window.TWMap.allies[window.TWMap.players[village.owner]] > 0) {
- tribetag = window.TWMap.allies[window.TWMap.players[village.owner].ally].tag;
- tribename = window.TWMap.allies[window.TWMap.players[village.owner].ally].name;
- tribepoints = window.TWMap.allies[window.TWMap.players[village.owner].ally].points;
- ownerally = owner.ally;
- var tribe = window.TWMap.allies[window.TWMap.players[village.owner].ally];
- }
- else {
- tribe = "";
- tribetag = "";
- tribename = "";
- tribepoints = "";
- ownerally = 0;
- }
- }
- var image = "";
- if (village.bonus) {
- image = village.bonus[1];
- }
- var data = format.replace("{coord\}", coord)
- .replace("{player\}", ownername)
- .replace("{playerpoints\}", ownerpoints)
- .replace("{playerid\}", village.owner)
- .replace("{villageid\}", village.id)
- .replace("{points\}", village.points.replace(".", ""))
- .replace("{tag\}", tribetag)
- .replace("{tribename\}", tribename)
- .replace("{tribepoints\}", tribepoints)
- .replace("{tribeid\}", ownerally)
- .replace("{x\}", x)
- .replace("{y\}", y)
- .replace("{kk\}", window.TWMap.con.continentByXY(x, y))
- .replace("{image\}", 'http://' + document.URL.split('/')[2] + '/graphic/' + image)
- .replace("{index\}", index)
- .replace("{NL\}", "\n");
- document.getElementById(outputID).innerHTML += data;
- /* $('#' + outputID).value += data + "\n";*/
- return false;
- };
- $('#saveFarm').on('click' , function(){
- var coords = $('#villageList').val() , axe = $('#Axe').val() , spy = $('#Spy').val() , light = $('#Light').val();
- var ls = localStorage;
- ls.setItem('index' , 0);
- ls.setItem('farmCoord' , coords);
- ls.setItem('AxE' , axe);
- ls.setItem('SpY' , spy);
- ls.setItem('LighT' , light);
- window.UI.InfoMessage('تم حفظ الاعدادات.' , 1000 , 'success');
- });
- $('#GoToPlace').on('click' , function(){
- window.UI.InfoMessage('سيتم نقلك الى نقطة التجمع.' , 1000 , 'success');
- setTimeout(()=>{
- window.location.href = '/game.php?village='+ window.game_data.village.id +'&screen=place';
- },1000);
- });
- if(!localStorage.AxE && !localStorage.SpY && !localStorage.LighT){
- $('#Axe').val(0); $('#Spy').val(0); $('#LighT').val(0);
- }else{
- $('#Axe').val(localStorage.AxE); $('#Spy').val(localStorage.SpY); $('#LighT').val(localStorage.LighT);
- }
- $('#reset').on('click' , function(){
- localStorage.removeItem('farmCoord');
- localStorage.removeItem('AxE');
- localStorage.removeItem('SpY');
- localStorage.removeItem('LighT');
- $('#villageList').val(null); $('#Axe').val(0); $('#Spy').val(0); $('#LighT').val(0);
- window.UI.InfoMessage('تم اعادة الضبط بنجاح.' , 1000 , 'success');
- setTimeout(()=>{
- window.location.reload();
- },1000);
- });
- }
- else if(window.game_data.screen == 'place'){
- if(window.game_data.screen == 'place' && !window.location.href.match(/&screen=place&try=confirm/)){
- if(localStorage.index >= localStorage.farmCoord.split(' ').length - 1){
- localStorage.index = 0;
- window.UI.InfoMessage('انتهى السكربت من الهجوم على جميع القرى وسيبدا بالاحداثيات من جديد.' , 1500 , 'error');
- setTimeout(()=>{window.location.reload();},1500);
- }else{
- var i = localStorage.index;
- localStorage.setItem('index' , ++i);
- var COORD = localStorage.farmCoord.split(' ')[localStorage.index];
- var x = COORD.split('|')[0];
- var y = COORD.split('|')[1];
- document.forms[0].x.value = x;
- document.forms[0].y.value = y;
- document.querySelector('#unit_input_axe').value = localStorage.AxE;
- document.querySelector('#unit_input_spy').value = localStorage.SpY;
- document.querySelector('#unit_input_light').value = localStorage.LighT;
- setTimeout(()=>{document.querySelector('#target_attack').click();},300);
- }
- }
- else if(window.game_data.screen == 'place' && window.location.href.match(/&screen=place&try=confirm/)){
- document.querySelector("#default_name_span > a > img").click();
- setTimeout(()=>{document.querySelector("#new_attack_name").value = ' هجمة رقم '+localStorage.index+' بواسطة سكربت نهب المزارع';},10);
- setTimeout(()=>{document.querySelector("#attack_name_btn").click();},15);
- setTimeout(()=>{document.querySelector("#troop_confirm_go").click();},20);
- }
- }
- else {
- window.UI.InfoMessage('السكربت يعمل من الخريطة سيتم نقلك الى الخريطة..' , 1500 , 'error');
- setTimeout(()=>{window.location.href = '/game.php?village='+ window.game_data.village.id +'&screen=map';},1500);
- }
- }
- });
- void (0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement