docu_core.php 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796
  1. <section id="General">
  2. <table>
  3. <tr>
  4. <th class="command">
  5. + - * / % = += -= *= /= %= ++ -- &lt;&lt;=
  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. <table>
  567. <tr>
  568. <th class="command">bit.leftShift</th>
  569. <th class="desc">&lt;&lt;</th>
  570. </tr>
  571. <tr>
  572. <td class="bold">Format</td>
  573. <td>bit.leftShift(value, value)</td>
  574. </tr>
  575. <tr>
  576. <td class="bold">Returns</td>
  577. <td>the left shifted value</td>
  578. </tr>
  579. </table>
  580. <table>
  581. <tr>
  582. <th class="command">bit.rightShift</th>
  583. <th class="desc">&gt;&gt;</th>
  584. </tr>
  585. <tr>
  586. <td class="bold">Format</td>
  587. <td>bit.rightShift(value, value)</td>
  588. </tr>
  589. <tr>
  590. <td class="bold">Returns</td>
  591. <td>the right shifted value</td>
  592. </tr>
  593. </table>
  594. <table>
  595. <tr>
  596. <th class="command">bit.and</th>
  597. <th class="desc">&</th>
  598. </tr>
  599. <tr>
  600. <td class="bold">Format</td>
  601. <td>bit.and(value, value)</td>
  602. </tr>
  603. <tr>
  604. <td class="bold">Returns</td>
  605. <td>the and value</td>
  606. </tr>
  607. </table>
  608. <table>
  609. <tr>
  610. <th class="command">bit.or</th>
  611. <th class="desc">|</th>
  612. </tr>
  613. <tr>
  614. <td class="bold">Format</td>
  615. <td>bit.or(value, value)</td>
  616. </tr>
  617. <tr>
  618. <td class="bold">Returns</td>
  619. <td>the or value</td>
  620. </tr>
  621. </table>
  622. <table>
  623. <tr>
  624. <th class="command">bit.xor</th>
  625. <th class="desc">^</th>
  626. </tr>
  627. <tr>
  628. <td class="bold">Format</td>
  629. <td>bit.xor(value, value)</td>
  630. </tr>
  631. <tr>
  632. <td class="bold">Returns</td>
  633. <td>the xor value</td>
  634. </tr>
  635. </table>
  636. <table>
  637. <tr>
  638. <th class="command">bit.invert</th>
  639. <th class="desc">~</th>
  640. </tr>
  641. <tr>
  642. <td class="bold">Format</td>
  643. <td>bit.invert(value)</td>
  644. </tr>
  645. <tr>
  646. <td class="bold">Returns</td>
  647. <td>the inverted value</td>
  648. </tr>
  649. </table>
  650. </section>
  651. <section id="Math">
  652. <table>
  653. <tr>
  654. <th class="command">math.min</th>
  655. <th class="desc">returns the lower value</th>
  656. </tr>
  657. <tr>
  658. <td class="bold">Format</td>
  659. <td>math.min(value1, value2)</td>
  660. </tr>
  661. </table>
  662. <table>
  663. <tr>
  664. <th class="command">math.max</th>
  665. <th class="desc">returns the higher value</th>
  666. </tr>
  667. <tr>
  668. <td class="bold">Format</td>
  669. <td>math.max(value1, value2)</td>
  670. </tr>
  671. </table>
  672. <table>
  673. <tr>
  674. <th class="command">math.abs</th>
  675. <th class="desc">returns the absolute value of a value</th>
  676. </tr>
  677. <tr>
  678. <td class="bold">Format</td>
  679. <td>math.abs(value)</td>
  680. </tr>
  681. </table>
  682. <table>
  683. <tr>
  684. <th class="command">math.pow</th>
  685. <th class="desc">returns a value to the power of another</th>
  686. </tr>
  687. <tr>
  688. <td class="bold">Format</td>
  689. <td>math.pow(value, power)</td>
  690. </tr>
  691. </table>
  692. <table>
  693. <tr>
  694. <th class="command">math.root</th>
  695. <th class="desc">returns the given root of a value</th>
  696. </tr>
  697. <tr>
  698. <td class="bold">Format</td>
  699. <td>math.root(value, root)</td>
  700. </tr>
  701. </table>
  702. <table>
  703. <tr>
  704. <th class="command">math.sqrt</th>
  705. <th class="desc">returns the square root a value</th>
  706. </tr>
  707. <tr>
  708. <td class="bold">Format</td>
  709. <td>math.sqrt(value)</td>
  710. </tr>
  711. </table>
  712. <table>
  713. <tr>
  714. <th class="command">math.hypot</th>
  715. <th class="desc">returns sqrt(x&sup2; + y&sup2;)</th>
  716. </tr>
  717. <tr>
  718. <td class="bold">Format</td>
  719. <td>math.hypot(x, y)</td>
  720. </tr>
  721. </table>
  722. <table>
  723. <tr>
  724. <th class="command">math.sin</th>
  725. <th class="desc">returns the sine of a value</th>
  726. </tr>
  727. <tr>
  728. <td class="bold">Format</td>
  729. <td>math.sin(value)</td>
  730. </tr>
  731. </table>
  732. <table>
  733. <tr>
  734. <th class="command">math.cos</th>
  735. <th class="desc">returns the cosine of a value</th>
  736. </tr>
  737. <tr>
  738. <td class="bold">Format</td>
  739. <td>math.cos(value)</td>
  740. </tr>
  741. </table>
  742. <table>
  743. <tr>
  744. <th class="command">math.tan</th>
  745. <th class="desc">returns the tangent of a value</th>
  746. </tr>
  747. <tr>
  748. <td class="bold">Format</td>
  749. <td>math.tan(value)</td>
  750. </tr>
  751. </table>
  752. <table>
  753. <tr>
  754. <th class="command">math.asin</th>
  755. <th class="desc">returns the arcsine of a value</th>
  756. </tr>
  757. <tr>
  758. <td class="bold">Format</td>
  759. <td>math.asin(value)</td>
  760. </tr>
  761. </table>
  762. <table>
  763. <tr>
  764. <th class="command">math.acos</th>
  765. <th class="desc">returns the arccosine of a value</th>
  766. </tr>
  767. <tr>
  768. <td class="bold">Format</td>
  769. <td>math.acos(value)</td>
  770. </tr>
  771. </table>
  772. <table>
  773. <tr>
  774. <th class="command">math.atan</th>
  775. <th class="desc">returns the arctangent of a value</th>
  776. </tr>
  777. <tr>
  778. <td class="bold">Format</td>
  779. <td>math.atan(value)</td>
  780. </tr>
  781. </table>
  782. <table>
  783. <tr>
  784. <th class="command">math.e</th>
  785. <th class="desc">returns Euler's number</th>
  786. </tr>
  787. <tr>
  788. <td class="bold">Format</td>
  789. <td>math.e()</td>
  790. </tr>
  791. </table>
  792. <table>
  793. <tr>
  794. <th class="command">math.pi</th>
  795. <th class="desc">returns pi</th>
  796. </tr>
  797. <tr>
  798. <td class="bold">Format</td>
  799. <td>math.pi()</td>
  800. </tr>
  801. </table>
  802. <table>
  803. <tr>
  804. <th class="command">math.ln</th>
  805. <th class="desc">returns the natural logarithm of a value</th>
  806. </tr>
  807. <tr>
  808. <td class="bold">Format</td>
  809. <td>math.ln(value)</td>
  810. </tr>
  811. </table>
  812. <table>
  813. <tr>
  814. <th class="command">math.log</th>
  815. <th class="desc">returns the decadic logarithm of a value</th>
  816. </tr>
  817. <tr>
  818. <td class="bold">Format</td>
  819. <td>math.log(value)</td>
  820. </tr>
  821. </table>
  822. <table>
  823. <tr>
  824. <th class="command">math.random</th>
  825. <th class="desc">returns a random natural number between both values including both borders</th>
  826. </tr>
  827. <tr>
  828. <td class="bold">Format</td>
  829. <td>math.random(from, to)</td>
  830. </tr>
  831. </table>
  832. <table>
  833. <tr>
  834. <th class="command">math.round</th>
  835. <th class="desc">returns a value rounded</th>
  836. </tr>
  837. <tr>
  838. <td class="bold">Format</td>
  839. <td>math.round(value)</td>
  840. </tr>
  841. </table>
  842. <table>
  843. <tr>
  844. <th class="command">math.roundUp</th>
  845. <th class="desc">returns a value rounded up</th>
  846. </tr>
  847. <tr>
  848. <td class="bold">Format</td>
  849. <td>math.roundUp(value)</td>
  850. </tr>
  851. </table>
  852. <table>
  853. <tr>
  854. <th class="command">math.roundDown</th>
  855. <th class="desc">returns a value rounded down</th>
  856. </tr>
  857. <tr>
  858. <td class="bold">Format</td>
  859. <td>math.roundDown(value)</td>
  860. </tr>
  861. </table>
  862. <table>
  863. <tr>
  864. <th class="command">math.roundComma</th>
  865. <th class="desc">returns a value rounded to a specific number of decimals</th>
  866. </tr>
  867. <tr>
  868. <td class="bold">Format</td>
  869. <td>math.roundComma(value, number_of_dezimals)</td>
  870. </tr>
  871. </table>
  872. </section>
  873. <section id="List">
  874. <table>
  875. <tr>
  876. <th class="command">list.new</th>
  877. <th class="desc">returns a new list</th>
  878. </tr>
  879. <tr>
  880. <td class="bold">Format</td>
  881. <td>list.new()</td>
  882. </tr>
  883. </table>
  884. <table>
  885. <tr>
  886. <th class="command">list.exists</th>
  887. <th class="desc">returns true if the given value is a list</th>
  888. </tr>
  889. <tr>
  890. <td class="bold">Format</td>
  891. <td>list.exists(value)</td>
  892. </tr>
  893. </table>
  894. <table>
  895. <tr>
  896. <th class="command">list.add</th>
  897. <th class="desc">adds an element to a list</th>
  898. </tr>
  899. <tr>
  900. <td class="bold">Format</td>
  901. <td>list.add(list, element)</td>
  902. </tr>
  903. </table>
  904. <table>
  905. <tr>
  906. <th class="command">list.addAll</th>
  907. <th class="desc">adds all given elements to the list</th>
  908. </tr>
  909. <tr>
  910. <td class="bold">Format</td>
  911. <td>list.addAll(List, element, ...)</td>
  912. </tr>
  913. </table>
  914. <table>
  915. <tr>
  916. <th class="command">list.remove</th>
  917. <th class="desc">removes an element from a list and returns true on success</th>
  918. </tr>
  919. <tr>
  920. <td class="bold">Format</td>
  921. <td>list.remove(list, element)</td>
  922. </tr>
  923. </table>
  924. <table>
  925. <tr>
  926. <th class="command">list.removeIndex</th>
  927. <th class="desc">removes an element from a list at the given index and returns true on success</th>
  928. </tr>
  929. <tr>
  930. <td class="bold">Format</td>
  931. <td>list.removeIndex(list, index)</td>
  932. </tr>
  933. </table>
  934. <table>
  935. <tr>
  936. <th class="command">list.contains</th>
  937. <th class="desc">returns true if a list contains a given element</th>
  938. </tr>
  939. <tr>
  940. <td class="bold">Format</td>
  941. <td>list.contains(list, element)</td>
  942. </tr>
  943. </table>
  944. <table>
  945. <tr>
  946. <th class="command">list.getSize</th>
  947. <th class="desc">returns the size of a list</th>
  948. </tr>
  949. <tr>
  950. <td class="bold">Format</td>
  951. <td>list.getSize(list)</td>
  952. </tr>
  953. </table>
  954. <table>
  955. <tr>
  956. <th class="command">list.getIndex</th>
  957. <th class="desc">returns the element at a given index of a list</th>
  958. </tr>
  959. <tr>
  960. <td class="bold">Format</td>
  961. <td>list.getIndex(list, index)</td>
  962. </tr>
  963. <tr>
  964. <td class="bold">Alias</td>
  965. <td>list.get(list, index)</td>
  966. </tr>
  967. </table>
  968. <table>
  969. <tr>
  970. <th class="command">list.setIndex</th>
  971. <th class="desc">sets the element at a given index of a list and returns the old element</th>
  972. </tr>
  973. <tr>
  974. <td class="bold">Format</td>
  975. <td>list.setIndex(list, index, element)</td>
  976. </tr>
  977. </table>
  978. <table>
  979. <tr>
  980. <th class="command">list.getIndexOf</th>
  981. <th class="desc">returns the index of a given element in a list or -1 if the list does not contain the element</th>
  982. </tr>
  983. <tr>
  984. <td class="bold">Format</td>
  985. <td>list.getIndexOf(list, element)</td>
  986. </tr>
  987. </table>
  988. <table>
  989. <tr>
  990. <th class="command">list.clear</th>
  991. <th class="desc">removes all elements of a list</th>
  992. </tr>
  993. <tr>
  994. <td class="bold">Format</td>
  995. <td>list.clear(list)</td>
  996. </tr>
  997. </table>
  998. <table>
  999. <tr>
  1000. <th class="command">list.sort</th>
  1001. <th class="desc">sorts a list</th>
  1002. </tr>
  1003. <tr>
  1004. <td class="bold">Format</td>
  1005. <td>list.sort(list)</td>
  1006. </tr>
  1007. </table>
  1008. <table>
  1009. <tr>
  1010. <th class="command">list.reverse</th>
  1011. <th class="desc">reverses the order of a list</th>
  1012. </tr>
  1013. <tr>
  1014. <td class="bold">Format</td>
  1015. <td>list.reverse(list)</td>
  1016. </tr>
  1017. </table>
  1018. <table>
  1019. <tr>
  1020. <th class="command">list.shuffle</th>
  1021. <th class="desc">shuffles a list</th>
  1022. </tr>
  1023. <tr>
  1024. <td class="bold">Format</td>
  1025. <td>list.shuffle(list)</td>
  1026. </tr>
  1027. </table>
  1028. <table>
  1029. <tr>
  1030. <th class="command">list.iterator (deprecated)</th>
  1031. <th class="desc">returns the iterator of a list</th>
  1032. </tr>
  1033. <tr>
  1034. <td class="bold">Format</td>
  1035. <td>list.iterator(list)</td>
  1036. </tr>
  1037. </table>
  1038. </section>
  1039. <section id="Map">
  1040. <table>
  1041. <tr>
  1042. <th class="command">map.new</th>
  1043. <th class="desc">returns a new map</th>
  1044. </tr>
  1045. <tr>
  1046. <td class="bold">Format</td>
  1047. <td>map.new()</td>
  1048. </tr>
  1049. </table>
  1050. <table>
  1051. <tr>
  1052. <th class="command">map.exists</th>
  1053. <th class="desc">returns true if the given value is a map</th>
  1054. </tr>
  1055. <tr>
  1056. <td class="bold">Format</td>
  1057. <td>map.exists(value)</td>
  1058. </tr>
  1059. </table>
  1060. <table>
  1061. <tr>
  1062. <th class="command">map.add</th>
  1063. <th class="desc">adds a key value pair to a map and returns the old value</th>
  1064. </tr>
  1065. <tr>
  1066. <td class="bold">Format</td>
  1067. <td>map.add(map, key, value)</td>
  1068. </tr>
  1069. </table>
  1070. <table>
  1071. <tr>
  1072. <th class="command">map.remove</th>
  1073. <th class="desc">removes a key from a map and returns the old value</th>
  1074. </tr>
  1075. <tr>
  1076. <td class="bold">Format</td>
  1077. <td>map.remove(map, key)</td>
  1078. </tr>
  1079. </table>
  1080. <table>
  1081. <tr>
  1082. <th class="command">map.contains</th>
  1083. <th class="desc">returns true if a map contains a given key</th>
  1084. </tr>
  1085. <tr>
  1086. <td class="bold">Format</td>
  1087. <td>map.contains(map, key)</td>
  1088. </tr>
  1089. </table>
  1090. <table>
  1091. <tr>
  1092. <th class="command">map.getSize</th>
  1093. <th class="desc">returns the size of a map</th>
  1094. </tr>
  1095. <tr>
  1096. <td class="bold">Format</td>
  1097. <td>map.getSize(map)</td>
  1098. </tr>
  1099. </table>
  1100. <table>
  1101. <tr>
  1102. <th class="command">map.get</th>
  1103. <th class="desc">returns the value associated with a key in a map</th>
  1104. </tr>
  1105. <tr>
  1106. <td class="bold">Format</td>
  1107. <td>map.get(map, key)</td>
  1108. </tr>
  1109. </table>
  1110. <table>
  1111. <tr>
  1112. <th class="command">map.getOrDefault</th>
  1113. <th class="desc">returns the value associated with a key in a map or the default value if the key is not present</th>
  1114. </tr>
  1115. <tr>
  1116. <td class="bold">Format</td>
  1117. <td>map.getOrDefault(map, key, default)</td>
  1118. </tr>
  1119. </table>
  1120. <table>
  1121. <tr>
  1122. <th class="command">map.iterator</th>
  1123. <th class="desc">returns the iterator of a map</th>
  1124. </tr>
  1125. <tr>
  1126. <td class="bold">Format</td>
  1127. <td>map.iterator(map)</td>
  1128. </tr>
  1129. </table>
  1130. <table>
  1131. <tr>
  1132. <th class="command">map.getKey</th>
  1133. <th class="desc">returns the key</th>
  1134. </tr>
  1135. <tr>
  1136. <td class="bold">Format</td>
  1137. <td>map.getKey(iterator_element)</td>
  1138. </tr>
  1139. </table>
  1140. <table>
  1141. <tr>
  1142. <th class="command">map.getValue</th>
  1143. <th class="desc">returns the value</th>
  1144. </tr>
  1145. <tr>
  1146. <td class="bold">Format</td>
  1147. <td>map.getValue(iterator_element)</td>
  1148. </tr>
  1149. </table>
  1150. <table>
  1151. <tr>
  1152. <th class="command">map.setValue</th>
  1153. <th class="desc">sets the newValue and returns the oldValue</th>
  1154. </tr>
  1155. <tr>
  1156. <td class="bold">Format</td>
  1157. <td>map.setValue(iterator_element, newValue)</td>
  1158. </tr>
  1159. </table>
  1160. <table>
  1161. <tr>
  1162. <th class="command">map.clear</th>
  1163. <th class="desc">removes all key value pairs from a map</th>
  1164. </tr>
  1165. <tr>
  1166. <td class="bold">Format</td>
  1167. <td>map.clear(map)</td>
  1168. </tr>
  1169. </table>
  1170. </section>
  1171. <section id="Set">
  1172. <table>
  1173. <tr>
  1174. <th class="command">set.new</th>
  1175. <th class="desc">returns a new set</th>
  1176. </tr>
  1177. <tr>
  1178. <td class="bold">Format</td>
  1179. <td>set.new()</td>
  1180. </tr>
  1181. </table>
  1182. <table>
  1183. <tr>
  1184. <th class="command">set.exists</th>
  1185. <th class="desc">returns true if the given value is a set</th>
  1186. </tr>
  1187. <tr>
  1188. <td class="bold">Format</td>
  1189. <td>set.exists(value)</td>
  1190. </tr>
  1191. </table>
  1192. <table>
  1193. <tr>
  1194. <th class="command">set.add</th>
  1195. <th class="desc">adds a key to a set and returns true if the key was added</th>
  1196. </tr>
  1197. <tr>
  1198. <td class="bold">Format</td>
  1199. <td>set.add(set, key)</td>
  1200. </tr>
  1201. </table>
  1202. <table>
  1203. <tr>
  1204. <th class="command">set.addAll</th>
  1205. <th class="desc">adds all given keys to a set</th>
  1206. </tr>
  1207. <tr>
  1208. <td class="bold">Format</td>
  1209. <td>set.addAll(set, key, ...)</td>
  1210. </tr>
  1211. </table>
  1212. <table>
  1213. <tr>
  1214. <th class="command">set.remove</th>
  1215. <th class="desc">removes a key from a set and returns true if the key was removed</th>
  1216. </tr>
  1217. <tr>
  1218. <td class="bold">Format</td>
  1219. <td>set.remove(set, key)</td>
  1220. </tr>
  1221. </table>
  1222. <table>
  1223. <tr>
  1224. <th class="command">set.contains</th>
  1225. <th class="desc">returns true if a set contains a given key</th>
  1226. </tr>
  1227. <tr>
  1228. <td class="bold">Format</td>
  1229. <td>set.contains(set, key)</td>
  1230. </tr>
  1231. </table>
  1232. <table>
  1233. <tr>
  1234. <th class="command">set.getSize</th>
  1235. <th class="desc">returns the size of a set</th>
  1236. </tr>
  1237. <tr>
  1238. <td class="bold">Format</td>
  1239. <td>set.getSize(set)</td>
  1240. </tr>
  1241. </table>
  1242. <table>
  1243. <tr>
  1244. <th class="command">set.clear</th>
  1245. <th class="desc">removes all keys from a map</th>
  1246. </tr>
  1247. <tr>
  1248. <td class="bold">Format</td>
  1249. <td>set.clear(set)</td>
  1250. </tr>
  1251. </table>
  1252. <table>
  1253. <tr>
  1254. <th class="command">set.toList</th>
  1255. <th class="desc">returns all keys of a set as list</th>
  1256. </tr>
  1257. <tr>
  1258. <td class="bold">Format</td>
  1259. <td>set.toList(set)</td>
  1260. </tr>
  1261. </table>
  1262. <table>
  1263. <tr>
  1264. <th class="command">set.iterator (deprecated)</th>
  1265. <th class="desc">returns the iterator of a set</th>
  1266. </tr>
  1267. <tr>
  1268. <td class="bold">Format</td>
  1269. <td>set.iterator(set)</td>
  1270. </tr>
  1271. </table>
  1272. </section>
  1273. <section id="Time">
  1274. <table>
  1275. <tr>
  1276. <th class="command">time.new</th>
  1277. <th class="desc">returns a calendar of a given time in milliseconds</th>
  1278. </tr>
  1279. <tr>
  1280. <td class="bold">Format</td>
  1281. <td>time.new(time_millis)</td>
  1282. </tr>
  1283. <tr>
  1284. <td class="bold">Arguments</td>
  1285. <td>time_millis are milliseconds passed since 01.01.1970</td>
  1286. </tr>
  1287. </table>
  1288. <table>
  1289. <tr>
  1290. <th class="command">time.getMillis</th>
  1291. <th class="desc">returns the current millisecond time</th>
  1292. </tr>
  1293. <tr>
  1294. <td class="bold">Format</td>
  1295. <td>time.getMillis()</td>
  1296. </tr>
  1297. </table>
  1298. <table>
  1299. <tr>
  1300. <th class="command">time.getNanos</th>
  1301. <th class="desc">returns the current nanosecond time of the whole engine</th>
  1302. </tr>
  1303. <tr>
  1304. <td class="bold">Format</td>
  1305. <td>time.getNanos()</td>
  1306. </tr>
  1307. </table>
  1308. <table>
  1309. <tr>
  1310. <th class="command">time.from</th>
  1311. <th class="desc">returns the millisecond time of a calendar</th>
  1312. </tr>
  1313. <tr>
  1314. <td class="bold">Format</td>
  1315. <td>time.from(calendar)</td>
  1316. </tr>
  1317. </table>
  1318. <table>
  1319. <tr>
  1320. <th class="command">time.nextDay</th>
  1321. <th class="desc">sets the time of a calendar to the beginning of the next day</th>
  1322. </tr>
  1323. <tr>
  1324. <td class="bold">Format</td>
  1325. <td>time.nextDay(calendar)</td>
  1326. </tr>
  1327. </table>
  1328. <table>
  1329. <tr>
  1330. <th class="command">time.getYear</th>
  1331. <th class="desc">returns the year of a calendar</th>
  1332. </tr>
  1333. <tr>
  1334. <td class="bold">Format</td>
  1335. <td>time.getYear(calendar)</td>
  1336. </tr>
  1337. </table>
  1338. <table>
  1339. <tr>
  1340. <th class="command">time.getMonth</th>
  1341. <th class="desc">returns the month of a calendar</th>
  1342. </tr>
  1343. <tr>
  1344. <td class="bold">Format</td>
  1345. <td>time.getMonth(calendar)</td>
  1346. </tr>
  1347. </table>
  1348. <table>
  1349. <tr>
  1350. <th class="command">time.getDay</th>
  1351. <th class="desc">returns the day of a calendar</th>
  1352. </tr>
  1353. <tr>
  1354. <td class="bold">Format</td>
  1355. <td>time.getDay(calendar)</td>
  1356. </tr>
  1357. </table>
  1358. <table>
  1359. <tr>
  1360. <th class="command">time.getHour</th>
  1361. <th class="desc">returns the hours of a calendar</th>
  1362. </tr>
  1363. <tr>
  1364. <td class="bold">Format</td>
  1365. <td>time.getHour(calendar)</td>
  1366. </tr>
  1367. </table>
  1368. <table>
  1369. <tr>
  1370. <th class="command">time.getMinute</th>
  1371. <th class="desc">returns the minutes of a calendar</th>
  1372. </tr>
  1373. <tr>
  1374. <td class="bold">Format</td>
  1375. <td>time.getMinute(calendar)</td>
  1376. </tr>
  1377. </table>
  1378. <table>
  1379. <tr>
  1380. <th class="command">time.getSecond</th>
  1381. <th class="desc">returns the seconds of a calendar</th>
  1382. </tr>
  1383. <tr>
  1384. <td class="bold">Format</td>
  1385. <td>time.getSecond(calendar)</td>
  1386. </tr>
  1387. </table>
  1388. <table>
  1389. <tr>
  1390. <th class="command">time.parse</th>
  1391. <th class="desc">returns a calendar</th>
  1392. </tr>
  1393. <tr>
  1394. <td class="bold">Format</td>
  1395. <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>
  1396. </tr>
  1397. </table>
  1398. </section>
  1399. <section id="String">
  1400. <table>
  1401. <tr>
  1402. <th class="command">string</th>
  1403. <th class="desc">returns any object as string</th>
  1404. </tr>
  1405. <tr>
  1406. <td class="bold">Format</td>
  1407. <td>string(object)</td>
  1408. </tr>
  1409. </table>
  1410. <table>
  1411. <tr>
  1412. <th class="command">string.number</th>
  1413. <th class="desc">returns a number as string without unnecessary .0</th>
  1414. </tr>
  1415. <tr>
  1416. <td class="bold">Format</td>
  1417. <td>string.number(number)</td>
  1418. </tr>
  1419. </table>
  1420. <table>
  1421. <tr>
  1422. <th class="command">string.class</th>
  1423. <th class="desc">returns the class of any object</th>
  1424. </tr>
  1425. <tr>
  1426. <td class="bold">Format</td>
  1427. <td>string.class(objekt)</td>
  1428. </tr>
  1429. </table>
  1430. <table>
  1431. <tr>
  1432. <th class="command">string.toUpperCase</th>
  1433. <th class="desc">returns a string capitalized</th>
  1434. </tr>
  1435. <tr>
  1436. <td class="bold">Format</td>
  1437. <td>string.toUpperCase(string)</td>
  1438. </tr>
  1439. </table>
  1440. <table>
  1441. <tr>
  1442. <th class="command">string.toLowerCase</th>
  1443. <th class="desc">returns a string decapitalized</th>
  1444. </tr>
  1445. <tr>
  1446. <td class="bold">Format</td>
  1447. <td>string.toLowerCase(string)</td>
  1448. </tr>
  1449. </table>
  1450. <table>
  1451. <tr>
  1452. <th class="command">string.split</th>
  1453. <th class="desc">returns a string splitted by a given separator as array </th>
  1454. </tr>
  1455. <tr>
  1456. <td class="bold">Format</td>
  1457. <td>string.split(separator, string)</td>
  1458. </tr>
  1459. </table>
  1460. <table>
  1461. <tr>
  1462. <th class="command">string.concat</th>
  1463. <th class="desc">returns one string which connects all given arguments</th>
  1464. </tr>
  1465. <tr>
  1466. <td class="bold">Format</td>
  1467. <td>string.concat(arg, ...)</td>
  1468. </tr>
  1469. </table>
  1470. <table>
  1471. <tr>
  1472. <th class="command">string.startsWith</th>
  1473. <th class="desc">returns true if a string starts with another starting from a given index</th>
  1474. </tr>
  1475. <tr>
  1476. <td class="bold">Format</td>
  1477. <td>string.startsWith(string, search_text, start_index)</td>
  1478. </tr>
  1479. </table>
  1480. <table>
  1481. <tr>
  1482. <th class="command">string.endsWith</th>
  1483. <th class="desc">returns true if a string ends with another</th>
  1484. </tr>
  1485. <tr>
  1486. <td class="bold">Format</td>
  1487. <td>string.endsWith(string, search_text)</td>
  1488. </tr>
  1489. </table>
  1490. <table>
  1491. <tr>
  1492. <th class="command">string.contains</th>
  1493. <th class="desc">returns true if a string is in another</th>
  1494. </tr>
  1495. <tr>
  1496. <td class="bold">Format</td>
  1497. <td>string.contains(string, search_text)</td>
  1498. </tr>
  1499. </table>
  1500. <table>
  1501. <tr>
  1502. <th class="command">string.indexOf</th>
  1503. <th class="desc">returns the index of string in another starting from a given index or -1 if not found</th>
  1504. </tr>
  1505. <tr>
  1506. <td class="bold">Format</td>
  1507. <td>string.indexOf(string, search_text, start_index)</td>
  1508. </tr>
  1509. </table>
  1510. <table>
  1511. <tr>
  1512. <th class="command">string.lastIndexOf</th>
  1513. <th class="desc">returns the last index of a string in another starting from a given index or -1 if not found</th>
  1514. </tr>
  1515. <tr>
  1516. <td class="bold">Format</td>
  1517. <td>string.lastIndexOf(string, search_text, start_index)</td>
  1518. </tr>
  1519. </table>
  1520. <table>
  1521. <tr>
  1522. <th class="command">string.replace</th>
  1523. <th class="desc">returns string where all occurrences in a given string of a given string are replaced with another given string</th>
  1524. </tr>
  1525. <tr>
  1526. <td class="bold">Format</td>
  1527. <td>string.replace(string, search_text, swap_text)</td>
  1528. </tr>
  1529. </table>
  1530. <table>
  1531. <tr>
  1532. <th class="command">string.trim</th>
  1533. <th class="desc">returns a string without leading and trailing whitespaces</th>
  1534. </tr>
  1535. <tr>
  1536. <td class="bold">Format</td>
  1537. <td>string.trim(string)</td>
  1538. </tr>
  1539. </table>
  1540. <table>
  1541. <tr>
  1542. <th class="command">string.matches</th>
  1543. <th class="desc">returns true if a string matches a regex</th>
  1544. </tr>
  1545. <tr>
  1546. <td class="bold">Format</td>
  1547. <td>string.matches(string, regex)</td>
  1548. </tr>
  1549. </table>
  1550. <table>
  1551. <tr>
  1552. <th class="command">string.charcode</th>
  1553. <th class="desc">returns the character code of an index in a string</th>
  1554. </tr>
  1555. <tr>
  1556. <td class="bold">Format</td>
  1557. <td>string.charcode(string, index)</td>
  1558. </tr>
  1559. </table>
  1560. <table>
  1561. <tr>
  1562. <th class="command">string.fromCode</th>
  1563. <th class="desc">returns a string from a character code</th>
  1564. </tr>
  1565. <tr>
  1566. <td class="bold">Format</td>
  1567. <td>string.fromCode(character_code)</td>
  1568. </tr>
  1569. </table>
  1570. <table>
  1571. <tr>
  1572. <th class="command">string.length</th>
  1573. <th class="desc">returns the length of a string</th>
  1574. </tr>
  1575. <tr>
  1576. <td class="bold">Format</td>
  1577. <td>string.length(string)</td>
  1578. </tr>
  1579. </table>
  1580. <table>
  1581. <tr>
  1582. <th class="command">string.subString</th>
  1583. <th class="desc">returns a sub string starting at one index and ending at another exclusively</th>
  1584. </tr>
  1585. <tr>
  1586. <td class="bold">Format</td>
  1587. <td>string.subString(string, from_index, to_index)</td>
  1588. </tr>
  1589. </table>
  1590. </section>
  1591. <section id="File">
  1592. <table>
  1593. <tr>
  1594. <th class="command">file.new</th>
  1595. <th class="desc">returns a new file</th>
  1596. </tr>
  1597. <tr>
  1598. <td class="bold">Format</td>
  1599. <td>file.new(path)</td>
  1600. </tr>
  1601. </table>
  1602. <table>
  1603. <tr>
  1604. <th class="command">file.exists</th>
  1605. <th class="desc">returns true if a file exists</th>
  1606. </tr>
  1607. <tr>
  1608. <td class="bold">Format</td>
  1609. <td>file.exists(file)</td>
  1610. </tr>
  1611. </table>
  1612. <table>
  1613. <tr>
  1614. <th class="command">file.delete</th>
  1615. <th class="desc">removes a file and returns true on success</th>
  1616. </tr>
  1617. <tr>
  1618. <td class="bold">Format</td>
  1619. <td>file.delete(file)</td>
  1620. </tr>
  1621. </table>
  1622. <table>
  1623. <tr>
  1624. <th class="command">file.getName</th>
  1625. <th class="desc">returns the name of a file</th>
  1626. </tr>
  1627. <tr>
  1628. <td class="bold">Format</td>
  1629. <td>file.getName(file)</td>
  1630. </tr>
  1631. </table>
  1632. <table>
  1633. <tr>
  1634. <th class="command">file.getList</th>
  1635. <th class="desc">returns all files in a folder as list</th>
  1636. </tr>
  1637. <tr>
  1638. <td class="bold">Format</td>
  1639. <td>file.getList(file)</td>
  1640. </tr>
  1641. </table>
  1642. <table>
  1643. <tr>
  1644. <th class="command">file.read</th>
  1645. <th class="desc">returns all lines in a file as list</th>
  1646. </tr>
  1647. <tr>
  1648. <td class="bold">Format</td>
  1649. <td>file.read(file)</td>
  1650. </tr>
  1651. </table>
  1652. <table>
  1653. <tr>
  1654. <th class="command">file.write</th>
  1655. <th class="desc">writes all entries of a list to a file</th>
  1656. </tr>
  1657. <tr>
  1658. <td class="bold">Format</td>
  1659. <td>file.write(file, list)</td>
  1660. </tr>
  1661. </table>
  1662. <table>
  1663. <tr>
  1664. <th class="command">file.isFile</th>
  1665. <th class="desc">returns true if a file is a file</th>
  1666. </tr>
  1667. <tr>
  1668. <td class="bold">Format</td>
  1669. <td>file.isFile(file)</td>
  1670. </tr>
  1671. </table>
  1672. <table>
  1673. <tr>
  1674. <th class="command">file.isDirectory</th>
  1675. <th class="desc">returns true if a file is a directory</th>
  1676. </tr>
  1677. <tr>
  1678. <td class="bold">Format</td>
  1679. <td>file.isDirectory(file)</td>
  1680. </tr>
  1681. </table>
  1682. <table>
  1683. <tr>
  1684. <th class="command">file.createFolder</th>
  1685. <th class="desc">creates a folder</th>
  1686. </tr>
  1687. <tr>
  1688. <td class="bold">Format</td>
  1689. <td>file.createFolder(file)</td>
  1690. </tr>
  1691. </table>
  1692. </section>
  1693. <section id="Config">
  1694. <table>
  1695. <tr>
  1696. <th class="command">config.new</th>
  1697. <th class="desc">returns a new config</th>
  1698. </tr>
  1699. <tr>
  1700. <td class="bold">Format</td>
  1701. <td>config.new(path, name)</td>
  1702. </tr>
  1703. </table>
  1704. <table>
  1705. <tr>
  1706. <th class="command">config.exists</th>
  1707. <th class="desc">returns true if the config exists</th>
  1708. </tr>
  1709. <tr>
  1710. <td class="bold">Format</td>
  1711. <td>config.exists(config)</td>
  1712. </tr>
  1713. </table>
  1714. <table>
  1715. <tr>
  1716. <th class="command">config.save</th>
  1717. <th class="desc">saves a config and returns true on success</th>
  1718. </tr>
  1719. <tr>
  1720. <td class="bold">Format</td>
  1721. <td>config.save(config)</td>
  1722. </tr>
  1723. </table>
  1724. <table>
  1725. <tr>
  1726. <th class="command">config.load</th>
  1727. <th class="desc">loads a config</th>
  1728. </tr>
  1729. <tr>
  1730. <td class="bold">Format</td>
  1731. <td>config.load(config)</td>
  1732. </tr>
  1733. </table>
  1734. <table>
  1735. <tr>
  1736. <th class="command">config.delete</th>
  1737. <th class="desc">removes a config</th>
  1738. </tr>
  1739. <tr>
  1740. <td class="bold">Format</td>
  1741. <td>config.delete(config)</td>
  1742. </tr>
  1743. </table>
  1744. <table>
  1745. <tr>
  1746. <th class="command">config.set</th>
  1747. <th class="desc">sets a key value pair in a config</th>
  1748. </tr>
  1749. <tr>
  1750. <td class="bold">Format</td>
  1751. <td>config.set(config, key, value)</td>
  1752. </tr>
  1753. </table>
  1754. <table>
  1755. <tr>
  1756. <th class="command">config.getBool</th>
  1757. <th class="desc">returns a boolean or a default value from a config key</th>
  1758. </tr>
  1759. <tr>
  1760. <td class="bold">Format</td>
  1761. <td>config.getBool(config, key, default)</td>
  1762. </tr>
  1763. </table>
  1764. <table>
  1765. <tr>
  1766. <th class="command">config.getDouble</th>
  1767. <th class="desc">returns a double or a default value from a config key</th>
  1768. </tr>
  1769. <tr>
  1770. <td class="bold">Format</td>
  1771. <td>config.getDouble(config, key, default)</td>
  1772. </tr>
  1773. </table>
  1774. <table>
  1775. <tr>
  1776. <th class="command">config.getString</th>
  1777. <th class="desc">returns a string or a default value from a config key</th>
  1778. </tr>
  1779. <tr>
  1780. <td class="bold">Format</td>
  1781. <td>config.getString(config, key, default)</td>
  1782. </tr>
  1783. </table>
  1784. </section>