Advertisement
Roem_

Untitled

Feb 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function farm() {
  2.     if ($(".StreamRpgError") != undefined) {
  3.         location.reload();
  4.     } else {
  5.         var a = $('.srpg-map-actions-expired-button');
  6.         var b = $('.fight-results-buttons');
  7.         var c = $('.srpg-map-actions-fight-buttons');
  8.         var d = $('.rewards-cta-buttons');
  9.         e = $('#srpg-map-nodes-node-node_raid_scifi_1_1_tier_4');
  10.         if (e) { e.click(); }
  11.         e = $('#srpg-map-nodes-node-node_fantasy_3_1_tier_4');
  12.         if (e) { e.click(); }
  13.         e = $('#srpg-map-nodes-node-node_fantasy_2_1_tier_4');
  14.         if (e) { e.click(); }
  15.         e = $('#srpg-map-nodes-node-node_raid_fantasy_1_1_tier_4');
  16.         if (e) { e.click(); }
  17.         e = $('#srpg-map-nodes-node-node_fantasy_1_1_tier_4');
  18.         if (e) { e.click(); }
  19.         e = $('#srpg-map-nodes-node-node_raid_military_1_1_tier_4');
  20.         if (e) { e.click(); }
  21.         e = $('#srpg-map-nodes-node-node_military_1_1_tier_4');
  22.         if (e) { e.click(); }
  23.         e = $('#srpg-map-nodes-node-node_raid_fantasy_1_1_tier_4');
  24.         if (e) { e.click(); }
  25.         e = $('#srpg-map-nodes-node-node_military_2_1_tier_4');
  26.         if (e) { e.click(); }
  27.         if ($('.CountdownTimer') && $('.CountdownTimer').innerHTML == "00:00") {
  28.             $('#srpg-nav-tab-GEAR').click();
  29.             $('#srpg-nav-tab-FIGHT').click();
  30.         }
  31.         if (a) {
  32.             f = a.getElementsByClassName('srpg-button');
  33.             f[0].click();
  34.         } else if (b) {
  35.             f = b.getElementsByClassName('srpg-button');
  36.             f[0].click();
  37.         } else if (c) {
  38.             f = c.getElementsByClassName('srpg-button');
  39.             f[0].click();
  40.         } else if (d) {
  41.             f = d.getElementsByClassName('srpg-button btn btn-default');
  42.             if (f.length == 3) {
  43.                 f[2].click();
  44.             } else if (f.length == 2) {
  45.                 f[1].click();
  46.             } else {
  47.                 f[0].click();
  48.             }
  49.         } else {
  50.             console.log("%cFarming", "color:#009FC0");
  51.         }
  52.         if ($(".srpg-button-raid") != null) {
  53.             $(".srpg-button-raid").click();
  54.         }
  55.         if ($(".srpg-button-maps") != null) {
  56.             $(".srpg-button-maps").click();
  57.         }
  58.     }
  59. }
  60.  
  61. function sellall() {
  62.     if ($("#srpg-nav-tab-GEAR") != null) {
  63.         $("#srpg-nav-tab-GEAR").click();
  64.     }
  65.     if ($(".backpack-item-common") != null) {
  66.         $(".backpack-item-common").click();
  67.     } else if ($(".backpack-item-uncommon") != null) {
  68.         $(".backpack-item-uncommon").click();
  69.     } else if ($(".backpack-item-rare") != null) {
  70.         $(".backpack-item-rare").click();
  71.     } else if ($(".backpack-item-epic") != null) {
  72.         $(".backpack-item-epic").click();
  73.     } else if ($(".backpack-item-common") == null && $(".backpack-item-uncommon") == null && $(".backpack-item-rare") == null && $(".backpack-item-epic") == null) {
  74.         console.log("%cnothing to sell", "color:#FF00FF");
  75.     } else {
  76.         console.log("%cerror selling", "color:#FF0000");
  77.         if ($("#srpg-nav-tab-FIGHT") != null) {
  78.             $("#srpg-nav-tab-FIGHT").click();
  79.         }
  80.     }
  81.     if ($(".srpg-active-item-actions-trash") != null) {
  82.         $(".srpg-active-item-actions-trash").click();
  83.         if ($(".button-block > .btn-default") != null) {
  84.             $(".button-block > .btn-default").click();
  85.         }
  86.     } else {
  87.         if ($("#srpg-nav-tab-FIGHT") != null) {
  88.             $("#srpg-nav-tab-FIGHT").click();
  89.         } else if ($("#srpg-nav-tab-button") != null) {
  90.             $("#srpg-nav-tab-button").click();
  91.         } else if ($("#srpg-nav-tab-continue") != null) {
  92.             $("#srpg-nav-tab-continue").click();
  93.         } else {
  94.             console.log("%cbutton error", "color:#FF0000");
  95.         }
  96.     }
  97.     if ($("#srpg-nav-tab-FIGHT") != null) {
  98.         $("#srpg-nav-tab-FIGHT").click();
  99.     }
  100. }
  101.  
  102. function contribute() {
  103.     var str = "";
  104.     if ($("#srpg-building-building_watchtower-contribute") != null) {
  105.         $("#srpg-building-building_watchtower-contribute").click();
  106.         console.log("%cupgrading watchtower", "color:#0000FF");
  107.     } else {
  108.         str += "watchtower ";
  109.     }
  110.     if ($("#srpg-building-building_wormhole-contribute") != null) {
  111.         $("#srpg-building-building_wormhole-contribute").click();
  112.         console.log("%cupgrading wormhole", "color:#0000FF");
  113.     } else {
  114.         str += "wormhole ";
  115.     }
  116.     if ($("#srpg-build-building_barracks-contribute") != null) {
  117.         $("#srpg-building-building_barracks-contribute").click();
  118.         console.log("%cupgrading barracks", "color:#0000FF");
  119.     } else {
  120.         str += "barracks ";
  121.     }
  122.     if (str != "") {
  123.         console.log("%c" + "%s" + "maxed", "color:#FF00FF", str);
  124.     }
  125. }
  126.  
  127. if (i == null) { var i = 0; }
  128. if (j == null) { var j = 0; }
  129.  
  130. function main() {
  131.     console.log("\n".repeat(10));
  132.     farm();
  133.     if (i >= 8) {
  134.         console.log("%cTrying to sell", "color:#0000FF");
  135.         sellall();
  136.         i = 0;
  137.     } else if (j >= 16) {
  138.         console.log("%cTrying to contribute", "color:#0000FF");
  139.         contribute();
  140.         j = 0;
  141.     }
  142.     i++;
  143.     j++;
  144.     console.log("i = " + i + "\n" + "j = " + j);
  145. }
  146.  
  147. main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement