docu_core.php 51 KB

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