conq

test

Від 08.06.2025. Дивіться остання версія.

Цей скрипт не слід встановлювати безпосередньо. Це - бібліотека для інших скриптів для включення в мета директиву // @require https://update.greasyfork.org/scripts/538768/1603731/conq.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// Add this to your existing tabs
Tabs.Conquest = {
  tabOrder: 1000,
  tabLabel: 'Conquest',
  tabDisabled: false,
  myDiv: null,
  timer: null,

  init: function(div){
    var t = Tabs.Conquest;
    t.myDiv = div;
    t.createMainDiv();
  },

  createMainDiv: function(){
    var t = Tabs.Conquest;
    var m = '<DIV class=divHeader align=center>'+tx('CONQUEST')+'</div>';
    
    m += '<div id="ConquestContent" style="padding:10px;">';
    m += '<table width="100%">';
    m += '<tr><td><INPUT id=btConquestEnabled type=checkbox '+ (Options.ConquestOptions.Enabled?' CHECKED':'') +'> '+tx('Enable Conquest')+'</td>';
    m += '<td>'+tx('Conquest Interval')+': <INPUT id=btConquestInterval type=text size=3 value="'+ Options.ConquestOptions.Interval +'"> '+tx('minutes')+'</td></tr>';
    m += '</table>';

    m += '<hr>';
    m += '<div id="ConquestStatus"></div>';
    m += '<div id="ConquestLog" style="height:400px; overflow-y:auto;"></div>';
    m += '</div>';

    t.myDiv.innerHTML = m;
    
    ById('btConquestEnabled').addEventListener('change', function(){
      Options.ConquestOptions.Enabled = this.checked;
      saveOptions();
      t.toggleConquest();
    }, false);
    
    ById('btConquestInterval').addEventListener('change', function(){
      Options.ConquestOptions.Interval = parseInt(this.value);
      saveOptions();
    }, false);

    t.toggleConquest();
  },

  toggleConquest: function(){
    var t = Tabs.Conquest;
    if(Options.ConquestOptions.Enabled){
      t.start();
      ById('ConquestStatus').innerHTML = '<b>'+tx('Conquest is ACTIVE')+'</b>';
    } else {
      t.stop();
      ById('ConquestStatus').innerHTML = '<b>'+tx('Conquest is INACTIVE')+'</b>';
    }
  },

  start: function(){
    var t = Tabs.Conquest;
    if(t.timer == null){
      t.timer = setInterval(t.doConquest, Options.ConquestOptions.Interval * 60 * 1000);
      t.doConquest(); // Run immediately
    }
  },

  stop: function(){
    var t = Tabs.Conquest;
    if(t.timer != null){
      clearInterval(t.timer);
      t.timer = null;
    }
  },

  doConquest: function(){
    // Implement your conquest logic here
    // This function will be called every X minutes (based on the interval set)
    
    // For example:
    var log = ById('ConquestLog');
    log.innerHTML += '<div>' + new Date().toLocaleString() + ': Conquest action performed</div>';
    log.scrollTop = log.scrollHeight;
  },

  // Add more functions as needed for your conquest logic
};