docu_core.php 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812
  1. <section id="General">
  2. <table>
  3. <tr>
  4. <th class="command">
  5. + - * / % &amp; | ^ ~ = += -= *= /= %= ++ -- &lt;&lt; &lt;&lt;= &gt;&gt;
  6. &gt;&gt;= &amp;= ^= |= || &amp;&amp; () &lt; &gt; &lt;= &gt;= == ! !=
  7. if while break continue elseif else
  8. </th>
  9. <th class="desc">work as in any general purpose programming language</th>
  10. </tr>
  11. <tr>
  12. <td class="bold">Examples</td>
  13. <td>a = 3 * (5 - 1);<br>a++;<br>a <<= 3;</td>
  14. </tr>
  15. </table>
  16. <table>
  17. <tr>
  18. <th class="command">for</th>
  19. <th class="desc">executes the start instruction once, and repeats the block and the per loop function until the loop check is false</th>
  20. </tr>
  21. <tr>
  22. <td class="bold">Format</td>
  23. <td>for(start_instruction; loop_check; per_loop) { } </td>
  24. </tr>
  25. <tr>
  26. <td class="bold">Examples</td>
  27. <td>for(i = 0; i < 5; i++) { print("hi"); }</td>
  28. </tr>
  29. </table>
  30. <table>
  31. <tr>
  32. <th class="command">functions</th>
  33. <th class="desc">functions can be written and have their own scope, global variables can be accessed by using a $</th>
  34. </tr>
  35. <tr>
  36. <td class="bold">Format</td>
  37. <td>function function_name(vars, ...) { } </td>
  38. </tr>
  39. <tr>
  40. <td class="bold">Examples</td>
  41. <td>c = 6;<br>function printStuff(a, b)<br>{<br>print(a, b, $c);<br>}<br>printStuff(4, "Hallo");</td>
  42. </tr>
  43. </table>
  44. <table>
  45. <tr>
  46. <th class="command">print</th>
  47. <th class="desc">prints all arguments connected to the default console</th>
  48. </tr>
  49. <tr>
  50. <td class="bold">Format</td>
  51. <td>print(arg, ...)</td>
  52. </tr>
  53. </table>
  54. <table>
  55. <tr>
  56. <th class="command">getVar</th>
  57. <th class="desc">returns the value of a variable</th>
  58. </tr>
  59. <tr>
  60. <td class="bold">Format</td>
  61. <td>getVar(variable_name_string)</td>
  62. </tr>
  63. </table>
  64. <table>
  65. <tr>
  66. <th class="command">setVar</th>
  67. <th class="desc">sets the value of a variable</th>
  68. </tr>
  69. <tr>
  70. <td class="bold">Format</td>
  71. <td>setVar(variable_name_string, value)</td>
  72. </tr>
  73. </table>
  74. <table>
  75. <tr>
  76. <th class="command">swap</th>
  77. <th class="desc">swaps the values of two variables</th>
  78. </tr>
  79. <tr>
  80. <td class="bold">Format</td>
  81. <td>swap(var1, var2)</td>
  82. </tr>
  83. </table>
  84. <table>
  85. <tr>
  86. <th class="command">nothing</th>
  87. <th class="desc">does nothing</th>
  88. </tr>
  89. <tr>
  90. <td class="bold">Format</td>
  91. <td>nothing()</td>
  92. </tr>
  93. </table>
  94. <table>
  95. <tr>
  96. <th class="command">error</th>
  97. <th class="desc">sets if full stack exceptions are printed to the logger</th>
  98. </tr>
  99. <tr>
  100. <td class="bold">Format</td>
  101. <td>error(boolean)</td>
  102. </tr>
  103. </table>
  104. <table>
  105. <tr>
  106. <th class="command">array.new</th>
  107. <th class="desc">initializes an array with the given size</th>
  108. </tr>
  109. <tr>
  110. <td class="bold">Format</td>
  111. <td>array.new(var[size, ...])</td>
  112. </tr>
  113. <tr>
  114. <td class="bold">Examples</td>
  115. <td>array.new(a[3]);<br>a[0] = 3;<br>array.new(b[3, 2])<br>b[0, 0] = 3;</td>
  116. </tr>
  117. </table>
  118. <table>
  119. <tr>
  120. <th class="command">array.getSize</th>
  121. <th class="desc">returns the size of an array</th>
  122. </tr>
  123. <tr>
  124. <td class="bold">Format</td>
  125. <td>array.getSize(array)</td>
  126. </tr>
  127. <tr>
  128. <td class="bold">Examples</td>
  129. <td>array.new(a[3, 2])<br>array.getSize(a)<br>array.getSize(a[0])</td>
  130. </tr>
  131. </table>
  132. <table>
  133. <tr>
  134. <th class="command">read.number</th>
  135. <th class="desc">returns a double parsed from a string</th>
  136. </tr>
  137. <tr>
  138. <td class="bold">Format</td>
  139. <td>read.number(double_string)</td>
  140. </tr>
  141. </table>
  142. <table>
  143. <tr>
  144. <th class="command">wait</th>
  145. <th class="desc">stops a script until an event is received</th>
  146. </tr>
  147. <tr>
  148. <td class="bold">Format</td>
  149. <td>wait()</td>
  150. </tr>
  151. </table>
  152. <table>
  153. <tr>
  154. <th class="command">term</th>
  155. <th class="desc">terminates a script</th>
  156. </tr>
  157. <tr>
  158. <td class="bold">Format</td>
  159. <td>term()</td>
  160. </tr>
  161. </table>
  162. <table>
  163. <tr>
  164. <th class="command">goto</th>
  165. <th class="desc">jumps to a label</th>
  166. </tr>
  167. <tr>
  168. <td class="bold">Format</td>
  169. <td>goto(label)</td>
  170. </tr>
  171. <tr>
  172. <td class="bold">Arguments</td>
  173. <td>the label can either be a string or @label_name, labels can be made by writing @label_name</td>
  174. </tr>
  175. </table>
  176. <table>
  177. <tr>
  178. <th class="command">sgoto</th>
  179. <th class="desc">jumps to a label after a specific amount of scheduler ticks</th>
  180. </tr>
  181. <tr>
  182. <td class="bold">Format</td>
  183. <td>sgoto(ticks, label)</td>
  184. </tr>
  185. <tr>
  186. <td class="bold">Info</td>
  187. <td>all scheduled tasks are instantly executed on server stop</td>
  188. </tr>
  189. </table>
  190. <table>
  191. <tr>
  192. <th class="command">ignoreGoto</th>
  193. <th class="desc">jumps to a label if it exists</th>
  194. </tr>
  195. <tr>
  196. <td class="bold">Format</td>
  197. <td>ignoreGoto(label)</td>
  198. </tr>
  199. <tr>
  200. <td class="bold">Alias</td>
  201. <td>iGoto(label)</td>
  202. </tr>
  203. </table>
  204. <table>
  205. <tr>
  206. <th class="command">gosub</th>
  207. <th class="desc">jumps to a label and remembers the old position</th>
  208. </tr>
  209. <tr>
  210. <td class="bold">Format</td>
  211. <td>gosub(label)</td>
  212. </tr>
  213. </table>
  214. <table>
  215. <tr>
  216. <th class="command">return</th>
  217. <th class="desc">returns to the previous execution position returning nothing or a value</th>
  218. </tr>
  219. <tr>
  220. <td class="bold">Format</td>
  221. <td>return<br>return 5</td>
  222. </tr>
  223. </table>
  224. <table>
  225. <tr>
  226. <th class="command">waitfor</th>
  227. <th class="desc">waits a specific amount of scheduler ticks, no events are received while waiting, sgotos until now won´t be received anymore</th>
  228. </tr>
  229. <tr>
  230. <td class="bold">Format</td>
  231. <td>waitfor(ticks)</td>
  232. </tr>
  233. </table>
  234. <table>
  235. <tr>
  236. <th class="command">assert</th>
  237. <th class="desc">throws an exception of the given bool is false</th>
  238. </tr>
  239. <tr>
  240. <td class="bold">Format</td>
  241. <td>assert(boolean)</td>
  242. </tr>
  243. </table>
  244. <table>
  245. <tr>
  246. <th class="command">isBool</th>
  247. <th class="desc">returns true if a value is a boolean</th>
  248. </tr>
  249. <tr>
  250. <td class="bold">Format</td>
  251. <td>isBool(value)</td>
  252. </tr>
  253. </table>
  254. <table>
  255. <tr>
  256. <th class="command">isDouble</th>
  257. <th class="desc">returns true if a value is a double</th>
  258. </tr>
  259. <tr>
  260. <td class="bold">Format</td>
  261. <td>isDouble(value)</td>
  262. </tr>
  263. </table>
  264. <table>
  265. <tr>
  266. <th class="command">isLong</th>
  267. <th class="desc">returns true if a value is a long</th>
  268. </tr>
  269. <tr>
  270. <td class="bold">Format</td>
  271. <td>isLong(value)</td>
  272. </tr>
  273. </table>
  274. <table>
  275. <tr>
  276. <th class="command">class</th>
  277. <th class="desc">returns the class of any object</th>
  278. </tr>
  279. <tr>
  280. <td class="bold">Format</td>
  281. <td>class(object)</td>
  282. </tr>
  283. </table>
  284. <table>
  285. <tr>
  286. <th class="command">usedMemory</th>
  287. <th class="desc">returns used memory in mega bytes</th>
  288. </tr>
  289. <tr>
  290. <td class="bold">Format</td>
  291. <td>usedmemory()</td>
  292. </tr>
  293. </table>
  294. <table>
  295. <tr>
  296. <th class="command">allocatedMemory</th>
  297. <th class="desc">returns allocated memory in mega bytes</th>
  298. </tr>
  299. <tr>
  300. <td class="bold">Format</td>
  301. <td>allocatedmemory()</td>
  302. </tr>
  303. </table>
  304. <table>
  305. <tr>
  306. <th class="command">hasNext</th>
  307. <th class="desc">returns true if the iterator has a next entry</th>
  308. </tr>
  309. <tr>
  310. <td class="bold">Format</td>
  311. <td>hasNext(iterator)</td>
  312. </tr>
  313. </table>
  314. <table>
  315. <tr>
  316. <th class="command">next</th>
  317. <th class="desc">returns the next entry of an iterator</th>
  318. </tr>
  319. <tr>
  320. <td class="bold">Format</td>
  321. <td>next(iterator)</td>
  322. </tr>
  323. </table>
  324. <table>
  325. <tr>
  326. <th class="command">remove</th>
  327. <th class="desc">removes the actual entry of an iterator</th>
  328. </tr>
  329. <tr>
  330. <td class="bold">Format</td>
  331. <td>remove(iterator)</td>
  332. </tr>
  333. </table>
  334. </section>
  335. <section id="Event">
  336. <table>
  337. <tr>
  338. <th class="command">event.load</th>
  339. <th class="desc">loads an event, a script does not receive non loaded events</th>
  340. </tr>
  341. <tr>
  342. <td class="bold">Format</td>
  343. <td>event.load(event_name_string)</td>
  344. </tr>
  345. </table>
  346. <table>
  347. <tr>
  348. <th class="command">event.unload</th>
  349. <th class="desc">unloads an event</th>
  350. </tr>
  351. <tr>
  352. <td class="bold">Format</td>
  353. <td>event.unload(event_name_string)</td>
  354. </tr>
  355. </table>
  356. <table>
  357. <tr>
  358. <th class="command">event.isloaded</th>
  359. <th class="desc">returns true if the given event is loaded</th>
  360. </tr>
  361. <tr>
  362. <td class="bold">Format</td>
  363. <td>event.isloaded(event_name_string)</td>
  364. </tr>
  365. </table>
  366. </section>
  367. <section id="Script">
  368. <table>
  369. <tr>
  370. <th class="command">script.get</th>
  371. <th class="desc">returns a script</th>
  372. </tr>
  373. <tr>
  374. <td class="bold">Format</td>
  375. <td>script.get()<br>script.get(script_name)</td>
  376. </tr>
  377. </table>
  378. <table>
  379. <tr>
  380. <th class="command">script.getId</th>
  381. <th class="desc">returns the id of a script</th>
  382. </tr>
  383. <tr>
  384. <td class="bold">Format</td>
  385. <td>script.getId(script)</td>
  386. </tr>
  387. </table>
  388. <table>
  389. <tr>
  390. <th class="command">script.getFromId</th>
  391. <th class="desc">returns the script with this id</th>
  392. </tr>
  393. <tr>
  394. <td class="bold">Format</td>
  395. <td>script.getFromId(script_id)</td>
  396. </tr>
  397. </table>
  398. <table>
  399. <tr>
  400. <th class="command">script.getAll</th>
  401. <th class="desc">returns a list with all active scripts with this name</th>
  402. </tr>
  403. <tr>
  404. <td class="bold">Format</td>
  405. <td>script.getAll(script_name)</td>
  406. </tr>
  407. </table>
  408. <table>
  409. <tr>
  410. <th class="command">script.term</th>
  411. <th class="desc">terminates a script</th>
  412. </tr>
  413. <tr>
  414. <td class="bold">Format</td>
  415. <td>script.term(script)</td>
  416. </tr>
  417. </table>
  418. <table>
  419. <tr>
  420. <th class="command">script.getVar</th>
  421. <th class="desc">returns the value from a var from script</th>
  422. </tr>
  423. <tr>
  424. <td class="bold">Format</td>
  425. <td>script.getVar(script, var_name)</td>
  426. </tr>
  427. </table>
  428. <table>
  429. <tr>
  430. <th class="command">script.setVar</th>
  431. <th class="desc">sets the value from a var from script</th>
  432. </tr>
  433. <tr>
  434. <td class="bold">Format</td>
  435. <td>script.setVar(script, var_name, value)</td>
  436. </tr>
  437. </table>
  438. </section>
  439. <section id="ScriptVar">
  440. <table>
  441. <tr>
  442. <th class="command">getScriptVar</th>
  443. <th class="desc">returns the value from a scriptvar (scriptvars are script-across)</th>
  444. </tr>
  445. <tr>
  446. <td class="bold">Format</td>
  447. <td>getScriptVar(String varname)</td>
  448. </tr>
  449. </table>
  450. <table>
  451. <tr>
  452. <th class="command">setScriptVar</th>
  453. <th class="desc">sets the value from a scriptvar (scriptvars are script-across)</th>
  454. </tr>
  455. <tr>
  456. <td class="bold">Format</td>
  457. <td>setScriptVar(String varname, value)</td>
  458. </tr>
  459. </table>
  460. <table>
  461. <tr>
  462. <th class="command">delScriptVar</th>
  463. <th class="desc">deletes a scriptvar</th>
  464. </tr>
  465. <tr>
  466. <td class="bold">Format</td>
  467. <td>delScriptVar(String varname)</td>
  468. </tr>
  469. </table>
  470. <table>
  471. <tr>
  472. <th class="command">clearScriptVars</th>
  473. <th class="desc">clears all scriptvars</th>
  474. </tr>
  475. <tr>
  476. <td class="bold">Format</td>
  477. <td>clearScriptVars()</td>
  478. </tr>
  479. </table>
  480. </section>
  481. <section id="Bit-Operations">
  482. <table>
  483. <tr>
  484. <th class="command">bit.set</th>
  485. <th class="desc">returns a value, where a single bit is set to 1</th>
  486. </tr>
  487. <tr>
  488. <td class="bold">Format</td>
  489. <td>bit.set(value, bit_index)</td>
  490. </tr>
  491. <tr>
  492. <td class="bold">Arguments</td>
  493. <td>bit_index should be from 0 to 31</td>
  494. </tr>
  495. </table>
  496. <table>
  497. <tr>
  498. <th class="command">bit.unset</th>
  499. <th class="desc">returns a value, where a single bit is set to 0</th>
  500. </tr>
  501. <tr>
  502. <td class="bold">Format</td>
  503. <td>bit.unset(value, bit_index)</td>
  504. </tr>
  505. <tr>
  506. <td class="bold">Arguments</td>
  507. <td>bit_index should be from 0 to 31</td>
  508. </tr>
  509. </table>
  510. <table>
  511. <tr>
  512. <th class="command">bit.get</th>
  513. <th class="desc">returns a single bit as boolean</th>
  514. </tr>
  515. <tr>
  516. <td class="bold">Format</td>
  517. <td>bit.get(value, bit_index)</td>
  518. </tr>
  519. <tr>
  520. <td class="bold">Arguments</td>
  521. <td>bit_index should be from 0 to 31</td>
  522. </tr>
  523. <tr>
  524. <td class="bold">Returns</td>
  525. <td>true or false depending on the bit</td>
  526. </tr>
  527. </table>
  528. </section>
  529. <section id="Math">
  530. <table>
  531. <tr>
  532. <th class="command">math.min</th>
  533. <th class="desc">returns the lower value</th>
  534. </tr>
  535. <tr>
  536. <td class="bold">Format</td>
  537. <td>math.min(value1, value2)</td>
  538. </tr>
  539. </table>
  540. <table>
  541. <tr>
  542. <th class="command">math.max</th>
  543. <th class="desc">returns the higher value</th>
  544. </tr>
  545. <tr>
  546. <td class="bold">Format</td>
  547. <td>math.max(value1, value2)</td>
  548. </tr>
  549. </table>
  550. <table>
  551. <tr>
  552. <th class="command">math.abs</th>
  553. <th class="desc">returns the absolute value of a value</th>
  554. </tr>
  555. <tr>
  556. <td class="bold">Format</td>
  557. <td>math.abs(value)</td>
  558. </tr>
  559. </table>
  560. <table>
  561. <tr>
  562. <th class="command">math.pow</th>
  563. <th class="desc">returns a value to the power of another</th>
  564. </tr>
  565. <tr>
  566. <td class="bold">Format</td>
  567. <td>math.pow(value, power)</td>
  568. </tr>
  569. </table>
  570. <table>
  571. <tr>
  572. <th class="command">math.root</th>
  573. <th class="desc">returns the given root of a value</th>
  574. </tr>
  575. <tr>
  576. <td class="bold">Format</td>
  577. <td>math.root(value, root)</td>
  578. </tr>
  579. </table>
  580. <table>
  581. <tr>
  582. <th class="command">math.sqrt</th>
  583. <th class="desc">returns the square root a value</th>
  584. </tr>
  585. <tr>
  586. <td class="bold">Format</td>
  587. <td>math.sqrt(value)</td>
  588. </tr>
  589. </table>
  590. <table>
  591. <tr>
  592. <th class="command">math.hypot</th>
  593. <th class="desc">returns sqrt(x&sup2; + y&sup2;)</th>
  594. </tr>
  595. <tr>
  596. <td class="bold">Format</td>
  597. <td>math.hypot(x, y)</td>
  598. </tr>
  599. </table>
  600. <table>
  601. <tr>
  602. <th class="command">math.sin</th>
  603. <th class="desc">returns the sine of a value</th>
  604. </tr>
  605. <tr>
  606. <td class="bold">Format</td>
  607. <td>math.sin(value)</td>
  608. </tr>
  609. </table>
  610. <table>
  611. <tr>
  612. <th class="command">math.cos</th>
  613. <th class="desc">returns the cosine of a value</th>
  614. </tr>
  615. <tr>
  616. <td class="bold">Format</td>
  617. <td>math.cos(value)</td>
  618. </tr>
  619. </table>
  620. <table>
  621. <tr>
  622. <th class="command">math.tan</th>
  623. <th class="desc">returns the tangent of a value</th>
  624. </tr>
  625. <tr>
  626. <td class="bold">Format</td>
  627. <td>math.tan(value)</td>
  628. </tr>
  629. </table>
  630. <table>
  631. <tr>
  632. <th class="command">math.asin</th>
  633. <th class="desc">returns the arcsine of a value</th>
  634. </tr>
  635. <tr>
  636. <td class="bold">Format</td>
  637. <td>math.asin(value)</td>
  638. </tr>
  639. </table>
  640. <table>
  641. <tr>
  642. <th class="command">math.acos</th>
  643. <th class="desc">returns the arccosine of a value</th>
  644. </tr>
  645. <tr>
  646. <td class="bold">Format</td>
  647. <td>math.acos(value)</td>
  648. </tr>
  649. </table>
  650. <table>
  651. <tr>
  652. <th class="command">math.atan</th>
  653. <th class="desc">returns the arctangent of a value</th>
  654. </tr>
  655. <tr>
  656. <td class="bold">Format</td>
  657. <td>math.atan(value)</td>
  658. </tr>
  659. </table>
  660. <table>
  661. <tr>
  662. <th class="command">math.e</th>
  663. <th class="desc">returns Euler's number</th>
  664. </tr>
  665. <tr>
  666. <td class="bold">Format</td>
  667. <td>math.e()</td>
  668. </tr>
  669. </table>
  670. <table>
  671. <tr>
  672. <th class="command">math.pi</th>
  673. <th class="desc">returns pi</th>
  674. </tr>
  675. <tr>
  676. <td class="bold">Format</td>
  677. <td>math.pi()</td>
  678. </tr>
  679. </table>
  680. <table>
  681. <tr>
  682. <th class="command">math.ln</th>
  683. <th class="desc">returns the natural logarithm of a value</th>
  684. </tr>
  685. <tr>
  686. <td class="bold">Format</td>
  687. <td>math.ln(value)</td>
  688. </tr>
  689. </table>
  690. <table>
  691. <tr>
  692. <th class="command">math.log</th>
  693. <th class="desc">returns the decadic logarithm of a value</th>
  694. </tr>
  695. <tr>
  696. <td class="bold">Format</td>
  697. <td>math.log(value)</td>
  698. </tr>
  699. </table>
  700. <table>
  701. <tr>
  702. <th class="command">math.random</th>
  703. <th class="desc">returns a random natural number between both values including both borders</th>
  704. </tr>
  705. <tr>
  706. <td class="bold">Format</td>
  707. <td>math.random(from, to)</td>
  708. </tr>
  709. </table>
  710. <table>
  711. <tr>
  712. <th class="command">math.round</th>
  713. <th class="desc">returns a value rounded</th>
  714. </tr>
  715. <tr>
  716. <td class="bold">Format</td>
  717. <td>math.round(value)</td>
  718. </tr>
  719. </table>
  720. <table>
  721. <tr>
  722. <th class="command">math.roundUp</th>
  723. <th class="desc">returns a value rounded up</th>
  724. </tr>
  725. <tr>
  726. <td class="bold">Format</td>
  727. <td>math.roundUp(value)</td>
  728. </tr>
  729. </table>
  730. <table>
  731. <tr>
  732. <th class="command">math.roundDown</th>
  733. <th class="desc">returns a value rounded down</th>
  734. </tr>
  735. <tr>
  736. <td class="bold">Format</td>
  737. <td>math.roundDown(value)</td>
  738. </tr>
  739. </table>
  740. <table>
  741. <tr>
  742. <th class="command">math.roundComma</th>
  743. <th class="desc">returns a value rounded to a specific number of decimals</th>
  744. </tr>
  745. <tr>
  746. <td class="bold">Format</td>
  747. <td>math.roundComma(value, number_of_dezimals)</td>
  748. </tr>
  749. </table>
  750. </section>
  751. <section id="List">
  752. <table>
  753. <tr>
  754. <th class="command">list.new</th>
  755. <th class="desc">returns a new list</th>
  756. </tr>
  757. <tr>
  758. <td class="bold">Format</td>
  759. <td>list.new()</td>
  760. </tr>
  761. </table>
  762. <table>
  763. <tr>
  764. <th class="command">list.exists</th>
  765. <th class="desc">returns true if the given value is a list</th>
  766. </tr>
  767. <tr>
  768. <td class="bold">Format</td>
  769. <td>list.exists(value)</td>
  770. </tr>
  771. </table>
  772. <table>
  773. <tr>
  774. <th class="command">list.add</th>
  775. <th class="desc">adds an element to a list</th>
  776. </tr>
  777. <tr>
  778. <td class="bold">Format</td>
  779. <td>list.add(list, element)</td>
  780. </tr>
  781. </table>
  782. <table>
  783. <tr>
  784. <th class="command">list.addAll</th>
  785. <th class="desc">adds all given elements to the list</th>
  786. </tr>
  787. <tr>
  788. <td class="bold">Format</td>
  789. <td>list.addAll(List, element, ...)</td>
  790. </tr>
  791. </table>
  792. <table>
  793. <tr>
  794. <th class="command">list.remove</th>
  795. <th class="desc">removes an element from a list and returns true on success</th>
  796. </tr>
  797. <tr>
  798. <td class="bold">Format</td>
  799. <td>list.remove(list, element)</td>
  800. </tr>
  801. </table>
  802. <table>
  803. <tr>
  804. <th class="command">list.removeIndex</th>
  805. <th class="desc">removes an element from a list at the given index and returns true on success</th>
  806. </tr>
  807. <tr>
  808. <td class="bold">Format</td>
  809. <td>list.removeIndex(list, index)</td>
  810. </tr>
  811. </table>
  812. <table>
  813. <tr>
  814. <th class="command">list.contains</th>
  815. <th class="desc">returns true if a list contains a given element</th>
  816. </tr>
  817. <tr>
  818. <td class="bold">Format</td>
  819. <td>list.contains(list, element)</td>
  820. </tr>
  821. </table>
  822. <table>
  823. <tr>
  824. <th class="command">list.getSize</th>
  825. <th class="desc">returns the size of a list</th>
  826. </tr>
  827. <tr>
  828. <td class="bold">Format</td>
  829. <td>list.getSize(list)</td>
  830. </tr>
  831. </table>
  832. <table>
  833. <tr>
  834. <th class="command">list.getIndex</th>
  835. <th class="desc">returns the element at a given index of a list</th>
  836. </tr>
  837. <tr>
  838. <td class="bold">Format</td>
  839. <td>list.getIndex(list, index)</td>
  840. </tr>
  841. <tr>
  842. <td class="bold">Alias</td>
  843. <td>list.get(list, index)</td>
  844. </tr>
  845. </table>
  846. <table>
  847. <tr>
  848. <th class="command">list.setIndex</th>
  849. <th class="desc">sets the element at a given index of a list and returns the old element</th>
  850. </tr>
  851. <tr>
  852. <td class="bold">Format</td>
  853. <td>list.setIndex(list, index, element)</td>
  854. </tr>
  855. </table>
  856. <table>
  857. <tr>
  858. <th class="command">list.getIndexOf</th>
  859. <th class="desc">returns the index of a given element in a list or -1 if the list does not contain the element</th>
  860. </tr>
  861. <tr>
  862. <td class="bold">Format</td>
  863. <td>list.getIndexOf(list, element)</td>
  864. </tr>
  865. </table>
  866. <table>
  867. <tr>
  868. <th class="command">list.clear</th>
  869. <th class="desc">removes all elements of a list</th>
  870. </tr>
  871. <tr>
  872. <td class="bold">Format</td>
  873. <td>list.clear(list)</td>
  874. </tr>
  875. </table>
  876. <table>
  877. <tr>
  878. <th class="command">list.sort</th>
  879. <th class="desc">sorts a list</th>
  880. </tr>
  881. <tr>
  882. <td class="bold">Format</td>
  883. <td>list.sort(list)</td>
  884. </tr>
  885. </table>
  886. <table>
  887. <tr>
  888. <th class="command">list.reverse</th>
  889. <th class="desc">reverses the order of a list</th>
  890. </tr>
  891. <tr>
  892. <td class="bold">Format</td>
  893. <td>list.reverse(list)</td>
  894. </tr>
  895. </table>
  896. <table>
  897. <tr>
  898. <th class="command">list.shuffle</th>
  899. <th class="desc">shuffles a list</th>
  900. </tr>
  901. <tr>
  902. <td class="bold">Format</td>
  903. <td>list.shuffle(list)</td>
  904. </tr>
  905. </table>
  906. <table>
  907. <tr>
  908. <th class="command">list.iterator</th>
  909. <th class="desc">returns the iterator of a list</th>
  910. </tr>
  911. <tr>
  912. <td class="bold">Format</td>
  913. <td>list.iterator(list)</td>
  914. </tr>
  915. </table>
  916. </section>
  917. <section id="Map">
  918. <table>
  919. <tr>
  920. <th class="command">map.new</th>
  921. <th class="desc">returns a new map</th>
  922. </tr>
  923. <tr>
  924. <td class="bold">Format</td>
  925. <td>map.new()</td>
  926. </tr>
  927. </table>
  928. <table>
  929. <tr>
  930. <th class="command">map.exists</th>
  931. <th class="desc">returns true if the given value is a map</th>
  932. </tr>
  933. <tr>
  934. <td class="bold">Format</td>
  935. <td>map.exists(value)</td>
  936. </tr>
  937. </table>
  938. <table>
  939. <tr>
  940. <th class="command">map.add</th>
  941. <th class="desc">adds a key value pair to a map and returns the old value</th>
  942. </tr>
  943. <tr>
  944. <td class="bold">Format</td>
  945. <td>map.add(map, key, value)</td>
  946. </tr>
  947. </table>
  948. <table>
  949. <tr>
  950. <th class="command">map.remove</th>
  951. <th class="desc">removes a key from a map and returns the old value</th>
  952. </tr>
  953. <tr>
  954. <td class="bold">Format</td>
  955. <td>map.remove(map, key)</td>
  956. </tr>
  957. </table>
  958. <table>
  959. <tr>
  960. <th class="command">map.contains</th>
  961. <th class="desc">returns true if a map contains a given key</th>
  962. </tr>
  963. <tr>
  964. <td class="bold">Format</td>
  965. <td>map.contains(map, key)</td>
  966. </tr>
  967. </table>
  968. <table>
  969. <tr>
  970. <th class="command">map.getSize</th>
  971. <th class="desc">returns the size of a map</th>
  972. </tr>
  973. <tr>
  974. <td class="bold">Format</td>
  975. <td>map.getSize(map)</td>
  976. </tr>
  977. </table>
  978. <table>
  979. <tr>
  980. <th class="command">map.get</th>
  981. <th class="desc">returns the value associated with a key in a map</th>
  982. </tr>
  983. <tr>
  984. <td class="bold">Format</td>
  985. <td>map.get(map, key)</td>
  986. </tr>
  987. </table>
  988. <table>
  989. <tr>
  990. <th class="command">map.getOrDefault</th>
  991. <th class="desc">returns the value associated with a key in a map or the default value if the key is not present</th>
  992. </tr>
  993. <tr>
  994. <td class="bold">Format</td>
  995. <td>map.getOrDefault(map, key, default)</td>
  996. </tr>
  997. </table>
  998. <table>
  999. <tr>
  1000. <th class="command">map.iterator</th>
  1001. <th class="desc">returns the iterator of a map</th>
  1002. </tr>
  1003. <tr>
  1004. <td class="bold">Format</td>
  1005. <td>map.iterator(map)</td>
  1006. </tr>
  1007. </table>
  1008. <table>
  1009. <tr>
  1010. <th class="command">map.getKey</th>
  1011. <th class="desc">returns the key</th>
  1012. </tr>
  1013. <tr>
  1014. <td class="bold">Format</td>
  1015. <td>map.getKey(iterator_element)</td>
  1016. </tr>
  1017. </table>
  1018. <table>
  1019. <tr>
  1020. <th class="command">map.getValue</th>
  1021. <th class="desc">returns the value</th>
  1022. </tr>
  1023. <tr>
  1024. <td class="bold">Format</td>
  1025. <td>map.getValue(iterator_element)</td>
  1026. </tr>
  1027. </table>
  1028. <table>
  1029. <tr>
  1030. <th class="command">map.setValue</th>
  1031. <th class="desc">sets the newValue and returns the oldValue</th>
  1032. </tr>
  1033. <tr>
  1034. <td class="bold">Format</td>
  1035. <td>map.setValue(iterator_element, newValue)</td>
  1036. </tr>
  1037. </table>
  1038. <table>
  1039. <tr>
  1040. <th class="command">map.clear</th>
  1041. <th class="desc">removes all key value pairs from a map</th>
  1042. </tr>
  1043. <tr>
  1044. <td class="bold">Format</td>
  1045. <td>map.clear(map)</td>
  1046. </tr>
  1047. </table>
  1048. </section>
  1049. <section id="Set">
  1050. <table>
  1051. <tr>
  1052. <th class="command">set.new</th>
  1053. <th class="desc">returns a new set</th>
  1054. </tr>
  1055. <tr>
  1056. <td class="bold">Format</td>
  1057. <td>set.new()</td>
  1058. </tr>
  1059. </table>
  1060. <table>
  1061. <tr>
  1062. <th class="command">set.exists</th>
  1063. <th class="desc">returns true if the given value is a set</th>
  1064. </tr>
  1065. <tr>
  1066. <td class="bold">Format</td>
  1067. <td>set.exists(value)</td>
  1068. </tr>
  1069. </table>
  1070. <table>
  1071. <tr>
  1072. <th class="command">set.add</th>
  1073. <th class="desc">adds a key to a set and returns true if the key was added</th>
  1074. </tr>
  1075. <tr>
  1076. <td class="bold">Format</td>
  1077. <td>set.add(set, key)</td>
  1078. </tr>
  1079. </table>
  1080. <table>
  1081. <tr>
  1082. <th class="command">set.addAll</th>
  1083. <th class="desc">adds all given keys to a set</th>
  1084. </tr>
  1085. <tr>
  1086. <td class="bold">Format</td>
  1087. <td>set.addAll(set, key, ...)</td>
  1088. </tr>
  1089. </table>
  1090. <table>
  1091. <tr>
  1092. <th class="command">set.remove</th>
  1093. <th class="desc">removes a key from a set and returns true if the key was removed</th>
  1094. </tr>
  1095. <tr>
  1096. <td class="bold">Format</td>
  1097. <td>set.remove(set, key)</td>
  1098. </tr>
  1099. </table>
  1100. <table>
  1101. <tr>
  1102. <th class="command">set.contains</th>
  1103. <th class="desc">returns true if a set contains a given key</th>
  1104. </tr>
  1105. <tr>
  1106. <td class="bold">Format</td>
  1107. <td>set.contains(set, key)</td>
  1108. </tr>
  1109. </table>
  1110. <table>
  1111. <tr>
  1112. <th class="command">set.getSize</th>
  1113. <th class="desc">returns the size of a set</th>
  1114. </tr>
  1115. <tr>
  1116. <td class="bold">Format</td>
  1117. <td>set.getSize(set)</td>
  1118. </tr>
  1119. </table>
  1120. <table>
  1121. <tr>
  1122. <th class="command">set.clear</th>
  1123. <th class="desc">removes all keys from a map</th>
  1124. </tr>
  1125. <tr>
  1126. <td class="bold">Format</td>
  1127. <td>set.clear(set)</td>
  1128. </tr>
  1129. </table>
  1130. <table>
  1131. <tr>
  1132. <th class="command">set.toList</th>
  1133. <th class="desc">returns all keys of a set as list</th>
  1134. </tr>
  1135. <tr>
  1136. <td class="bold">Format</td>
  1137. <td>set.toList(set)</td>
  1138. </tr>
  1139. </table>
  1140. <table>
  1141. <tr>
  1142. <th class="command">set.iterator</th>
  1143. <th class="desc">returns the iterator of a set</th>
  1144. </tr>
  1145. <tr>
  1146. <td class="bold">Format</td>
  1147. <td>set.iterator(set)</td>
  1148. </tr>
  1149. </table>
  1150. </section>
  1151. <section id="Time">
  1152. <table>
  1153. <tr>
  1154. <th class="command">time.new</th>
  1155. <th class="desc">returns a calendar of a given time in milliseconds</th>
  1156. </tr>
  1157. <tr>
  1158. <td class="bold">Format</td>
  1159. <td>time.new(time_millis)</td>
  1160. </tr>
  1161. <tr>
  1162. <td class="bold">Arguments</td>
  1163. <td>time_millis are milliseconds passed since 01.01.1970</td>
  1164. </tr>
  1165. </table>
  1166. <table>
  1167. <tr>
  1168. <th class="command">time.getMillis</th>
  1169. <th class="desc">returns the current millisecond time</th>
  1170. </tr>
  1171. <tr>
  1172. <td class="bold">Format</td>
  1173. <td>time.getMillis()</td>
  1174. </tr>
  1175. </table>
  1176. <table>
  1177. <tr>
  1178. <th class="command">time.getNanos</th>
  1179. <th class="desc">returns the current nanosecond time of the whole engine</th>
  1180. </tr>
  1181. <tr>
  1182. <td class="bold">Format</td>
  1183. <td>time.getNanos()</td>
  1184. </tr>
  1185. </table>
  1186. <table>
  1187. <tr>
  1188. <th class="command">time.from</th>
  1189. <th class="desc">returns the millisecond time of a calendar</th>
  1190. </tr>
  1191. <tr>
  1192. <td class="bold">Format</td>
  1193. <td>time.from(calendar)</td>
  1194. </tr>
  1195. </table>
  1196. <table>
  1197. <tr>
  1198. <th class="command">time.nextDay</th>
  1199. <th class="desc">sets the time of a calendar to the beginning of the next day</th>
  1200. </tr>
  1201. <tr>
  1202. <td class="bold">Format</td>
  1203. <td>time.nextDay(calendar)</td>
  1204. </tr>
  1205. </table>
  1206. <table>
  1207. <tr>
  1208. <th class="command">time.getYear</th>
  1209. <th class="desc">returns the year of a calendar</th>
  1210. </tr>
  1211. <tr>
  1212. <td class="bold">Format</td>
  1213. <td>time.getYear(calendar)</td>
  1214. </tr>
  1215. </table>
  1216. <table>
  1217. <tr>
  1218. <th class="command">time.getMonth</th>
  1219. <th class="desc">returns the month of a calendar</th>
  1220. </tr>
  1221. <tr>
  1222. <td class="bold">Format</td>
  1223. <td>time.getMonth(calendar)</td>
  1224. </tr>
  1225. </table>
  1226. <table>
  1227. <tr>
  1228. <th class="command">time.getDay</th>
  1229. <th class="desc">returns the day of a calendar</th>
  1230. </tr>
  1231. <tr>
  1232. <td class="bold">Format</td>
  1233. <td>time.getDay(calendar)</td>
  1234. </tr>
  1235. </table>
  1236. <table>
  1237. <tr>
  1238. <th class="command">time.getHour</th>
  1239. <th class="desc">returns the hours of a calendar</th>
  1240. </tr>
  1241. <tr>
  1242. <td class="bold">Format</td>
  1243. <td>time.getHour(calendar)</td>
  1244. </tr>
  1245. </table>
  1246. <table>
  1247. <tr>
  1248. <th class="command">time.getMinute</th>
  1249. <th class="desc">returns the minutes of a calendar</th>
  1250. </tr>
  1251. <tr>
  1252. <td class="bold">Format</td>
  1253. <td>time.getMinute(calendar)</td>
  1254. </tr>
  1255. </table>
  1256. <table>
  1257. <tr>
  1258. <th class="command">time.getSecond</th>
  1259. <th class="desc">returns the seconds of a calendar</th>
  1260. </tr>
  1261. <tr>
  1262. <td class="bold">Format</td>
  1263. <td>time.getSecond(calendar)</td>
  1264. </tr>
  1265. </table>
  1266. </section>
  1267. <section id="Text">
  1268. <table>
  1269. <tr>
  1270. <th class="command">text</th>
  1271. <th class="desc">returns any object as string</th>
  1272. </tr>
  1273. <tr>
  1274. <td class="bold">Format</td>
  1275. <td>text(object)</td>
  1276. </tr>
  1277. </table>
  1278. <table>
  1279. <tr>
  1280. <th class="command">text.number</th>
  1281. <th class="desc">returns a number as string without unnecessary .0</th>
  1282. </tr>
  1283. <tr>
  1284. <td class="bold">Format</td>
  1285. <td>text.number(number)</td>
  1286. </tr>
  1287. </table>
  1288. <table>
  1289. <tr>
  1290. <th class="command">text.class</th>
  1291. <th class="desc">returns the class of any object</th>
  1292. </tr>
  1293. <tr>
  1294. <td class="bold">Format</td>
  1295. <td>text.class(objekt)</td>
  1296. </tr>
  1297. </table>
  1298. <table>
  1299. <tr>
  1300. <th class="command">text.toUpperCase</th>
  1301. <th class="desc">returns a string capitalized</th>
  1302. </tr>
  1303. <tr>
  1304. <td class="bold">Format</td>
  1305. <td>text.toUpperCase(string)</td>
  1306. </tr>
  1307. </table>
  1308. <table>
  1309. <tr>
  1310. <th class="command">text.toLowerCase</th>
  1311. <th class="desc">returns a string decapitalized</th>
  1312. </tr>
  1313. <tr>
  1314. <td class="bold">Format</td>
  1315. <td>text.toLowerCase(string)</td>
  1316. </tr>
  1317. </table>
  1318. <table>
  1319. <tr>
  1320. <th class="command">text.split</th>
  1321. <th class="desc">returns a string splitted by a given separator as list </th>
  1322. </tr>
  1323. <tr>
  1324. <td class="bold">Format</td>
  1325. <td>text.split(separator, string)</td>
  1326. </tr>
  1327. </table>
  1328. <table>
  1329. <tr>
  1330. <th class="command">text.concatList</th>
  1331. <th class="desc">returns one string which connects all elements of a sub list with a connector</th>
  1332. </tr>
  1333. <tr>
  1334. <td class="bold">Format</td>
  1335. <td>text.concatList(list, connector, fromIndex, toIndex)</td>
  1336. </tr>
  1337. </table>
  1338. <table>
  1339. <tr>
  1340. <th class="command">text.concat</th>
  1341. <th class="desc">returns one string which connects all given arguments</th>
  1342. </tr>
  1343. <tr>
  1344. <td class="bold">Format</td>
  1345. <td>text.concat(arg, ...)</td>
  1346. </tr>
  1347. </table>
  1348. <table>
  1349. <tr>
  1350. <th class="command">text.concatSpace</th>
  1351. <th class="desc">returns one string which connects all given arguments with a space</th>
  1352. </tr>
  1353. <tr>
  1354. <td class="bold">Format</td>
  1355. <td>text.concatSpace(arg, ...)</td>
  1356. </tr>
  1357. </table>
  1358. <table>
  1359. <tr>
  1360. <th class="command">text.startsWith</th>
  1361. <th class="desc">returns true if a string starts with another starting from a given index</th>
  1362. </tr>
  1363. <tr>
  1364. <td class="bold">Format</td>
  1365. <td>text.startsWith(string, search_text, start_index)</td>
  1366. </tr>
  1367. </table>
  1368. <table>
  1369. <tr>
  1370. <th class="command">text.endsWith</th>
  1371. <th class="desc">returns true if a string ends with another</th>
  1372. </tr>
  1373. <tr>
  1374. <td class="bold">Format</td>
  1375. <td>text.endsWith(string, search_text)</td>
  1376. </tr>
  1377. </table>
  1378. <table>
  1379. <tr>
  1380. <th class="command">text.contains</th>
  1381. <th class="desc">returns true if a string is in another</th>
  1382. </tr>
  1383. <tr>
  1384. <td class="bold">Format</td>
  1385. <td>text.contains(string, search_text)</td>
  1386. </tr>
  1387. </table>
  1388. <table>
  1389. <tr>
  1390. <th class="command">text.indexOf</th>
  1391. <th class="desc">returns the index of string in another starting from a given index or -1 if not found</th>
  1392. </tr>
  1393. <tr>
  1394. <td class="bold">Format</td>
  1395. <td>text.indexOf(string, search_text, start_index)</td>
  1396. </tr>
  1397. </table>
  1398. <table>
  1399. <tr>
  1400. <th class="command">text.lastIndexOf</th>
  1401. <th class="desc">returns the last index of a string in another starting from a given index or -1 if not found</th>
  1402. </tr>
  1403. <tr>
  1404. <td class="bold">Format</td>
  1405. <td>text.lastIndexOf(string, search_text, start_index)</td>
  1406. </tr>
  1407. </table>
  1408. <table>
  1409. <tr>
  1410. <th class="command">text.replace</th>
  1411. <th class="desc">replaces all occurrences of a given string in another with a given string</th>
  1412. </tr>
  1413. <tr>
  1414. <td class="bold">Format</td>
  1415. <td>text.replace(string, search_text, swap_text)</td>
  1416. </tr>
  1417. </table>
  1418. <table>
  1419. <tr>
  1420. <th class="command">text.trim</th>
  1421. <th class="desc">returns a string without leading and trailing whitespaces</th>
  1422. </tr>
  1423. <tr>
  1424. <td class="bold">Format</td>
  1425. <td>text.trim(string)</td>
  1426. </tr>
  1427. </table>
  1428. <table>
  1429. <tr>
  1430. <th class="command">text.matches</th>
  1431. <th class="desc">returns true if a string matches a regex</th>
  1432. </tr>
  1433. <tr>
  1434. <td class="bold">Format</td>
  1435. <td>text.matches(string, regex)</td>
  1436. </tr>
  1437. </table>
  1438. <table>
  1439. <tr>
  1440. <th class="command">text.charcode</th>
  1441. <th class="desc">returns the character code of an index in a string</th>
  1442. </tr>
  1443. <tr>
  1444. <td class="bold">Format</td>
  1445. <td>text.charcode(string, index)</td>
  1446. </tr>
  1447. </table>
  1448. <table>
  1449. <tr>
  1450. <th class="command">text.fromCode</th>
  1451. <th class="desc">returns a string from a character code</th>
  1452. </tr>
  1453. <tr>
  1454. <td class="bold">Format</td>
  1455. <td>text.fromCode(character_code)</td>
  1456. </tr>
  1457. </table>
  1458. <table>
  1459. <tr>
  1460. <th class="command">text.length</th>
  1461. <th class="desc">returns the length of a string</th>
  1462. </tr>
  1463. <tr>
  1464. <td class="bold">Format</td>
  1465. <td>text.length(string)</td>
  1466. </tr>
  1467. </table>
  1468. <table>
  1469. <tr>
  1470. <th class="command">text.subString</th>
  1471. <th class="desc">returns a sub string starting at one index and ending at another exclusively</th>
  1472. </tr>
  1473. <tr>
  1474. <td class="bold">Format</td>
  1475. <td>text.subString(string, from_index, to_index)</td>
  1476. </tr>
  1477. </table>
  1478. <table>
  1479. <tr>
  1480. <th class="command">text.onlyLetters</th>
  1481. <th class="desc">returns true if a text has only letters</th>
  1482. </tr>
  1483. <tr>
  1484. <td class="bold">Format</td>
  1485. <td>text.onlyLetters(String)</td>
  1486. </tr>
  1487. </table>
  1488. <table>
  1489. <tr>
  1490. <th class="command">text.convert</th>
  1491. <th class="desc">converts strings into objects</th>
  1492. </tr>
  1493. <tr>
  1494. <td class="bold">Format</td>
  1495. <td>text.convert(any object)</td>
  1496. </tr>
  1497. <tr>
  1498. <td class="bold">Info</td>
  1499. <td>
  1500. null -> null<br>
  1501. "null" -> null<br>
  1502. "true" -> true<br>
  1503. "false" -> false<br>
  1504. "\"" -> \"<br>
  1505. "1" -> 1.0<br>
  1506. "string" -> "string"
  1507. </td>
  1508. </tr>
  1509. </table>
  1510. </section>
  1511. <section id="File">
  1512. <table>
  1513. <tr>
  1514. <th class="command">file.new</th>
  1515. <th class="desc">returns a new file</th>
  1516. </tr>
  1517. <tr>
  1518. <td class="bold">Format</td>
  1519. <td>file.new(path)</td>
  1520. </tr>
  1521. </table>
  1522. <table>
  1523. <tr>
  1524. <th class="command">file.exists</th>
  1525. <th class="desc">returns true if a file exists</th>
  1526. </tr>
  1527. <tr>
  1528. <td class="bold">Format</td>
  1529. <td>file.exists(file)</td>
  1530. </tr>
  1531. </table>
  1532. <table>
  1533. <tr>
  1534. <th class="command">file.delete</th>
  1535. <th class="desc">removes a file and returns true on success</th>
  1536. </tr>
  1537. <tr>
  1538. <td class="bold">Format</td>
  1539. <td>file.delete(file)</td>
  1540. </tr>
  1541. </table>
  1542. <table>
  1543. <tr>
  1544. <th class="command">file.getName</th>
  1545. <th class="desc">returns the name of a file</th>
  1546. </tr>
  1547. <tr>
  1548. <td class="bold">Format</td>
  1549. <td>file.getName(file)</td>
  1550. </tr>
  1551. </table>
  1552. <table>
  1553. <tr>
  1554. <th class="command">file.getList</th>
  1555. <th class="desc">returns all files in a folder as list</th>
  1556. </tr>
  1557. <tr>
  1558. <td class="bold">Format</td>
  1559. <td>file.getList(file)</td>
  1560. </tr>
  1561. </table>
  1562. <table>
  1563. <tr>
  1564. <th class="command">file.read</th>
  1565. <th class="desc">returns all lines in a file as list</th>
  1566. </tr>
  1567. <tr>
  1568. <td class="bold">Format</td>
  1569. <td>file.read(file)</td>
  1570. </tr>
  1571. </table>
  1572. <table>
  1573. <tr>
  1574. <th class="command">file.write</th>
  1575. <th class="desc">writes all entries of a list to a file</th>
  1576. </tr>
  1577. <tr>
  1578. <td class="bold">Format</td>
  1579. <td>file.write(file, list)</td>
  1580. </tr>
  1581. </table>
  1582. <table>
  1583. <tr>
  1584. <th class="command">file.isFile</th>
  1585. <th class="desc">returns true if a file is a file</th>
  1586. </tr>
  1587. <tr>
  1588. <td class="bold">Format</td>
  1589. <td>file.isFile(file)</td>
  1590. </tr>
  1591. </table>
  1592. <table>
  1593. <tr>
  1594. <th class="command">file.isDirectory</th>
  1595. <th class="desc">returns true if a file is a directory</th>
  1596. </tr>
  1597. <tr>
  1598. <td class="bold">Format</td>
  1599. <td>file.isDirectory(file)</td>
  1600. </tr>
  1601. </table>
  1602. </section>
  1603. <section id="Config">
  1604. <table>
  1605. <tr>
  1606. <th class="command">config.new</th>
  1607. <th class="desc">returns a new config</th>
  1608. </tr>
  1609. <tr>
  1610. <td class="bold">Format</td>
  1611. <td>config.new(path, name)</td>
  1612. </tr>
  1613. </table>
  1614. <table>
  1615. <tr>
  1616. <th class="command">config.exists</th>
  1617. <th class="desc">returns true if the config exists</th>
  1618. </tr>
  1619. <tr>
  1620. <td class="bold">Format</td>
  1621. <td>config.exists(config)</td>
  1622. </tr>
  1623. </table>
  1624. <table>
  1625. <tr>
  1626. <th class="command">config.save</th>
  1627. <th class="desc">saves a config and returns true on success</th>
  1628. </tr>
  1629. <tr>
  1630. <td class="bold">Format</td>
  1631. <td>config.save(config)</td>
  1632. </tr>
  1633. </table>
  1634. <table>
  1635. <tr>
  1636. <th class="command">config.load</th>
  1637. <th class="desc">loads a config</th>
  1638. </tr>
  1639. <tr>
  1640. <td class="bold">Format</td>
  1641. <td>config.load(config)</td>
  1642. </tr>
  1643. </table>
  1644. <table>
  1645. <tr>
  1646. <th class="command">config.delete</th>
  1647. <th class="desc">removes a config</th>
  1648. </tr>
  1649. <tr>
  1650. <td class="bold">Format</td>
  1651. <td>config.delete(config)</td>
  1652. </tr>
  1653. </table>
  1654. <table>
  1655. <tr>
  1656. <th class="command">config.set</th>
  1657. <th class="desc">sets a key value pair in a config</th>
  1658. </tr>
  1659. <tr>
  1660. <td class="bold">Format</td>
  1661. <td>config.set(config, key, value)</td>
  1662. </tr>
  1663. </table>
  1664. <table>
  1665. <tr>
  1666. <th class="command">config.getBool</th>
  1667. <th class="desc">returns a boolean or a default value from a config key</th>
  1668. </tr>
  1669. <tr>
  1670. <td class="bold">Format</td>
  1671. <td>config.getBool(config, key, default)</td>
  1672. </tr>
  1673. </table>
  1674. <table>
  1675. <tr>
  1676. <th class="command">config.getDouble</th>
  1677. <th class="desc">returns a double or a default value from a config key</th>
  1678. </tr>
  1679. <tr>
  1680. <td class="bold">Format</td>
  1681. <td>config.getDouble(config, key, default)</td>
  1682. </tr>
  1683. </table>
  1684. <table>
  1685. <tr>
  1686. <th class="command">config.getString</th>
  1687. <th class="desc">returns a string or a default value from a config key</th>
  1688. </tr>
  1689. <tr>
  1690. <td class="bold">Format</td>
  1691. <td>config.getString(config, key, default)</td>
  1692. </tr>
  1693. </table>
  1694. </section>
  1695. <section id="Matrix">
  1696. <table>
  1697. <tr>
  1698. <th class="command">matrix.new</th>
  1699. <th class="desc">returns a new matrix</th>
  1700. </tr>
  1701. <tr>
  1702. <td class="bold">Format</td>
  1703. <td>matrix.new()</td>
  1704. </tr>
  1705. </table>
  1706. <table>
  1707. <tr>
  1708. <th class="command">matrix.newRotationX</th>
  1709. <th class="desc">returns a new rotated matrix</th>
  1710. </tr>
  1711. <tr>
  1712. <td class="bold">Format</td>
  1713. <td>matrix.newRotationX(angle in radiant)</td>
  1714. </tr>
  1715. </table>
  1716. <table>
  1717. <tr>
  1718. <th class="command">matrix.newRotationY</th>
  1719. <th class="desc">returns a new rotated matrix</th>
  1720. </tr>
  1721. <tr>
  1722. <td class="bold">Format</td>
  1723. <td>matrix.newRotationY(angle in radiant)</td>
  1724. </tr>
  1725. </table>
  1726. <table>
  1727. <tr>
  1728. <th class="command">matrix.mul</th>
  1729. <th class="desc">multiplies two matrices</th>
  1730. </tr>
  1731. <tr>
  1732. <td class="bold">Format</td>
  1733. <td>matrix.mul(matrix1, matrix2)</td>
  1734. </tr>
  1735. </table>
  1736. <table>
  1737. <tr>
  1738. <th class="command">matrix.mulVector</th>
  1739. <th class="desc">multiplies a matrix and a vector</th>
  1740. </tr>
  1741. <tr>
  1742. <td class="bold">Format</td>
  1743. <td>matrix.mulVector(matrix, vector)</td>
  1744. </tr>
  1745. </table>
  1746. </section>
  1747. <section id="Vector">
  1748. <table>
  1749. <tr>
  1750. <th class="command">vector.new</th>
  1751. <th class="desc">returns a new vector</th>
  1752. </tr>
  1753. <tr>
  1754. <td class="bold">Format</td>
  1755. <td>vector.new(x, y, z)</td>
  1756. </tr>
  1757. </table>
  1758. <table>
  1759. <tr>
  1760. <th class="command">vector.set</th>
  1761. <th class="desc">modifies a vector</th>
  1762. </tr>
  1763. <tr>
  1764. <td class="bold">Format</td>
  1765. <td>vector.set(vector, x, y, z)</td>
  1766. </tr>
  1767. </table>
  1768. <table>
  1769. <tr>
  1770. <th class="command">vector.getX</th>
  1771. <th class="desc">returns x from a vector</th>
  1772. </tr>
  1773. <tr>
  1774. <td class="bold">Format</td>
  1775. <td>vector.getX(vector)</td>
  1776. </tr>
  1777. </table>
  1778. <table>
  1779. <tr>
  1780. <th class="command">vector.getY</th>
  1781. <th class="desc">returns y from a vector</th>
  1782. </tr>
  1783. <tr>
  1784. <td class="bold">Format</td>
  1785. <td>vector.getY(vector)</td>
  1786. </tr>
  1787. </table>
  1788. <table>
  1789. <tr>
  1790. <th class="command">vector.getZ</th>
  1791. <th class="desc">returns z from a vector</th>
  1792. </tr>
  1793. <tr>
  1794. <td class="bold">Format</td>
  1795. <td>vector.getZ(vector)</td>
  1796. </tr>
  1797. </table>
  1798. </section>