click to ten

click to ten

Not enough ratings
How to setup, use, and create mods for Click To Ten!
By space
Modding your game in Click To Ten, was made possible by CTTMM (click to ten mod manager). It is a useful tool that allows ease for players and modders.
   
Award
Favorite
Favorited
Unfavorite
How do I get a modded game?
At the moment, modding your game is fairly simple, but it is planned to make it simpler. If you would be interested in modding your game you would first need to navigate to this website[bytespacegames.com] in your browser. From there, click downloads. You should see "cttmm", or "click to ten mod manager", download the latest version. You should now have a zip file, what you need to do, is open the file, and find the folder titled "click to ten_Data", copy this, and then paste it into your click to ten directory. The directory for click to ten can be found by right clicking click to ten in steam, hovering over manage, and clicking "Browse local files", which will open the directory in your file manager, in windows, your directory is likely C:\Program Files (x86)\Steam\steamapps\common\click to ten. Once the folder is pasted there, on your next launch you should see "0 mod(s) loaded" along with ctttmm version, and a mods folder will have been automatically generated inside of the data folder, this means it worked. Horaay.
Finding Mods to Play.
With your newly found powers of modding your game, you might still not have the commitment to make your own mods, or maybe you just want to see what others have come up with. At the moment, the only official and reputable location of obtaining mods is in the click to ten discord[discord.gg]. The click to ten discord has an official #mods channel, dedicated to posting just mods. Maintained by me, this makes it a very good source for easy downloadable mods. These mods can be installed simply by dragging them into your mods folder, located in your click to ten_Data folder.
How do I make mods?
You may want to get creative, and create your own mods, but don't know where to begin. At the moment, the recommended way to make mods is simply using text files, but with the .cttm extension. This allows ease for modders. In the future, the way mods are created will remain the same, and nearly all mods will remain backwards compatible, but a better recommended format may be introduced.

How do I setup a mod?
Now that you get the general idea, you would like to actually make your first mod, so lets do it! Create a new text file, on windows this can be done by right clicking on a folder, hovering new, and clicking text file, rename the file's extension to .cttmm, instead of .txt. You might want to do this inside of the mods folder, but it can be moved at a later time. Drag this mod into your mods folder if it isn't already, and launch your game, you should notice the mods loaded has increased by one, good job! You have made your first mod.
Documentation of every single command and functionality in cttmm, is avaliable here: Documentation[esolangs.org]

Custom Goal
Now you have loaded a mod, you would like to make some new innovations, add some new, uh, "bosses" to the game, well, it's easy! In your cttm file, simply add the like
setgoal #
, and replace the # with your desired goal, of course. When you launch the game, you'll notice you now only need to click to that number!

Basic AutoClicker
What we have just done, is put code in our start section, with an autoclicker, you would like it constantly running. To do this, you must seperate your start section, by putting an update line, which will make all code after it, run each frame.
[Update]
Now we have an update line, we must actually do something. Adding one to the click count, is a little tricky, you can not directly add with one command to clicks, but you can read the click count to a variable, add to a variable, and set clicks to a variable. First, we must copy the click count.

set clickinc clicks
This code, will set a brand new variable named "clickinc" to clicks. Now, we need to add one to that variable. Also, to avoid future errors, also put this line in the start section.
setadd clickinc clickinc 1
This sets a variable to the sum of a variable, plus itself, clickinc now equals one higher than clicks.
setclicks clickinc
This now sets the clicks, to clickinc, increasing clicks by one.

Safeguard
Once you've put this mod in your game, you'll notice that it doesn't actually close the game once it reaches 10, this is because it only checks to close the game every time the player actually clicks, we can add a safeguard to prevent this.
After your setclicks line, input an if statement, which will check if the game should quit:

if clicks>goal 1

this will do, is check if the clicks has reached higher than the goal. We now need to put one more line below it, to close the game. In this case, win or quit both work the same, but win is preferred in terms of actually beating the game.
win

But once you open the game, you'll notice that it closes at 11, not ten, this is because it is checking if the clicks are HIGHER than the goal, in order to the opposite, replace clicks with clickinc in this scenario, and before the if statement, increment one to it,
You should now have this:
setadd clickinc clickinc 1 if clicks>goal 1 win

Your safeguard is complete!

Speed
Another noticable issue with our autoclicker is the speed, this is ran every frame, meaning it clicks at max, 60 cps, we need something more reasonable, to do that, we'll start by creating a cps variable.

Before the update line, set a new variable titled "cps" to your desired clicks per second,
set cps 6

You will also need to add another variable, called elapsed, which will be used for determining when the delay has passed.
set cps 6 set elapsed 0

Inside of the update section, you should now increment elapsed by deltatime, which is the amount of milliseconds since the last frame, this means, whenever this is used, it will return the amount of time in milliseconds since it was last reset.
setadd elapsed elapsed deltatime

Now, before your 3 lines add two lines, the first will get the millisecond delay inbetween clicks.
setdiv delay 1000 cps

Then, a line to check if that delay has passed. With the line count of 4, since 3 lines are used for clicking, 1 will be added for resetting.
if elapsed>delay 4

Then, before your click code, reset elapsed.
set elapsed 0

Now, all clicks will be limited to your specified cps!

Trigger

There's still an issue with our autoclicker though, it's unrealistic for it to be clicking as soon as the game begins, so we should delay it to when the player actually starts playing.

Inside the start section, set a new variable called triggered, to 0, this will act as a boolean for if the player has actually started playing yet.
set triggered 0

Now, you need to check if triggered is true before clicking. Before your 5 lines for the delay check and clicking, add an if statement, for 5 lines.
if triggered=1 5
This will only click, if triggered is 1, otherwise, ignoring the next 5 lines.

To set the trigger, you will need to check if the left mouse button is down, you can do this with the leftclicked condition. Do this in your update section.
if leftclicked 1
Below it, set triggered to 1.
set triggered 1

Congratulations, you now have an advanced auto clicker! Adjust the values and functionality of the auto clicker to your liking, and maybe try to expand the code to make something new!