Clickclang

clicklang, is an esoteric programming language created by User:SpaceByte for their project, Click To Ten Mod Manager. It is a simple esolang with commands of a command, and it's arguments, however, data storage is unusual, only allowing for one string, and has an unusual system of doing so.
==Mechanics==
clicklang does not have proper events or functions, so in order to execute code per frame, you must somewhere in your code type [Update]. Any code after an Update line, is executed each frame.
==Valid Conditions==
[val]=[val2] Equality, represents if values are the same.
[val]>[val2] Represents if one value is bigger than another.
[val]<[val2] Represents if one value is smaller than another.
leftclicked Returns true if left mouse button went down.
rightclicked Returns true if right mouse button went down.
arrowkey.[up/down/left/right] Returns if an arrow key is currently down.
spacekey Return true when the space bar first goes down.
==Reference Variables==
Reference variables are ones that are not made in a cttmm mod, or by any mod developer, but is referenced from click to ten, or the unity engine,
clicks | The amount of clicks displayed in game.
interval | The click interval.
goal | The goal amount to win.
deltatime | The amount of milliseconds since the last frame.
intlimit | Integer limit.
string.length | Length in characters of the stored string.
===Strings===
clicklang does not have string variables. Each mod gets one string for storage. You can not set this with one command, however you can type append commands, and clear commands. A clear command sets it to a blank string, and you can use the append command to add text to the end of the string. Thus, a clear command and then an append command, is equivalent to setting the string.
==Commands==
Command 	Description 	
setinterval [interval] 	Sets the interval (amount) per click. 	
setgoal [goal] 	Sets the goal of the game (amount of clicks to close the game). 	
win 	Close the game. At the moment, executes the same as the quit command, but is its own in case of future changes to winning, such as achievements. 	
quit 	Closes the game. 	
set [variable] [value/other variable] 	Set the value of a variable to a value, or the value of another variable. 	
setclicks [value/other variable] 	Sets the click counter to a specific value or variable. 	
goto [line] 	Skip backwards or forward to a line. 	
setadd [variable] [value1] [value2] 	Set the value of a variable to the sum of two values, which may also be variables. 	
setsub [variable] [value1] [value2] 	Set the value of a variable to the difference of two values, which may also be variables. 	
setmulti [variable] [value1] [value2] 	Set the value of a variable to the product of two values, which may also be variables. 	
setdiv [variable] [value1] [value2] 	Set the value of a variable to the quotient of two values, which may also be variables. 	
setran [variable] [min] [max] 	Set the value of a variable to a random number in a range. Max inclusive. 	
setsin [variable] [value] 	Set the value of a variable to the sine of a value. 	
setcos [variable] [value] 	Set the value of a variable to the cosine of a value. 	
setabs [variable] [value] 	Set the value of a variable to the absolute value of another value. 	
if [condition] [lines] 	If a condition is true, run the next [lines] amount of lines. 	
ifnot [condition] [lines] 	If a condition is false, run the next [lines] amount of lines. 	
while [condition] [lines] 	Run the next [lines] lines until the condition is false. 	
setred [color] 	Set the red value of the background color. 	
setgreen [color] 	Set the green value of the background color. 	
setblue [color] 	Set the blue value of the background color. 	
string.clear 	Clear the stored string (set to "") 	
string.append [text] 	Append text to the current string. 	
string.appendnumber [value/variable] 	Append a number converted to a string, to the stored string. 	
string.appendversion 	Append the version of cttmm to the stored string. 	
string.appendspace 	Append a space character to the stored string. 	
string.appendlinebreak 	Append a linebreak character to the stored string. 	
settext 	Set the text on screen to the stored string. 	
settext [variable/value] 	Set the text on screen to a variables value, or a number. 	
settext [text] 	Set the text on screen to specific text. (MUST BE CALLED ON UPDATE TO DO ANYTHING) 	
switchperspective 	Switch between a 2d and 3d camera. 	
movecamera [x] [y] [z] [rotation y] [rotation z] 	Move the camera in world space position. 	
addobject [x] [y] [z] [width] [height] [length] [red] [green] [blue] [alpha] 	Add a 3d (also shown as a square in 2d), object to the scene, given the parameters. 	
addimage [x] [y] [z] [width] [height] [rotation] [file] 	Add a 3d, or 2d image into the scene, of the chosen file. 	
addmodel [x] [y] [z] [width] [height] [length] [red] [green] [blue] [alpha] [file]	Do the same thing as addobject, but with a specified model, one argument for the file name & type of the wavefront obj file. 	
clearobjects 	Remove all CTTMM objects from the scene. 	
playsound [file with extension] 	Play a sound from the audio file in the mods folder. 	
showmenu 	Show the mods loaded / version menu at any point in the game, including showing accurate clicks while displaying it. Must be run every frame that it should be visible on. 	
func [cttf file name, or cttf file with the extension] 	Runs code in a file, without it being its own mod, good for repetitive code. 	
log 	Log the stored string to the console. 	
settext [variable/value] 	Log a variables value, or a number. 	
settext [text] 	Log specific, pre-loaded text. 	
savevar [value/variable] [save name] 	Save a value to a location, which can be loaded on another game session. 	
loadvar [variable] [save name] 	Set a variable to the variable saved at location. Defaults to 0. 	
loadvar [variable] [save name] [default] 	Set a variable to the variable saved at location, defaulting to a specified value, if not found. 	
http.setbaseaddress [url] 	This is the base address for your http requests. For example, "localhost:8080", this way, when I call a url, all I have to enter is "api/endpoint". 	
http.setresponsefunction [api call] [function] 	Sets the function that will be called on response to an API call. For example, if my base address is "localhost:8080" and I call "api/endpoint" I would set that as my api call, and "EndPointResponse" as my function.	
http.setstatusfunction [Status Code] [function] 	Sets the function that will be called on any response of this status code. 	
http.addfield [Field Name] [Value] 	Add a field to your HTTP call. Mainly used for POST requests. 	
http.setrequesttype [Request Type] 	Set the type of HTTP call will be sent. Eg, "POST", "GET". 	
http.call [api call] 	Finally call the endpoint. After the request is sent, the Fields list will be reset. 	
All commands which first arguments are not any that a command holds, aren't checked or executed at all, and are fully comments.
== HTTP ==
Apart from the commands involved, the use of HTTP in CTTMM is somewhat complex. CTTMM is not object-oriented, and doesn't contain complex types like lists, or dictionaries. To get around this, when you call an HTTP request, there are some unique functionalities. To get a function called on response, you must use http.setresponsefunction request function. Upon this call, it sets a variable titled "responsebasic", to the text download content. This "responsebasic" variable is equivalent to UnityWebRequest.downloadHandler.text, if a value is a boolean it is either 0, or 1, for false or true respectively. If the value is a string, it is set to -404. It also sets a variable for each headers key, and its value as the variable value. You can also detect any unsuccessful http request with http.setstatusfunction [code] [function], which will call that function on ANY of that status code type. These limitations make it somewhat necessary to make a custom REST or HTTP API, for use in CTTMM.
==Example==
===Click To 69===
Simple test mod. Sets the goal to 69, and makes clicking increment by 3, not one.
setinterval 3
setgoal 69
Category:Languages
Category:2022
Category:Implemented
Category:Turing complete
Category:Imperative_paradigm
Category:Nondeterministic
Category:Graphical_Output
Category:High-level
Category:Audio_Output