this page is really basic and unfinished like the library itself
but you can still read about functions and stuff here
also, this page has codely.js linked! so you can test a few functions in the console right here by using the shortcut and then clicking "console"
the library is only in web form right now but MIGHTTT be released as a downloadable... its still best to use the web form for the latest changes and stuff without having to download and download and download
in this part, youll learn a few simple things like settings and memory
this took a while
you can check the actual library code for a more up-to-date list
path | function | what for |
---|---|---|
cly.test | checkFunction(path) | checking if a function exists before using it |
cly.test | confirm(condition, value, strict = false) | confirming something, optionally with a strict () mode not to be confused with the browser's confirmation dialog |
cly.math | add(a, b) | addition with a and b |
cly.math | subtract(a, b) | subtraction with a and b |
cly.math | multiply(a, b) | multiplication with a and b |
cly.math | divide(a, b, fixed) | division with a and b, optionally with a fixed mode to return a instead of a warning when dividing by zero |
cly.math | random(min, max) | getting a random decimal between min and max |
cly.math | round(number) | rounding a decimal, good for cly.math.random(min, max) |
cly.math | pi(digits) | getting 2-15 digits of pi 15 because thats the limit for javascript and 2 because 3.1 or just 3 isnt cool for pi |
cly.string | capitalize(str) | capitalizing strings |
cly.string | reverse(str) | reversing strings |
cly.string | count(str, char) | counting how many times a character shows in a string |
cly.string | recase(str, type) | changing the casing of a string supports Capital case, camelCase, PascalCase, snake_case, kebab-case, Title Case, UPPER CASE, lower case, flatcase, dot.case, Arrow > Case, path/case/, Keyboard+Case and codely[case], use the first word of one as the type argument |
cly.event.broadcast | transmit(id, value, key) | transmitting a broadcast with id, value and key |
cly.event.broadcast | update(id, newValue, key, newKey) | updating a broadcast with a new value and optionally a new key |
cly.event.broadcast | receive(id, key, expected, whenYes, whenNot) | receiving a broadcast, doing something when the value is expected and something else when not |
cly.event.broadcast | offAir(id, key) | taking a broadcast off-air |
cly.event.broadcast | list() | listing all the broadcasts on-air with a nice structure |
cly.event.broadcast | ping(id) | pinging a broadcast to make sure its on-air |
cly.logic | pauseFor(ms) | pausing the script for milliseconds requires |
cly.logic | repeat(times, orUntil, action) | repeating an action for times or until orUntil is true |
cly.logic | forEachIn(collection, action) | repeating an action for each item in a collection |
cly.logic | run(func) | running a function |
cly.logic.gate | not(a) | returning the opposite of a |
cly.logic.gate | and(a, b) | returning true when both a and b is true |
cly.logic.gate | or(a, b) | returning true when a or b is true |
cly.logic.gate | most(a, b, c, d, e) | returning true when 3/5 inputs are true |
cly.console | title(text) | ==== [ writing a nicely formatted title to console ] ==== |
cly.console | list(root, ...branches) | writing a nicely formatted list to the console |
cly.console | write(text, style) | simply writing text to console, optionally with styling |
cly.console | clear() | clearing the console |
cly.tick | run(speed) | starting the ticking with speed (as ticks per second) |
cly.tick | pause() | pausing the ticking |
cly.tick | get() | getting the current tick the moment the function was called |
cly.tick | every(ticks, action) | scheduling an action every amount of ticks |
cly.tick | after(ticks, action) | doing something after amount of ticks since the function was called |
cly.tick | skip(ticks) | skipping amount of ticks |
cly.tick | convert(tick) | converting the given tick into seconds |
cly.tick | reset() | resetting the ticking and clearing all scheduled actions |