Greasy Fork is available in English.

Neopets Auto Daily

Login to Neopets and go to http://www.neopets.com/index.phtml

  1. // ==UserScript==
  2. // @name Neopets Auto Daily
  3. // @version 1.1
  4. // @grant none
  5. // @include https://www.neopets.com/*
  6. // @author Bochuplah, lyd723
  7. // @description Login to Neopets and go to http://www.neopets.com/index.phtml
  8. // @namespace https://greasyfork.org/users/1263461
  9. // ==/UserScript==
  10.  
  11. //dailies pages
  12. var indexPage="https://www.neopets.com/myaccount.phtml";
  13. var omelettePage="https://www.neopets.com/prehistoric/omelette.phtml"
  14. var fishingPage="https://www.neopets.com/water/fishing.phtml"
  15. var shrinePage="https://www.neopets.com/desert/shrine.phtml"
  16. var plushiePage="https://www.neopets.com/faerieland/tdmbgpop.phtml"
  17. var springPage="https://www.neopets.com/faerieland/springs.phtml"
  18. var springPageTwo="https://www.neopets.com/faerieland/index.phtml?"
  19. var tombolaPage="https://www.neopets.com/island/tombola.phtml"
  20. var tombolaPageTwo="https://www.neopets.com/island/tombola2.phtml" //after collecting prize
  21. var trudyPage="https://www.neopets.com/trudys_surprise.phtml"
  22. var bankPage="https://www.neopets.com/bank.phtml"
  23. var jellyPage="https://www.neopets.com/jelly/jelly.phtml"
  24. var fruitPage="https://www.neopets.com/desert/fruit/index.phtml"
  25. var anchorPage="https://www.neopets.com/pirates/anchormanagement.phtml"
  26. var gravePage="https://www.neopets.com/halloween/gravedanger/"
  27. var shorePage="https://www.neopets.com/pirates/forgottenshore.phtml"
  28.  
  29.  
  30. //start the magic if you have already login
  31. function indexFun()
  32. {
  33. var f = document.getElementById("logout_link");
  34.  
  35. if (f!= null)
  36. {
  37. //go to the next page
  38. setTimeout(() => { window.location.href = omelettePage; }, 2000);
  39. }
  40. else
  41. {
  42. alert("[Neopets BotBot]Please Login to Neopets!!!")
  43. }
  44. }
  45.  
  46. function omeletteFun()
  47. {
  48. var omeletteForm = document.getElementsByTagName("form")[1];
  49.  
  50. if (omeletteForm != null && omeletteForm.innerHTML.includes("Grab"))
  51. {
  52. omeletteForm.submit();
  53. }
  54. else
  55. {
  56. //go to the next page
  57. setTimeout(() => { window.location.href = fishingPage; }, 4000);
  58. }
  59. }
  60.  
  61. function fishingFun()
  62. {
  63. var fishingForm = document.getElementsByTagName("form")[1];
  64.  
  65. if (fishingForm != null && fishingForm.innerHTML.includes("Reel"))
  66. {
  67. fishingForm.submit();
  68. }
  69. else
  70. {
  71. //go to the next page
  72. setTimeout(() => { window.location.href = shrinePage; }, 4000);
  73. }
  74. }
  75.  
  76. function shrineFun()
  77. {
  78. var shrineForm = document.getElementsByTagName("form")[1];
  79.  
  80.  
  81. if (shrineForm != null && shrineForm.innerHTML.includes("Approach"))
  82. {
  83. shrineForm.submit();
  84. }
  85. else
  86. {
  87. //go to the next page
  88. setTimeout(() => { window.location.href = plushiePage; }, 4000);
  89. }
  90. }
  91.  
  92. function plushieFun()
  93. {
  94. var plushieForm = document.getElementsByTagName("form")[1];
  95.  
  96. if (plushieForm != null && plushieForm.innerHTML.includes("Talk"))
  97. {
  98. plushieForm.submit();
  99. }
  100. else
  101. {
  102. //go to the next page
  103. setTimeout(() => { window.location.href = springPage; }, 4000);
  104. }
  105. }
  106.  
  107. function springFun()
  108. {
  109. var springForm = document.getElementsByTagName("form")[1];
  110.  
  111. if (springForm != null && springForm.innerHTML.includes("Heal"))
  112. {
  113. springForm.submit();
  114. }
  115. else
  116. {
  117. //go to the next page
  118. setTimeout(() => { window.location.href = tombolaPage; }, 4000);
  119. }
  120. }
  121.  
  122. function tombolaFun()
  123. {
  124. var tombolaForm = document.getElementsByTagName("form")[1];
  125.  
  126. if (tombolaForm != null && tombolaForm.innerHTML.includes("Play"))
  127. {
  128. tombolaForm.submit();
  129. }
  130. else
  131. {
  132. //go to the next page
  133. setTimeout(() => { window.location.href = jellyPage; }, 4000);
  134. }
  135. }
  136.  
  137. function jellyFun()
  138. {
  139. var jellyForm = document.getElementsByTagName("form")[1];
  140. if (jellyForm != null && jellyForm.innerHTML.includes("Grab"))
  141. {
  142. jellyForm.submit();
  143. }
  144. else
  145. {
  146. //go to the next page
  147. setTimeout(() => { window.location.href = fruitPage; }, 4000);
  148. }
  149. }
  150.  
  151. function fruitFun()
  152. {
  153. var fruitForm = document.getElementsByTagName("form")[1];
  154. if (fruitForm != null && fruitForm.innerHTML.includes("Spin, spin, spin"))
  155. {
  156. fruitForm.submit();
  157. }
  158. else
  159. {
  160. //go to the next page
  161. setTimeout(() => { window.location.href = anchorPage; }, 20000);
  162. }
  163. }
  164.  
  165. function anchorFun()
  166. {
  167. var anchorForm = document.getElementsByTagName("form")[1];
  168.  
  169. if (anchorForm != null)
  170. {
  171. anchorForm.submit();
  172. }
  173. else
  174. {
  175. //go to the next page
  176. setTimeout(() => { window.location.href = shorePage; }, 4000);
  177. }
  178. }
  179.  
  180. function shoreFun()
  181. {
  182. var exploreButton = document.querySelector('#shore_back a');
  183.  
  184. if (exploreButton != null)
  185. {
  186. exploreButton.click();
  187. }
  188. else
  189. {
  190. //go to the next page
  191. setTimeout(() => { window.location.href = gravePage; }, 4000);
  192. }
  193. }
  194.  
  195. function graveFun()
  196. {
  197. var sendButton = document.querySelector('.select.button-yellow__2020.button-default__2020.btn-single__2020');
  198. var replayButton = document.querySelector('#gdReward + .gdForm .button-default__2020.button-yellow__2020.btn-single__2020');
  199. if (sendButton != null)
  200. {
  201. document.querySelector('#gdSelection div').click();
  202. sendButton.click();
  203. setTimeout(() => {
  204. document.querySelector('.select.button-default__2020.button-green__2020.popup-right-button__2020').click();
  205. }, 1000);
  206. }
  207. else if (replayButton != null && replayButton.innerText != 'Visit the NC Mall') {
  208. replayButton.click();
  209. }
  210. else
  211. {
  212. //go to the next page
  213. setTimeout(() => { window.location.href = trudyPage; }, 4000);
  214. }
  215. }
  216.  
  217. //perform actions only when page finish loading
  218. window.addEventListener('load', function() {
  219. var currentURL = window.location.href;
  220. if (currentURL.localeCompare(indexPage) == 0)
  221. {
  222. indexFun();
  223. }
  224. else if (currentURL.localeCompare(omelettePage) == 0)
  225. {
  226. omeletteFun();
  227. }
  228. else if (currentURL.localeCompare(fishingPage) == 0)
  229. {
  230. fishingFun();
  231. }
  232. else if (currentURL.localeCompare(shrinePage) == 0)
  233. {
  234. shrineFun();
  235. }
  236. else if (currentURL.localeCompare(plushiePage) == 0)
  237. {
  238. plushieFun();
  239. }
  240. else if (currentURL.localeCompare(springPage) == 0 || currentURL.localeCompare(springPageTwo) == 0)
  241. {
  242. springFun();
  243. }
  244. else if (currentURL.toLowerCase().includes("tombola") && !currentURL.toLowerCase().includes("wizard"))
  245. {
  246. tombolaFun();
  247. }
  248. else if (currentURL.toLowerCase().includes("jelly.phtml")) {
  249. jellyFun();
  250. }
  251. else if (currentURL.localeCompare(fruitPage) == 0) {
  252. fruitFun();
  253. }
  254. else if (currentURL.localeCompare(anchorPage) == 0) {
  255. anchorFun();
  256. }
  257. else if (currentURL.localeCompare(gravePage) == 0) {
  258. graveFun();
  259. }
  260. else if (currentURL.toLowerCase().includes("forgottenshore")) {
  261. shoreFun();
  262. }
  263. }, false);