[Mod] Quick Refresh w/o Saving (w/ Instructions)

Intro And Explanation

In the original browser version of Cookie Clicker, you can quickly refresh the page using F5 or Ctrl+R to reload the page without saving. There are many reasons that refreshing/reloading can be useful in Cookie Clicker, including, but not limited to:

Restoring cookies spent on upgrades/buildings, or restoring buildings if sold accidentally

Avoiding the negative outcomes of Wrath Cookies or Backfired Grimoire Spells

Rerolling random drops when popping Wrinklers or harvesting crops

Allows you to pick a mature (but not ripe) sugar lump and refresh if you botch the harvest

Allows you to maximize sugar lump gains from unusual sugar lumpsHowever, in the current Steam version of Cookie Clicker, there is no way to refresh the game without exiting. The only built-in ways of reloading (Changing languages and enabling/disabling mods) save before doing so. As such, I created a mod that will restore a method to refresh anytime using the keybind Ctrl+R. I believe this should be a built-in feature of the game, but until then, this mod will have to do.

This guide will quickly explain how to install the mod for yourself and activate it, install the mod from a premade ZIP folder, or (easiest) subscribe to the Steam Workshop mod.

Method 1: Manual Installation

Below is a step-by-step guide to install the mod manually. If you are at least a little computer savvy, this should be simple. You get the added benefit of getting some understanding how mods work in Cookie Clicker. However, if you get stuck at a step (or would like to quickly install it), Method 2 can be used instead.

Open your Cookie Clicker Mod Folder. This can be done 2 ways:

Opening via the in-game Mod Menu at the bottom of the Options Menu, then navigating to "Open /mods folder" and into the "workshop" folder.

In Windows, the default location for the "workshop" folder can be found below.

C:\Program Files (x86)\Steam\steamapps\common\Cookie Clicker\resources\app\mods\workshop In the "workshop" folder, create a new folder by right clicking--->New--->Folder and name it "QuickRefresh" (without the quotation marks).

Navigate into that folder and create two files by right clicking--->New--->Text Document and name them exactly "info.txt" and "main.js" (without the quotations marks).

It should look like this when you are done:

NOTE: File extensions need to be enabled to properly complete the above step. If you have already completed the above step, you can skip to the next sections.

File extensions are the tags you see at the end of files such as .txt, .docx, or .exe. Naming the files above with the proper extensions is important, namely the main.js as .js represents a JavaScript file.

If we name the files above without extensions enabled, the files will internally be "info.txt.txt" and "main.js.txt", which is no good.

To enable file extensions:

Open your search bar on your taskbar and type "File Explorer Options" (Windows 10). Alternatively, navigate to Control Panel--->Appearance and Personalization--->File Explorer Options.

Click "View" and uncheck "Hide extensions for known file types."

Click Apply and OK.

Open info.txt and paste the following info:

{ "Name": "Quick Refresh", "ID": "refresh", "Author": "LupinSamurai", "Description": "Mod which refreshes the page when Ctrl+R is pressed without saving.", "ModVersion": 2.042, "GameVersion": 2.042, "Date": "09/09/2021", "Dependencies": [], "Disabled": 1, "AllowSteamAchievs": 1 } "Disabled": 1 means that the mod will be disabled until enabled in the mod menu; you can change 1 to 0, but it is unnecessary as once it is enabled, it will remain enabled until disabled from the mod menu.

"AllowSteamAchievs": 1 means that Steam Achievements are Enabled. Mods that give the player an unfair advantage or otherwise break the game can set this to 0, which disables achievements, but as this doesn't give an unbalanced advantage, this can (and should) remain 1.

Right click "main.js" and select Edit. If prompted, select Notepad (or a preferred code editor) to open .js files. In "main.js", paste the following code:

Game.registerMod("refresh",{ init:function(){ Game.Notify(`Quick Refresh loaded!`,'',[16,5]); addEventListener("keydown", function(event) { if (event.keyCode == 82 && event.ctrlKey) location.reload(); }); }, save:function(){ }, load:function(str){ }, }); The code works by adding an Event Listener that looks for the combination of the control key pressed (event.ctrlKey) and R pressed (event.keyCode = 82) (82 is the ASCII value for 'R'). If both are true i.e. both are pressed, location.reload() is executed which in JavaScript refreshes the page, or in this case, reloads the game to the last save.

If Cookie Clicker is running, restart the game or refresh it by using the built-in methods discussed above (changing languages or enabling/disabling other mods). Otherwise, run Cookie Clicker.

You should now see "Quick Refresh" in the mod menu. Select it and choose enable. Then, press "Restart with new changes" You don't need to change the priority.

After the game reloads, you should see this in-game popup appear.

If you see that, try using Ctrl+R to reload. From here on out, as long as the mod remains enabled, you can use Ctrl+R to reload to your heart's content! The mod will remain enabled until you choose to disable it or it is deleted.

Method 2: Automatic Installation & Steam Workshop

Below is a quick and easy way to activate the Quick Refresh mod.

First, download the .zip file from Google Drive here. Quick Refresh[drive.google.com]

Unzip the file by right clicking--->Extract All, and confirm by selecting "Extract".

Navigate into the unzipped folder. Copy the folder named "Quick Refresh". You need to make sure that the folder selected is the one in the unzipped folder i.e. the folder you are copying contains exactly info.txt and main.js, not another folder named "Quick Refresh".

Next, navigate to the "workshop" folder as seen in Step 1 of the Manual Installation method. Paste the copied folder in "workshop".

Then, follow Steps 5-7 of the Manual Installation method to enable the mod and test it out!

NEW! Quick Refresh is now on the Steam Workshop! You can subscribe there and it will be available in the modding menu after subscribing! Here is the link: https://steamcommunity.com/sharedfiles/filedetails/?id=2686648239


If everything went well, the mod should have been successfully installed (and maybe you did it yourself too!). I hope Orteil choose to officially add a quick refresh/reload back into the game, but until then, I hope you get a lot out of this mod!

If you have any questions, please feel free to post them in the comments below. The instructions focused on Windows OS, but the method should be similar I think for other OS's.

Thank you for checking out this guide, and if it helped you out, feel free to give it a thumbs-up!

Source: https://steamcommunity.com/sharedfiles/filedetails/?id=2597870543					

More Cookie Clicker guilds