Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /****************************************************************************************************
  2. Setting the initial stage of the cheating tool and some quick definitions.
  3. */
  4. const cheats = {};
  5. const cheatState = {
  6. damageMultiplier: 1,
  7. efficiencyMultiplier: 1,
  8. afkMultiplier: 1,
  9. cloudz: false,
  10. runescape: false,
  11. godlikes: false,
  12. godlike: {
  13. crit: false,
  14. reach: false,
  15. hp: false,
  16. mp: false,
  17. ability: false,
  18. bosshp: false,
  19. food: false,
  20. hitchance: false,
  21. dmg: false,
  22. buff: false,
  23. },
  24. unlocks: false,
  25. unlock: {
  26. teleports: false,
  27. quickref: false,
  28. tickets: false,
  29. silvpen: false,
  30. goldpen: false,
  31. obolfrag: false,
  32. revive: false,
  33. },
  34. wides: false,
  35. wide: {
  36. mtx: false,
  37. post: false,
  38. guild: false,
  39. task: false,
  40. quest: false,
  41. star: false,
  42. crystal: false,
  43. giant: false,
  44. obol: false,
  45. },
  46. W1s: false,
  47. W1: {
  48. stampcost: false,
  49. anvil: false,
  50. forge: false,
  51. smith: false,
  52. statue: false,
  53. },
  54. cauldrons: false,
  55. cauldron: {
  56. vialrng: false,
  57. vialattempt: false,
  58. bubblecost: false,
  59. vialcost: false,
  60. lvlreq: false,
  61. newbubble: false,
  62. re_speed: false,
  63. liq_rate: false,
  64. },
  65. W3s: false,
  66. W3: {
  67. mobdeath: false,
  68. flagreq: false,
  69. saltcost: false,
  70. matcost: false,
  71. instabuild: false,
  72. booktime: false,
  73. totalflags: false,
  74. buildspd: false,
  75. saltlick: false,
  76. refinery: false,
  77. trapping: false,
  78. book: false,
  79. prayer: false,
  80. shrinehr: false,
  81. globalshrines: false,
  82. worshipspeed: false,
  83. freeworship: false,
  84. },
  85. W4s: false,
  86. W4: {
  87. eggcap: false,
  88. fenceyard: false,
  89. battleslots: false,
  90. petchance: false,
  91. petupgrades: false,
  92. genes: false,
  93. fasteggs: false,
  94. labpx: false,
  95. instameals: false,
  96. instarecipes: false,
  97. luckychef: false,
  98. freekitchens: false,
  99. freeplates: false,
  100. candy: false,
  101. petrng: false,
  102. },
  103. minigames: false,
  104. minigame: {
  105. mining: false,
  106. catching: false,
  107. fishing: false,
  108. choppin: false,
  109. },
  110. rng: false,
  111. };
  112. // Used to store things like item and card definitions
  113. let dictVals = {};
  114. let setupDone = false;
  115. let fixobj; // An object used to store stuff, for example an un-broken piece of GameAttribute from one character to another
  116. function registerCheat(command, fn) { cheats[command] = fn; }
  117. function isGameReady() {
  118. let result = true; // Check for engine
  119. result = !!this["com.stencyl.Engine"];
  120. return result;
  121. }
  122. // The main function that executes all cheats
  123. function cheat(action) {
  124. try {
  125. if (!isGameReady.call(this)) return 'Game is not ready.';
  126. if (!setupDone) setup.call(this);
  127. const [command, ...params] = action.split(' ');
  128. const foundCheat = cheats[command];
  129. if (foundCheat) {
  130. const result = foundCheat.call(this, params);
  131. return result ?? 'Done.';
  132. } else return `${command} is not a valid option.`;
  133. } catch (error) { return `Error: ${error.stack}`; }
  134. }
  135. /****************************************************************************************************
  136. A proxy setup and all Proxy definitions
  137. */
  138. function setup() {
  139. setupDone = true;
  140. // setup proxies
  141. setupRngProxy.call(this);
  142. setupCurrenciesOwnedProxy.call(this);
  143. setupArbitraryProxy.call(this);
  144. setupAnvilProxy.call(this);
  145. setupStampCostProxy.call(this);
  146. setupAFKRateProxy.call(this);
  147. setupAlchProxy.call(this);
  148. setupW3StuffProxy.call(this);
  149. setupW4StuffProxy.call(this);
  150. setupOptionsListAccountProxy.call(this);
  151. setupCListProxy.call(this);
  152. setupGameAttrProxy.call(this);
  153. setupQuestProxy.call(this);
  154. setupSmithProxy.call(this);
  155. setupAbilityProxy.call(this);
  156. setupValuesMapProxy.call(this);
  157. setupCloudSaveProxy.call(this);
  158. setupSpaceCandyProxy.call(this);
  159. //setupBuffsActiveProxy.call(this);
  160. }
  161.  
  162. function setupSpaceCandyProxy() {
  163. const bEngine = this["com.stencyl.Engine"].engine;
  164. const behavior = this["com.stencyl.behavior.Script"];
  165.  
  166. const handler = {
  167. apply: function(originalFn, context, argumentsList) {
  168.  
  169. if (cheatState.W4.candy && argumentsList[0].toString().includes("TIME_CANDY")) {
  170. Reflect.apply(originalFn, context, [function (t) {
  171. originalMap = bEngine.getGameAttribute("CurrentMap");
  172. bEngine.setGameAttribute("CurrentMap", 10);
  173. Reflect.apply(argumentsList[0], context, [t]);
  174. bEngine.setGameAttribute("CurrentMap", originalMap);
  175. }]);
  176. } else {
  177. Reflect.apply(originalFn, context, argumentsList);
  178. }
  179. }
  180. }
  181. const proxy = new Proxy(behavior.prototype.addMouseReleasedListener, handler);
  182.  
  183. behavior.prototype.addMouseReleasedListener = proxy;
  184. }
  185.  
  186. function setupRngProxy() {
  187. const behaviour = this["com.stencyl.behavior.Script"];
  188.  
  189. const randomFloatBetween = behaviour.randomFloatBetween;
  190. const handler = {
  191. apply: function (originalFn, context, argumentsList)
  192. {
  193. if (cheatState.rng === "high") return argumentsList[1];
  194. if (cheatState.rng === "low") return argumentsList[0];
  195. return Reflect.apply(originalFn, context, argumentsList);
  196. }
  197. };
  198.  
  199. proxy = new Proxy(randomFloatBetween, handler);
  200.  
  201. behaviour.randomFloatBetween = proxy;
  202. }
  203.  
  204. // Unlock quick references
  205. function setupOptionsListAccountProxy() {
  206. const bEngine = this["com.stencyl.Engine"].engine;
  207. const optionsListAccount = bEngine.getGameAttribute("OptionsListAccount");
  208. const handler = {
  209. get: function(obj, prop) {
  210. if ((cheatState.unlocks || cheatState.unlock.quickref) && Number(prop) === 34) return 0;
  211. if (cheatState.minigames && Number(prop) === 33) return obj[33] || 1;
  212. return Reflect.get(...arguments);
  213. },
  214. set: function(obj, prop, value) {
  215. if (cheatState.minigames && Number(prop) === 33) {
  216. if (obj[33] < value) obj[33] = value;
  217. return true;
  218. } return Reflect.set(...arguments);
  219. }
  220. };
  221. const proxy = new Proxy(optionsListAccount, handler);
  222. bEngine.setGameAttribute("OptionsListAccount", proxy);
  223. }
  224. // Free revival cheat
  225. function setupValuesMapProxy() {
  226. const bEngine = this["com.stencyl.Engine"].engine;
  227. const CurrenciesOwned = bEngine.getGameAttribute("PersonalValuesMap").h;
  228. const handler = {
  229. get: function(obj, prop) {
  230. if ((cheatState.unlocks || cheatState.unlock.revive) && prop === "InstaRevives") return obj.InstaRevives || 10;
  231. return Reflect.get(...arguments);
  232. },
  233. set: function(obj, prop, value) {
  234. if ((cheatState.unlocks || cheatState.unlock.revive) && prop === "InstaRevives"){
  235. if (obj["InstaRevives"] < value) obj["InstaRevives"] = value;
  236. return true;
  237. } return Reflect.set(...arguments);
  238. }
  239. };
  240. const proxy = new Proxy(CurrenciesOwned, handler);
  241. bEngine.getGameAttribute("PersonalValuesMap").h = proxy;
  242. }
  243. // Buffs never run out
  244. function setupBuffsActiveProxy() {
  245. const bEngine = this["com.stencyl.Engine"].engine;
  246. const BuffsActive = bEngine.getGameAttribute("BuffsActive");
  247. const handler = {
  248. get: function(obj, prop) {
  249. if ((cheatState.godlikes || cheatState.godlike.buff) && typeof obj[prop][1] != "undefined") obj[prop][1] = 5; // Trap at 5 seconds left
  250. return Reflect.get(...arguments);
  251. },
  252. set: function(obj, prop, value) {
  253. if ((cheatState.godlikes || cheatState.godlike.buff) && typeof obj[prop][1] != "undefined"){
  254. obj[prop][1] = 5;
  255. return true;
  256. } return Reflect.set(...arguments);
  257. }
  258. };
  259. const proxy = new Proxy(BuffsActive, handler);
  260. bEngine.setGameAttribute("BuffsActive", proxy);
  261. }
  262. // Stop cloud saving, once re-enabled it'll proc a save in 2 seconds.
  263. function setupCloudSaveProxy() {
  264. const bEngine = this["com.stencyl.Engine"].engine;
  265. const CloudSave = bEngine.getGameAttribute("CloudSaveCD");
  266. const handler = {
  267. get: function(obj, prop) {
  268. if (cheatState.cloudz && Number(prop) === 0) return 235;
  269. return Reflect.get(...arguments);
  270. },
  271. set: function(obj, prop, value) {
  272. if (cheatState.cloudz && Number(prop) === 0){
  273. obj[0] = 235;
  274. return true;
  275. } return Reflect.set(...arguments);
  276. }
  277. };
  278. const proxy = new Proxy(CloudSave, handler);
  279. bEngine.setGameAttribute("CloudSaveCD", proxy);
  280.  
  281. }
  282. // Some godlike cheats
  283. function setupGameAttrProxy() {
  284. const bEngine = this["com.stencyl.Engine"].engine;
  285. const gameAttr = bEngine.gameAttributes.h;
  286. const handler = {
  287. get: function(obj, prop) {
  288. if((cheatState.godlikes || cheatState.godlike.hp) && prop === "PlayerHP") return obj.PlayerHP || 1;
  289. if((cheatState.godlikes || cheatState.godlike.mp) && prop === "PlayerMP") return obj.PlayerMP || 1;
  290. if((cheatState.godlikes || cheatState.godlike.bosshp) && prop === "BossHP") return 0;
  291. return Reflect.get(...arguments);
  292. },
  293. set: function(obj, prop, value) {
  294. if((cheatState.godlikes || cheatState.godlike.hp) && prop === "PlayerHP"){ if (obj.PlayerHP < value) obj.PlayerHP = value; return true; }
  295. if((cheatState.godlikes || cheatState.godlike.mp) && prop === "PlayerMP"){ if (obj.PlayerMP < value) obj.PlayerMP = value; return true; }
  296. if((cheatState.godlikes || cheatState.godlike.bosshp) && prop === "BossHP"){ if (obj.BossHP < 0) obj.BossHP = 0; return true; }
  297. return Reflect.set(...arguments);
  298. }
  299. };
  300. const proxy = new Proxy(gameAttr, handler);
  301. bEngine.gameAttributes.h = proxy;
  302. }
  303. // Some more stats, as well as a forge upgrade within this one
  304. function setupArbitraryProxy(){
  305. const ActorEvents12 = this["scripts.ActorEvents_12"];
  306. // 100% crit chance
  307. const CritChance = ActorEvents12._customBlock_CritChance;
  308. const handlerCrit = {
  309. apply: function(originalFn, context, argumentsList) {
  310. if (cheatState.godlike.dmg) return 0; // Disable crits on dmg cap, as it's already capped
  311. if (cheatState.godlikes || cheatState.godlike.crit) return 100;
  312. return Reflect.apply(originalFn, context, argumentsList);
  313. }
  314. };
  315. const proxyCrit = new Proxy(CritChance, handlerCrit);
  316. ActorEvents12._customBlock_CritChance = proxyCrit;
  317. // Reach to 230
  318. const atkReach = ActorEvents12._customBlock_PlayerReach;
  319. const handlerReach = {
  320. apply: function(originalFn, context, argumentsList) {
  321. if (cheatState.godlikes || cheatState.godlike.reach) return 666;
  322. return Reflect.apply(originalFn, context, argumentsList);
  323. }
  324. };
  325. const proxyReach = new Proxy(atkReach, handlerReach);
  326. ActorEvents12._customBlock_PlayerReach = proxyReach;
  327. // Free forge upgrades
  328. const forgeupgr = ActorEvents12._customBlock_ForgeUpdateCosts;
  329. const handlerForge = {
  330. apply: function(originalFn, context, argumentsList) {
  331. if (cheatState.W1s || cheatState.W1.forge) return 0;
  332. return Reflect.apply(originalFn, context, argumentsList);
  333. }
  334. };
  335. const proxyForge = new Proxy(forgeupgr, handlerForge);
  336. ActorEvents12._customBlock_ForgeUpdateCosts = proxyForge;
  337. // Imperfect damage cap on too-OP broken players with overflowing damage
  338. const DamageDealt = ActorEvents12._customBlock_DamageDealed;
  339. const handlerDamage = {
  340. apply: function(originalFn, context, argumentsList) {
  341. const t = argumentsList[0];
  342. if (cheatState.godlike.dmg && t == "Min") return Number.MAX_SAFE_INTEGER;
  343. if (cheatState.godlike.dmg && t == "Max") return Number.MAX_SAFE_INTEGER;
  344. if (cheatState.godlike.dmg && t == "RNG") return Number.MAX_SAFE_INTEGER;
  345. return Reflect.apply(originalFn, context, argumentsList) * (argumentsList[0] == "Max" ? cheatState.damageMultiplier : 1);
  346. }
  347. };
  348. const proxyDamage = new Proxy(DamageDealt, handlerDamage);
  349. ActorEvents12._customBlock_DamageDealed = proxyDamage;
  350.  
  351. // Skill stats
  352. const SkillStats = ActorEvents12._customBlock_SkillStats;
  353. const handlerSkillStats = {
  354. apply: function(originalFn, context, argumentsList) {
  355. const t = argumentsList[0];
  356. if ((cheatState.W3s || cheatState.W3.worshipspeed) && t == "WorshipSpeed") return 5000; // 1000 worship%/h
  357. return Reflect.apply(originalFn, context, argumentsList) * (t.includes("Efficiency") ? cheatState.efficiencyMultiplier : 1);
  358. }
  359. };
  360. const proxySkillStats = new Proxy(SkillStats, handlerSkillStats);
  361. ActorEvents12._customBlock_SkillStats = proxySkillStats;
  362. ActorEvents12._customBlock_skillstats2 = new Proxy(ActorEvents12._customBlock_skillstats2, handlerSkillStats);
  363.  
  364. // Some arbitrary stuff
  365. const Arbitrary = ActorEvents12._customBlock_ArbitraryCode;
  366. const handlerArbitrary = {
  367. apply: function(originalFn, context, argumentsList) {
  368. const t = argumentsList[0];
  369. // if (cheatState.W1.statue && t.substring(0, 12) == "StatueExpReq") return 1; // This cheat works, but absolutely destroys your account
  370. if ((cheatState.wides || cheatState.wide.crystal) && t == "CrystalSpawn") return 1; // Crystal mob spawn rate 1
  371. if ((cheatState.wides || cheatState.wide.giant) && t == "GiantMob") return 1; // Giant mob spawn rate 1
  372. if ((cheatState.godlikes || cheatState.godlike.food) && t == "FoodNOTconsume") return 100; // Food never consumed
  373. if ((cheatState.godlikes || cheatState.godlike.hitchance) && t == "HitChancePCT") return 100; // 100% hit chance
  374.  
  375. return Reflect.apply(originalFn, context, argumentsList);
  376. }
  377. };
  378. const proxyArbitrary = new Proxy(Arbitrary, handlerArbitrary);
  379. ActorEvents12._customBlock_ArbitraryCode = proxyArbitrary;
  380.  
  381. const XforThingY = ActorEvents12._customBlock_RunCodeOfTypeXforThingY;
  382. const handlerXforThingY = {
  383. apply: function(originalFn, context, argumentsList) {
  384. const t = argumentsList[0];
  385. if ((cheatState.wides || cheatState.wide.obol) && t == "ObolRerollCostMoney") return 0;
  386. if ((cheatState.wides || cheatState.wide.obol) && t == "ObolRerollCostFrag") return 0;
  387. return Reflect.apply(originalFn, context, argumentsList);
  388. }
  389. };
  390. const proxyXforThingY = new Proxy(XforThingY, handlerXforThingY);
  391. ActorEvents12._customBlock_RunCodeOfTypeXforThingY = proxyXforThingY;
  392. }
  393. // A bunch of currency related cheats
  394. function setupCurrenciesOwnedProxy() {
  395. const bEngine = this["com.stencyl.Engine"].engine;
  396. const currencies = bEngine.getGameAttribute("CurrenciesOwned").h;
  397. const handler = {
  398. get: function(obj, prop) {
  399. if ((cheatState.unlocks || cheatState.unlock.teleports) && prop === 'WorldTeleports') return obj.WorldTeleports || 1;
  400. if ((cheatState.unlocks || cheatState.unlock.tickets) && prop === 'ColosseumTickets') return obj.ColosseumTickets || 1;
  401. if ((cheatState.unlocks || cheatState.unlock.obolfrag) && prop === 'ObolFragments') return obj.ObolFragments || 9001; // It's over nine thousand
  402. if ((cheatState.unlocks || cheatState.unlock.silvpen) && prop === 'SilverPens') return obj.SilverPens || 1;
  403. // Not a safe cheat as golden pens aren't released yet,
  404. // Only for people that use the manual cheat: chng bEngine.getGameAttribute("CurrenciesOwned").h["GoldPens"]=100
  405. //if ((cheatState.unlocks || cheatState.unlock.goldpen) && prop === 'GoldPens') return obj.GoldPens || 1;
  406. return Reflect.get(...arguments);
  407. },
  408. set: function(obj, prop, value) {
  409. if ((cheatState.unlocks || cheatState.unlock.teleports) && prop === 'WorldTeleports') return true; // Do nothing
  410. if ((cheatState.unlocks || cheatState.unlock.tickets) && prop === 'ColosseumTickets') {
  411. if (obj.ColosseumTickets < value) obj.ColosseumTickets = value;
  412. return true;
  413. } if ((cheatState.unlocks || cheatState.unlock.silvpen) && prop === 'SilverPens') {
  414. if(obj.SilverPens < value) obj.SilverPens = value;
  415. return true;
  416. } if ((cheatState.unlocks || cheatState.unlock.GoldPens) && prop === 'GoldPens') {
  417. if(obj.GoldPens < value) obj.GoldPens = value;
  418. return true;
  419. } if ((cheatState.unlocks || cheatState.unlock.obolfrag) && prop === 'ObolFragments') {
  420. if(obj.ObolFragments < value) obj.ObolFragments = value;
  421. return true;
  422. } return Reflect.set(...arguments);
  423. }
  424. };
  425. const proxy = new Proxy(currencies, handler);
  426. bEngine.getGameAttribute("CurrenciesOwned").h = proxy;
  427. }
  428. // Nullify stamp upgrade cost
  429. function setupStampCostProxy() {
  430. const bEngine = this["com.stencyl.Engine"].engine;
  431. const actorEvents124 = this["scripts.ActorEvents_124"];
  432. const stampCostFn = actorEvents124._customBlock_StampCostss;
  433. const handler = {
  434. apply: function(originalFn, context, argumentsList) {
  435. if (cheatState.W1s || cheatState.W1.stampcost) {
  436. const tab = argumentsList[0];
  437. const index = argumentsList[1];
  438. const currentStampLevel = bEngine.getGameAttribute("StampLevel")[tab][index];
  439. const maxStampLevel = bEngine.getGameAttribute("StampLevelMAX")[tab][index];
  440. if (currentStampLevel < maxStampLevel) return ['Money', 0];
  441. return ['PremiumGem', 0];
  442. } return Reflect.apply(originalFn, context, argumentsList);
  443. }
  444. };
  445. const proxy = new Proxy(stampCostFn, handler);
  446. actorEvents124._customBlock_StampCostss = proxy;
  447. }
  448.  
  449. function setupAFKRateProxy() {
  450. const actorEvents124 = this["scripts.ActorEvents_124"];
  451. const afkRate = actorEvents124._customBlock_AFKgainrates;
  452. const handler = {
  453. apply: function(originalFn, context, argumentsList) {
  454. return Reflect.apply(originalFn, context, argumentsList) * cheatState.afkMultiplier;
  455. }
  456. };
  457. const proxy = new Proxy(afkRate, handler);
  458. actorEvents124._customBlock_AFKgainrates = proxy;
  459. }
  460.  
  461. // Nullify anvil upgrade cost and duration
  462. function setupAnvilProxy() {
  463. const ActorEvents189 = this["scripts.ActorEvents_189"];
  464. const _AnvilProduceStats = ActorEvents189._customBlock_AnvilProduceStats;
  465. const handler = {
  466. apply: function(originalFn, context, argumentsList) {
  467. if (cheatState.W1s || cheatState.W1.anvil) {
  468. const t = argumentsList[0];
  469. if (t == "Costs1") return 0;
  470. if (t == "Costs2") return 0;
  471. if (t == "ProductionSpeed") return 1000000;
  472. else return Reflect.apply(originalFn, context, argumentsList);
  473. } return Reflect.apply(originalFn, context, argumentsList);
  474. }
  475. };
  476. const proxy = new Proxy(_AnvilProduceStats, handler);
  477. ActorEvents189._customBlock_AnvilProduceStats = proxy;
  478. }
  479. // Ability tweaking cheat
  480. function setupAbilityProxy() {
  481. const CustomMaps = this["scripts.CustomMaps"];
  482. const atkMoveMap = JSON.parse(JSON.stringify(this["scripts.CustomMaps"].atkMoveMap.h));
  483. for(const [key, value] of Object.entries(atkMoveMap)){
  484. value.h["cooldown"] = 0;
  485. value.h["castTime"] = .1;
  486. value.h["manaCost"] = 0;
  487. atkMoveMap[key] = value;
  488. }
  489. const handler = {
  490. get: function(obj, prop) {
  491. if(cheatState.godlikes || cheatState.godlike.ability) return atkMoveMap[prop];
  492. return Reflect.get(...arguments);
  493. }
  494. };
  495. const proxy = new Proxy(CustomMaps.atkMoveMap.h, handler);
  496. CustomMaps.atkMoveMap.h = proxy;
  497. }
  498. // Nullify smithing cost
  499. function setupSmithProxy() {
  500. const bEngine = this["com.stencyl.Engine"].engine;
  501. const sizeref = bEngine.getGameAttribute("CustomLists").h["ItemToCraftEXP"];
  502. const tCustomList = this["scripts.CustomLists"];
  503.  
  504. const NewReqs = []; // This'll be the new Array where we write our stuff to
  505. const size = []; // Time to obtain the Array lengths (e.g. amount of items per smithing tab)
  506. for(const [index, element] of Object.entries(sizeref)) size.push(element.length);
  507. // Yup we're using double square brackets, cause each item could require multiple materials to craft, while we only need to fill in one
  508. for(i=0; i < size.length; i++) NewReqs.push(new Array(size[i]).fill([["Copper", "0"]]));
  509. const handler = {
  510. apply: function(originalFn, context, argumentsList) {
  511. if (cheatState.W1s || cheatState.W1.smith) return NewReqs;
  512. return Reflect.apply(originalFn, context, argumentsList);
  513. }
  514. };
  515. const proxy = new Proxy(tCustomList["ItemToCraftCostTYPE"], handler);
  516. tCustomList["ItemToCraftCostTYPE"] = proxy;
  517. }
  518. // Modification of many functions that return static N-dimensional Arrays
  519. function setupCListProxy() {
  520. const bEngine = this["com.stencyl.Engine"].engine;
  521. const CList = bEngine.getGameAttribute("CustomLists").h;
  522.  
  523. const FuncDict = {
  524. AlchemyVialItemsPCT: new Array(CList.AlchemyVialItemsPCT.length).fill(99), // Vials unlock at rollin 1+
  525. SaltLicks: ChangeND(bEngine,2,"SaltLicks","0",[2]), // Nullify Saltlick upgrade cost
  526. RefineryInfo: ChangeND(bEngine,2,"RefineryInfo","0",[6,7,8,9,10,11]), // Nullify refinery cost
  527. TrapBoxInfo: ChangeND(bEngine,3,"TrapBoxInfo","0", [0]), // Nullify trapping time
  528. PrayerInfo: ChangeND(bEngine,2, // Nullify Prayer Curses and upgrade cost
  529. ChangeND(bEngine,2,"PrayerInfo","0",[4,6]),
  530. "None._Even_curses_need_time_off_every_now_and_then.",[2]),
  531. MTXinfo: ChangeND(bEngine,4,
  532. ChangeND(bEngine,4,"MTXinfo",0,[3,7]),
  533. function(t) {return Math.max(t, 15);},[5]), // Nullify MTX cost
  534. PostOfficePossibleOrders: ChangeND(bEngine,4,"PostOfficePossibleOrders","0",[1]), // Nullify post office order cost
  535. GuildGPtasks: ChangeND(bEngine,2,"GuildGPtasks","0",[1]), // Nullify guild task requirements
  536. TaskDescriptions: ChangeND(bEngine,3,"TaskDescriptions","0",[5,6,7,8,9,10,11,12,13,14]), // Nullify task requirements
  537. SSignInfoUI: ChangeND(bEngine,2,"SSignInfoUI","0",[4]), // Nullify star sign unlock req
  538. WorshipBASEinfos: ChangeND(bEngine,2,"WorshipBASEinfos", 0,[6]) // Nullify worship cost
  539. };
  540. const handler = {
  541. get: function(obj, prop) {
  542. if ((cheatState.cauldrons || cheatState.cauldron.vialrng) && prop === "AlchemyVialItemsPCT") return FuncDict[prop];
  543. if ((cheatState.W3s || cheatState.W3.saltlick) && prop === "SaltLicks") return FuncDict[prop];
  544. if ((cheatState.W3s || cheatState.W3.refinery) && prop === "RefineryInfo") return FuncDict[prop];
  545. if ((cheatState.W3s || cheatState.W3.trapping) && prop === "TrapBoxInfo") return FuncDict[prop];
  546. if ((cheatState.W3s || cheatState.W3.prayer) && prop === "PrayerInfo") return FuncDict[prop];
  547. if ((cheatState.wides || cheatState.wide.mtx) && prop === "MTXinfo") return FuncDict[prop];
  548. if ((cheatState.wides || cheatState.wide.post) && prop === "PostOfficePossibleOrders") return FuncDict[prop];
  549. if ((cheatState.wides || cheatState.wide.guild) && prop === "GuildGPtasks") return FuncDict[prop];
  550. if ((cheatState.wides || cheatState.wide.task) && prop === "TaskDescriptions") return FuncDict[prop];
  551. if ((cheatState.wides || cheatState.wide.star) && prop === "SSignInfoUI") return FuncDict[prop];
  552. if ((cheatState.W3s || cheatState.W3.freeworship) && prop === "WorshipBASEinfos") return FuncDict[prop];
  553. return Reflect.get(...arguments);
  554. }
  555. };
  556. const proxy = new Proxy(CList, handler);
  557. bEngine.getGameAttribute("CustomLists").h = proxy;
  558. }
  559. // The proxy that allows us to enable/disable quest item requirement nullifications whenever we like
  560. function setupQuestProxy() {
  561. const dialogueDefs = this["scripts.DialogueDefinitions"];
  562. const dialogueDefsC = JSON.parse(JSON.stringify( this["scripts.DialogueDefinitions"].dialogueDefs.h ));
  563. for(const [key, value] of Object.entries(dialogueDefsC)) // Go over all the quest-giving NPCs
  564. for(i=0; i < value[1].length; i++) // Go over all the addLine elements of that NPC
  565. // Notice that inside each value (e.g. NPC object), the 1st element is where all numeric stuff reside.
  566. // The 0th element holds the textual dialogue, which is not what we're looking for
  567. if(value[1][i].length == 9){ // Both addLine_ItemsAndSpaceRequired and addLine_Custom have nine elements within
  568. // Iterate over an unknown amount of req. values/Arrays
  569. if(value[1][i][2] === value[1][i][8]) // This is addLine_Custom
  570. for(j=0; j < value[1][i][3].length; j++){
  571. dialogueDefsC[key][1][i][3][j][1] = 0;
  572. dialogueDefsC[key][1][i][3][j][3] = 0;
  573. }
  574. else for(j=0; j < value[1][i][3].length; j++) // This is addLine_ItemsAndSpaceRequired
  575. dialogueDefsC[key][1][i][3][j] = 0;
  576. }
  577. const handler = {
  578. get: function(obj, prop) {
  579. if (cheatState.wides || cheatState.wide.quest) return dialogueDefsC[prop];
  580. return Reflect.get(...arguments);
  581. }
  582. };
  583. const proxy = new Proxy(dialogueDefs.dialogueDefs.h, handler);
  584. dialogueDefs.dialogueDefs.h = proxy;
  585. }
  586. // Alchemy cheats
  587. function setupAlchProxy() {
  588. const bEngine = this["com.stencyl.Engine"].engine;
  589. const ActorEvents189 = this["scripts.ActorEvents_189"];
  590. // No vial attempt reduction
  591. const CauldronP2W = bEngine.getGameAttribute("CauldronP2W");
  592. const handlerP2W = {
  593. get: function(obj, prop) {
  594. if ((cheatState.cauldron.vialattempt || cheatState.cauldrons) && obj[5][0] < obj[5][1]) {
  595. obj[5][0] = obj[5][1];
  596. return obj;
  597. } return Reflect.get(...arguments);
  598. }
  599. };
  600. const proxyP2W = new Proxy(CauldronP2W, handlerP2W);
  601. bEngine.setGameAttribute("CauldronP2W", proxyP2W);
  602. // Nullify all cauldron costs and durations (except P2W)
  603. const CauldronStats = ActorEvents189._customBlock_CauldronStats;
  604. const handlerStats = {
  605. apply: function(originalFn, context, argumentsList) {
  606. const t = argumentsList[0];
  607. if ((cheatState.cauldrons || cheatState.cauldron.bubblecost) && t == "CauldronCosts") return 0; // Nullified cauldron cost
  608. if ((cheatState.cauldrons || cheatState.cauldron.vialcost) && t == "VialCosts") return 0; // Nullified vial cost
  609. if ((cheatState.cauldrons || cheatState.cauldron.lvlreq) && t == "CauldronLvsBrewREQ") return 0; // Nullified brew reqs
  610. if ((cheatState.cauldrons || cheatState.cauldron.newbubble) && t == "PctChanceNewBubble") return 1000000; // Big enough new bubble chance
  611. if ((cheatState.cauldrons || cheatState.cauldron.re_speed) && t == "ResearchSpeed") return 10000; // Instant research speed
  612. if ((cheatState.cauldrons || cheatState.cauldron.liq_rate) && t == "LiquidHRrate") return 10000; // Quick liquid
  613. return Reflect.apply(originalFn, context, argumentsList);
  614. }
  615. };
  616. const proxyStats = new Proxy(CauldronStats, handlerStats);
  617. ActorEvents189._customBlock_CauldronStats = proxyStats;
  618. }
  619. // W3 cheats
  620. function setupW3StuffProxy() {
  621. const bEngine = this["com.stencyl.Engine"].engine;
  622. const actorEvents345 = this["scripts.ActorEvents_345"];
  623. // Nullification of all costs inside the workbench
  624. const WorkbenchStuff = actorEvents345._customBlock_WorkbenchStuff;
  625. const handlerWb = {
  626. apply: function(originalFn, context, argumentsList) {
  627. const t = argumentsList[0];
  628. if ((cheatState.W3s || cheatState.W3.flagreq) && t == "FlagReq") return 0; // Nullified flag unlock time
  629. if ((cheatState.W3s || cheatState.W3.saltcost) && t == "TowerSaltCost") return 0; // Partial Tower cost nullification
  630. if ((cheatState.W3s || cheatState.W3.matcost) && t == "TowerMatCost") return 0; // Partial Tower cost nullification
  631. if ((cheatState.W3s || cheatState.W3.instabuild) && t == "TowerBuildReq") return 0; // Instant build/upgrade
  632. if ((cheatState.W3s || cheatState.W3.booktime) && t == "BookReqTime") return 1; // Book/second, holds shadow ban danger and could one day be replaced
  633. if ((cheatState.W3s || cheatState.W3.totalflags) && t == "TotalFlags") return 10; // Total amnt of placeable flags
  634. if ((cheatState.W3s || cheatState.W3.buildspd) && t == "PlayerBuildSpd") return 1000000; // Buildrate on cogs
  635. if (cheatState.W3.shrinehr && t == "ShrineHrREQ") return 0.5; // Shrine lvl up time reduced to 0.5 hour
  636. // The minimum level talent book from the library is equivalent to the max level
  637. if ((cheatState.W3s || cheatState.W3.book) && t == "minBookLv"){ argumentsList[0] = "maxBookLv"; return Reflect.apply(originalFn, context, argumentsList); }
  638. return Reflect.apply(originalFn, context, argumentsList);
  639. }
  640. };
  641. const proxyWb = new Proxy(WorkbenchStuff, handlerWb);
  642. actorEvents345._customBlock_WorkbenchStuff = proxyWb;
  643. // Worship mobs die on spawn
  644. const _customBlock_2inputsFn = actorEvents345._customBlock_2inputs;
  645. const handlerWs = {
  646. apply: function(originalFn, context, argumentsList) {
  647. if (cheatState.W3.mobdeath || cheatState.W3s)
  648. return "Worshipmobdeathi" == true ? 0 : 0;
  649. return Reflect.apply(originalFn, context, argumentsList);
  650. }
  651. };
  652. const proxyWorship = new Proxy(_customBlock_2inputsFn, handlerWs);
  653. actorEvents345._customBlock_2inputs = proxyWorship;
  654.  
  655. const shrineInfo = bEngine.getGameAttribute("ShrineInfo");
  656. for(const i in shrineInfo) {
  657. shrineInfo[i] = new Proxy(shrineInfo[i], {
  658. get: function (original, j) {
  659. return cheatState.W3.globalshrines && j == 0 ? bEngine.getGameAttribute("CurrentMap") : original[j];
  660. }
  661. });
  662. }
  663. }
  664.  
  665. // W4 cheats
  666. function setupW4StuffProxy() {
  667. const actorEvents345 = this["scripts.ActorEvents_345"];
  668. // Nullification of all costs inside the workbench
  669. const breeding = actorEvents345._customBlock_Breeding;
  670. const handlerBreeding = {
  671. apply: function(originalFn, context, argumentsList) {
  672. const t = argumentsList[0];
  673. if ((cheatState.W4s || cheatState.W4.eggcap) && t == "TotalEggCapacity") return 13; // 13 eggs
  674. if ((cheatState.W4s || cheatState.W4.fenceyard) && t == "FenceYardSlots") return 27; // 27 fenceyard slots
  675. if ((cheatState.W4s || cheatState.W4.battleslots) && t == "PetBattleSlots") return 6; // 6 battle slots
  676. if ((cheatState.W4s || cheatState.W4.petchance) && t == "TotalBreedChance") return 1; // 100% new pet chance
  677. if ((cheatState.W4s || cheatState.W4.genes) && t == "GeneticCost") return 0; // 0 gene upgrades
  678. if ((cheatState.W4s || cheatState.W4.fasteggs) && t == "TotalTimeForEgg") return 1; // fast eggs
  679. if ((cheatState.W4s || cheatState.W4.petupgrades) && t == "PetUpgCostREAL") return 0; // free pet upgrades
  680. if ((cheatState.W4s || cheatState.W4.petrng) && t == "PetQTYonBreed") {
  681. cheatState.rng = "low";
  682. var power = Reflect.apply(originalFn, context, argumentsList);
  683. cheatState.rng = false;
  684. return Math.round(power * (1 + (Math.random() * 0.1)));
  685. }; // max power pets
  686. return Reflect.apply(originalFn, context, argumentsList);
  687. }
  688. };
  689. const proxyBreeding = new Proxy(breeding, handlerBreeding);
  690. actorEvents345._customBlock_Breeding = proxyBreeding;
  691.  
  692. const lab = actorEvents345._customBlock_Labb;
  693. const handlerLab = {
  694. apply: function(originalFn, context, argumentsList) {
  695. const t = argumentsList[0];
  696. if ((cheatState.W4s || cheatState.W4.labpx) && (t == "Dist" || t == "BonusLineWidth")) return 1000; // long lab connections
  697. return Reflect.apply(originalFn, context, argumentsList);
  698. }
  699. };
  700. const proxyLab = new Proxy(lab, handlerLab);
  701. actorEvents345._customBlock_Labb = proxyLab;
  702.  
  703. const cooking = actorEvents345._customBlock_CookingR;
  704. const handlerCooking = {
  705. apply: function(originalFn, context, argumentsList) {
  706. const t = argumentsList[0];
  707. if ((cheatState.W4s || cheatState.W4.instameals) && t == "CookingReqToCook") return 1; // super fast food
  708. if ((cheatState.W4s || cheatState.W4.instarecipes) && t == "CookingFireREQ") return 1; // super fast recipes
  709. if ((cheatState.W4s || cheatState.W4.luckychef) && t == "CookingNewRecipeOdds") return 4 == argumentsList[1] ? 1 : 5 == argumentsList[1] ? 0 : Reflect.apply(originalFn, context, argumentsList); // always cook a new recipe
  710. if ((cheatState.W4s || cheatState.W4.freekitchens) && (t == "CookingNewKitchenCoinCost" || t == "CookingUpgSpiceCostQty")) return 0; // free kitchens and upgrades
  711. if ((cheatState.W4s || cheatState.W4.freeplates) && t == "CookingMenuMealCosts") return 0; //free dinner table upgrades
  712. return Reflect.apply(originalFn, context, argumentsList);
  713. }
  714. }
  715. const proxyCooking = new Proxy(cooking, handlerCooking);
  716.  
  717. actorEvents345._customBlock_CookingR = proxyCooking;
  718. }
  719.  
  720. // Minigame cheats
  721. function setupMinigameProxy() {
  722. const bEngine = this["com.stencyl.Engine"].engine;
  723.  
  724. const miningGameOver = bEngine.getGameAttribute("PixelHelperActor")[4].getValue('ActorEvents_229', '_customEvent_MiningGameOver');
  725. const handlerMining = {
  726. apply: function(originalFn, context, argumentsList) {
  727. if (cheatState.minigame.mining) return; // Do nothing when game over
  728. return Reflect.apply(originalFn, context, argumentsList);
  729. }
  730. };
  731. const proxyMining = new Proxy(miningGameOver, handlerMining);
  732. bEngine.getGameAttribute("PixelHelperActor")[4].setValue('ActorEvents_229', '_customEvent_MiningGameOver', proxyMining);
  733.  
  734. const fishingGameOver = bEngine.getGameAttribute("PixelHelperActor")[4].getValue('ActorEvents_229', '_customEvent_FishingGameOver');
  735. const handlerFishing = {
  736. apply: function(originalFn, context, argumentsList) {
  737. if (cheatState.minigame.fishing) return; // Do nothing when game over
  738. return Reflect.apply(originalFn, context, argumentsList);
  739. }
  740. };
  741. const proxyFishing = new Proxy(fishingGameOver, handlerFishing);
  742. bEngine.getGameAttribute("PixelHelperActor")[4].setValue('ActorEvents_229', '_customEvent_FishingGameOver', proxyFishing);
  743. }
  744. // Static fly and hoop positions
  745. function setupCatchingMinigameProxy() {
  746. const bEngine = this["com.stencyl.Engine"].engine;
  747.  
  748. const catchingGameGenInfo = bEngine.getGameAttribute("PixelHelperActor")[4].getValue('ActorEvents_229', '_GenInfo');
  749. const handler = {
  750. get: function(originalObject, property) {
  751. if (cheatState.minigame.catching) {
  752. if (Number(property) === 31) return 70;
  753. if (Number(property) === 33) return [95, 95, 95, 95, 95];
  754. } return Reflect.get(...arguments);
  755. }
  756. };
  757. const proxyCatching = new Proxy(catchingGameGenInfo, handler);
  758. bEngine.getGameAttribute("PixelHelperActor")[4].setValue('ActorEvents_229', '_GenInfo', proxyCatching);
  759. }
  760. // Chopping minigame: Whole bar filled with gold zone
  761. function setupGeneralInfoProxy() {
  762. const bEngine = this["com.stencyl.Engine"].engine;
  763. const generalInfo = bEngine.getGameAttribute("PixelHelperActor")[1].getValue("ActorEvents_116", "_GeneralINFO");
  764. const handler = {
  765. get: function(orignalObject, property) {
  766. if (cheatState.minigame.choppin && Number(property) === 7)
  767. return [100, -1, 0, 2, 0, 220, -1, 0, -1, 0, -1, 0, 0, 220, 0, 0, 1];
  768. return Reflect.get(...arguments);
  769. }
  770. };
  771. const proxyChopping = new Proxy(generalInfo, handler);
  772. bEngine.getGameAttribute("PixelHelperActor")[1].setValue("ActorEvents_116", "_GeneralINFO", proxyChopping);
  773. }
  774. /****************************************************************************************************
  775. The following few commands are related functions for Creater0822's fork of the injection tool.
  776. */
  777. registerCheat('exit', function () { return "exit"; }); // Terminates the game process quicker
  778. /****************************************************************************************************
  779. Runescape homage cheats: Now we're finally God Gaming xD
  780. */
  781. registerCheat('runescape', function() { // Activate ability bar switching when switching weapons
  782. cheatState.runescape = !cheatState.runescape;
  783. return `${cheatState.runescape ? 'Activated' : 'Deactived'} ability bar switching.`;
  784. });
  785. // Preset BiS weapon + upgrade binding
  786. registerCheat('bind', function () {
  787. const bEngine = this["com.stencyl.Engine"].engine;
  788. const itemDefs = this["scripts.ItemDefinitions"].itemDefs;
  789. const AttackLoadout = bEngine.getGameAttribute("AttackLoadout");
  790. bEngine.whenAnyKeyPressedListeners.push((function(e, t) {
  791. if ( (e.keyCode === 65 || e.keyCode === 83 || e.keyCode === 68 || e.keyCode === 70) && bEngine.getGameAttribute("MenuType") === 6 ) {
  792. const BiS = {
  793. 65:["STR", "EquipmentSword3"], // Key A
  794. 83:["AGI", "EquipmentBows8"], // Key S
  795. 68:["WIS", "EquipmentWands7"], // Key D
  796. 70:["LUK", "EquipmentPunching5"] // Key F
  797. };
  798. // BiS = Warped Weapon Upgrade Stone: All random stats goes to the style's DPS stat
  799. const upgrstats = { Weapon_Power:3, Defence:0, Random_Stat:4 } // Edit this line to whatever you like
  800. const EquipOrd = bEngine.getGameAttribute("EquipmentOrder")[0];
  801. const EquipMap = bEngine.getGameAttribute("EquipmentMap")[0];
  802. const upgrslots = itemDefs.h[BiS[e.keyCode][1]].h["Upgrade_Slots_Left"];
  803. if(BiS[e.keyCode]){ // Only procs if whatever keycode is defined in the dictionary
  804. EquipOrd[1] = BiS[e.keyCode][1]; // Change equipped weapon
  805. EquipMap[1].h["Upgrade_Slots_Left"] = upgrslots*-1; // Deduct the amount of slots left
  806. EquipMap[1].h["Weapon_Power"] = upgrslots*upgrstats["Weapon_Power"];
  807. EquipMap[1].h["Defence"] = upgrslots*upgrstats["Defence"];
  808. EquipMap[1].h[BiS[e.keyCode][0]] = upgrslots*upgrstats["Random_Stat"];
  809. }
  810. if(cheatState.runescape){ // Let's play Runescape xD
  811. switch(e.keyCode) {
  812. case 65: // Melee
  813. AttackLoadout[0] = [90,91,105,120,106,121];
  814. AttackLoadout[1] = [94,108,122,107,639,635];
  815. break;
  816. case 83: // Ranged
  817. AttackLoadout[0] = [270,271,285,300,286,301];
  818. AttackLoadout[1] = [273,288,303,302,639,635];
  819. break;
  820. case 68: // Mage
  821. AttackLoadout[0] = [453,450,451,482,465,467];
  822. AttackLoadout[1] = [481,480,466,469,639,635];
  823. break;
  824. case 70: // Buffbar
  825. AttackLoadout[0] = [15,30,94,108,288,481];
  826. AttackLoadout[1] = [302,303,466,469,122,273];
  827. break;
  828. default: break;
  829. }
  830. }
  831. }
  832. })); return `The custom keybinds have been activated! (Has to be re-applied when changing maps)`;
  833. });
  834. /****************************************************************************************************
  835. We'll start things off with the relatively safe cheats.
  836. Though the drop function itself is safe, dropping unreleased items obviously isn't!
  837. */
  838. // Show all available cheats, this one's as safe as it can get xD
  839. registerCheat('cheats', function () { return Object.keys(cheats).join('\n'); });
  840. // Restore non-Proxy changed values
  841. registerCheat('restore', function(params) {
  842. if(params[0] === 'save'){
  843. dictVals.itemDefs = JSON.parse(JSON.stringify(this["scripts.ItemDefinitions"].itemDefs.h));
  844. dictVals.CardStuff = JSON.parse(JSON.stringify(this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["CardStuff"]));
  845. return `Saved the current values.`;
  846. }
  847. if(params[0] === 'item'){
  848. this["scripts.ItemDefinitions"].itemDefs.h = dictVals.itemDefs;
  849. return `Restored original item values.`;
  850. }
  851. if(params[0] === 'card'){
  852. this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["CardStuff"] = dictVals.CardStuff;
  853. return `Restored original card values`;
  854. }
  855. });
  856.  
  857. registerCheat('common', function() {
  858. let rtn = [];
  859. [
  860. 'godlike food',
  861. 'unlock quickref',
  862. 'unlock teleports',
  863. 'unlock tickets',
  864. 'unlock silvpen',
  865. 'unlock revive',
  866. 'wide mtx',
  867. 'wide star',
  868. 'wide obol',
  869. 'minigame',
  870. 'w3 prayer',
  871. 'w3 freeworship',
  872. 'w3 book',
  873. 'w3 globalshrines',
  874. 'w4 candy',
  875. 'w4 petrng',
  876. 'w4 labpx',
  877. 'upstones rng',
  878. ].forEach(function (c){
  879. rtn.push(cheat.apply(this, [c]));
  880. }, this);
  881. return rtn.join('\n');
  882. });
  883.  
  884. // Damage multiplier
  885. registerCheat('damagemultiplier', function (params) {
  886. cheatState.damageMultiplier = params[0] || 1;
  887. return `Damage multiplier set to ${cheatState.damageMultiplier}`;
  888. });
  889. // Efficiency multiplier
  890. registerCheat('efficiencymultiplier', function (params) {
  891. cheatState.efficiencyMultiplier = params[0] || 1;
  892. return `Efficiency multiplier set to ${cheatState.efficiencyMultiplier}`;
  893. });
  894. // AFKRate multiplier
  895. registerCheat('afkmultiplier', function (params) {
  896. cheatState.afkMultiplier = params[0] || 1;
  897. return `AFK % multiplier set to ${cheatState.afkMultiplier}`;
  898. });
  899.  
  900. // The OG-drop function that we all love
  901. registerCheat('drop', function (params) {
  902. const bEngine = this["com.stencyl.Engine"].engine;
  903. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  904. const actorEvents189 = this["scripts.ActorEvents_189"];
  905. const character = bEngine.getGameAttribute("OtherPlayers").h[bEngine.getGameAttribute("UserInfo")[0]];
  906.  
  907. const item = params[0];
  908. const amount = params[1] || 1;
  909. try {
  910. const itemDefinition = itemDefs[item];
  911. if (itemDefinition) {
  912. let x = character.getXCenter()
  913. let y = character.getValue("ActorEvents_20", "_PlayerNode");
  914. if(item.includes("SmithingRecipes")) actorEvents189._customBlock_DropSomething(item, 0, amount, 0, 2, y, 0, x, y);
  915. else actorEvents189._customBlock_DropSomething(item, amount, 0, 0, 2, y, 0, x, y);
  916. return `Dropped ${itemDefinition.h.displayName.replace(/_/g, ' ')}. (x${amount})`;
  917. } else return `No item found for '${item}'`;
  918. } catch (err) { return `Error: ${err}`; }
  919. });
  920. // Spawn any monster you like: Be careful with what you spawn!
  921. registerCheat('spawn', function(params) {
  922. const bEngine = this["com.stencyl.Engine"].engine;
  923. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  924. const ActorEvents124 = this["scripts.ActorEvents_124"];
  925. const character = bEngine.getGameAttribute("OtherPlayers").h[bEngine.getGameAttribute("UserInfo")[0]];
  926. const monster = params[0];
  927. const spawnAmnt = params[1] || 1;
  928. try{
  929. const monsterDefinition = monsterDefs[monster];
  930. if(monsterDefinition){
  931. let x = character.getXCenter();
  932. let y = character.getValue("ActorEvents_20", "_PlayerNode");
  933. for(let i=0; i<spawnAmnt; i++) ActorEvents124._customBlock_CreateMonster(monster, y, x);
  934. return `Spawned ${monsterDefinition.h["Name"].replace(/_/g, ' ')} ${spawnAmnt} time(s)`
  935. } else return `No monster found for '${monster}'`;
  936. } catch (err) { return `Error: ${err}`; }
  937. });
  938. // The OG portal unlock command
  939. registerCheat('unlock', function(params) {
  940. const bEngine = this["com.stencyl.Engine"].engine;
  941. if(params[0]){ // Execute sub-commands individually
  942. if (params && params[0] === 'portals') {
  943. bEngine.getGameAttribute("KillsLeft2Advance").map(entry => {
  944. for(i=0; i < entry.length; i++) entry[i] = 0;
  945. return entry; });
  946. return `The portals have been unlocked!`;
  947. }
  948. if (params && params[0] === 'quickref') {
  949. cheatState.unlock.quickref = !cheatState.unlock.quickref;
  950. return `${cheatState.unlock.quickref ? 'Activated' : 'Deactived'} quickref.`
  951. }
  952. if (params && params[0] === 'teleports') {
  953. cheatState.unlock.teleports = !cheatState.unlock.teleports;
  954. return `${cheatState.unlock.teleports ? 'Activated' : 'Deactived'} free teleports.`
  955. }
  956. if (params && params[0] === 'tickets') {
  957. cheatState.unlock.tickets = !cheatState.unlock.tickets;
  958. return `${cheatState.unlock.tickets ? 'Activated' : 'Deactived'} free colosseum tickets.`
  959. }
  960. if (params && params[0] === 'silvpen') {
  961. cheatState.unlock.silvpen = !cheatState.unlock.silvpen;
  962. return `${cheatState.unlock.silvpen ? 'Activated' : 'Deactived'} free silver pens.`
  963. }
  964. if (params && params[0] === 'goldpen') {
  965. cheatState.unlock.goldpen = !cheatState.unlock.goldpen;
  966. return `${cheatState.unlock.goldpen ? 'Activated' : 'Deactived'} free golden pens (if you have at least one xD).`
  967. }
  968. if (params && params[0] === 'obolfrag') {
  969. cheatState.unlock.obolfrag = !cheatState.unlock.obolfrag;
  970. return `${cheatState.unlock.obolfrag ? 'Activated' : 'Deactived'} free obol fragments.`
  971. }
  972. if (params && params[0] === 'revive') {
  973. cheatState.unlock.revive = !cheatState.unlock.revive;
  974. return `${cheatState.unlock.revive ? 'Activated' : 'Deactived'} unlimited revival attempts.`
  975. }
  976. return `Wrong sub-command, use one of these:\nportals, ${Object.keys(cheatState.unlock).join(", ")}`;
  977. } else{ // All Proxy cheats, so everything except portals
  978. if(cheatState.unlocks){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  979. cheatState.unlock.quickref = false;
  980. cheatState.unlock.teleports = false;
  981. cheatState.unlock.teleports = false;
  982. cheatState.unlock.silvpen = false;
  983. cheatState.unlock.goldpen = false;
  984. cheatState.unlock.obolfrag = false;
  985. cheatState.unlock.revive = false;
  986. } cheatState.unlocks = !cheatState.unlocks;
  987. return `${cheatState.unlocks ? 'Activated' : 'Deactived'} quickref & free teleports, colosseum tickets, silver/gold pens.`;
  988. }
  989. });
  990. // The bulk item function with dictionary item collections
  991. registerCheat('bulk', function(params) {
  992. const bEngine = this["com.stencyl.Engine"].engine;
  993. const itemDefs = this['scripts.ItemDefinitions'].itemDefs.h;
  994. const actorEvents189 = this["scripts.ActorEvents_189"];
  995. const character = bEngine.getGameAttribute("OtherPlayers").h[bEngine.getGameAttribute("UserInfo")[0]];
  996.  
  997. // Obtaining clusters of items at once (Doesn't return a drop log in the console)
  998. const items = params[0] || "default";
  999. const amnt = params[1] || 1;
  1000. try {
  1001. let x = character.getXCenter();
  1002. let y = character.getValue("ActorEvents_20", "_PlayerNode");
  1003. const drop_log = [];
  1004. // Here we'll use the pre-defined function to work out the magic
  1005. if(DictDrops[items]){
  1006. if(items === 'startalents') DictDrops[items].forEach(item => {
  1007. actorEvents189._customBlock_DropSomething("TalentBook1", item, 0, 0, 2, y, 0, x, y);
  1008. drop_log.push(`Dropped talent book with id ${item}`);
  1009. });
  1010. if(items === 'smith'){
  1011. DictDrops[items].forEach(item => { // Drop the regular items
  1012. if(itemDefs[item]){
  1013. actorEvents189._customBlock_DropSomething(item, 1, 0, 0, 2, y, 0, x, y);
  1014. drop_log.push(`Dropped ${itemDefs[item].h.displayName.replace(/_/g, ' ')}. (x${1})`);
  1015. } else drop_log.push(`No item found for '${item}'`);
  1016. });
  1017. //Not really too efficient, must be a better way to deal with this... Since this one's kinda lackluster I'll postphone it for now
  1018. const notreleased = [[23,59,63,70],[24,44,48,65,66,67,79],[20,21,46,59]]; // Array of smithing recipes that aren't out yet
  1019. if(amnt==1) [...Array(84).keys()].forEach(item => { if(notreleased[0].indexOf(item) == -1) actorEvents189._customBlock_DropSomething(`SmithingRecipes1`, 0, item, 0, 2, y, 0, x, y); });
  1020. if(amnt==2) [...Array(80).keys()].forEach(item => { if(notreleased[1].indexOf(item) == -1) actorEvents189._customBlock_DropSomething(`SmithingRecipes2`, 0, item, 0, 2, y, 0, x, y); });
  1021. if(amnt==3) [...Array(60).keys()].forEach(item => { if(notreleased[2].indexOf(item) == -1) actorEvents189._customBlock_DropSomething(`SmithingRecipes3`, 0, item, 0, 2, y, 0, x, y); });
  1022. } else DictDrops[items].forEach(item => {
  1023. if(itemDefs[item]){
  1024. actorEvents189._customBlock_DropSomething(item, amnt, 0, 0, 2, y, 0, x, y);
  1025. drop_log.push(`Dropped ${itemDefs[item].h.displayName.replace(/_/g, ' ')}. (x${amnt})`);
  1026. } else drop_log.push(`No item found for '${item}'`);
  1027. });
  1028. } else drop_log.push(` The sub-command didn't yield any item collection. Existing sub-commands are: \n ${Object.keys(DictDrops).join(", ")}`);
  1029. return drop_log.join("\n");
  1030. } catch (err) { return `Error: ${err}`; }
  1031. });
  1032. // Minigame cheats
  1033. registerCheat('minigame', function (params) {
  1034. if (!params || params.length === 0) {
  1035. cheatState.minigames = !cheatState.minigames;
  1036. return `${cheatState.minigames ? 'Activated' : 'Deactived'} unlimited minigames.`;
  1037. } else {
  1038. // setup needs to be repeated, because currently swapping players would break the setup.
  1039. setupMinigameProxy.call(this);
  1040. setupCatchingMinigameProxy.call(this);
  1041. setupGeneralInfoProxy.call(this);
  1042. if (params && params[0] === 'mining') {
  1043. cheatState.minigame.mining = !cheatState.minigame.mining;
  1044. return `${cheatState.minigame.mining ? 'Activated' : 'Deactived'} minigame mining.`;
  1045. }
  1046. if (params && params[0] === 'fishing') {
  1047. cheatState.minigame.fishing = !cheatState.minigame.fishing;
  1048. return `${cheatState.minigame.fishing ? 'Activated' : 'Deactived'} minigame fishing.`;
  1049. }
  1050. if (params && params[0] === 'catching') {
  1051. cheatState.minigame.catching = !cheatState.minigame.catching;
  1052. return `${cheatState.minigame.catching ? 'Activated' : 'Deactived'} minigame catching.`;
  1053. }
  1054. if (params && params[0] === 'choppin') {
  1055. cheatState.minigame.choppin = !cheatState.minigame.choppin;
  1056. return `${cheatState.minigame.choppin ? 'Activated' : 'Deactived'} minigame choppin.`;
  1057. }
  1058. }
  1059.  
  1060. return `${params ? params[0] : ''} not supported.`;
  1061. });
  1062. /****************************************************************************************************
  1063. The following commands have not been tested properly and/or are definitely dangerous to use
  1064. Use these only if you don't care about shadow ban and/or have the confidence in some...
  1065. Functions such as spawn, godlike and nullify don't directly modify the account info...
  1066. ...and may be safe to use to some degree. (No guarantees!!)
  1067. */
  1068. // All W1 related Proxy cheats
  1069. registerCheat('w1', function(params) {
  1070. if(params[0]){
  1071. if (params && params[0] === 'anvil') {
  1072. cheatState.W1.anvil = !cheatState.W1.anvil;
  1073. return `${cheatState.W1.anvil ? 'Activated' : 'Deactived'} anvil cost and duration nullification.`;
  1074. }
  1075. if (params && params[0] === 'forge') {
  1076. cheatState.W1.forge = !cheatState.W1.forge;
  1077. return `${cheatState.W1.forge ? 'Activated' : 'Deactived'} forge upgrade cost nullification.`;
  1078. }
  1079. if (params && params[0] === 'stampcost') {
  1080. cheatState.W1.stampcost = !cheatState.W1.stampcost;
  1081. return `${cheatState.W1.stampcost ? 'Activated' : 'Deactived'} stamp cost nullification.`;
  1082. }
  1083. if (params && params[0] === 'smith') {
  1084. cheatState.W1.smith = !cheatState.W1.smith;
  1085. return `${cheatState.W1.smith ? 'Activated' : 'Deactived'} smithing cost nullification (change maps to have the effect apply).`;
  1086. }
  1087. if (params && params[0] === 'statue') {
  1088. cheatState.W1.smith = !cheatState.W1.smith;
  1089. return `${cheatState.W1.smith ? 'Activated' : 'Deactived'} statue upgrade cost to 1. \n(This cheat has been commented out due to account breaking issues)`;
  1090. }
  1091. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.W1).join(", ")}`;
  1092. } else{
  1093. if(cheatState.W1s){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1094. cheatState.W1.anvil = false;
  1095. cheatState.W1.forge = false;
  1096. cheatState.W1.stampcost = false;
  1097. cheatState.W1.smith = false;
  1098. } cheatState.W1s = !cheatState.W1s;
  1099. return `${cheatState.W1s ? 'Activated' : 'Deactived'} stamps, forge and anvil upgrade cost nullification.`;
  1100. }
  1101. });
  1102. // Account-wide cheats
  1103. registerCheat('wide', function(params) {
  1104. if(params[0]){
  1105. if (params && params[0] === 'mtx') {
  1106. cheatState.wide.mtx = !cheatState.wide.mtx;
  1107. return `${cheatState.wide.mtx ? 'Activated' : 'Deactived'} mtx shop cost nullification.`;
  1108. }
  1109. if (params && params[0] === 'post') {
  1110. cheatState.wide.post = !cheatState.wide.post;
  1111. return `${cheatState.wide.post ? 'Activated' : 'Deactived'} post office cost nullification.`;
  1112. }
  1113. if (params && params[0] === 'guild') {
  1114. cheatState.wide.guild = !cheatState.wide.guild;
  1115. return `${cheatState.wide.guild ? 'Activated' : 'Deactived'} guild task cost nullification.`;
  1116. }
  1117. if (params && params[0] === 'task') {
  1118. cheatState.wide.task = !cheatState.wide.task;
  1119. return `${cheatState.wide.task ? 'Activated' : 'Deactived'} task cost nullification.`;
  1120. }
  1121. if (params && params[0] === 'quest') {
  1122. cheatState.wide.quest = !cheatState.wide.quest; // Nullifies quest item requirements (doesn't nullify level requirements)
  1123. return `${cheatState.wide.quest ? 'Activated' : 'Deactived'} quest item requirement nullification.`;
  1124. }
  1125. if (params && params[0] === 'star') {
  1126. cheatState.wide.star = !cheatState.wide.star;
  1127. return `${cheatState.wide.star ? 'Activated' : 'Deactived'} star point req. to unlock signs.`;
  1128. }
  1129. if (params && params[0] === 'crystal') {
  1130. cheatState.wide.crystal = !cheatState.wide.crystal;
  1131. return `${cheatState.wide.crystal ? 'Activated' : 'Deactived'} 100% Crystal mob spawn rate.`;
  1132. }
  1133. if (params && params[0] === 'giant') {
  1134. cheatState.wide.giant = !cheatState.wide.giant;
  1135. return `${cheatState.wide.giant ? 'Activated' : 'Deactived'} 100% giant mob spawn rate.`;
  1136. }
  1137. if (params && params[0] === 'obol') {
  1138. cheatState.wide.obol = !cheatState.wide.obol;
  1139. return `${cheatState.wide.obol ? 'Activated' : 'Deactived'} obol reroll cost nullification.`;
  1140. }
  1141. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.wide).join(", ")}`;
  1142. } else{
  1143. if(cheatState.wides){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1144. cheatState.wide.guild = false;
  1145. cheatState.wide.mtx = false;
  1146. cheatState.wide.post = false;
  1147. cheatState.wide.task = false;
  1148. cheatState.wide.quest = false;
  1149. cheatState.wide.star = false;
  1150. cheatState.wide.crystal = false;
  1151. cheatState.wide.giant = false;
  1152. cheatState.wide.obol = false;
  1153. } cheatState.wides = !cheatState.wides;
  1154. return `${cheatState.wides ? 'Activated' : 'Deactived'} account-wide nullifications e.g. mtx, post office, tasks and guild tasks cost.`;
  1155. }
  1156. });
  1157. // All cauldron related cheats
  1158. registerCheat('cauldron', function(params) {
  1159. if(params[0]){
  1160. if (params && params[0] === 'vialrng') {
  1161. cheatState.cauldron.vialrng = !cheatState.cauldron.vialrng;
  1162. return `${cheatState.cauldron.vialrng ? 'Activated' : 'Deactived'} vial unlock upon rolling 1+.`;
  1163. }
  1164. if (params && params[0] === 'vialattempt') {
  1165. cheatState.cauldron.vialattempt = !cheatState.cauldron.vialattempt;
  1166. return `${cheatState.cauldron.vialattempt ? 'Activated' : 'Deactived'} unlimited vial attempts.`;
  1167. }
  1168. if (params && params[0] === 'bubblecost') {
  1169. cheatState.cauldron.bubblecost = !cheatState.cauldron.bubblecost;
  1170. return `${cheatState.cauldron.bubblecost ? 'Activated' : 'Deactived'} bubble cost nullification.`;
  1171. }
  1172. if (params && params[0] === 'vialcost') {
  1173. cheatState.cauldron.vialcost = !cheatState.cauldron.vialcost;
  1174. return `${cheatState.cauldron.vialcost ? 'Activated' : 'Deactived'} vial cost nullification.`;
  1175. }
  1176. if (params && params[0] === 'lvlreq') {
  1177. cheatState.cauldron.lvlreq = !cheatState.cauldron.lvlreq;
  1178. return `${cheatState.cauldron.lvlreq ? 'Activated' : 'Deactived'} lvl requirement nullification.`;
  1179. }
  1180. if (params && params[0] === 'newbubble') {
  1181. cheatState.cauldron.newbubble = !cheatState.cauldron.newbubble;
  1182. return `${cheatState.cauldron.newbubble ? 'Activated' : 'Deactived'} new bubble chance 100%.`;
  1183. }
  1184. if (params && params[0] === 're_speed') {
  1185. cheatState.cauldron.re_speed = !cheatState.cauldron.re_speed;
  1186. return `${cheatState.cauldron.re_speed ? 'Activated' : 'Deactived'} super research speed.`;
  1187. }
  1188. if (params && params[0] === 'liq_rate') {
  1189. cheatState.cauldron.liq_rate = !cheatState.cauldron.liq_rate;
  1190. return `${cheatState.cauldron.liq_rate ? 'Activated' : 'Deactived'} super liquid speed.`;
  1191. }
  1192. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.cauldron).join(", ")}`;
  1193. } else{ // The full cauldron command that does everything
  1194. if(cheatState.cauldrons){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1195. cheatState.cauldron.vialrng = false,
  1196. cheatState.cauldron.vialattempt = false,
  1197. cheatState.cauldron.bubblecost = false;
  1198. cheatState.cauldron.vialcost = false;
  1199. cheatState.cauldron.lvlreq = false;
  1200. cheatState.cauldron.newbubble = false;
  1201. cheatState.cauldron.re_speed = false;
  1202. cheatState.cauldron.liq_rate = false;
  1203. } cheatState.cauldrons = !cheatState.cauldrons;
  1204. return `${cheatState.cauldrons ? 'Activated' : 'Deactived'} all cauldron costs and duration nullifications (except P2W).`;
  1205. }
  1206. });
  1207. // All W3 related Proxy cheats
  1208. registerCheat('w3', function(params) {
  1209. if(params[0]){
  1210. if (params && params[0] === 'mobdeath') {
  1211. cheatState.W3.mobdeath = !cheatState.W3.mobdeath;
  1212. return `${cheatState.W3.mobdeath ? 'Activated' : 'Deactived'} worship mobs insta-death.`;
  1213. }
  1214. if (params && params[0] === 'flagreq') {
  1215. cheatState.W3.flagreq = !cheatState.W3.flagreq;
  1216. return `${cheatState.W3.flagreq ? 'Activated' : 'Deactived'} flag unlock time nullification.`;
  1217. }
  1218. if (params && params[0] === 'saltcost') {
  1219. cheatState.W3.altcost = !cheatState.W3.altcost;
  1220. return `${cheatState.W3.altcost ? 'Activated' : 'Deactived'} salt cost nullification.`;
  1221. }
  1222. if (params && params[0] === 'matcost') {
  1223. cheatState.W3.flagreq = !cheatState.W3.flagreq;
  1224. return `${cheatState.W3.flagreq ? 'Activated' : 'Deactived'} flag unlock time nullification.`;
  1225. }
  1226. if (params && params[0] === 'instabuild') {
  1227. cheatState.W3.instabuild = !cheatState.W3.instabuild;
  1228. return `${cheatState.W3.instabuild ? 'Activated' : 'Deactived'} insta-build of buildings.`;
  1229. }
  1230. if (params && params[0] === 'booktime') {
  1231. cheatState.W3.booktime = !cheatState.W3.booktime;
  1232. return `${cheatState.W3.booktime ? 'Activated' : 'Deactived'} book per second.`;
  1233. }
  1234. if (params && params[0] === 'totalflags') {
  1235. cheatState.W3.totalflags = !cheatState.W3.totalflags;
  1236. return `${cheatState.W3.totalflags ? 'Activated' : 'Deactived'} 10 total flags.`;
  1237. }
  1238. if (params && params[0] === 'buildcogs') {
  1239. cheatState.W3.buildspd = !cheatState.W3.buildspd;
  1240. return `${cheatState.W3.buildspd ? 'Activated' : 'Deactived'} super build speed on cogs.`;
  1241. }
  1242. if (params && params[0] === 'saltlick') {
  1243. cheatState.W3.saltlick = !cheatState.W3.saltlick;
  1244. return `${cheatState.W3.saltlick ? 'Activated' : 'Deactived'} Salt Lick upgrade cost nullification.`;
  1245. }
  1246. if (params && params[0] === 'refinery') {
  1247. cheatState.W3.refinery = !cheatState.W3.refinery;
  1248. return `${cheatState.W3.refinery ? 'Activated' : 'Deactived'} refinery cost nullification.`;
  1249. }
  1250. if (params && params[0] === 'trapping') {
  1251. cheatState.W3.trapping = !cheatState.W3.trapping;
  1252. return `${cheatState.W3.trapping ? 'Activated' : 'Deactived'} trapping duration nullification.`;
  1253. }
  1254. if (params && params[0] === 'book') {
  1255. cheatState.W3.book = !cheatState.W3.book;
  1256. return `${cheatState.W3.book ? 'Activated' : 'Deactived'} always max lvl talent book.`;
  1257. }
  1258. if (params && params[0] === 'prayer') {
  1259. cheatState.W3.prayer = !cheatState.W3.prayer;
  1260. return `${cheatState.W3.prayer ? 'Activated' : 'Deactived'} Prayer curse nullification.`;
  1261. }
  1262. if (params && params[0] === 'shrinehr') {
  1263. cheatState.W3.shrinehr = !cheatState.W3.shrinehr;
  1264. return `${cheatState.W3.shrinehr ? 'Activated' : 'Deactived'} shrine lvl time reduction to 0.5h.`;
  1265. }
  1266. if (params && params[0] === 'worshipspeed') {
  1267. cheatState.W3.worshipspeed = !cheatState.W3.worshipspeed;
  1268. return `${cheatState.W3.worshipspeed ? 'Activated' : 'Deactived'} worship charge superspeed`;
  1269. }
  1270. if (params && params[0] === 'freeworship') {
  1271. cheatState.W3.freeworship = !cheatState.W3.freeworship;
  1272. return `${cheatState.W3.freeworship ? 'Activated' : 'Deactived'} nullification of worship charge cost`;
  1273. }
  1274. if (params && params[0] === 'globalshrines') {
  1275. cheatState.W3.globalshrines = !cheatState.W3.globalshrines;
  1276. return `${cheatState.W3.globalshrines ? 'Activated' : 'Deactived'} global shrines`;
  1277. }
  1278. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.W3).join(", ")}`;
  1279. } else{ // The full workbench command that does everything
  1280. if(cheatState.W3s){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1281. for (const i in Object.keys(cheatState.W3)) cheatState.W3[i] = false;
  1282. } cheatState.W3s = !cheatState.W3s;
  1283. return `${cheatState.W3s ? 'Activated' : 'Deactived'} all workbench nullifications and worship mob insta-death.`;
  1284. }
  1285. });
  1286. // All W4 related Proxy cheats
  1287. registerCheat('w4', function(params) {
  1288. if(params[0]){
  1289. const descriptionMap = {
  1290. 'battleslots': 'all 6 battle slots',
  1291. 'eggcap': 'all egg slots',
  1292. 'fenceyard': 'all fenceyard slots',
  1293. 'petchance': '100% new pet chance',
  1294. 'genes': '0 gene upgrades',
  1295. 'fasteggs': 'fast incubation',
  1296. 'petupgrades': 'free pet upgrades',
  1297. 'petrng': 'max strength pets (for level and egg, with a tiny bit of randomness)',
  1298. 'labpx': 'long lab connections',
  1299. 'instameals': 'speedy meal cooking',
  1300. 'instarecipes': 'speedy recipe research',
  1301. 'luckychef': 'new recipe guarantee',
  1302. 'freekitchens': 'free kitchens and upgrades',
  1303. 'freeplates': 'free dinner plate upgrades',
  1304. 'candy': 'candy use in space',
  1305. };
  1306. if(params[0] in descriptionMap) {
  1307. cheatState.W4[params[0]] = ! cheatState.W4[params[0]];
  1308. return `${cheatState.W4[params[0]] ? 'Activated' : 'Deactived'} ${descriptionMap[params[0]]}`;
  1309. }
  1310. if (params && params[0] === 'labchips') {
  1311. let labChips = this["com.stencyl.Engine"].engine.getGameAttribute("Lab")[15];
  1312. for(let i = 0; i <= 21; i++) {
  1313. labChips[i] = 20;
  1314. }
  1315. return `Added 20x all lab chips`;
  1316. }
  1317. return `Wrong sub-command, use one of these:\n${Object.keys(cheatState.W4).join(", ")}`;
  1318. } else{ // The full workbench command that does everything
  1319. if(cheatState.W4s){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1320. for (const i in Object.keys(cheatState.W4)) cheatState.W4[i] = false;
  1321. } cheatState.W4s = !cheatState.W4s;
  1322. return `${cheatState.W4s ? 'Activated' : 'Deactived'} all W4 cheats`;
  1323. }
  1324. });
  1325.  
  1326. // Godlike powers
  1327. registerCheat('godlike', function(params) {
  1328. if(params[0]){
  1329. if (params && params[0] === 'hp') {
  1330. cheatState.godlike.hp = !cheatState.godlike.hp;
  1331. return `${cheatState.godlike.hp ? 'Activated' : 'Deactived'} hp deduction nullification.`;
  1332. }
  1333. if (params && params[0] === 'mp') {
  1334. cheatState.godlike.mp = !cheatState.godlike.mp;
  1335. return `${cheatState.godlike.mp ? 'Activated' : 'Deactived'} mp deduction nullification.`;
  1336. }
  1337. if (params && params[0] === 'reach') {
  1338. cheatState.godlike.reach = !cheatState.godlike.reach;
  1339. return `${cheatState.godlike.reach ? 'Activated' : 'Deactived'} reach set to 666.`;
  1340. }
  1341. if (params && params[0] === 'crit') {
  1342. cheatState.godlike.crit = !cheatState.godlike.crit;
  1343. return `${cheatState.godlike.crit ? 'Activated' : 'Deactived'} crit set to 100.`;
  1344. }
  1345. if (params && params[0] === 'ability') {
  1346. cheatState.godlike.ability = !cheatState.godlike.ability;
  1347. return `${cheatState.godlike.ability ? 'Activated' : 'Deactived'} zero ability cooldown, mana cost nullification and cast time 0.1s.`;
  1348. }
  1349. if (params && params[0] === 'bosshp') {
  1350. cheatState.godlike.bosshp = !cheatState.godlike.bosshp;
  1351. return `${cheatState.godlike.bosshp ? 'Activated' : 'Deactived'} Boss HP nullification.`;
  1352. }
  1353. if (params && params[0] === 'food') {
  1354. cheatState.godlike.food = !cheatState.godlike.food;
  1355. return `${cheatState.godlike.food ? 'Activated' : 'Deactived'} food deduction nullification.`;
  1356. }
  1357. if (params && params[0] === 'hitchance') {
  1358. cheatState.godlike.hitchance = !cheatState.godlike.hitchance;
  1359. return `${cheatState.godlike.hitchance ? 'Activated' : 'Deactived'} 100% hit chance.`;
  1360. }
  1361. if (params && params[0] === 'buff') {
  1362. cheatState.godlike.buff = !cheatState.godlike.buff;
  1363. return `${cheatState.godlike.buff ? 'Activated' : 'Deactived'} unlimited buff time: Once disabled it'll run out in 5 seconds. \n(This cheat has been commented out due to crashing upon activating new buffs)`;
  1364. }
  1365. if (params && params[0] === 'dmg') {
  1366. cheatState.godlike.dmg = !cheatState.godlike.dmg;
  1367. return `${cheatState.godlike.dmg ? 'Activated' : 'Deactived'} auto attack capping: Crits are disabled and combat abilities will overflow.`;
  1368. }
  1369. if (params && params[0] === 'speed') { // Not a Proxy cheat, will have to activate individually
  1370. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1371. for( const [index, element] of Object.entries(itemDefs))
  1372. if(element.h["typeGen"] === "aWeapon") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Speed"] = params[1] || 9;
  1373. return `All weapon speed are up to Turbo. \nThe max speed parameter you can set is 14: Higher will cause a non-attacking bug.`;
  1374. }
  1375. if (params && params[0] === 'card') {
  1376. const bEngine = this["com.stencyl.Engine"].engine;
  1377. const CardStuff = bEngine.getGameAttribute("CustomLists").h["CardStuff"];
  1378. const TargetCards = ["Boss2A", "Boss2B", "poopBig", "OakTree", "Copper"];
  1379. for(const [key1, value1] of Object.entries(CardStuff))
  1380. for(const [key2, value2] of Object.entries(value1))
  1381. if(TargetCards.includes(value2[0])) CardStuff[key1][key2][4] = "10000";
  1382. return `The cards Efaunt, Chaotic Efaunt, Dr Defecaus, Oak Tree and Copper have been altered with insane stats.`;
  1383. }
  1384. return `Wrong sub-command, use one of these:\nfood, speed, card, ${Object.keys(cheatState.godlike).join(", ")}`;
  1385. } else{
  1386. if(cheatState.godlikes){ // If this was true, then the next line should be 'disable', so set all the individuals to false too
  1387. cheatState.godlike.hp = false;
  1388. cheatState.godlike.mp = false;
  1389. cheatState.godlike.reach = false;
  1390. cheatState.godlike.crit = false;
  1391. cheatState.godlike.ability = false;
  1392. cheatState.godlike.bosshp = false;
  1393. cheatState.godlike.food = false;
  1394. cheatState.godlike.hitchance = false;
  1395. cheatState.godlike.buff = false;
  1396. } cheatState.godlikes = !cheatState.godlikes;
  1397. return `${cheatState.godlikes ? 'Activated' : 'Deactived'}: \nNo HP/MP deduction, \n100% crit chance, 666 reach, \nZero ability cooldown, mana usage and 0.1s cast time, \nBoss HP set to zero.`;
  1398. }
  1399. });
  1400. // Quick daily shop and post office reset
  1401. registerCheat('daily', function(params) {
  1402. this["com.stencyl.Engine"].engine.getGameAttribute("TimeAway").h["ShopRestock"]=1
  1403. return `The daily shop restock has been triggered, which somehow also triggers the daily post office reset.`;
  1404. });
  1405. // This function doesn't kill other players (luckily) but yourself :)
  1406. registerCheat('noob', function(params) {
  1407. const hpval = parseInt(params[0]) || 0;
  1408. this["com.stencyl.Engine"].engine.gameAttributes.h.PlayerHP = hpval;
  1409. return `The amount of health is set to ${params[0]}`;
  1410. });
  1411. // This function definitely looks dangerous as it changes your class, but doesn't reset distributed talents!
  1412. registerCheat('class', function(params) {
  1413. let ClassId = parseInt(params[0]) || -1;
  1414. if(ClassId == -1) return `Class Id has to be a numeric value!`;
  1415. if(ClassId > 50 || ClassId < 0) ClassId = 1; // A small fail-safe
  1416. this["com.stencyl.Engine"].engine.setGameAttribute("CharacterClass", ClassId);
  1417. return `Class id has been changed to ${ClassId}`;
  1418. });
  1419. // Not sure if this function's safe, probably is to most items but I have not personally tested.
  1420. registerCheat('qnty', function(params) {
  1421. const bEngine = this["com.stencyl.Engine"].engine;
  1422. const setqnty = params[1] || 1;
  1423. if(params[0] === "inv"){
  1424. bEngine.getGameAttribute("ItemQuantity")[0] = setqnty;
  1425. return `The item quantity in the first inventory slot has been changed to ${setqnty}`;
  1426. } else if(params[0] === "chest"){
  1427. bEngine.getGameAttribute("ChestQuantity")[0] = setqnty;
  1428. return `The item quantity in the first chest slot has been changed to ${setqnty}`;
  1429. } else return "Unknown sub-command!\nKnown sub-commands are 'inv' and 'chest'.";
  1430. });
  1431. // This function is extremely dangerous, as you're changing the lvl value your exp isn't changing accordingly
  1432. registerCheat('lvl', function(params) {
  1433. const bEngine = this["com.stencyl.Engine"].engine;
  1434. const lvltype = params[0];
  1435. const setlvl = parseInt(params[1]) || -1;
  1436. if(setlvl == -1) return `The lvl value has to be numeric!`; // Yup this is a dummy-proof measurement to prevent account bricking
  1437. // The class and skill lvl code is easily done through dictionary.
  1438. const dictype = {'class':0,'mining':1,'smithing':2,'chopping':3,'fishing':4,'alchemy':5,'catching':6,'trapping':7,'construction':8,'worship':9};
  1439. if(Object.keys(dictype).includes(lvltype)) bEngine.getGameAttribute('Lv0')[dictype[lvltype]] = setlvl;
  1440. else if(lvltype === 'furnace') bEngine.setGameAttribute("FurnaceLevels", [16,setlvl,setlvl,setlvl,setlvl,setlvl]);
  1441. else if(lvltype === 'statue') bEngine.getGameAttribute("StatueLevels").forEach(item => item[0] = setlvl);
  1442. else if(lvltype === 'anvil'){
  1443. const Levels = bEngine.getGameAttribute("AnvilPAstats");
  1444. const lvllist = { exp: 3, spd: 4, cap: 5 };
  1445. for (const i in lvllist) Levels[lvllist[i]] = setlvl;
  1446. bEngine.setGameAttribute("AnvilPAstats", Levels);
  1447. } else if(lvltype === 'talent'){
  1448. const Levels0 = bEngine.getGameAttribute("SkillLevelsMAX");
  1449. const Levels1 = bEngine.getGameAttribute("SkillLevels");
  1450. for(const [index,element] of Object.entries(Levels0)) Levels0[index] = Levels1[index] = setlvl;
  1451. } else if(lvltype === 'stamp'){
  1452. const Levels0 = bEngine.getGameAttribute("StampLevelMAX");
  1453. const Levels1 = bEngine.getGameAttribute("StampLevel");
  1454. for(const [index1,element1] of Object.entries(Levels0)) // A double for loop to nail the job
  1455. for(const [index2,element2] of Object.entries(element1))
  1456. Levels0[index1][index2] = Levels1[index1][index2] = setlvl;
  1457. return `Both current and max of all stamp levels have been set to ${setlvl}`;
  1458. } else if(lvltype === 'shrine'){
  1459. const Levels = bEngine.getGameAttribute("ShrineInfo");
  1460. Levels.forEach(item => { item[3] = setlvl; item[4] = 0; }); // Shrine lvl set and accumulated xp to 0
  1461. } else if(lvltype === 'guild'){
  1462. const Levels = bEngine.getGameAttribute("GuildTasks");
  1463. for(const [index,element] of Object.entries(Levels[0])) Levels[0][index] = setlvl;
  1464. return "This is only for show and does not truly work server-sided. Might even be dangerous, but so is the entire lvl-command.";
  1465. } else return "This lvl type isn't supported.";
  1466. return `${lvltype} has been changed to ${setlvl}.`;
  1467. });
  1468. // Raw changes to cauldron variables
  1469. registerCheat('setalch', function(params) {
  1470. const bEngine = this["com.stencyl.Engine"].engine;
  1471. const alchdict = {"orange":0, "green":1, "purple":2, "yellow":3, "vial":4, "color":5, "liquid":6, "upgrade":8};
  1472. const setlvl = params[1] || 1000;
  1473. if(Object.keys(alchdict).includes(params[0])) {
  1474. const tochange = bEngine.getGameAttribute("CauldronInfo")[alchdict[params[0]]];
  1475. if(params[0] === "upgrade"){
  1476. for(const [index1,element1] of Object.entries(tochange))
  1477. for(const [index2,element2] of Object.entries(element1))
  1478. tochange[index1][index2][1] = setlvl;
  1479. return `All cauldron upgrades set to lvl ${setlvl}`;
  1480. } // No need to else, as there's a return
  1481. for(const [index,element] of Object.entries(tochange)) tochange[index] = setlvl;
  1482. return `All ${params[0]} levels have changed to ${setlvl}.`;
  1483. } else return `Wrong sub-command, use one of these:\n${Object.keys(alchdict).join(", ")}`;
  1484. });
  1485. // A highly dangerous function, only use it on shadow banned test accounts!!
  1486. registerCheat('abilitybar', function(params) {
  1487. const bEngine = this["com.stencyl.Engine"].engine;
  1488. const talentDefs = bEngine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1489. const AttackLoadout = bEngine.getGameAttribute("AttackLoadout");
  1490. // First parameter is the ability bar that ranges from 0 to 9.
  1491. const abilitybar = params[0];
  1492. const abilities = params.slice(1); //
  1493. const Abilities = [];
  1494. if(abilitybar < 10 && abilitybar >= 0){
  1495. for(const [index,element] of Object.entries(abilities)){
  1496. if(index >= 6) return "An ability bar can only hold 6 elements!";
  1497. if(element < talentDefs.length && element >= 0){
  1498. Abilities.push(`Bar ${abilitybar} ability ${index} set to: ${talentDefs[element].replace(/_/g, ' ').toLowerCase()}`)
  1499. AttackLoadout[abilitybar][index] = element;
  1500. } else Abilities.push("Ability falls out of the known id range!");
  1501. }
  1502. bEngine.setGameAttribute("AttackLoadout", AttackLoadout);
  1503. return Abilities.join("\n");
  1504. } else return "The ability bar index ranges from 0 to 9!";
  1505. });
  1506. // All item can by worn by any class
  1507. registerCheat('equipall', function(params) {
  1508. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1509. for( const [index, element] of Object.entries(itemDefs)){ // Any item with Class attribute is set to ALL, and any with lvlReqToEquip set to 1
  1510. if(element.h["Class"]) this["scripts.ItemDefinitions"].itemDefs.h[index].h["Class"] = "ALL";
  1511. if(element.h["lvReqToEquip"]) this["scripts.ItemDefinitions"].itemDefs.h[index].h["lvReqToEquip"] = 1;
  1512. } return `All items can be worn by any class at any level.`;
  1513. });
  1514. // All item can by worn by any class
  1515. registerCheat('upstones', function(params) {
  1516. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1517. if(params[0] === 'rng'){ // Should be 100% safe
  1518. for( const [index, element] of Object.entries(itemDefs))
  1519. if(element.h["typeGen"] === "dStone") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Amount"] = 100;
  1520. return `All upgrade stones have 100% success chance.`;
  1521. } else if(params[0] === 'use'){ // Probably risky
  1522. for( const [index, element] of Object.entries(itemDefs))
  1523. if(element.h["typeGen"] === "dStone") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Trigger"] = 0;
  1524. return `Using an upgrade stone doesn't deduct remaining upgrade amount on an item.`;
  1525. } return `Wrong sub-command, correct ones are:\nrng: Upgrade stones have 100% success chance, \nuse: Upgrade stones doesn't deduct remaining upgrade amount on an item.`;
  1526. });
  1527. // I still aim to add even more costs to nullify
  1528. registerCheat('nullify', function(params) {
  1529. const changedstuff = []; // Used to concatenate strings about what has been nullified by this command xD
  1530.  
  1531. cheatState.wides = !cheatState.wides;
  1532. changedstuff.push(`${cheatState.wides ? 'Activated' : 'Deactived'} account-wide nullifications e.g. mtx, post office, tasks and guild tasks cost.`);
  1533.  
  1534. cheatState.W1s = !cheatState.W1s;
  1535. changedstuff.push(`${cheatState.W1s ? 'Activated' : 'Deactived'} stamps, forge and anvil upgrade cost nullification.`);
  1536.  
  1537. cheatState.cauldrons = !cheatState.cauldrons;
  1538. changedstuff.push(`${cheatState.cauldrons ? 'Activated' : 'Deactived'} all cauldron costs and durations (except P2W).`);
  1539.  
  1540. cheatState.W3s = !cheatState.W3s;
  1541. changedstuff.push(`${cheatState.W3s ? 'Activated' : 'Deactived'} all workbench nullifications and worship mob insta-death.`);
  1542.  
  1543. return changedstuff.join("\n"); // Tell the user how many things have happened through this singular command xD
  1544. });
  1545. /****************************************************************************************************
  1546. The following functions only aggregate information from the game's data structures.
  1547. As such, these functions are perfectly safe.
  1548. */
  1549. // Search by item, monster or talent name: All in lowercase!
  1550. registerCheat('search', function (params) {
  1551. const queryX = params.slice(1) && params.slice(1).length ? params.slice(1).join(' ').toLowerCase() : undefined;
  1552. const bEngine = this["com.stencyl.Engine"].engine;
  1553. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1554. const ItemVals = [[],[]]
  1555. const searchVals = [];
  1556. if(queryX){
  1557. if(params[0] === "item"){
  1558. searchVals.push("Id, Item");
  1559. for(const [key, value] of Object.entries(itemDefs)){
  1560. const valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
  1561. if (valName.includes(queryX)) searchVals.push(`${key} - ${valName}`);
  1562. }
  1563. } else if(params[0] === "monster"){
  1564. searchVals.push("Id, Monster");
  1565. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  1566. for (const [key, value] of Object.entries(monsterDefs)) {
  1567. const valName = value.h["Name"].replace(/_/g, ' ').toLowerCase();
  1568. if (valName.includes(queryX)) searchVals.push(`${key} - ${valName}`);
  1569. }
  1570. } else if(params[0] === "talent"){
  1571. searchVals.push("Order, Id, Talent");
  1572. const talentDefs = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1573. const Order = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h["TalentOrder"];
  1574. for(let i=0; i < Order.length; i++){
  1575. const valName = talentDefs[Order[i]].replace(/_/g, ' ').toLowerCase();
  1576. if (valName.includes(queryX)) searchVals.push(`${i} - ${Order[i]} - ${valName}`);
  1577. }
  1578. } else if(params[0] === "smith"){
  1579. searchVals.push("Tab, Id, ItemId, ItemName");
  1580. const ItemToCraftNAME = bEngine.getGameAttribute("CustomLists").h["ItemToCraftNAME"];
  1581. for(const [key, value] of Object.entries(itemDefs)){
  1582. const valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
  1583. if (valName.includes(queryX)) ItemVals.push([key,valName]);
  1584. }
  1585. for(h=0; h < ItemVals.length; h++) for(i=0; i < ItemToCraftNAME.length; i++) for(j=0; j < ItemToCraftNAME[i].length; j++)
  1586. if (ItemVals[h][0] == ItemToCraftNAME[i][j]) searchVals.push(`${i+i}, ${j}, ${ItemVals[h][0]}, ${ItemVals[h][1]}`);
  1587. } else return "Invalid sub-command! Valid ones are:\n item\n monster\n talent\n smith";
  1588. if (searchVals.length > 0) return searchVals.join('\n');
  1589. else return `No info found for '${queryX}'`;
  1590. }
  1591. });
  1592. // Get Game Attributes: Uses a for loop to iterate over the object's key/index and element.
  1593. registerCheat('gga', function(params) {
  1594. const bEngine = this["com.stencyl.Engine"].engine;
  1595. return gg_func(params, 0, bEngine); // Yup the function's down at the bottom
  1596. });
  1597. // Get Game Key
  1598. registerCheat('ggk', function(params) {
  1599. const bEngine = this["com.stencyl.Engine"].engine;
  1600. return gg_func(params, 1, bEngine); // Yup the function's down at the bottom
  1601. });
  1602. /* Evaluate Get Game Attributes: fill in the variable you'd like to see
  1603. > egga this["com.stencyl.Engine"].engine.getGameAttribute("Lv0");
  1604. Under the hood it does:
  1605. > let gga = this["com.stencyl.Engine"].engine.getGameAttribute("Lv0");
  1606. Yeah this function is therefore pretty buggy, don't expect too much out of it xD
  1607. */
  1608. registerCheat('egga', function(params) {
  1609. const foundVals = [];
  1610. const bEngine = this["com.stencyl.Engine"].engine;
  1611. const CList = this["scripts.CustomLists"];
  1612. const Clist = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1613. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1614. const atkMoveMap = this["scripts.CustomMaps"].atkMoveMap.h;
  1615. const abilities = this["com.stencyl.Engine"].engine.getGameAttribute("AttackLoadout");
  1616. try{
  1617. let gga = eval(params[0]);
  1618. let obj_gga = Object.entries(gga);
  1619. if(typeof obj_gga == "string" || obj_gga.length == 0) foundVals.push(`${gga}`);
  1620. else for(const [index,element] of obj_gga) foundVals.push(`${index}, ${element}`);
  1621. return foundVals.join("\n");
  1622. } catch(error){
  1623. // If the gga isn't an Array nor Dictionary.
  1624. if(error instanceof TypeError) return `This TypeError should appear if you gave a non-existing object`;
  1625. return `Error: ${err}`;
  1626. }
  1627. });
  1628. // Evaluate Get Game Key: The code is indeed quite redundant, but yeah... it works
  1629. registerCheat('eggk', function(params) {
  1630. const foundVals = [];
  1631. const bEngine = this["com.stencyl.Engine"].engine;
  1632. const CList = this["scripts.CustomLists"];
  1633. const Clist = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1634. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1635. const atkMoveMap = this["scripts.CustomMaps"].atkMoveMap.h;
  1636. const abilities = this["com.stencyl.Engine"].engine.getGameAttribute("AttackLoadout");
  1637. try{
  1638. let gga = eval(params[0]);
  1639. let obj_gga = Object.entries(gga);
  1640. if(typeof obj_gga == "string" || obj_gga.length == 0) foundVals.push(`Non iterable value: ${gga}`);
  1641. else for(const [index,element] of obj_gga) foundVals.push(`${index}`);
  1642. return foundVals.join("\n");
  1643. } catch(error){
  1644. // If the gga isn't an Array nor Dictionary.
  1645. if(error instanceof TypeError) return `This TypeError should appear if you gave a non-existing object`;
  1646. return `Error: ${err}`;
  1647. }
  1648. });
  1649. // A list creator
  1650. registerCheat('list', function (params) {
  1651. const bEngine = this["com.stencyl.Engine"].engine;
  1652. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  1653. const CList = this["scripts.CustomLists"];
  1654. const Clist = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1655. const foundVals = [];
  1656.  
  1657. if(params[0] == "item"){
  1658. foundVals.push("Id, ingameName");
  1659. for(const [key, value] of Object.entries(itemDefs)){
  1660. let valName;
  1661. if(key.startsWith("Cards")) valName = (value.h.desc_line1.replace(/_/g, ' ').toLowerCase() + value.h.desc_line2.replace(/_/g, ' ').toLowerCase()).replace("filler", '');
  1662. else valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
  1663. foundVals.push(`${key}, ${valName}`);
  1664. }
  1665. } else if(params[0] == "monster"){
  1666. foundVals.push("Id, ingameName, HP, Defence, Damage, EXP");
  1667. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  1668. for(const [key, value] of Object.entries(monsterDefs)){
  1669. const valName = value.h["Name"].replace(/_/g, ' ').toLowerCase();
  1670. foundVals.push(`${key}, ${valName}, ${value.h["MonsterHPTotal"]}, ${value.h["Defence"]}, ${value.h["Damages"][0]}, ${value.h["ExpGiven"]}`);
  1671. }
  1672. } else if(params[0] == "card"){
  1673. foundVals.push("Id, Entity, Value, Effect");
  1674. const monsterDefs = this["scripts.MonsterDefinitions"].monsterDefs.h;
  1675. const CardStuff = bEngine.getGameAttribute("CustomLists").h["CardStuff"];
  1676. for(const [key1, value1] of Object.entries(CardStuff))
  1677. for(const [key2, value2] of Object.entries(value1)){
  1678. if(monsterDefs[value2[0]]) foundVals.push(`${value2[0]}, ${monsterDefs[value2[0]].h["Name"]}, ${value2[4]}, ${value2[3]}`);
  1679. else foundVals.push(`${value2[0]}, Unknown, ${value2[4]}, ${value2[3]}`);
  1680. }
  1681. } else if(params[0] == "class"){
  1682. foundVals.push("Id, ClassName, PromotesTo");
  1683. for(const [index, element] of CList.ClassNames().entries())
  1684. foundVals.push(`${index}, ${element}, [${CList.ClassPromotionChoices()[index]}]`);
  1685. } else if(params[0] == "quest"){
  1686. foundVals.push("Id, QuestName, NPC, QuestlineNo, paramX1");
  1687. for(const [index, element] of CList.SceneNPCquestOrder().entries())
  1688. foundVals.push(`${element}, ${CList.SceneNPCquestInfo()[index].join(", ")}`);
  1689. } else if(params[0] == "map"){
  1690. foundVals.push("Num_Id, Str_Id, MapName, AFK1, AFK2, Transition");
  1691. for(const [index, element] of CList.MapName().entries())
  1692. foundVals.push(`${index}, ${element}, ${CList.MapDispName()[index]}, ${CList.MapAFKtarget()[index]}, ${CList.MapAFKtargetSide()[index]}, [${CList.SceneTransitions()[index]}]`);
  1693. } else if(params[0] == "talent"){
  1694. foundVals.push("Order, Id, Name");
  1695. const Order = bEngine.getGameAttribute("CustomLists").h["TalentOrder"];
  1696. const talentDefs = bEngine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1697. for(i=0; i < Order.length; i++) if(talentDefs[Order[i]] !== "_")
  1698. foundVals.push(`${i}, ${Order[i]}, ${talentDefs[Order[i]]}`);
  1699. } else if(params[0] == "ability"){
  1700. foundVals.push("Order, Id, Name");
  1701. const Order = bEngine.getGameAttribute("CustomLists").h["TalentOrder"];
  1702. const talentDefs = bEngine.getGameAttribute("CustomLists").h["TalentIconNames"];
  1703. const atkMoveMap = this["scripts.CustomMaps"].atkMoveMap.h;
  1704. for(i=0; i < Order.length; i++) if(talentDefs[Order[i]] !== "_")
  1705. if(atkMoveMap[talentDefs[Order[i]]]) // Filter out all non-ability talents
  1706. foundVals.push(`${i}, ${Order[i]}, ${talentDefs[Order[i]]}`);
  1707. } else if(params[0] == "smith"){
  1708. foundVals.push("CraftId, Tab, ItemId, ItemName");
  1709. const ItemToCraftNAME = bEngine.getGameAttribute("CustomLists").h["ItemToCraftNAME"];
  1710. for(i=0; i < ItemToCraftNAME.length; i++) for(j=0; j < ItemToCraftNAME[i].length; j++){
  1711. let itemName = itemDefs[ItemToCraftNAME[i][j]].h.displayName.replace(/_/g, ' ').toLowerCase();
  1712. foundVals.push(`${i+1}, ${j}, ${ItemToCraftNAME[i][j]}, ${itemName}`);
  1713. }
  1714. }
  1715. else if(params[0] = "gga") for(const [key, val] of Object.entries(bEngine.gameAttributes.h)) foundVals.push(key);
  1716. else return "Valid sub-commands are:\n item\n monster\n class\n quest\n map\n talent\n smith";
  1717. if(params[1]) return foundVals.filter(foundVals => foundVals.includes(params[1])).join("\n");
  1718. return foundVals.join("\n"); // Concatenate all lines into one string with new lines
  1719. });
  1720. /****************************************************************************************************
  1721. These following functions enable you to perform extremely risky value manipulations...
  1722. ...and have insanely high chance of destroying your account.
  1723.  
  1724. Only use these when you know what you're doing!!
  1725. */
  1726. // Stop/restart cloud saving
  1727. registerCheat('cloudz', function() {
  1728. cheatState.cloudz = !cheatState.cloudz;
  1729. return `${cheatState.cloudz ? 'Activated' : 'Deactived'} the cloudsave jammer: Your game will not be saved while it's active! \nOnce disabled, your game will proc a cloudsave in 5 seconds. \nProbably doesn't work.`;
  1730. });
  1731. // Wipe stuff
  1732. registerCheat('wipe', function(params) {
  1733. const bEngine = this["com.stencyl.Engine"].engine;
  1734. if(params[0] === "inv"){
  1735. const wipedef = bEngine.getGameAttribute("InventoryOrder");
  1736. for(const [index,element] of Object.entries(wipedef)) wipedef[index] = "Blank";
  1737. return "The inventory has been wiped.";
  1738. } else if(params[0] == "chest"){
  1739. const wipedef = bEngine.getGameAttribute("ChestOrder");
  1740. for(const [index,element] of Object.entries(wipedef)) wipedef[index] = "Blank";
  1741. return "Wipe chest could result in a crash: Should be fine after restart.";
  1742. } else if(params[0] === "forge"){
  1743. for(const [index,element] of Object.entries(bEngine.getGameAttribute("ForgeItemOrder"))){
  1744. bEngine.getGameAttribute("ForgeItemOrder")[index] = "Blank";
  1745. bEngine.getGameAttribute("ForgeItemQuantity")[index] = 0;
  1746. } return "The forge has been wiped. \nIf the game crashes, it should be fine after restart.";
  1747. } else if(params[0] === "ban"){
  1748. bEngine.getGameAttribute("OptionsListAccount")[26] = 0;
  1749. return "The shadowing has been cleared, but it doesn't clear the true flag on your account. \n(note that this is not a true unban)";
  1750. } else return "Unknown sub-command given\nKnown sub-commands are 'inv', 'chest', 'forge' and 'ban'.";
  1751. });
  1752. // Don't use unless needed: This function exists to wipe certain stuff from your already broken account!
  1753. registerCheat('fix_save', function(params) {
  1754. fixobj = this["com.stencyl.Engine"].engine.getGameAttribute(params[0]);
  1755. return "Saved";
  1756. });
  1757. registerCheat('fix_write', function(params) {
  1758. this["com.stencyl.Engine"].engine.setGameAttribute(params[0], fixobj);
  1759. return "Writen";
  1760. });
  1761. // A highly dangerous function that lets you manually change in-game variables, like:
  1762. // > chng bEngine.getGameAttribute("QuestComplete").h["Secretkeeper1"]=1
  1763. registerCheat('chng', function(params) {
  1764. const bEngine = this["com.stencyl.Engine"].engine;
  1765. const CList = this["com.stencyl.Engine"].engine.getGameAttribute("CustomLists").h;
  1766. try{
  1767. eval(params[0]);
  1768. return `${params[0]}`;
  1769. } catch(error){ return `Error: ${err}`; }
  1770. });
  1771.  
  1772. /****************************************************************************************************
  1773. A huge dictionary made for the bulk function:
  1774. Since we'd hardly access this part of the code, it's fine being all the way down here.
  1775. */
  1776. const DictDrops = {
  1777. // 0) Handy cheat items
  1778. default:["Timecandy6","ExpBalloon3","ResetCompleted","ResetCompletedS","ClassSwap"],
  1779. // 1) All bag boosters
  1780. invbag:["InvBag1","InvBag2","InvBag3","InvBag4","InvBag5","InvBag6","InvBag7","InvBag8",//"InvBag9",
  1781. "InvBag21","InvBag22","InvBag23","InvBag24","InvBag25","InvBag26","InvBag100",
  1782. "InvBag101","InvBag102","InvBag103","InvBag104","InvBag105","InvBag106","InvBag107",//"InvBag101",
  1783. "InvBag109","InvBag110"],
  1784. // 2) All storage chest boosters
  1785. invstorage:["InvStorage1","InvStorage2","InvStorage3","InvStorage4","InvStorage5","InvStorage6","InvStorage7",
  1786. "InvStorage8","InvStorage9","InvStorage10","InvStorage11","InvStorage12","InvStorage13",//"InvStorage14",
  1787. "InvStorage15","InvStorage16","InvStorage17","InvStorage18","InvStorage19","InvStorage20","InvStorage21",
  1788. "InvStorage31","InvStorage32","InvStorage33","InvStorage34","InvStorage35","InvStorage36","InvStorage37",
  1789. "InvStorage38","InvStorage39","InvStorage40","InvStorage41","InvStorage42","InvStorageF"],
  1790. // 3) All item bag capacity boosters
  1791. capbag:["MaxCapBagT2","MaxCapBag1","MaxCapBag2","MaxCapBag3","MaxCapBag4","MaxCapBag5",
  1792. "MaxCapBagMi6","MaxCapBagT1","MaxCapBag7","MaxCapBag9","MaxCapBagT3","MaxCapBagT4",
  1793. "MaxCapBagT5","MaxCapBagT6","MaxCapBag6","MaxCapBag8","MaxCapBag10","MaxCapBagF3",
  1794. "MaxCapBagF4","MaxCapBagF5","MaxCapBagF6","MaxCapBagM1","MaxCapBagM2","MaxCapBagM3",
  1795. "MaxCapBagM4","MaxCapBagM5","MaxCapBagM6","MaxCapBagM7","MaxCapBagFi0","MaxCapBagFi1",
  1796. "MaxCapBagFi2","MaxCapBagFi3","MaxCapBagFi4","MaxCapBagFi5","MaxCapBagFi6","MaxCapBagB0",
  1797. "MaxCapBagB1","MaxCapBagB2","MaxCapBagB3","MaxCapBagB4","MaxCapBagB5","MaxCapBagB6",
  1798. "MaxCapBagTr0","MaxCapBagTr1","MaxCapBagTr2","MaxCapBagTr3","MaxCapBagTr4","MaxCapBagTr5",
  1799. "MaxCapBagS0","MaxCapBagS1","MaxCapBagS2","MaxCapBagS3","MaxCapBagS4","MaxCapBagS5"],
  1800. // 4) All Yugioh cards
  1801. yugioh:["CardsA0","CardsA1","CardsA2","CardsA3","CardsA4","CardsA5","CardsA6","CardsA7","CardsA8",
  1802. "CardsA9","CardsA10","CardsA11","CardsA12","CardsA13","CardsA14","CardsA15","CardsA16",
  1803. "CardsB1","CardsB2","CardsB3","CardsB4","CardsB5","CardsB6","CardsB7","CardsB8",
  1804. "CardsB9","CardsB10","CardsB11","CardsB12","CardsB13","CardsB14",
  1805. "CardsC1","CardsC2","CardsC3","CardsC4","CardsC5","CardsC6","CardsC7","CardsC8",
  1806. "CardsC9","CardsC10","CardsC11","CardsC12","CardsC13","CardsC14","CardsC15","CardsC16",
  1807. "CardsD1","CardsD2","CardsD3","CardsD4","CardsD5","CardsD6","CardsD7","CardsD8","CardsD9","CardsD10",
  1808. "CardsD11","CardsD12","CardsD13","CardsD16","CardsD17","CardsD18","CardsD19","CardsD20","CardsD21",
  1809. "CardsE0","CardsE1","CardsE2","CardsE3","CardsE4","CardsE5","CardsE6","CardsE7","CardsE8",
  1810. "CardsE9","CardsE10","CardsE11","CardsE12","CardsE13","CardsE14","CardsE15",
  1811. "CardsF1","CardsF2","CardsF3","CardsF4","CardsF5","CardsF6","CardsF7","CardsF8","CardsF9","CardsF10","CardsF11",
  1812. "CardsY0","CardsY1","CardsY2","CardsY3","CardsY4","CardsY5","CardsY5","CardsY6",
  1813. "CardsY7","CardsY8","CardsY9","CardsY10","CardsY11","CardsY12","CardsY13",
  1814. "CardsZ0","CardsZ1","CardsZ2","CardsZ3","CardsZ4","CardsZ5","CardsZ6","CardsZ7","CardsZ8","CardsZ9"],
  1815. // 5) All statues
  1816. statues:["EquipmentStatues1","EquipmentStatues2","EquipmentStatues3","EquipmentStatues4","EquipmentStatues5",
  1817. "EquipmentStatues6","EquipmentStatues7","EquipmentStatues8","EquipmentStatues9","EquipmentStatues10",
  1818. "EquipmentStatues11","EquipmentStatues12","EquipmentStatues13","EquipmentStatues14","EquipmentStatues15",
  1819. "EquipmentStatues16","EquipmentStatues17","EquipmentStatues18","EquipmentStatues19"],
  1820. // 6) All stamps (Many stamps aren't released yet)
  1821. stamps:["StampA1","StampA2","StampA3","StampA4","StampA5","StampA6","StampA7","StampA8","StampA9","StampA10",
  1822. "StampA11","StampA12","StampA13","StampA14","StampA15","StampA16","StampA17","StampA18","StampA19",
  1823. "StampA20","StampA21"/*,"StampA22"*/,"StampA23","StampA24"/*,"StampA25"*/,"StampA26","StampA27","StampA28",
  1824. //"StampA29","StampA30","StampA31","StampA32","StampA33","StampA34","StampA35",
  1825. "StampB1","StampB2","StampB3","StampB4","StampB5","StampB6","StampB7","StampB8","StampB9","StampB10",
  1826. "StampB11","StampB12","StampB13","StampB14","StampB15","StampB16","StampB17","StampB18","StampB19",
  1827. "StampB20","StampB21","StampB22","StampB23","StampB24","StampB25","StampB26","StampB27",//"StampB28","StampB29",
  1828. "StampB30","StampB31"/*,"StampB32","StampB33"*/,"StampB34"/*,"StampB35"*/,"StampB36",
  1829. "StampC1","StampC2","StampC3"/*,"StampC4","StampC5"*/,"StampC6","StampC7"/*,"StampC8"*/,"StampC9",//"StampC10","StampC11","StampC12","StampC13",
  1830. "StampC14","StampC15"/*,"StampC16","StampC17","StampC18"*/,"StampC19","StampC20"],
  1831. // 7) All fishing tools
  1832. fishtools:["Line1","Line2","Line3","Line4","Line5","Line6","Line7",
  1833. "Line8","Line9","Line10","Line11","Line12","Line13","Line14",
  1834. "Weight1","Weight2","Weight3","Weight4","Weight5","Weight6","Weight7",
  1835. "Weight8","Weight9","Weight10","Weight11","Weight12","Weight13","Weight14"],
  1836. // 8) All released Star Talent books
  1837. startalents:[
  1838. //"3615100", //Bored To Death (Lvl 100)
  1839. "361650", //Beginner Best Class (Lvl 50)
  1840. //"3617100", //Studious Quester (Lvl 100)
  1841. "3618100", //Quest Chungus (Lvl 100)
  1842. "3619100", //Crystals 4 Dayys (Lvl 100)
  1843. "362050", //Will Of The Eldest (Lvl 50)
  1844. "3621104", //TICK TOCK (Lvl 104)
  1845. "3622100", //STONKS! (Lvl 100)
  1846. "3623100", //Roll Da Dice (Lvl 100)
  1847. "362450", //Attacks on simmer (Lvl 50)
  1848. "3625120", //Toilet Paper Postage (Lvl 120)
  1849. "362640", //Exp Converter (Lvl 40)
  1850. "362750", //Goblet Of Hemoglobin (Lvl 50)
  1851. "3628100", //JUST EXP (Lvl 100)
  1852. "3629100", //Frothy Malk (Lvl 100)
  1853. "363050", //Convert Better Darnit (Lvl 50)
  1854. "3631100", //PULSATION (Lvl 100)
  1855. "3632100", //CARDIOVASCULAR! (Lvl 100)
  1856. //"3633100", //Nothing
  1857. "363450", //Telekinetic Storage (Lvl 50)
  1858. "3635100", //Printer Sampling (Lvl 100)
  1859. "3639100", //Shrine Architect (Lvl 100)
  1860. ],
  1861. // 9) Blacksmith recipes and tabs
  1862. smith:["EquipmentSmithingTabs3","SmithingHammerChisel","SmithingHammerChisel2"],
  1863. // 10) All skilling resources
  1864. skill:["Copper","Iron","Gold","Plat","Dementia","Void","Lustre","Starfire","Dreadlo","Godshard",
  1865. "CopperBar","IronBar","GoldBar","PlatBar","DementiaBar","VoidBar","LustreBar","StarfireBar","DreadloBar","GodshardBar",
  1866. "OakTree","BirchTree","JungleTree","ForestTree","ToiletTree","PalmTree","StumpTree","SaharanFoal","Tree7",
  1867. "Leaf1","Leaf2","Leaf3",
  1868. "Fish1","Fish2","Fish3","Fish4",
  1869. "Bug1","Bug2","Bug3","Bug4","Bug5","Bug6","PureWater",
  1870. "Critter1","Critter2","Critter3","Critter4","Critter5","Critter6","Critter7","Critter8","Critter9",
  1871. "Critter1A","Critter2A","Critter3A","Critter4A","Critter5A","Critter6A","Critter7A","Critter8A","Critter9A",
  1872. "Soul1","Soul2","Soul3","Soul4","Soul5",
  1873. "Soul6","Refinery1","Refinery2","Refinery3","Refinery4","Refinery5","Refinery6",
  1874. "CraftMat1","CraftMat2","CraftMat3"/*,"CraftMat4"*/,"CraftMat5","CraftMat6","CraftMat7","CraftMat8","CraftMat9","CraftMat10"],
  1875. // 11) All monster resources
  1876. monster:["Grasslands1","Grasslands2","Grasslands3","Grasslands4","Jungle1","Jungle2","Jungle3","Forest1","Forest2","Forest3",
  1877. "Sewers1","Sewers1b","Sewers2","Sewers3","TreeInterior1","TreeInterior1b","TreeInterior2","BabaYagaETC",
  1878. "DesertA1","DesertA1b","DesertA2","DesertA3","DesertA3b","DesertB1","DesertB2","DesertB3","DesertB4",
  1879. "DesertC1","DesertC2","DesertC2b","DesertC3","DesertC4","SnowA1","SnowA2","SnowA2a","SnowA3","SnowA4",
  1880. "SnowB1","SnowB2","SnowB2a","SnowB5","SnowB3","SnowB4","SnowC1","SnowC2","SnowC3","SnowC4","SnowC4a",
  1881. "IceMountains2","Hgg","EfauntDrop1","EfauntDrop2"],
  1882. // 12) Most (not all) currencies and gift items
  1883. currency:["Key1","Key2","Key3","SilverPen","PremiumGem",//"DeliveryBox",
  1884. "Quest30","Quest35","Quest36","Quest38","Quest40","Quest42","Quest44","Quest45","Quest49","Quest50"],
  1885. // 13) Best food
  1886. food:["PeanutG","FoodG1","FoodG2","FoodG3","FoodG4","FoodG5","FoodG6","Meatloaf","MidnightCookie",
  1887. "FoodPotOr3","FoodPotRe3","FoodPotGr3","FoodPotMana3","FoodPotYe3"],
  1888. // 14) All trophies
  1889. trophy:["Trophy1","Trophy2","Trophy3"/*,"Trophy4"*/,
  1890. "Trophy5","Trophy6","Trophy7","Trophy8","Trophy9","Trophy10",
  1891. "Trophy11","Trophy12","Trophy13","Trophy14"],
  1892. // 15) All upgrade stones (except lvl 1 and 2 cause 3 exists)
  1893. upstone:["StoneWe","StoneWeb","StoneW3","StoneW6",
  1894. "StoneA1b","StoneA2b","StoneA3b","StoneA3","StoneAe","StoneAeB",
  1895. "StoneHelm1","StoneHelm6","StoneHelm1b",
  1896. "StoneTe","StoneT1e","StoneT1eb","StoneT3",
  1897. "StoneZ2",
  1898. "StonePremSTR","StonePremAGI","StonePremWIS","StonePremLUK"],
  1899. // 16) All premium hats
  1900. phats:["EquipmentHats31","EquipmentHats32","EquipmentHats33","EquipmentHats34","EquipmentHats35",
  1901. "EquipmentHats36","EquipmentHats40","EquipmentHats37","EquipmentHats38","EquipmentHats46",
  1902. "EquipmentHats47","EquipmentHats48","EquipmentHats49","EquipmentHats50","EquipmentHats43",
  1903. "EquipmentHats45","EquipmentHats57","EquipmentHats62"],
  1904. // 17) High level Gear
  1905. gear:["EquipmentHats60","EquipmentShirts28","EquipmentShirts29","EquipmentShirts30","EquipmentPants21",
  1906. "EquipmentShoes22","EquipmentPendant14","EquipmentPendant17","EquipmentRings16","EquipmentRings16",
  1907. "EquipmentRings6","EquipmentRings6","EquipmentTools11","EquipmentTools7","EquipmentToolsHatchet5",
  1908. "EquipmentToolsHatchet7","CatchingNet7","CatchingNet6","FishingRod6","FishingRod7",
  1909. "EquipmentSword3","EquipmentBows8","EquipmentWands7","EquipmentPunching5",
  1910. "EquipmentHats58","EquipmentHats59","TrapBoxSet5","WorshipSkull5"],
  1911. // 18) Cheat equipments (Some unreleased items which will definitely shadow ban you)
  1912. cheat:["EquipmentWeapons2","TestObj16","EquipmentRings8","EquipmentPendant8","EquipmentShoes12","EquipmentPants13","EquipmentShirts8"]
  1913. };
  1914. /****************************************************************************************************
  1915. This function is made to simplify some code, basically a bit of elementary programming.
  1916. The arguments are as followed:
  1917. bEng = Engine input: Not very elegant, but it works for until I have more JavaScript experience.
  1918. dim = Amount of dimensions, can take values 2 to 4 (at 1D there's no reason for such complexity)
  1919. KeyName = The respecitve key inside GameAttribute Customlist that we want to iterate
  1920. repl = The replacement value
  1921. elem = List of Array indices, which elements we want replaced
  1922. */
  1923. function ChangeND(bEng, dim, KeyName, repl, elem){
  1924. let NDArr;
  1925. if(typeof KeyName === "string") // Creates a deep-copy
  1926. NDArr = JSON.parse(JSON.stringify(bEng.getGameAttribute("CustomLists").h[KeyName]));
  1927. else NDArr = KeyName; // Else this KeyName parameter is an object
  1928. if(dim === 4){
  1929. for(const [index1, element1] of Object.entries(NDArr)){
  1930. for(const [index2, element2] of Object.entries(element1)){
  1931. for(const [index3, element3] of Object.entries(element2)){
  1932. for(i in elem) element3[elem[i]] = repl instanceof Function ? repl(element3[elem[i]]) : repl; // Fill every
  1933. NDArr[index1][index2][index3] = element3; // Write back to the 4D Array
  1934. }
  1935. }
  1936. }
  1937. } else if(dim === 3){
  1938. for(const [index1, element1] of Object.entries(NDArr)){
  1939. for(const [index2, element2] of Object.entries(element1)){
  1940. for(i in elem) element2[elem[i]] = repl instanceof Function ? repl(element3[elem[i]]) : repl;
  1941. NDArr[index1][index2] = element2; // Write back to the 3D Array
  1942. }
  1943. }
  1944. } else if(dim === 2){
  1945. for(const [index1, element1] of Object.entries(NDArr)){
  1946. for(i in elem) element1[elem[i]] = repl instanceof Function ? repl(element3[elem[i]]) : repl;
  1947. NDArr[index1] = element1; // Write back to the 2D Array
  1948. }
  1949. } else return NDArr; // Else return the original without modifications
  1950. return NDArr;
  1951. } // This function's even less likely to ever be revisited, so it's nice here
  1952. /****************************************************************************************************
  1953. The help function for gga/ggk
  1954. */
  1955. function gg_func(Params, which, bEngine){
  1956. const foundVals = [];
  1957. try{
  1958. let gga = bEngine.gameAttributes.h;
  1959. let eva_gga; let obj_gga;
  1960. if(Params.length > 0){
  1961. gga = bEngine.getGameAttribute(Params[0]);
  1962. if("h" in gga) gga = bEngine.getGameAttribute(Params[0]).h; // Some attributes may not have a .h
  1963. }
  1964. switch(Params.length) {
  1965. case 2:
  1966. eva_gga = gga[Params[1]];
  1967. break;
  1968. case 3:
  1969. eva_gga = gga[Params[1]][Params[2]];
  1970. break;
  1971. case 4:
  1972. eva_gga = gga[Params[1]][Params[2]][Params[3]];
  1973. break;
  1974. case 5:
  1975. eva_gga = gga[Params[1]][Params[2]][Params[3]][Params[4]];
  1976. break;
  1977. default: // For every other length goes this
  1978. eva_gga = gga;
  1979. break;
  1980. }
  1981.  
  1982. obj_gga = Object.entries(eva_gga);
  1983. if(typeof obj_gga == "string" || obj_gga.length == 0){
  1984. if(which == 0) foundVals.push(`${eva_gga}`);
  1985. else foundVals.push(`Non iterable value: ${eva_gga}`);
  1986. } else for(const [index,element] of obj_gga){
  1987. if(which == 0) foundVals.push(`${index}, ${element}`); // This one's for gga
  1988. else foundVals.push(`${index}`); // This one's for ggk
  1989. }
  1990. return foundVals.join("\n");
  1991. } catch(error){
  1992. if(error instanceof TypeError) return `This TypeError should appear if you gave a non-existing key.`;
  1993. return `Error: ${err}`;
  1994. }
  1995. }
  1996.  
  1997. /* Credit section:
  1998.  
  1999. iBelg
  2000. User profile: https://fearlessrevolution.com/memberlist.php?mode=viewprofile&u=45315
  2001. Tool release: https://fearlessrevolution.com/viewtopic.php?p=199352#p199352
  2002. > The creator of the console injection, designer of the cheats syntax as well as many cheats
  2003.  
  2004. salmon85
  2005. User profile: https://fearlessrevolution.com/memberlist.php?mode=viewprofile&u=80266
  2006. > Wipe inv, wipe forge and class lvl command
  2007.  
  2008. Creater0822
  2009. User profile: https://fearlessrevolution.com/memberlist.php?mode=viewprofile&u=10529
  2010. Google Drive: https://drive.google.com/drive/folders/1MyEkO0uNEpGx1VctMEKZ5sQiNzuSZv36?usp=sharing
  2011. > For the remaining commands
  2012. */
  2013.  
  2014. /* Help & troubleshoot section:
  2015.  
  2016. How to use:
  2017. > Place iBelg's injecting tool and this script inside the game's root folder and execute the tool (not the game)
  2018. > To close the game, you have to close the NodeJS console.
  2019.  
  2020. The tool closes itself instantly after execution?!?!
  2021. The error shows things like: UnhandledPromiseRejectionWarning: Error: No inspectable targets
  2022. > You probably forgot to have the Steam client launched in the background.
  2023.  
  2024. The game is has been loaded, but the console doesn't load.
  2025. > There could be multiple sessions running.
  2026. > If you rapidly re-start the injected game after closing it, the previous process may not be killed yet.
  2027. */
  2028.  
  2029. /* Depreciated unique cheats:
  2030. // A non-proxy cheat that nullifies boost food consumption and health food cooldown.
  2031. if (params && params[0] === 'food') {
  2032. const itemDefs = this["scripts.ItemDefinitions"].itemDefs.h;
  2033. for( const [index, element] of Object.entries(itemDefs))
  2034. if(element.h["typeGen"] === "cFood") this["scripts.ItemDefinitions"].itemDefs.h[index].h["Cooldown"] = 0;
  2035. return `Boost food is never consumed and consumption cooldown on health food is nullified.`;
  2036. }
  2037. */