Yohoho.io Cheats

Cheats for the popular IO game, Yohoho.IO!

当前为 2019-10-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Yohoho.io Cheats
  3. // @namespace http://yohoho.io/
  4. // @version 1.0.1
  5. // @description Cheats for the popular IO game, Yohoho.IO!
  6. // @author Steviegt6
  7. // @match http://yohoho.io/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. window.addEventListener("keydown", cheats, false);
  12.  
  13. showCheats();
  14.  
  15. function showCheats()
  16. {
  17. var box = document.getElementById("desktop-controls");
  18. var controls = document.createElement("div");
  19. controls.className = "title2";
  20. controls.id = "hackids";
  21. var hacks = document.getElementById("hackids");
  22. var hackselement = document.createElement("div");
  23. var hackstextnode = document.createTextNode("Available Cheats:\nI - Change your island (Conflicts with XP cheat.)\nO - Gain a set amount of coins\nP = Change your character\nX = Set XP! (Conflicts with island cheat.)");
  24. hackselement.appendChild(hackstextnode);
  25. var controlstextnode = document.createTextNode("Cheats");
  26. controls.appendChild(controls);
  27. box.appendChild(controls);
  28. box.appendChild(hackselement);
  29. }
  30.  
  31. function cheats(e)
  32. {
  33. if (e.keyCode =="79") //O - Coins
  34. {
  35. var a = prompt("What would you like to set your coin coint to?");
  36. if(isNaN(a))
  37. {
  38. window.alert("Oops! Something went wrong! Perhaps entering a number next time will solve the issue?")
  39. }
  40. else
  41. {
  42. localStorage.setItem("coinsOwned", a);
  43. document.getElementById("homepage-booty").innerHTML = a;
  44. document.getElementById("skin-popup-booty").innerHTML = a;
  45. }
  46. }
  47. else
  48. if (e.keyCode =="88") //X - XP
  49. {
  50. var x = prompt("What would you like to set your XP to?");
  51. if(isNaN(a))
  52. {
  53. window.alert("Oops! Something went wrong! Perhaps entering a number next time will solve the issue?")
  54. }
  55. else
  56. {
  57. localStorage.setItem("playerXP", a);
  58. document.getElementById("homepage-booty").innerHTML = a;
  59. document.getElementById("skin-popup-booty").innerHTML = a;
  60. }
  61. }
  62. else if(e.keyCode == "80") //P - Character
  63. {
  64. var b = prompt("Which character would you like to become? Please pick a number between 1 and 45!")
  65. if (isNaN(b))
  66. {
  67. window.alert("Oops! something went wrong! Perhaps enterign a number next time will solve the issue?")
  68. }
  69. else if (b < 1 || b > 45)
  70. {
  71. window.alert("Oops! something went wrong! Please choose a number between 1 and 45!")
  72. }
  73. else if (b != null || b != undefined || b!= "")
  74. {
  75. localStorage.setItem("playerSkin", b);
  76. window.alert("Please reload the page the enable the skin you have chosen!")
  77. }
  78. }
  79. else if(e.keyCode == "73") //I - Island
  80. {
  81. var c = prompt("Which island would you like to travel to?\n1 = Tortuga\n2 = Beach\n3 = Easter\n4 = Wreck\n5 = Aztec\n6 = Volcano\n7 = Village")
  82. if(c == 1) ////0,140,700,2100,4400,7600,13500
  83. {
  84. localStorage.setItem("playerXP", 0);
  85. window.alert("Island set to Tortuga. Please reload.");
  86. }
  87. else if(c == 2)
  88. {
  89. localStorage.setItem("playerXP", 140);
  90. window.alert("Island set to Beach. Please reload.");
  91. }
  92. else if(c == 3)
  93. {
  94. localStorage.setItem("playerXP", 700);
  95. window.alert("Island set to Easter. Please reload.");
  96. }
  97. else if(c == 4){
  98. localStorage.setItem("playerXP", 2100);
  99. window.alert("Island set to Wreck. Please reload.");
  100. }
  101. else if(c == 5){
  102. localStorage.setItem("playerXP", 4400);
  103. window.alert("Island set to Aztec. Please reload.");
  104. }
  105. else if(c == 6){
  106. localStorage.setItem("playerXP", 4400);
  107. window.alert("Island set to Volcano. Please reload.");
  108. }
  109. else if(c == 7){
  110. localStorage.setItem("playerXP", 4400);
  111. window.alert("Island set to Volcano. Please reload.");
  112. }
  113. else if(c != (1 || 2 || 3 || 4 || 5 || 6 || 7)){
  114. window.alert("Oops! Something went wrong! Please enter a number between 1 and 7!");
  115. }
  116. }
  117. }
  118.  
  119. console.log("b");
  120.  
  121. let ez = document.getElementById("skin-button");
  122. ez.onclick = function(){
  123. yohoho.chooseSkin();
  124. let a = parseInt(localStorage.getItem("coinsOwned"));
  125. document.getElementById("skin-popup-booty").innerHTML = a;
  126. }