Star Federation

Star Federation game

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Advertisement:

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Advertisement:

// ==UserScript==
// @name         Star Federation
// @description:en Star Federation game
// @namespace starfederationuimod
// @include      https://www.star-kings.ru/*
// @include      https://star-kings.ru/*
// @include      https://starfederation.ru/*
// @include      https://www.starfederation.ru/*
// @version      2
// @grant        none
// @description Star Federation game
// ==/UserScript==
var run = function() {

$("body").append ( '\
<table id="gmRightSideBar" style="position:fixed; top:80; right: 0;z-index:99999900; "> \
<tr> \
<td> <table>\
<tr><td><button type="button" \
         onclick="document.getElementById(`gmRightSideBar`).style.right=`0px`" \
         class="text_btn_bg" style="font-size:11px;height:24px;width:100%;background-position:left 0px top 0px,right 0px top 0px, left 2px top;background-size:2px 24px, 3px 24px, 30px 24px;">Вкл.</button></td></tr> \
<tr><td><button type="button" class="text_btn_bg" \
         onclick="document.getElementById(`gmRightSideBar`).style.right=`-190px`" \
         style="font-size:11px;height:24px;width:100%;background-position:left 0px top 0px,right 0px top 0px, left 2px top;background-size:2px 24px, 3px 24px, 30px 24px;">Выкл.</button></td></tr> \
</table></td> \
<td> <table>\
<tr><td style="font-size:13px;height:24px;width:100%;" background="/images/ui/buttons/text_btn_bg_center_h.png">Панель расширенных команд:</td></tr> \
<tr><td><button type="button" class="text_btn_bg" style="font-size:11px;height:24px;width:100%;background-position:left 0px top 0px,right 0px top 0px, left 2px top;background-size:2px 24px, 3px 24px, 173px 24px;" onclick="$(`#gmRightSideBar`).trigger(`grabFlightPlan`);">Сохранить полетник</button></td></tr> \
<tr><td><button type="button" class="text_btn_bg" style="font-size:11px;height:24px;width:100%;background-position:left 0px top 0px,right 0px top 0px, left 2px top;background-size:2px 24px, 3px 24px, 173px 24px;" onclick="$(`#gmRightSideBar`).trigger(`loadFlightPlan`);">Добавить команды к полетнику</button></td></tr> \
</td> </table>\
</tr> \
</table> \
' );


function addnextcmd(forms_html,id){
if (id == forms_html.length)
return;

var new_form = $("#WndFleet_comand_form_new");
new_form[0].outerHTML = forms_html[id];
var forms = $("form[id^='WndFleet_comand_form_']:last");
forms.attr('id','WndFleet_comand_form_new');
$("> input[name='icmd']",forms).attr('value','new');
getWindow('WndFleet').add_comand('new');
setTimeout(function(){addnextcmd(forms_html,id+1)}, 5000);
}

$("#gmRightSideBar").bind('loadFlightPlan',function() {
var text = window.prompt("Вставьте сохраненные команды: Ctrl+V, Enter", '');
var forms_html = text.split("<;>");
addnextcmd(forms_html,0);
});

$("#gmRightSideBar").bind('grabFlightPlan',function() {
var forms = $("form[id^='WndFleet_comand_form_']");
var text = "";
forms.each(function(index){
if (index < forms.length-1){
if (index > 0)
         text = text + "<;>";
var tmp = forms[index].outerHTML;       
text = text + tmp.replace(/<[^\/if][^>]*>/g,"").replace(/<\/[^f][^>]*>/g,"").replace(/title="[^"]*"/g,"").replace(/style="[^"]*"/g,"").replace(/onclick="[^"]*"/g,"").replace(/src="[^"]*"/g,"").replace(/class="[^"]*"/g,"").replace(/>[^<]*</g,"><").replace(/<img[^>]*>/g,"");
}
});
window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
});

}
var script = document.createElement("script");
script.textContent = '(' + run.toString() + ')();';
document.documentElement.appendChild(script);