docu_core.php 48 KB

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