From Candy Box Wiki
Jump to: navigation, search

Cheats will allow you to modify your game experience, at the cost of a genuine playthrough. They work by changing the javascript values of the game while it is running in the browser. To use cheats you must be using a browser that possesses a javascript/debug console. Other possibility : creating a bookmark starting with "javascript:", but then you can NOT use spaces! (if you want to use a code with spaces, then try removing all of them, but if it doesn't work let it go)

All codes must be typed into the javascript/debug console at the correct time.

If you know some cheats, please help others -players- cheaters

You want to find some? You'll need to view the source code, and you should also know the basics of JavaScript.

Also see section 7, "Code Comprehension Helper", and edit it if you have new infos!


[edit] More candies & Lollipops

[edit] Candies

[edit] Extra Candy

Can be entered: At any time during the game


X: number of candy you want

[edit] Lollipops

[edit] Extra Lollipops

Can be entered: At any time during the game (same as with candies the number in the lollipop can be modified)


X: number of lollipops you want

[edit] 100 Extra Lollipops per second

Can be entered: At any time during the game (same as with candies the number in the lollipop farm can be modified)

farm.setLollipopsProduction(farm.lollipopsPlanted + 8640000)

[edit] Remove 100 lp/sec Lollipop Farm cap

Can be entered: At any time during the game.

Note: Has to be reentered every time, after loading a saved game.

farm.maxLollipopsPerDay = Number.MAX_VALUE; farm.calculateLollipopsProductionFromLollipopsPerDay();

[edit] Add/Set 1000 Hp

Can be entered: When in a quest

To add 1000 HP

quest.things[quest.getCharacterIndex()].hp += 1000

Or to set HP to 1000 points "naturally".


[edit] And the chocolate bars, too...

[edit] Set chocolate bars


[edit] Shop Stuff

[edit] Show any product

No problem, just not on tab "candy box"!

Just type shop.showProduct("product_name");

Product names:

  • Lollipop
  • Swords : xxx_sword
    • wooden
    • copper
    • iron
    • silver
    • diamond
  • eat
  • throw_10
  • encrust
  • polish
  • coat
  • shop (candy merchant)

[edit] Lollipops restockage !

Tired of "stock shortage"? Then

lollipops.nbrInStock = 1000;

But, the stock will also be (maybe?) shorted  ; then replace 1000 by Number.POSITIVE_INFINITY

[edit] Swap Proposed Sword

This affects the price of the sword, but can be restored (see under)

Just type shop.showProduct("sword_name") (as "wooden_sword"), quotes needed!

Example : shop.showProduct("wooden_sword")

Or,without changing the price, shop.currentSwordButtonId = "buy_§type§_sword"

Replace §type§ by the type of the sword, as wooden.

Example : shop.currentSwordButtonId = "buy_wooden_sword"

[edit] Set Prices

The choice of the price... is yours! But quite cheated...

Available at any time

[edit] Lollipops

shop.oneLollipopPrice = price;

shop.tenLollipopsPrice = priceFor10;

[edit] Current Sword

shop.currentSwordPrice = price;

[edit] Change Sword

Can be entered: While not in a quest (will not take effect until after)

Just type this code : sword.setName("sword name"), replacing sword name by the name of the sword you want to switch with

  • Wooden Sword
  • Copper Sword
  • Silver Sword
  • Diamond Sword
  • Candy Diamond Sword
  • Polished Candy Diamond Sword
  • Chocolate Sword
  • Sharp Chocolate Sword
  • Sword of Flames
  • Sword of Life
  • Sword of Summoning
  • Sword of Liflamesummoning
  • Sword of Randomness

[edit] Add Any Item

Can be entered: While in a quest

List of available objects:

  • key
  • boots
  • swamp Map
  • hut Map
  • well Map
  • magician Hat
  • pink Ring
  • forge Map
  • candies Converter
  • plate Armour
  • cauldron
  • magical Horn
  • horn Of Plenty
  • old Amulet


[edit] Get Extra Potions/Scrolls

Can be entered: At any time during the game.

X : Name of the potion/scroll you want. It can be :

  • health
  • escape
  • berserk
  • fireScroll
  • acidRainScroll
  • teleportScroll
  • earthquakeScroll
  • impInvocationScroll
  • majorHealth
  • invulnerability
  • turtle
  • jelly
  • seed
  • cloning
  • superman
  • gmooh

N : How many potions/scrolls you desire.

potions.setPotionNbrOwned(potions.list.X, N);


[edit] Special Places Cheating

[edit] Set Sword To Higher Level (Only Special Swords)

Can be entered: While not in a quest (will not take effect until after)

Note: You can increase the level as high as desired. There is no maximum level.

sword.specialPower = 7

[edit] Reset Status of Wishing Well


[edit] Quest

Remember: any modification will apply to Yourself, so do NOT try to apply "Infinite Invincibility" when in this quest!
If you did, or you want to quit a level, just use a GMOOH potion / cheat!

[edit] Peaceful Forest

[edit] More Chests

So, this makes more chests spawn in the Forest

peacefulForest.basicChestProbability = 1;

[edit] No Ponies

This code is hackish, and has to be entered 'before' the quest, and at each reload!

peacefulForest.makeWoodPoney = function() {};

[edit] Mount Goblin

Sorry, the map config doesn't allow to disable enemies generation.

[edit] More Chests

Just, more probability so chests spawn, but not sure...

mountGoblin.basicChestProbability = 1;

[edit] Underwater Cave

As Mount Goblin, special mob generation doesn't allow to affect mob spawning probability, except changing the generation code.

Because no chests spawn naturally in the Cave, this cheat isn't possible.

[edit] Castle's Entrance

Okay, from this point no chests are available, so there's no way to affect it.
Please don't throw me any tomatoes at me, I can give you the following cheats :

[edit] Remove guards

castleEntrance.makeGuard = function() {};

[edit] Remove knights

Doing this will deprive you of the Plate Armor, but... castleEntrance.makeKnight = function() {};
Uh, found that it also deletes the knights in the Castle's Keep!

[edit] Freeze magic ball

This is quite complicated, as it sets the magic ball's position to its original one each time it moves. It has to be re-entered at each reload.
castleEntrance.originalMove = castleEntrance.move; castleEntrance.move = function() {castleEntrance.originalMove(); if(castleEntrance.thereIsAMagicBall){ castleEntrance.magicBallX = 72; castleEntrance.magicBallY = 5; }};
Unfortunately, I tried and it didn't work... please help me by working on it ! ;)

[edit] Developer's Computer

[edit] Figure out the DEV killing letter

Can be entered: While in the developer's computer quest

This will display the key you need to press, but the game will pause until you close the window.


If you use a javascript console, you can use this, it will display it in the console, without pausing the game :


[edit] All Quests

[edit] Enable pony time! (or disable it if you find it annoying)

land.ponyTime = true;

[edit] Create you own ally (SWORD summon only)

You must create two functions :
The first one is to let your personal ally to be summoned : sword.summonList.push({name:"XXX(1)", summonFunction:quest.makeXXX(2).bind(quest), powerNeeded:X(3)});
Help to create :

  1. The name of the ally
  2. A random name, doesn't matter
  3. The level required to summon (at least 8, else get ready to bug)

The second one is to create your ally : quest.makeXXX(1) = function(){return land.createAlly("ALL(2)", XXX(3), XXX(3), "XXX(4)", "XXX(5)", []);};
Help to create :

  1. Put the same name as above
  2. The THREE letters that will be displayed on the quest screen
  3. Total HP (put the same numbers, else there may be some bugs, didn't test
  4. Name of the weapon
  5. The description

[edit] Potions Never Stop

This code is very hackish, and requires to be re-used at each reload ; it removes the "potion ending" function

[edit] Infinite Invincible

quest.stopInvulnerability = function() {}

[edit] Infinite Berserk

quest.stopBerserk = function() {} or quest.beginBerserk();

[edit] Infinite Turtle

quest.stopTurtle = function() {} whyyyyyy

[edit] Set Potion Countdown To Zero

Can be entered: While in a quest, and the potion countdown is running

quest.potionUseCountdown = 0

[edit] Invincible

[edit] For 1000 Steps

Can be entered: While in a quest

quest.beginInvulnerability(); quest.invulnerabilityCountdown = 1000;

[edit] Infinite

quest.beginInvulnerability(); quest.invulnerabilityCountdown = -1;

Or, look the next tip.

[edit] True Invincibility

Can be entered: While not in a quest (does not work in Hard mode)



by negative HP (showed 'NaN/NaN')

candies.setNbrEaten(-1); but this can bug when :

  • You fight against Yourself
  • You summon an ally against the developer ; it can be very long...

Another way to do is to set your health to 100 at any time :

setInterval(function(){quest.things[quest.getCharacterIndex()].hp = 100}, 200)

Each fifth of second, it sets your health to 100

But, this makes you lag, and does NOT protect you from enemies that deal more than 100 damage. Sorry.

[edit] Berserk

Can be entered: While in a quest

[edit] For 1000 Steps

quest.beginBerserk(); quest.berserkCountDown = 1000;

[edit] Infinite

quest.beginBerserk(); quest.berserkCountDown = -1;

[edit] Turtle

Can be entered: While in a quest

[edit] For 1000 steps

quest.beginTurtle(); quest.turtleCountdown = 1000;

[edit] Infinite

quest.beginTurtle(); quest.turtleCountDown = -1;

[edit] Activate GMOOH

Can be entered: While in a quest

quest.gmooh = true

[edit] Remove Tired Time

Can be entered: While not in a quest

quest.tiredTime = 0

[edit] Auto Finish Quest

Can be entered: When in a quest

quest.speed = 0

Note: This will just finish the quest, not actualy beat it. Thats still on you.

[edit] Drops

Use it in Quest

[edit] Set candies dropped

Replace §candies_number§ by the number of candies found : quest.setCandiesFound(§candies_number§);

[edit] Create a chest

A chest will appear, with the following loots :

  • 300 - 800 candies
  • Lollipop farm key
  • Boots (1/3)
  • Map to the swampy swamp (1/3)
  • Map to the sorceress' hut (1/3)

things[getCharacterId()] = quest.makeBasicChest();
Sorry, I didn't test it and think it doesn't work...

[edit] Create an open chest

6000 to 8000 candies! quest.makeOpenChest();
Sorry, I don't think it works...

[edit] Beat Quest

Can be entered: When in a quest

yourself.end = true;



[edit] Special skin for the Cow King

Can be used at any time, but at each reload ; creates a new skin to the COW KING, that can be found in the cow level
cowLevel.makeCowKing = function(){ return land.createMob("KIN", 180, 180, "horns", "The cow king ! It looks like a normal cow, but it isn't...", [drops.createDrop("candies", 1000), drops.createDrop("object", "hornOfPlenty", true)]); }
Hum, I noticed that the cow king WON'T move in that case ; use carefully...

[edit] Set damage you can do

When in a quest, quest.things[quest.getCharacterIndex()].weapon = "powerful explosion";
This will make you do 100 damage at once
If your sword level is over 17, then this will be better : quest.things[quest.getCharacterIndex()].weapon = "Sword of Liflamesummoning";
If you feel quite crazy, try the quest.things[quest.getCharacterIndex()].weapon = "Sword of Randomness";
For insane power, you could change the damage.getWeaponDamage by finding your sword name (e.g. iron sword, silver sword, etc.) and changing the number after return which will be your power/damage value. (e.g. case "wooden sword": return 99999999999999999999999999999999999999999999999; break;

[edit] AutoSave

Can be entered: At any time during the game. Has to be re-entered once you reload the page or load a saved game.

N: Interval to save at in milliseconds (ie 5000 saves the game every 5 seconds).

window.alert = function alert (message) {return true;}; setInterval(save,N);

[edit] Trivia

When looking at the source code, a line says: <!-- You're looking at the source code, hm, cheater ! :-) -->

[edit] Set the letter on top of the magician hat

Not really useful, but as you want inventory.setMagicianHatLetter("SSSSSletter") There must be five space ("S" in the example) before the letter.

At all time, type updateOnPage()

[edit] Code Comprehension Helper

In this section we're going to help people understand the source code.

[edit] HTML structure

Sorry, I didn't work on this. Please help me by looking at the source code !

[edit] JS files

We'll explain all the js files here.

[edit] jquery.js, jquery-ui.js

These are jQuery files ; see, jQuery official website for the first one and, jQuery UI official website for the second if you want to learn more about them.

[edit] tabs.js, base_js_additions.js, htmlInteraction.js

I don't know how these work, but anyway, they are't interesting since they don't affect the game itself ; (I mean, they don't provide any cheat).

[edit] random.js

This is the random object ; it provides a few methods :

Returns true / false, with 1 chance out of 2 to return true
Returns true / false, with 1 chance out of n to return true
Returns Math.floor. For code clarity, maybe ?

[edit] code 2.3.515

[edit] code cheats

like:bool candyBoxBoxOpened=false turned to bool candyBoxBoxOpened=true noob:number gameCandiesCurrent=46907 turned to number gameCandiesCurrent=0 or number gameCandiesCurrent=AFK

[edit] code Q&A

1Q:If you enter a wrong code(like candy Box Box Opened=true), what will happen?????
1A:Reset game and start over.
2Q:If I play the hard mode, what will happen?
2A:made the game harder(if you cheat a big number, just has a little effect)
3Q:if you enter a cheat code(number gameCandiesCurrent=999999999999999999999999999999999999999999999999999999999999999999999999999999999999999, number gameCandiesMax=999999999999999999999999999999999999999999999999999999999999999999999999999999999999999), what will happen??
3A:like this will work and you will get 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 candies!!!

[edit] make a new thing in candy box 2

If you make a new thing in candy box 2,like pig sword,if will appear (like pig land or someing like pig!):) but sorry, I don't know how to made,but anyway, they are not easy to made.