Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. const header = document.getElementsByClassName("right-tab-header")[0];
  2.  
  3. const spendCulture = () => {
  4. [
  5. "parchment",
  6. "manuscript",
  7. //"compedium",
  8. ].forEach(res => gamePage.craftAll(res));
  9. gamePage.huntAll({ preventDefault: () => null });
  10. }
  11.  
  12. const cultureBtn = document.createElement("button");
  13. const cultureText = document.createTextNode("Spend culture");
  14. cultureBtn.onclick = () => {
  15. spendCulture();
  16. };
  17. cultureBtn.appendChild(cultureText);
  18.  
  19. const stuff = ["slab","beam"];
  20.  
  21. const matsBtn = document.createElement("button");
  22. const matsText = document.createTextNode("Make stuff");
  23. matsBtn.onclick = () => {
  24. stuff.forEach(res => gamePage.craftAll(res));
  25. };
  26. matsBtn.appendChild(matsText);
  27.  
  28. const withPlates = document.createElement("button");
  29. const stufftxt = document.createTextNode("Make stuff + plates");
  30. withPlates.onclick = () => {
  31. ["plate", ...stuff].forEach(res => gamePage.craftAll(res));
  32. };
  33. withPlates.appendChild(stufftxt);
  34.  
  35. const withSteel = document.createElement("button");
  36. const withSteelText = document.createTextNode("Make stuff + steel");
  37. withSteel.onclick = () => {
  38. ["steel", ...stuff].forEach(res => gamePage.craftAll(res));
  39. };
  40. withSteel.appendChild(withSteelText);
  41.  
  42. const withBoth = document.createElement("button");
  43. const withBothText = document.createTextNode("Make all the stuff");
  44. withBoth.onclick = () => {
  45. ["steel", "plate", ...stuff].forEach(res => gamePage.craftAll(res));
  46. };
  47. withBoth.appendChild(withBothText);
  48.  
  49. header.appendChild(matsBtn);
  50. header.appendChild(withPlates);
  51. header.appendChild(withSteel);
  52. header.appendChild(withBoth);
  53. header.appendChild(cultureBtn);
  54. header.appendChild(cultureFaithBtn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement