m24111

Untitled

Jun 22nd, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         DS Doubleclick Order/Ability
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        *://command.drop-shock.com/headquarters_ac.php*
  8. // @require      http://code.jquery.com/jquery-3.4.1.min.js
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. function drawcommands_2(){
  13.     mytext = "<table cellpadding=0 cellspacing=0 border=0 height='100%'><tr>"
  14.     for (var pi=0;pi<prereq.length;pi++) {
  15.         if (prereq[pi] != "X") {
  16.             mytext += "<td valign='top'>"
  17.             mytext += "<table cellpadding=0 cellspacing=3 border=0 width='140'>"
  18.                 HasItems = 0;
  19.                 for (var i=0;i<allcommandsname.length;i++) {
  20.                     if (prereq[pi] == allcommandspre[i]) {
  21.                         HasItems = 1;
  22.                         if (userownedcommands[i] == 1) {
  23.                             mytext +=`<tr><td width='22'><a href='#' ondblclick="purchase('command', ${i})" onClick="pickitem('command',` + allcommandsid[i] + "," + pi + ");showinfo('command'," + i + ",0);\"><img src='images/icons/" + allcommandsimg[i] + `' border='0'></a></td><td class='unittext'><a href='#' ondblclick="purchase('command', ${i})" onClick=\"pickitem('command',` + allcommandsid[i] + "," + pi + ");showinfo('command'," + i + ",0);\"><font color='white'>" + allcommandsname[i] + "</font></a></td></tr>";
  24.                         } else {
  25.                             mytext +=`<tr><td width='22'><a href='#' ondblclick="purchase('command', ${i})" onClick="pickitem('command',` + allcommandsid[i] + "," + pi + ");showinfo('command'," + i + ",1);\"><img src='images/icons/" + allcommandsimg[i] + `' border='0'></a></td><td class='unittext'><a href='#' ondblclick="purchase('command', ${i})" onClick=\"pickitem('command',` + allcommandsid[i] + "," + pi + ");showinfo('command'," + i + ",1);\"><b>" + allcommandsname[i] + "</b></a></td></tr>";
  26.                         }
  27.                     }
  28.                 }
  29.  
  30.             mytext += "</table>"
  31.             mytext += "</td>"
  32.             if (HasItems == 1) {
  33.                 mytext += "<td align='left' width='1' height='100%' bgcolor='#3B8524'><img src='images/pixel.gif'></td>"
  34.             }
  35.         }
  36.     }
  37.  
  38.     mytext += "</tr></table>"
  39.     layerWrite('chooseDIV',mytext)
  40. }
  41. drawcommands = drawcommands_2
  42.  
  43. function drawabilities_2(){
  44.     mytext = "<table cellpadding=0 cellspacing=0 border=0 height='100%'><tr>"
  45.     for (var pi=0;pi<prereq.length;pi++) {
  46.         if (prereq[pi] != "X") {
  47.             mytext += "<td valign='top'>"
  48.             mytext += "<table cellpadding=3 cellspacing=0 border=0 width='140'>"
  49.                 HasItems = 0;
  50.                 for (var i=0;i<allabilitiesname.length;i++) {
  51.                     if (prereq[pi] == allabilitiespre[i]) {
  52.                         HasItems = 1;
  53.                         if (userownedabilities[i] == 1) {
  54.                             mytext += `<tr><td width='22'><a href='#' ondblclick="purchase('ability', ${i})" onClick=\"pickitem('ability',` + allabilitiesid[i] + "," + pi + ");showinfo('ability'," + i + ",0);\"><img src='images/icons/" + allabilitiesimg[i] + `' border='0'></a></td><td class='unittext'><a href='#' ondblclick="purchase('ability', ${i})" onClick=\"pickitem('ability',` + allabilitiesid[i] + "," + pi + ");showinfo('ability'," + i + ",0);\"><font color='white'>" + allabilitiesname[i] + "</font></a></td></tr>";
  55.                         } else {
  56.                             mytext += `<tr><td width='22'><a href='#' ondblclick="purchase('ability', ${i})" onClick=\"pickitem('ability',` + allabilitiesid[i] + "," + pi + ");showinfo('ability'," + i + ",1);\"><img src='images/icons/" + allabilitiesimg[i] + `' border='0'></a></td><td class='unittext'><a href='#' ondblclick="purchase('ability', ${i})" onClick=\"pickitem('ability',` + allabilitiesid[i] + "," + pi + ");showinfo('ability'," + i + ",1);\">";
  57.                             if (allabilitiesremoves[i] != "*") {
  58.                                 mytext +="<font class='bantextb'>" + allabilitiesname[i] + "</font>";
  59.                             } else {
  60.                                 mytext +="<b>" + allabilitiesname[i] + "</b>";
  61.                             }
  62.                             mytext +="</a></td></tr>";
  63.                         }
  64.                     }
  65.                 }
  66.             mytext += "</table>"
  67.             mytext += "</td>"
  68.             if (HasItems == 1) {
  69.                 mytext += "<td align='left' width='1' height='100%' bgcolor='#3B8524'><img src='images/pixel.gif'></td>"
  70.             }
  71.         }
  72.     }
  73.  
  74.     mytext += "</tr></table>"
  75.     layerWrite('chooseDIV',mytext)
  76. }
  77. drawabilities = drawabilities_2
  78.  
  79. function pickitem_2(myytpe,myint, mypi){
  80.  
  81.     mypi += 1;
  82.     prereq[mypi] = myint;
  83.     for (var pi=(mypi+1);pi<prereq.length;pi++) { prereq[pi] = "X"; }
  84.  
  85.     if (myytpe == "command"){ setTimeout(drawcommands, 200)}
  86.     if (myytpe == "ability"){ setTimeout(drawabilities, 200)}
  87.  
  88. }
  89. pickitem = pickitem_2
  90.  
  91. var p_o = purchase
  92. function p_2(a, b){
  93.     console.log(a,b)
  94.     p_o(a,b)
  95. }
  96. purchase = p_2
Advertisement
Add Comment
Please, Sign In to add comment