Skip to content

Instantly share code, notes, and snippets.

@wesQ3
Created May 10, 2013 17:23
Show Gist options
  • Save wesQ3/5555932 to your computer and use it in GitHub Desktop.
Save wesQ3/5555932 to your computer and use it in GitHub Desktop.
Candybox enhancement scratchpad
window.wes = {
eatTask: null,
questTask: null,
titleTask: null,
questFn: function () {
if (!quest.weAreQuestingRightNow && quest.tiredTime === 0)
quest.begin(false, 3);
},
titleFn: function () {
document.title = candies.nbrOwned + 'c|'
+ Math.round(lollipops.nbrOwned/1000) + 'kL|'
+ quest.getCharacterMaxHp() + 'hp'
},
eatFn: function () { candies.eat() },
hotkeys: {
65: function() { potions.earthquakeScroll() }, // a
83: function() { potions.invulnerability() }, // s
68: function() { potions.heal(100) }, // d
70: function() { potions.teleportScroll() }, // f
},
};
wes.titleTask = setInterval(wes.titleFn, 5*1000);
$('body').keyup(function(e) {
if (wes.hotkeys[e.which] && quest.weAreQuestingRightNow)
wes.hotkeys[e.which].call()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment