docu_core.php 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692
  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 or null if not possible</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. <table>
  359. <tr>
  360. <th class="command">modTimer</th>
  361. <th class="desc">modifies the timer for the auto scheduler</th>
  362. </tr>
  363. <tr>
  364. <td class="bold">Format</td>
  365. <td>modTimer(milliseconds)</td>
  366. </tr>
  367. <tr>
  368. <td class="bold">Arguments</td>
  369. <td>milliseconds as long</td>
  370. </tr>
  371. </table>
  372. </section>
  373. <section id="Event">
  374. <table>
  375. <tr>
  376. <th class="command">event.load</th>
  377. <th class="desc">loads an event, a script does not receive non loaded events</th>
  378. </tr>
  379. <tr>
  380. <td class="bold">Format</td>
  381. <td>event.load(event_name_string)</td>
  382. </tr>
  383. </table>
  384. <table>
  385. <tr>
  386. <th class="command">event.unload</th>
  387. <th class="desc">unloads an event</th>
  388. </tr>
  389. <tr>
  390. <td class="bold">Format</td>
  391. <td>event.unload(event_name_string)</td>
  392. </tr>
  393. </table>
  394. <table>
  395. <tr>
  396. <th class="command">event.isloaded</th>
  397. <th class="desc">returns true if the given event is loaded</th>
  398. </tr>
  399. <tr>
  400. <td class="bold">Format</td>
  401. <td>event.isloaded(event_name_string)</td>
  402. </tr>
  403. </table>
  404. </section>
  405. <section id="Script">
  406. <table>
  407. <tr>
  408. <th class="command">script.get</th>
  409. <th class="desc">returns a script</th>
  410. </tr>
  411. <tr>
  412. <td class="bold">Format</td>
  413. <td>script.get()<br>script.get(script_name)</td>
  414. </tr>
  415. </table>
  416. <table>
  417. <tr>
  418. <th class="command">script.getId</th>
  419. <th class="desc">returns the id of a script</th>
  420. </tr>
  421. <tr>
  422. <td class="bold">Format</td>
  423. <td>script.getId(script)</td>
  424. </tr>
  425. </table>
  426. <table>
  427. <tr>
  428. <th class="command">script.getFromId</th>
  429. <th class="desc">returns the script with this id</th>
  430. </tr>
  431. <tr>
  432. <td class="bold">Format</td>
  433. <td>script.getFromId(script_id)</td>
  434. </tr>
  435. </table>
  436. <table>
  437. <tr>
  438. <th class="command">script.getAll</th>
  439. <th class="desc">returns a list with all active scripts with this name</th>
  440. </tr>
  441. <tr>
  442. <td class="bold">Format</td>
  443. <td>script.getAll(script_name)</td>
  444. </tr>
  445. </table>
  446. <table>
  447. <tr>
  448. <th class="command">script.term</th>
  449. <th class="desc">terminates a script</th>
  450. </tr>
  451. <tr>
  452. <td class="bold">Format</td>
  453. <td>script.term(script)</td>
  454. </tr>
  455. </table>
  456. <table>
  457. <tr>
  458. <th class="command">script.getVar</th>
  459. <th class="desc">returns the value from a var from script</th>
  460. </tr>
  461. <tr>
  462. <td class="bold">Format</td>
  463. <td>script.getVar(script, var_name)</td>
  464. </tr>
  465. </table>
  466. <table>
  467. <tr>
  468. <th class="command">script.setVar</th>
  469. <th class="desc">sets the value from a var from script</th>
  470. </tr>
  471. <tr>
  472. <td class="bold">Format</td>
  473. <td>script.setVar(script, var_name, value)</td>
  474. </tr>
  475. </table>
  476. </section>
  477. <section id="ScriptVar">
  478. <table>
  479. <tr>
  480. <th class="command">getScriptVar</th>
  481. <th class="desc">returns the value from a scriptvar (scriptvars are script-across)</th>
  482. </tr>
  483. <tr>
  484. <td class="bold">Format</td>
  485. <td>getScriptVar(String varname)</td>
  486. </tr>
  487. </table>
  488. <table>
  489. <tr>
  490. <th class="command">setScriptVar</th>
  491. <th class="desc">sets the value from a scriptvar (scriptvars are script-across)</th>
  492. </tr>
  493. <tr>
  494. <td class="bold">Format</td>
  495. <td>setScriptVar(String varname, value)</td>
  496. </tr>
  497. </table>
  498. <table>
  499. <tr>
  500. <th class="command">delScriptVar</th>
  501. <th class="desc">deletes a scriptvar</th>
  502. </tr>
  503. <tr>
  504. <td class="bold">Format</td>
  505. <td>delScriptVar(String varname)</td>
  506. </tr>
  507. </table>
  508. <table>
  509. <tr>
  510. <th class="command">clearScriptVars</th>
  511. <th class="desc">clears all scriptvars</th>
  512. </tr>
  513. <tr>
  514. <td class="bold">Format</td>
  515. <td>clearScriptVars()</td>
  516. </tr>
  517. </table>
  518. </section>
  519. <section id="Bit-Operations">
  520. <table>
  521. <tr>
  522. <th class="command">bit.set</th>
  523. <th class="desc">returns a value, where a single bit is set to 1</th>
  524. </tr>
  525. <tr>
  526. <td class="bold">Format</td>
  527. <td>bit.set(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.unset</th>
  537. <th class="desc">returns a value, where a single bit is set to 0</th>
  538. </tr>
  539. <tr>
  540. <td class="bold">Format</td>
  541. <td>bit.unset(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. </table>
  548. <table>
  549. <tr>
  550. <th class="command">bit.get</th>
  551. <th class="desc">returns a single bit as boolean</th>
  552. </tr>
  553. <tr>
  554. <td class="bold">Format</td>
  555. <td>bit.get(value, bit_index)</td>
  556. </tr>
  557. <tr>
  558. <td class="bold">Arguments</td>
  559. <td>bit_index should be from 0 to 31</td>
  560. </tr>
  561. <tr>
  562. <td class="bold">Returns</td>
  563. <td>true or false depending on the bit</td>
  564. </tr>
  565. </table>
  566. </section>
  567. <section id="Math">
  568. <table>
  569. <tr>
  570. <th class="command">math.min</th>
  571. <th class="desc">returns the lower value</th>
  572. </tr>
  573. <tr>
  574. <td class="bold">Format</td>
  575. <td>math.min(value1, value2)</td>
  576. </tr>
  577. </table>
  578. <table>
  579. <tr>
  580. <th class="command">math.max</th>
  581. <th class="desc">returns the higher value</th>
  582. </tr>
  583. <tr>
  584. <td class="bold">Format</td>
  585. <td>math.max(value1, value2)</td>
  586. </tr>
  587. </table>
  588. <table>
  589. <tr>
  590. <th class="command">math.abs</th>
  591. <th class="desc">returns the absolute value of a value</th>
  592. </tr>
  593. <tr>
  594. <td class="bold">Format</td>
  595. <td>math.abs(value)</td>
  596. </tr>
  597. </table>
  598. <table>
  599. <tr>
  600. <th class="command">math.pow</th>
  601. <th class="desc">returns a value to the power of another</th>
  602. </tr>
  603. <tr>
  604. <td class="bold">Format</td>
  605. <td>math.pow(value, power)</td>
  606. </tr>
  607. </table>
  608. <table>
  609. <tr>
  610. <th class="command">math.root</th>
  611. <th class="desc">returns the given root of a value</th>
  612. </tr>
  613. <tr>
  614. <td class="bold">Format</td>
  615. <td>math.root(value, root)</td>
  616. </tr>
  617. </table>
  618. <table>
  619. <tr>
  620. <th class="command">math.sqrt</th>
  621. <th class="desc">returns the square root a value</th>
  622. </tr>
  623. <tr>
  624. <td class="bold">Format</td>
  625. <td>math.sqrt(value)</td>
  626. </tr>
  627. </table>
  628. <table>
  629. <tr>
  630. <th class="command">math.hypot</th>
  631. <th class="desc">returns sqrt(x&sup2; + y&sup2;)</th>
  632. </tr>
  633. <tr>
  634. <td class="bold">Format</td>
  635. <td>math.hypot(x, y)</td>
  636. </tr>
  637. </table>
  638. <table>
  639. <tr>
  640. <th class="command">math.sin</th>
  641. <th class="desc">returns the sine of a value</th>
  642. </tr>
  643. <tr>
  644. <td class="bold">Format</td>
  645. <td>math.sin(value)</td>
  646. </tr>
  647. </table>
  648. <table>
  649. <tr>
  650. <th class="command">math.cos</th>
  651. <th class="desc">returns the cosine of a value</th>
  652. </tr>
  653. <tr>
  654. <td class="bold">Format</td>
  655. <td>math.cos(value)</td>
  656. </tr>
  657. </table>
  658. <table>
  659. <tr>
  660. <th class="command">math.tan</th>
  661. <th class="desc">returns the tangent of a value</th>
  662. </tr>
  663. <tr>
  664. <td class="bold">Format</td>
  665. <td>math.tan(value)</td>
  666. </tr>
  667. </table>
  668. <table>
  669. <tr>
  670. <th class="command">math.asin</th>
  671. <th class="desc">returns the arcsine of a value</th>
  672. </tr>
  673. <tr>
  674. <td class="bold">Format</td>
  675. <td>math.asin(value)</td>
  676. </tr>
  677. </table>
  678. <table>
  679. <tr>
  680. <th class="command">math.acos</th>
  681. <th class="desc">returns the arccosine of a value</th>
  682. </tr>
  683. <tr>
  684. <td class="bold">Format</td>
  685. <td>math.acos(value)</td>
  686. </tr>
  687. </table>
  688. <table>
  689. <tr>
  690. <th class="command">math.atan</th>
  691. <th class="desc">returns the arctangent of a value</th>
  692. </tr>
  693. <tr>
  694. <td class="bold">Format</td>
  695. <td>math.atan(value)</td>
  696. </tr>
  697. </table>
  698. <table>
  699. <tr>
  700. <th class="command">math.e</th>
  701. <th class="desc">returns Euler's number</th>
  702. </tr>
  703. <tr>
  704. <td class="bold">Format</td>
  705. <td>math.e()</td>
  706. </tr>
  707. </table>
  708. <table>
  709. <tr>
  710. <th class="command">math.pi</th>
  711. <th class="desc">returns pi</th>
  712. </tr>
  713. <tr>
  714. <td class="bold">Format</td>
  715. <td>math.pi()</td>
  716. </tr>
  717. </table>
  718. <table>
  719. <tr>
  720. <th class="command">math.ln</th>
  721. <th class="desc">returns the natural logarithm of a value</th>
  722. </tr>
  723. <tr>
  724. <td class="bold">Format</td>
  725. <td>math.ln(value)</td>
  726. </tr>
  727. </table>
  728. <table>
  729. <tr>
  730. <th class="command">math.log</th>
  731. <th class="desc">returns the decadic logarithm of a value</th>
  732. </tr>
  733. <tr>
  734. <td class="bold">Format</td>
  735. <td>math.log(value)</td>
  736. </tr>
  737. </table>
  738. <table>
  739. <tr>
  740. <th class="command">math.random</th>
  741. <th class="desc">returns a random natural number between both values including both borders</th>
  742. </tr>
  743. <tr>
  744. <td class="bold">Format</td>
  745. <td>math.random(from, to)</td>
  746. </tr>
  747. </table>
  748. <table>
  749. <tr>
  750. <th class="command">math.round</th>
  751. <th class="desc">returns a value rounded</th>
  752. </tr>
  753. <tr>
  754. <td class="bold">Format</td>
  755. <td>math.round(value)</td>
  756. </tr>
  757. </table>
  758. <table>
  759. <tr>
  760. <th class="command">math.roundUp</th>
  761. <th class="desc">returns a value rounded up</th>
  762. </tr>
  763. <tr>
  764. <td class="bold">Format</td>
  765. <td>math.roundUp(value)</td>
  766. </tr>
  767. </table>
  768. <table>
  769. <tr>
  770. <th class="command">math.roundDown</th>
  771. <th class="desc">returns a value rounded down</th>
  772. </tr>
  773. <tr>
  774. <td class="bold">Format</td>
  775. <td>math.roundDown(value)</td>
  776. </tr>
  777. </table>
  778. <table>
  779. <tr>
  780. <th class="command">math.roundComma</th>
  781. <th class="desc">returns a value rounded to a specific number of decimals</th>
  782. </tr>
  783. <tr>
  784. <td class="bold">Format</td>
  785. <td>math.roundComma(value, number_of_dezimals)</td>
  786. </tr>
  787. </table>
  788. </section>
  789. <section id="List">
  790. <table>
  791. <tr>
  792. <th class="command">list.new</th>
  793. <th class="desc">returns a new list</th>
  794. </tr>
  795. <tr>
  796. <td class="bold">Format</td>
  797. <td>list.new()</td>
  798. </tr>
  799. </table>
  800. <table>
  801. <tr>
  802. <th class="command">list.exists</th>
  803. <th class="desc">returns true if the given value is a list</th>
  804. </tr>
  805. <tr>
  806. <td class="bold">Format</td>
  807. <td>list.exists(value)</td>
  808. </tr>
  809. </table>
  810. <table>
  811. <tr>
  812. <th class="command">list.add</th>
  813. <th class="desc">adds an element to a list</th>
  814. </tr>
  815. <tr>
  816. <td class="bold">Format</td>
  817. <td>list.add(list, element)</td>
  818. </tr>
  819. </table>
  820. <table>
  821. <tr>
  822. <th class="command">list.addAll</th>
  823. <th class="desc">adds all given elements to the list</th>
  824. </tr>
  825. <tr>
  826. <td class="bold">Format</td>
  827. <td>list.addAll(List, element, ...)</td>
  828. </tr>
  829. </table>
  830. <table>
  831. <tr>
  832. <th class="command">list.remove</th>
  833. <th class="desc">removes an element from a list and returns true on success</th>
  834. </tr>
  835. <tr>
  836. <td class="bold">Format</td>
  837. <td>list.remove(list, element)</td>
  838. </tr>
  839. </table>
  840. <table>
  841. <tr>
  842. <th class="command">list.removeIndex</th>
  843. <th class="desc">removes an element from a list at the given index and returns true on success</th>
  844. </tr>
  845. <tr>
  846. <td class="bold">Format</td>
  847. <td>list.removeIndex(list, index)</td>
  848. </tr>
  849. </table>
  850. <table>
  851. <tr>
  852. <th class="command">list.contains</th>
  853. <th class="desc">returns true if a list contains a given element</th>
  854. </tr>
  855. <tr>
  856. <td class="bold">Format</td>
  857. <td>list.contains(list, element)</td>
  858. </tr>
  859. </table>
  860. <table>
  861. <tr>
  862. <th class="command">list.getSize</th>
  863. <th class="desc">returns the size of a list</th>
  864. </tr>
  865. <tr>
  866. <td class="bold">Format</td>
  867. <td>list.getSize(list)</td>
  868. </tr>
  869. </table>
  870. <table>
  871. <tr>
  872. <th class="command">list.getIndex</th>
  873. <th class="desc">returns the element at a given index of a list</th>
  874. </tr>
  875. <tr>
  876. <td class="bold">Format</td>
  877. <td>list.getIndex(list, index)</td>
  878. </tr>
  879. <tr>
  880. <td class="bold">Alias</td>
  881. <td>list.get(list, index)</td>
  882. </tr>
  883. </table>
  884. <table>
  885. <tr>
  886. <th class="command">list.setIndex</th>
  887. <th class="desc">sets the element at a given index of a list and returns the old element</th>
  888. </tr>
  889. <tr>
  890. <td class="bold">Format</td>
  891. <td>list.setIndex(list, index, element)</td>
  892. </tr>
  893. </table>
  894. <table>
  895. <tr>
  896. <th class="command">list.getIndexOf</th>
  897. <th class="desc">returns the index of a given element in a list or -1 if the list does not contain the element</th>
  898. </tr>
  899. <tr>
  900. <td class="bold">Format</td>
  901. <td>list.getIndexOf(list, element)</td>
  902. </tr>
  903. </table>
  904. <table>
  905. <tr>
  906. <th class="command">list.clear</th>
  907. <th class="desc">removes all elements of a list</th>
  908. </tr>
  909. <tr>
  910. <td class="bold">Format</td>
  911. <td>list.clear(list)</td>
  912. </tr>
  913. </table>
  914. <table>
  915. <tr>
  916. <th class="command">list.sort</th>
  917. <th class="desc">sorts a list</th>
  918. </tr>
  919. <tr>
  920. <td class="bold">Format</td>
  921. <td>list.sort(list)</td>
  922. </tr>
  923. </table>
  924. <table>
  925. <tr>
  926. <th class="command">list.reverse</th>
  927. <th class="desc">reverses the order of a list</th>
  928. </tr>
  929. <tr>
  930. <td class="bold">Format</td>
  931. <td>list.reverse(list)</td>
  932. </tr>
  933. </table>
  934. <table>
  935. <tr>
  936. <th class="command">list.shuffle</th>
  937. <th class="desc">shuffles a list</th>
  938. </tr>
  939. <tr>
  940. <td class="bold">Format</td>
  941. <td>list.shuffle(list)</td>
  942. </tr>
  943. </table>
  944. <table>
  945. <tr>
  946. <th class="command">list.iterator (deprecated)</th>
  947. <th class="desc">returns the iterator of a list</th>
  948. </tr>
  949. <tr>
  950. <td class="bold">Format</td>
  951. <td>list.iterator(list)</td>
  952. </tr>
  953. </table>
  954. </section>
  955. <section id="Map">
  956. <table>
  957. <tr>
  958. <th class="command">map.new</th>
  959. <th class="desc">returns a new map</th>
  960. </tr>
  961. <tr>
  962. <td class="bold">Format</td>
  963. <td>map.new()</td>
  964. </tr>
  965. </table>
  966. <table>
  967. <tr>
  968. <th class="command">map.exists</th>
  969. <th class="desc">returns true if the given value is a map</th>
  970. </tr>
  971. <tr>
  972. <td class="bold">Format</td>
  973. <td>map.exists(value)</td>
  974. </tr>
  975. </table>
  976. <table>
  977. <tr>
  978. <th class="command">map.add</th>
  979. <th class="desc">adds a key value pair to a map and returns the old value</th>
  980. </tr>
  981. <tr>
  982. <td class="bold">Format</td>
  983. <td>map.add(map, key, value)</td>
  984. </tr>
  985. </table>
  986. <table>
  987. <tr>
  988. <th class="command">map.remove</th>
  989. <th class="desc">removes a key from a map and returns the old value</th>
  990. </tr>
  991. <tr>
  992. <td class="bold">Format</td>
  993. <td>map.remove(map, key)</td>
  994. </tr>
  995. </table>
  996. <table>
  997. <tr>
  998. <th class="command">map.contains</th>
  999. <th class="desc">returns true if a map contains a given key</th>
  1000. </tr>
  1001. <tr>
  1002. <td class="bold">Format</td>
  1003. <td>map.contains(map, key)</td>
  1004. </tr>
  1005. </table>
  1006. <table>
  1007. <tr>
  1008. <th class="command">map.getSize</th>
  1009. <th class="desc">returns the size of a map</th>
  1010. </tr>
  1011. <tr>
  1012. <td class="bold">Format</td>
  1013. <td>map.getSize(map)</td>
  1014. </tr>
  1015. </table>
  1016. <table>
  1017. <tr>
  1018. <th class="command">map.get</th>
  1019. <th class="desc">returns the value associated with a key in a map</th>
  1020. </tr>
  1021. <tr>
  1022. <td class="bold">Format</td>
  1023. <td>map.get(map, key)</td>
  1024. </tr>
  1025. </table>
  1026. <table>
  1027. <tr>
  1028. <th class="command">map.getOrDefault</th>
  1029. <th class="desc">returns the value associated with a key in a map or the default value if the key is not present</th>
  1030. </tr>
  1031. <tr>
  1032. <td class="bold">Format</td>
  1033. <td>map.getOrDefault(map, key, default)</td>
  1034. </tr>
  1035. </table>
  1036. <table>
  1037. <tr>
  1038. <th class="command">map.iterator</th>
  1039. <th class="desc">returns the iterator of a map</th>
  1040. </tr>
  1041. <tr>
  1042. <td class="bold">Format</td>
  1043. <td>map.iterator(map)</td>
  1044. </tr>
  1045. </table>
  1046. <table>
  1047. <tr>
  1048. <th class="command">map.getKey</th>
  1049. <th class="desc">returns the key</th>
  1050. </tr>
  1051. <tr>
  1052. <td class="bold">Format</td>
  1053. <td>map.getKey(iterator_element)</td>
  1054. </tr>
  1055. </table>
  1056. <table>
  1057. <tr>
  1058. <th class="command">map.getValue</th>
  1059. <th class="desc">returns the value</th>
  1060. </tr>
  1061. <tr>
  1062. <td class="bold">Format</td>
  1063. <td>map.getValue(iterator_element)</td>
  1064. </tr>
  1065. </table>
  1066. <table>
  1067. <tr>
  1068. <th class="command">map.setValue</th>
  1069. <th class="desc">sets the newValue and returns the oldValue</th>
  1070. </tr>
  1071. <tr>
  1072. <td class="bold">Format</td>
  1073. <td>map.setValue(iterator_element, newValue)</td>
  1074. </tr>
  1075. </table>
  1076. <table>
  1077. <tr>
  1078. <th class="command">map.clear</th>
  1079. <th class="desc">removes all key value pairs from a map</th>
  1080. </tr>
  1081. <tr>
  1082. <td class="bold">Format</td>
  1083. <td>map.clear(map)</td>
  1084. </tr>
  1085. </table>
  1086. </section>
  1087. <section id="Set">
  1088. <table>
  1089. <tr>
  1090. <th class="command">set.new</th>
  1091. <th class="desc">returns a new set</th>
  1092. </tr>
  1093. <tr>
  1094. <td class="bold">Format</td>
  1095. <td>set.new()</td>
  1096. </tr>
  1097. </table>
  1098. <table>
  1099. <tr>
  1100. <th class="command">set.exists</th>
  1101. <th class="desc">returns true if the given value is a set</th>
  1102. </tr>
  1103. <tr>
  1104. <td class="bold">Format</td>
  1105. <td>set.exists(value)</td>
  1106. </tr>
  1107. </table>
  1108. <table>
  1109. <tr>
  1110. <th class="command">set.add</th>
  1111. <th class="desc">adds a key to a set and returns true if the key was added</th>
  1112. </tr>
  1113. <tr>
  1114. <td class="bold">Format</td>
  1115. <td>set.add(set, key)</td>
  1116. </tr>
  1117. </table>
  1118. <table>
  1119. <tr>
  1120. <th class="command">set.addAll</th>
  1121. <th class="desc">adds all given keys to a set</th>
  1122. </tr>
  1123. <tr>
  1124. <td class="bold">Format</td>
  1125. <td>set.addAll(set, key, ...)</td>
  1126. </tr>
  1127. </table>
  1128. <table>
  1129. <tr>
  1130. <th class="command">set.remove</th>
  1131. <th class="desc">removes a key from a set and returns true if the key was removed</th>
  1132. </tr>
  1133. <tr>
  1134. <td class="bold">Format</td>
  1135. <td>set.remove(set, key)</td>
  1136. </tr>
  1137. </table>
  1138. <table>
  1139. <tr>
  1140. <th class="command">set.contains</th>
  1141. <th class="desc">returns true if a set contains a given key</th>
  1142. </tr>
  1143. <tr>
  1144. <td class="bold">Format</td>
  1145. <td>set.contains(set, key)</td>
  1146. </tr>
  1147. </table>
  1148. <table>
  1149. <tr>
  1150. <th class="command">set.getSize</th>
  1151. <th class="desc">returns the size of a set</th>
  1152. </tr>
  1153. <tr>
  1154. <td class="bold">Format</td>
  1155. <td>set.getSize(set)</td>
  1156. </tr>
  1157. </table>
  1158. <table>
  1159. <tr>
  1160. <th class="command">set.clear</th>
  1161. <th class="desc">removes all keys from a map</th>
  1162. </tr>
  1163. <tr>
  1164. <td class="bold">Format</td>
  1165. <td>set.clear(set)</td>
  1166. </tr>
  1167. </table>
  1168. <table>
  1169. <tr>
  1170. <th class="command">set.toList</th>
  1171. <th class="desc">returns all keys of a set as list</th>
  1172. </tr>
  1173. <tr>
  1174. <td class="bold">Format</td>
  1175. <td>set.toList(set)</td>
  1176. </tr>
  1177. </table>
  1178. <table>
  1179. <tr>
  1180. <th class="command">set.iterator (deprecated)</th>
  1181. <th class="desc">returns the iterator of a set</th>
  1182. </tr>
  1183. <tr>
  1184. <td class="bold">Format</td>
  1185. <td>set.iterator(set)</td>
  1186. </tr>
  1187. </table>
  1188. </section>
  1189. <section id="Time">
  1190. <table>
  1191. <tr>
  1192. <th class="command">time.new</th>
  1193. <th class="desc">returns a calendar of a given time in milliseconds</th>
  1194. </tr>
  1195. <tr>
  1196. <td class="bold">Format</td>
  1197. <td>time.new(time_millis)</td>
  1198. </tr>
  1199. <tr>
  1200. <td class="bold">Arguments</td>
  1201. <td>time_millis are milliseconds passed since 01.01.1970</td>
  1202. </tr>
  1203. </table>
  1204. <table>
  1205. <tr>
  1206. <th class="command">time.getMillis</th>
  1207. <th class="desc">returns the current millisecond time</th>
  1208. </tr>
  1209. <tr>
  1210. <td class="bold">Format</td>
  1211. <td>time.getMillis()</td>
  1212. </tr>
  1213. </table>
  1214. <table>
  1215. <tr>
  1216. <th class="command">time.getNanos</th>
  1217. <th class="desc">returns the current nanosecond time of the whole engine</th>
  1218. </tr>
  1219. <tr>
  1220. <td class="bold">Format</td>
  1221. <td>time.getNanos()</td>
  1222. </tr>
  1223. </table>
  1224. <table>
  1225. <tr>
  1226. <th class="command">time.from</th>
  1227. <th class="desc">returns the millisecond time of a calendar</th>
  1228. </tr>
  1229. <tr>
  1230. <td class="bold">Format</td>
  1231. <td>time.from(calendar)</td>
  1232. </tr>
  1233. </table>
  1234. <table>
  1235. <tr>
  1236. <th class="command">time.nextDay</th>
  1237. <th class="desc">sets the time of a calendar to the beginning of the next day</th>
  1238. </tr>
  1239. <tr>
  1240. <td class="bold">Format</td>
  1241. <td>time.nextDay(calendar)</td>
  1242. </tr>
  1243. </table>
  1244. <table>
  1245. <tr>
  1246. <th class="command">time.getYear</th>
  1247. <th class="desc">returns the year of a calendar</th>
  1248. </tr>
  1249. <tr>
  1250. <td class="bold">Format</td>
  1251. <td>time.getYear(calendar)</td>
  1252. </tr>
  1253. </table>
  1254. <table>
  1255. <tr>
  1256. <th class="command">time.getMonth</th>
  1257. <th class="desc">returns the month of a calendar</th>
  1258. </tr>
  1259. <tr>
  1260. <td class="bold">Format</td>
  1261. <td>time.getMonth(calendar)</td>
  1262. </tr>
  1263. </table>
  1264. <table>
  1265. <tr>
  1266. <th class="command">time.getDay</th>
  1267. <th class="desc">returns the day of a calendar</th>
  1268. </tr>
  1269. <tr>
  1270. <td class="bold">Format</td>
  1271. <td>time.getDay(calendar)</td>
  1272. </tr>
  1273. </table>
  1274. <table>
  1275. <tr>
  1276. <th class="command">time.getHour</th>
  1277. <th class="desc">returns the hours of a calendar</th>
  1278. </tr>
  1279. <tr>
  1280. <td class="bold">Format</td>
  1281. <td>time.getHour(calendar)</td>
  1282. </tr>
  1283. </table>
  1284. <table>
  1285. <tr>
  1286. <th class="command">time.getMinute</th>
  1287. <th class="desc">returns the minutes of a calendar</th>
  1288. </tr>
  1289. <tr>
  1290. <td class="bold">Format</td>
  1291. <td>time.getMinute(calendar)</td>
  1292. </tr>
  1293. </table>
  1294. <table>
  1295. <tr>
  1296. <th class="command">time.getSecond</th>
  1297. <th class="desc">returns the seconds of a calendar</th>
  1298. </tr>
  1299. <tr>
  1300. <td class="bold">Format</td>
  1301. <td>time.getSecond(calendar)</td>
  1302. </tr>
  1303. </table>
  1304. </section>
  1305. <section id="String">
  1306. <table>
  1307. <tr>
  1308. <th class="command">string</th>
  1309. <th class="desc">returns any object as string</th>
  1310. </tr>
  1311. <tr>
  1312. <td class="bold">Format</td>
  1313. <td>string(object)</td>
  1314. </tr>
  1315. </table>
  1316. <table>
  1317. <tr>
  1318. <th class="command">string.number</th>
  1319. <th class="desc">returns a number as string without unnecessary .0</th>
  1320. </tr>
  1321. <tr>
  1322. <td class="bold">Format</td>
  1323. <td>string.number(number)</td>
  1324. </tr>
  1325. </table>
  1326. <table>
  1327. <tr>
  1328. <th class="command">string.class</th>
  1329. <th class="desc">returns the class of any object</th>
  1330. </tr>
  1331. <tr>
  1332. <td class="bold">Format</td>
  1333. <td>string.class(objekt)</td>
  1334. </tr>
  1335. </table>
  1336. <table>
  1337. <tr>
  1338. <th class="command">string.toUpperCase</th>
  1339. <th class="desc">returns a string capitalized</th>
  1340. </tr>
  1341. <tr>
  1342. <td class="bold">Format</td>
  1343. <td>string.toUpperCase(string)</td>
  1344. </tr>
  1345. </table>
  1346. <table>
  1347. <tr>
  1348. <th class="command">string.toLowerCase</th>
  1349. <th class="desc">returns a string decapitalized</th>
  1350. </tr>
  1351. <tr>
  1352. <td class="bold">Format</td>
  1353. <td>string.toLowerCase(string)</td>
  1354. </tr>
  1355. </table>
  1356. <table>
  1357. <tr>
  1358. <th class="command">string.split</th>
  1359. <th class="desc">returns a string splitted by a given separator as array </th>
  1360. </tr>
  1361. <tr>
  1362. <td class="bold">Format</td>
  1363. <td>string.split(separator, string)</td>
  1364. </tr>
  1365. </table>
  1366. <table>
  1367. <tr>
  1368. <th class="command">string.concat</th>
  1369. <th class="desc">returns one string which connects all given arguments</th>
  1370. </tr>
  1371. <tr>
  1372. <td class="bold">Format</td>
  1373. <td>string.concat(arg, ...)</td>
  1374. </tr>
  1375. </table>
  1376. <table>
  1377. <tr>
  1378. <th class="command">string.startsWith</th>
  1379. <th class="desc">returns true if a string starts with another starting from a given index</th>
  1380. </tr>
  1381. <tr>
  1382. <td class="bold">Format</td>
  1383. <td>string.startsWith(string, search_text, start_index)</td>
  1384. </tr>
  1385. </table>
  1386. <table>
  1387. <tr>
  1388. <th class="command">string.endsWith</th>
  1389. <th class="desc">returns true if a string ends with another</th>
  1390. </tr>
  1391. <tr>
  1392. <td class="bold">Format</td>
  1393. <td>string.endsWith(string, search_text)</td>
  1394. </tr>
  1395. </table>
  1396. <table>
  1397. <tr>
  1398. <th class="command">string.contains</th>
  1399. <th class="desc">returns true if a string is in another</th>
  1400. </tr>
  1401. <tr>
  1402. <td class="bold">Format</td>
  1403. <td>string.contains(string, search_text)</td>
  1404. </tr>
  1405. </table>
  1406. <table>
  1407. <tr>
  1408. <th class="command">string.indexOf</th>
  1409. <th class="desc">returns the index of string in another starting from a given index or -1 if not found</th>
  1410. </tr>
  1411. <tr>
  1412. <td class="bold">Format</td>
  1413. <td>string.indexOf(string, search_text, start_index)</td>
  1414. </tr>
  1415. </table>
  1416. <table>
  1417. <tr>
  1418. <th class="command">string.lastIndexOf</th>
  1419. <th class="desc">returns the last index of a string in another starting from a given index or -1 if not found</th>
  1420. </tr>
  1421. <tr>
  1422. <td class="bold">Format</td>
  1423. <td>string.lastIndexOf(string, search_text, start_index)</td>
  1424. </tr>
  1425. </table>
  1426. <table>
  1427. <tr>
  1428. <th class="command">string.replace</th>
  1429. <th class="desc">replaces all occurrences of a given string in another with a given string</th>
  1430. </tr>
  1431. <tr>
  1432. <td class="bold">Format</td>
  1433. <td>string.replace(string, search_text, swap_text)</td>
  1434. </tr>
  1435. </table>
  1436. <table>
  1437. <tr>
  1438. <th class="command">string.trim</th>
  1439. <th class="desc">returns a string without leading and trailing whitespaces</th>
  1440. </tr>
  1441. <tr>
  1442. <td class="bold">Format</td>
  1443. <td>string.trim(string)</td>
  1444. </tr>
  1445. </table>
  1446. <table>
  1447. <tr>
  1448. <th class="command">string.matches</th>
  1449. <th class="desc">returns true if a string matches a regex</th>
  1450. </tr>
  1451. <tr>
  1452. <td class="bold">Format</td>
  1453. <td>string.matches(string, regex)</td>
  1454. </tr>
  1455. </table>
  1456. <table>
  1457. <tr>
  1458. <th class="command">string.charcode</th>
  1459. <th class="desc">returns the character code of an index in a string</th>
  1460. </tr>
  1461. <tr>
  1462. <td class="bold">Format</td>
  1463. <td>string.charcode(string, index)</td>
  1464. </tr>
  1465. </table>
  1466. <table>
  1467. <tr>
  1468. <th class="command">string.fromCode</th>
  1469. <th class="desc">returns a string from a character code</th>
  1470. </tr>
  1471. <tr>
  1472. <td class="bold">Format</td>
  1473. <td>string.fromCode(character_code)</td>
  1474. </tr>
  1475. </table>
  1476. <table>
  1477. <tr>
  1478. <th class="command">string.length</th>
  1479. <th class="desc">returns the length of a string</th>
  1480. </tr>
  1481. <tr>
  1482. <td class="bold">Format</td>
  1483. <td>string.length(string)</td>
  1484. </tr>
  1485. </table>
  1486. <table>
  1487. <tr>
  1488. <th class="command">string.subString</th>
  1489. <th class="desc">returns a sub string starting at one index and ending at another exclusively</th>
  1490. </tr>
  1491. <tr>
  1492. <td class="bold">Format</td>
  1493. <td>string.subString(string, from_index, to_index)</td>
  1494. </tr>
  1495. </table>
  1496. </section>
  1497. <section id="File">
  1498. <table>
  1499. <tr>
  1500. <th class="command">file.new</th>
  1501. <th class="desc">returns a new file</th>
  1502. </tr>
  1503. <tr>
  1504. <td class="bold">Format</td>
  1505. <td>file.new(path)</td>
  1506. </tr>
  1507. </table>
  1508. <table>
  1509. <tr>
  1510. <th class="command">file.exists</th>
  1511. <th class="desc">returns true if a file exists</th>
  1512. </tr>
  1513. <tr>
  1514. <td class="bold">Format</td>
  1515. <td>file.exists(file)</td>
  1516. </tr>
  1517. </table>
  1518. <table>
  1519. <tr>
  1520. <th class="command">file.delete</th>
  1521. <th class="desc">removes a file and returns true on success</th>
  1522. </tr>
  1523. <tr>
  1524. <td class="bold">Format</td>
  1525. <td>file.delete(file)</td>
  1526. </tr>
  1527. </table>
  1528. <table>
  1529. <tr>
  1530. <th class="command">file.getName</th>
  1531. <th class="desc">returns the name of a file</th>
  1532. </tr>
  1533. <tr>
  1534. <td class="bold">Format</td>
  1535. <td>file.getName(file)</td>
  1536. </tr>
  1537. </table>
  1538. <table>
  1539. <tr>
  1540. <th class="command">file.getList</th>
  1541. <th class="desc">returns all files in a folder as list</th>
  1542. </tr>
  1543. <tr>
  1544. <td class="bold">Format</td>
  1545. <td>file.getList(file)</td>
  1546. </tr>
  1547. </table>
  1548. <table>
  1549. <tr>
  1550. <th class="command">file.read</th>
  1551. <th class="desc">returns all lines in a file as list</th>
  1552. </tr>
  1553. <tr>
  1554. <td class="bold">Format</td>
  1555. <td>file.read(file)</td>
  1556. </tr>
  1557. </table>
  1558. <table>
  1559. <tr>
  1560. <th class="command">file.write</th>
  1561. <th class="desc">writes all entries of a list to a file</th>
  1562. </tr>
  1563. <tr>
  1564. <td class="bold">Format</td>
  1565. <td>file.write(file, list)</td>
  1566. </tr>
  1567. </table>
  1568. <table>
  1569. <tr>
  1570. <th class="command">file.isFile</th>
  1571. <th class="desc">returns true if a file is a file</th>
  1572. </tr>
  1573. <tr>
  1574. <td class="bold">Format</td>
  1575. <td>file.isFile(file)</td>
  1576. </tr>
  1577. </table>
  1578. <table>
  1579. <tr>
  1580. <th class="command">file.isDirectory</th>
  1581. <th class="desc">returns true if a file is a directory</th>
  1582. </tr>
  1583. <tr>
  1584. <td class="bold">Format</td>
  1585. <td>file.isDirectory(file)</td>
  1586. </tr>
  1587. </table>
  1588. </section>
  1589. <section id="Config">
  1590. <table>
  1591. <tr>
  1592. <th class="command">config.new</th>
  1593. <th class="desc">returns a new config</th>
  1594. </tr>
  1595. <tr>
  1596. <td class="bold">Format</td>
  1597. <td>config.new(path, name)</td>
  1598. </tr>
  1599. </table>
  1600. <table>
  1601. <tr>
  1602. <th class="command">config.exists</th>
  1603. <th class="desc">returns true if the config exists</th>
  1604. </tr>
  1605. <tr>
  1606. <td class="bold">Format</td>
  1607. <td>config.exists(config)</td>
  1608. </tr>
  1609. </table>
  1610. <table>
  1611. <tr>
  1612. <th class="command">config.save</th>
  1613. <th class="desc">saves a config and returns true on success</th>
  1614. </tr>
  1615. <tr>
  1616. <td class="bold">Format</td>
  1617. <td>config.save(config)</td>
  1618. </tr>
  1619. </table>
  1620. <table>
  1621. <tr>
  1622. <th class="command">config.load</th>
  1623. <th class="desc">loads a config</th>
  1624. </tr>
  1625. <tr>
  1626. <td class="bold">Format</td>
  1627. <td>config.load(config)</td>
  1628. </tr>
  1629. </table>
  1630. <table>
  1631. <tr>
  1632. <th class="command">config.delete</th>
  1633. <th class="desc">removes a config</th>
  1634. </tr>
  1635. <tr>
  1636. <td class="bold">Format</td>
  1637. <td>config.delete(config)</td>
  1638. </tr>
  1639. </table>
  1640. <table>
  1641. <tr>
  1642. <th class="command">config.set</th>
  1643. <th class="desc">sets a key value pair in a config</th>
  1644. </tr>
  1645. <tr>
  1646. <td class="bold">Format</td>
  1647. <td>config.set(config, key, value)</td>
  1648. </tr>
  1649. </table>
  1650. <table>
  1651. <tr>
  1652. <th class="command">config.getBool</th>
  1653. <th class="desc">returns a boolean or a default value from a config key</th>
  1654. </tr>
  1655. <tr>
  1656. <td class="bold">Format</td>
  1657. <td>config.getBool(config, key, default)</td>
  1658. </tr>
  1659. </table>
  1660. <table>
  1661. <tr>
  1662. <th class="command">config.getDouble</th>
  1663. <th class="desc">returns a double or a default value from a config key</th>
  1664. </tr>
  1665. <tr>
  1666. <td class="bold">Format</td>
  1667. <td>config.getDouble(config, key, default)</td>
  1668. </tr>
  1669. </table>
  1670. <table>
  1671. <tr>
  1672. <th class="command">config.getString</th>
  1673. <th class="desc">returns a string or a default value from a config key</th>
  1674. </tr>
  1675. <tr>
  1676. <td class="bold">Format</td>
  1677. <td>config.getString(config, key, default)</td>
  1678. </tr>
  1679. </table>
  1680. </section>