help.c 155 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583
  1. /******************************************************************************
  2. * This file is part of TinTin++ *
  3. * *
  4. * Copyright 2004-2020 Igor van den Hoven *
  5. * *
  6. * TinTin++ is free software; you can redistribute it and/or modify *
  7. * it under the terms of the GNU General Public License as published by *
  8. * the Free Software Foundation; either version 3 of the License, or *
  9. * (at your option) any later version. *
  10. * *
  11. * This program is distributed in the hope that it will be useful, *
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  14. * GNU General Public License for more details. *
  15. * *
  16. * You should have received a copy of the GNU General Public License *
  17. * along with TinTin++. If not, see https://www.gnu.org/licenses. *
  18. ******************************************************************************/
  19. /******************************************************************************
  20. * T I N T I N + + *
  21. * *
  22. * coded by Igor van den Hoven 2004 *
  23. ******************************************************************************/
  24. #include "tintin.h"
  25. struct help_type
  26. {
  27. char * name;
  28. char * text;
  29. char * also;
  30. };
  31. struct help_type help_table[];
  32. char *help_related(struct session *ses, int index, int html)
  33. {
  34. char *arg;
  35. char tmp[BUFFER_SIZE], link[BUFFER_SIZE];
  36. static char buf[INPUT_SIZE];
  37. push_call("help_related(%p,%d,%d)",ses,index,html);
  38. arg = help_table[index].also;
  39. buf[0] = 0;
  40. while (*arg)
  41. {
  42. arg = get_arg_in_braces(ses, arg, tmp, GET_ONE);
  43. if (html)
  44. {
  45. sprintf(link, "\\c<a href='%s.php'\\c>%s\\c</a\\c>", tmp, tmp);
  46. sprintf(tmp, "%s", link);
  47. }
  48. if (*buf == 0)
  49. {
  50. sprintf(buf, "<178>Related<278>: %s", tmp);
  51. }
  52. else
  53. {
  54. if (*arg)
  55. {
  56. cat_sprintf(buf, ", %s", tmp);
  57. }
  58. else
  59. {
  60. cat_sprintf(buf, " and %s.", tmp);
  61. }
  62. }
  63. }
  64. pop_call();
  65. return buf;
  66. }
  67. DO_COMMAND(do_help)
  68. {
  69. char arg1[BUFFER_SIZE], buf[BUFFER_SIZE];
  70. int cnt, found;
  71. arg = get_arg_in_braces(ses, arg, arg1, GET_ALL);
  72. if (*arg1 == 0)
  73. {
  74. *buf = 0;
  75. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  76. {
  77. if (strlen(buf) + 19 > ses->wrap)
  78. {
  79. print_lines(ses, SUB_COL, "<088>%s<088>\n", buf);
  80. *buf = 0;
  81. }
  82. cat_sprintf(buf, "%19s ", help_table[cnt].name);
  83. }
  84. if (*buf)
  85. {
  86. print_lines(ses, SUB_COL, "<088>%s<088>\n", buf);
  87. }
  88. }
  89. else if (!strcasecmp(arg1, "dump"))
  90. {
  91. FILE *logfile = fopen("../docs/help.html", "w");
  92. do_configure(ses, "{log} {html}");
  93. if (HAS_BIT(ses->logmode, LOG_FLAG_HTML))
  94. {
  95. write_html_header(ses, logfile);
  96. }
  97. *buf = 0;
  98. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  99. {
  100. if (cnt && cnt % 4 == 0)
  101. {
  102. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  103. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  104. *buf = 0;
  105. }
  106. cat_sprintf(buf, " \\c<a href='#%s'\\c>%15s\\c</a\\c>", help_table[cnt].name, help_table[cnt].name);
  107. }
  108. cat_sprintf(buf, "\n\n");
  109. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  110. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  111. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  112. {
  113. sprintf(buf, "\\c<a name='%s'\\c>\\c</a\\c>\n", help_table[cnt].name);
  114. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  115. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  116. sprintf(buf, "<128> %s\n", help_table[cnt].name);
  117. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  118. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  119. substitute(ses, help_table[cnt].text, buf, SUB_COL);
  120. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  121. if (*help_table[cnt].also)
  122. {
  123. substitute(ses, help_related(ses, cnt, 0), buf, SUB_COL);
  124. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  125. }
  126. }
  127. fclose(logfile);
  128. }
  129. else if (!strcasecmp(arg1, "dump.php"))
  130. {
  131. FILE *logfile;
  132. do_configure(ses, "{log} {html}");
  133. *buf = 0;
  134. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  135. {
  136. filename_string(help_table[cnt].name, arg1);
  137. lowerstring(arg1);
  138. sprintf(buf, "../../manual/%s.php", arg1);
  139. logfile = fopen(buf, "w");
  140. fprintf(logfile, "<?php\n\tinclude 'manual.php';\n\n\tshow_head(\"%s.php\");\n\n\tshow_example(\"\n", arg1);
  141. if (*help_table[cnt].also)
  142. {
  143. sprintf(buf, "<128> %s\n", help_table[cnt].name);
  144. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  145. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  146. }
  147. substitute(ses, help_table[cnt].text, buf, SUB_COL);
  148. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  149. if (*help_table[cnt].also)
  150. {
  151. substitute(ses, help_related(ses, cnt, 1), buf, SUB_ESC|SUB_COL);
  152. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  153. }
  154. fprintf(logfile, "\n\t\");\n\n");
  155. fprintf(logfile, "\tshow_tail();\n?>\n");
  156. fclose(logfile);
  157. }
  158. }
  159. else
  160. {
  161. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  162. {
  163. if (is_abbrev(arg1, help_table[cnt].name))
  164. {
  165. print_lines(ses, SUB_COL, "%s<088>\n", help_table[cnt].text);
  166. if (*help_table[cnt].also)
  167. {
  168. print_lines(ses, SUB_COL, "%s<088>\n\n", help_related(ses, cnt, 0));
  169. }
  170. return ses;
  171. }
  172. }
  173. found = FALSE;
  174. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  175. {
  176. if (match(ses, help_table[cnt].name, arg1, SUB_VAR|SUB_FUN))
  177. {
  178. print_lines(ses, SUB_COL, "%s<088>\n", help_table[cnt].text);
  179. if (*help_table[cnt].also)
  180. {
  181. print_lines(ses, SUB_COL, "%s<088>\n\n", help_related(ses, cnt, 0));
  182. }
  183. found = TRUE;
  184. }
  185. }
  186. if (found == FALSE)
  187. {
  188. tintin_printf2(ses, "No help found for '%s'", arg1);
  189. }
  190. }
  191. return ses;
  192. }
  193. /*
  194. This help table is a mess, but I got better things to do - Igor
  195. */
  196. struct help_type help_table[] =
  197. {
  198. {
  199. "ACTION",
  200. "<178>Command<278>: #action <178>{<278>message<178>} {<278>commands<178>} {<278>priority<178>}<278>\n"
  201. "\n"
  202. " The #action command can be used to respond with one or several\n"
  203. " commands to a specific message send by the server. The %1-%99\n"
  204. " variables are substituted from the message and can be used in the\n"
  205. " command part of the action.\n"
  206. "\n"
  207. " The priority part is optional and determines the priority of the\n"
  208. " action, it defaults to 5.\n"
  209. "\n"
  210. " If the message starts with a ~ color codes must be matched. You can\n"
  211. " enable #config {convert meta} on to display meta characters.\n"
  212. "\n"
  213. " For more information on pattern matching see the section on PCRE.\n"
  214. "\n"
  215. "<178>Example<278>: #action {%1 tells you '%2'} {tell %1 I'm afk.}\n"
  216. "\n"
  217. " Actions can be triggered by the showme command and certain system\n"
  218. " messages.\n"
  219. "\n"
  220. " Actions can be triggered by the #showme command. If you don't want a\n"
  221. " #showme to get triggered use: #line ignore #showme {text}\n"
  222. "\n"
  223. " Actions are ordered alphabetically and only one action can trigger at\n"
  224. " a time. To change the order you can assign a priority, which defaults\n"
  225. " to 5, with a lower number indicating a higher priority. The priority\n"
  226. " can be a floating point number.\n"
  227. "\n"
  228. " To remove action with %* as the message, use #unaction {%%*} or\n"
  229. " #unaction {\%*}. Alternatively you could wrap the action inside a\n"
  230. " class, and kill that class when you no longer need the action.\n"
  231. "\n"
  232. "<178>Comment<278>: You can remove an action with the #unaction command.\n",
  233. "pcre gag highlight prompt substitute"
  234. },
  235. {
  236. "ALIAS",
  237. "<178>Command<278>: #alias <178>{<278>name<178>} {<278>commands<178>} {<278>priority<178>}<278>\n"
  238. "\n"
  239. " The #alias command can be used to shorten up long or oftenly used\n"
  240. " commands. The %1-99 variables are substituted from the arguments when\n"
  241. " using an alias and represent the 1st till 99th word which can be used\n"
  242. " in the commands part of the alias. If %0 is used it will contain all\n"
  243. " arguments. The priority part is optional and determines the priority\n"
  244. " of the alias, it defaults to 5.\n"
  245. "\n"
  246. "<178>Example<278>: #alias {k} {kill %1;kick}\n"
  247. "\n"
  248. " Typing 'k orc' would result in attacking the orc followed by a kick.\n"
  249. "\n"
  250. " You can create multi-word aliases by using variables in the name\n"
  251. " section.\n"
  252. "\n"
  253. "<178>Example<278>: #alias {k %1 with %2} {draw %2;attack %1;slash %1 with %2;\n"
  254. " kick at %2;strike %1 with %2}\n"
  255. "\n"
  256. " Using the above alias you could type k blue smurf with battle axe\n"
  257. "\n"
  258. " To have an alias that matches all user input, use %* as the name.\n"
  259. "\n"
  260. "<178>Example<278>: #alias {%*} {#showme You wrote: %0}\n"
  261. "\n"
  262. " Aliases are ordered alphabetically and only one alias can trigger at\n"
  263. " a time. To change the order you can assign a priority, which defaults\n"
  264. " to 5, with a lower number indicating a higher priority. The priority\n"
  265. " can be a floating point number.\n"
  266. "\n"
  267. " To remove an alias with %* as the name, use #unalias {%%*} or #unalias\n"
  268. " {\%*}. Alternatively you can wrap the alias inside a class, and kill\n"
  269. " that class when you no longer need the alias.\n"
  270. "\n"
  271. " For more information on pattern matching see the section on PCRE.\n"
  272. "\n"
  273. "<178>Comment<278>: You can remove an alias with the #unalias command.\n",
  274. "cursor history keypad macro speedwalk tab"
  275. },
  276. {
  277. "ALL",
  278. "<178>Command<278>: #all <178>{<278>string<178>}<278>\n"
  279. "\n"
  280. " If you have multiple sessions in one terminal you can use #all to\n"
  281. " execute the command with all sessions, excluding the startup session.\n"
  282. "\n"
  283. "<178>Example<278>: #all quit\n"
  284. "\n"
  285. " Sends 'quit' to all sessions.\n",
  286. "port run session sessionname snoop ssl zap"
  287. },
  288. {
  289. "BELL",
  290. "<178>Command<278>: #bell <178>{<278>flash<178>|<278>focus<178>|<278>margin<178>|<278>ring<178>|<278>volume<178>} {<278>argument<178>}<278>\n"
  291. "\n"
  292. " The #bell command without an argument will ring the terminal bell.\n"
  293. "\n"
  294. "<178>Example<278>: #action {Bubba tells you} {#bell}\n"
  295. "\n"
  296. " If you aren't watching the screen this could be useful if you don't\n"
  297. " want to miss out on a conversation with Bubba. Alternatively you can\n"
  298. " use #system to play a sound file.\n"
  299. "\n"
  300. " Some terminals will allow you to use VT100 Operating System Commands\n"
  301. " to change the terminal's bell behavior which can be used to flash the\n"
  302. " taskbar icon and or focus the window on receival of a bell.\n"
  303. "\n"
  304. "<178>Example<278>: #action {Bubba tells you} {#screen save title;#screen set title Tell!;\n"
  305. " #bell ring;#delay 10 #screen load title}\n"
  306. "\n"
  307. " The above example will save your window title, change the title to\n"
  308. " 'Tell!', ring the bell, next reset the window title after 10 seconds.\n"
  309. "\n"
  310. " It's possible to set the terminal to pop to the foreground upon\n"
  311. " ringing of the alarm bell.\n"
  312. "\n"
  313. "<178>Example<278>: #bell focus on;#bell ring;#bell focus off\n"
  314. "\n"
  315. " It's possible to adjust the alarm bell volume on some terminals.\n"
  316. "\n"
  317. "<178>Example<278>: #loop {1} {8} {cnt} {#line substitute variables\n"
  318. " #delay {$cnt} #showme {Volume $cnt: #bell volume $cnt;#bell}\n",
  319. "screen"
  320. },
  321. {
  322. "BREAK",
  323. "<178>Command<278>: #break\n"
  324. "\n"
  325. " The break command can be used inside the #foreach, #loop, #parse,\n"
  326. " #while and #switch statements. When #break is found, tintin will stop\n"
  327. " executing the statement it is currently in and move on to the next.\n"
  328. "\n"
  329. "<178>Example<278>: #while {1} {#math cnt $cnt + 1;#if {$cnt == 20} {#break}}\n",
  330. "statements"
  331. },
  332. {
  333. "BUFFER",
  334. "<178>Command<278>: #buffer <178>{<278>home<178>|<278>up<178>|<278>down<178>|<278>end<178>|<278>lock<178>|<278>find<178>|<278>get<178>|<278>clear<178>}<278>\n"
  335. "\n"
  336. " The buffer command has various options to manipulate your scrollback\n"
  337. " buffer.\n"
  338. "\n"
  339. " <178>#buffer {home}\n"
  340. "<278>\n"
  341. " Moves you to the top of your scrollback buffer and displays the page.\n"
  342. " Enables scroll lock mode. Most useful when used in a #macro.\n"
  343. "\n"
  344. " <178>#buffer {up} [lines]\n"
  345. "<278>\n"
  346. " Moves your scrollback buffer up one page and displays the page.\n"
  347. " Enables scroll lock mode. Most useful when used in a #macro. You\n"
  348. " can use #buffer {up} {1} to move the scrollback buffer up 1 line.\n"
  349. "\n"
  350. " <178>#buffer {down} [lines]\n"
  351. "<278>\n"
  352. " Moves your scrollback buffer down one page and displays the page.\n"
  353. " Enables scroll lock mode unless at the end. Most useful when used in\n"
  354. " a #macro.\n"
  355. "\n"
  356. " <178>#buffer {end}\n"
  357. "<278>\n"
  358. " Moves you to the end of your scrollback buffer and displays the page.\n"
  359. " Disables scroll lock mode. Most useful when used in a #macro.\n"
  360. "\n"
  361. " <178>#buffer {find} {[number]} {<string>}\n"
  362. "<278>\n"
  363. " Moves the buffer to the given string which can contain a regular\n"
  364. " expression. Optionally you can provide the number of matches to skip,\n"
  365. " allowing you to jump further back in the buffer.\n"
  366. "\n"
  367. " <178>#buffer {get} {<variable>} {<lower bound>} {[upper bound]}\n"
  368. "<278>\n"
  369. " Allows you to store one or several lines from your scrollback buffer\n"
  370. " (including color codes) into a variable. The lower and upper bound\n"
  371. " must be between 1 and the size of the buffer. If the upper bound is\n"
  372. " omitted the given line is stored as a standard variable. If an upper\n"
  373. " bound is given the lines between the two bounds are stored as a list.\n"
  374. "\n"
  375. " <178>#buffer {lock} {on|off}\n"
  376. "<278>\n"
  377. " Toggles the lock on the scrollback buffer. When locked, newly incoming\n"
  378. " text won't be displayed, any command will disable the lock, though\n"
  379. " several buffer commands will re-enable the lock. When unlocking it'll\n"
  380. " move you to the end of your scrollback buffer and display the page.\n"
  381. "\n"
  382. " <178>#buffer {write} {<filename>}\n"
  383. "<278>\n"
  384. " Writes the scrollback buffer to the given file.\n"
  385. "\n"
  386. "<178>Example<278>: #macro {\\e[F} {#buffer end}\n",
  387. "echo grep macro showme screen"
  388. },
  389. {
  390. "BUTTON",
  391. "<178>Command<278>: #button <178>{<278>square<178>} {<278>commands<178>} {<278>priority<178>}<278>\n"
  392. "\n"
  393. " The #button command can be used to respond with one or several\n"
  394. " commands to a mouse click received within the specified square.\n"
  395. " The click coordinates are stored in %0-%3 and can be used in the\n"
  396. " command part of the button.\n"
  397. "\n"
  398. " The square part should exists of two coordinates defining the\n"
  399. " upper left and bottom right corner using row, col, row, col syntax.\n"
  400. " The square arguments should be separated by spaces, semi-colons or\n"
  401. " braces.\n"
  402. "\n"
  403. " By default the button is set to respond to a mouse button press, to\n"
  404. " respond to other button presses you must add a 5th argument to the\n"
  405. " square that defines the button press type. You can enable #info\n"
  406. " button on to see button events and their type as they happen.\n"
  407. "\n"
  408. " The priority part is optional and determines the priority of the\n"
  409. " button, it defaults to 5.\n"
  410. "\n"
  411. " You must enable #config {mouse tracking} on for buttons to work.\n"
  412. "\n"
  413. " This command draws no visible button, you'll have to do so separately\n"
  414. " if needed.\n"
  415. "\n"
  416. "<178>Example<278>: #button {1;1;2;2} {#showme You clicked the upper left corner.}\n"
  417. "\n"
  418. " Buttons are ordered alphabetically and only one button can trigger at\n"
  419. " a time. To change the order you can assign a priority, which defaults\n"
  420. " to 5, with a lower number indicating a higher priority. The priority\n"
  421. " can be a floating point number.\n"
  422. "\n"
  423. "<178>Comment<278>: To see button clicks trigger use #info button on.\n"
  424. "\n"
  425. "<178>Comment<278>: You can remove a button with the #unbutton command.\n",
  426. "delay event ticker"
  427. },
  428. {
  429. "CASE",
  430. "<178>Command<278>: #case <178>{<278>conditional<178>} {<278>arguments<178>}<278>\n"
  431. "\n"
  432. " The case command must be used within the #switch command. When the\n"
  433. " conditional argument of the case command matches the conditional\n"
  434. " argument of the switch command the body of the case is executed.\n"
  435. "\n"
  436. " When comparing strings both the switch and case arguments must be\n"
  437. " surrounded in quotes.\n"
  438. "\n"
  439. "<178>Example<278>:\n"
  440. "\n"
  441. " #function {reverse_direction}\n"
  442. " {\n"
  443. " #switch {\"%1\"}\n"
  444. " {\n"
  445. " #case {\"north\"} {#return south};\n"
  446. " #case {\"east\"} {#return west};\n"
  447. " #case {\"south\"} {#return north};\n"
  448. " #case {\"west\"} {#return east};\n"
  449. " #case {\"up\"} {#return down};\n"
  450. " #case {\"down\"} {#return up}\n"
  451. " }\n"
  452. " }\n"
  453. "\n"
  454. " This function returns the reverse direction. @reverse_direction{north}\n"
  455. " would return south.\n",
  456. "default statements switch"
  457. },
  458. {
  459. "CAT",
  460. "<178>Command<278>: #cat <178>{<278>variable<178>} {<278>argument<178>}<278>\n"
  461. "\n"
  462. " The cat command will concatinate the argument to the given variable.\n",
  463. "format function local math replace script variable"
  464. },
  465. {
  466. "CHARACTERS",
  467. "<278>\n"
  468. " The following special characters are defined:\n"
  469. "\n"
  470. "# The hashtag is the default character for starting a command and is\n"
  471. " subsequently known as the command character or tintin character.\n"
  472. " When loading a command file the command character is set to the\n"
  473. " first character in the file. The character can also be redefined\n"
  474. " using #config.\n"
  475. "\n"
  476. "; The semi-colon is used as the command separator and can be used to\n"
  477. " separate two commands. Multiple commands can be strung together as\n"
  478. " well. Trailing semi-colons are ignored when reading a script file\n"
  479. " as this is a common error.\n"
  480. "\n"
  481. "{ } Curly brackets aka braces are used for separating multi word command\n"
  482. " arguments, nesting commands, and nesting variables. Braces cannot\n"
  483. " easily be escaped and must always be used in pairs.\n"
  484. "\n"
  485. "\" \" Quote characters are used for strings in the #math, #if, #switch,\n"
  486. " and #case commands. It is however suggested to use an extra\n"
  487. " set of braces { } to define strings.\n"
  488. "\n"
  489. "! The exclamation sign is used to repeat commands, see #help history.\n"
  490. " The character can be redefined using #config.\n"
  491. "\n"
  492. "\\ An input line starting with a backslash is send verbatim if you are\n"
  493. " connected to a server. This character can be configured with\n"
  494. " #config.\n",
  495. "colors escape mathematics pcre"
  496. },
  497. {
  498. "CHAT",
  499. "<178>Command<278>: #chat <178>{<278>option<178>} {<278>argument<178>}\n"
  500. "<278>\n"
  501. " The #chat command is used to create peer to peer connections to other\n"
  502. " clients, typically for the purpose of chatting and sending files.\n"
  503. " This is a decentralized chat system, meaning you have to exchange ip\n"
  504. " addresses and port numbers with other users in order to connect to\n"
  505. " them.\n"
  506. "\n"
  507. " <178>#chat {init} {port}\n"
  508. " <278> #chat initialize launches your chat server. The port number is\n"
  509. " optional, and by default 4050 is used as your port. After using\n"
  510. " this command other people can connect to your chat server using\n"
  511. " your ip address and port number, and in turn you can connect to\n"
  512. " other people.\n"
  513. " <178>#chat {name} {name}\n"
  514. " <278> By default your name is set to TinTin, but most servers will\n"
  515. " reject you if there is already someone with the name TinTin\n"
  516. " connected, so one of the first things you'd want to do is\n"
  517. " change your chat name. Your name can include color codes. Some\n"
  518. " names aren't accepted by tt++ chat servers, like the name 'all'\n"
  519. " and names longer than 20 characters.\n"
  520. " <178>#chat {message} {buddy|all} {text}\n"
  521. " <278> This is the main command used for communication. If you use\n"
  522. " #chat message all, the message is marked as public and send to\n"
  523. " everyone you are connected to.\n"
  524. " <178>#chat {accept} {buddy} {boost}\n"
  525. " <278> Accept a file transfer from a buddy. The boost is optional and\n"
  526. " must be a value between 1 and 1000.\n"
  527. " <178>#chat {call} {address} {port}\n"
  528. " <278> #chat call is used to connect to another chat server. If you\n"
  529. " omit the port argument the default port (4050) is used.\n"
  530. " <178>#chat {cancel} {buddy} Cancel a file transfer\n"
  531. " #chat {color} {color names} Set the default color\n"
  532. " #chat {decline} {buddy} Decline a file transfer\n"
  533. " #chat {dnd} Decline new connections\n"
  534. " #chat {download} {directory} Set your download directory\n"
  535. " #chat {emote} {buddy|all} {text} Send an emote message\n"
  536. " #chat {forward} {buddy} Forward all chat messages\n"
  537. " #chat {forwardall} {buddy} Forward all session output\n"
  538. " #chat {filestat} {buddy} Show file transfer data\n"
  539. " #chat {group} {buddy} {name} Assign a chat group\n"
  540. " #chat {ignore} {buddy} Ignores someone\n"
  541. " #chat {info} Displays your info\n"
  542. " #chat {ip} {address} Changes your IP address\n"
  543. " #chat {paste} {buddy|all} {text} Pastes a block of text\n"
  544. " #chat {peek} {buddy} Show one's public connections\n"
  545. " #chat {ping} {buddy} Display response time\n"
  546. " #chat {private} {buddy|all} Make a connection private\n"
  547. " #chat {public} {buddy|all} Make a connection public\n"
  548. " #chat {reply} {text} Reply to last private message\n"
  549. " #chat {request} {buddy} Request one's public connections\n"
  550. " #chat {send} {buddy|all} {text} Sends a raw data string\n"
  551. " #chat {sendfile} {buddy} {filename} Start a file transfer\n"
  552. " #chat {serve} {buddy} Forward all public chat messages\n"
  553. " #chat {uninitialize} Uninitialize the chat port.\n"
  554. " <178>#chat {who} Show all connections\n"
  555. " <278> #chat who shows all people you are connected to. The first\n"
  556. " column shows a reference number for the connection, which can be\n"
  557. " used instead of the connection's name when sending someone a message\n"
  558. " The second column shows the connection's name. The third column\n"
  559. " shows flags set for the connection, (P)rivate, (I)gnore, (S)erve,\n"
  560. " (F)orward to user, and (f)orward from user. The next columns show\n"
  561. " ip, port, and client name.\n"
  562. " <178>#chat {zap} {buddy} Close a connection\n",
  563. "port"
  564. },
  565. {
  566. "CLASS",
  567. "<178>Command<278>: #class <178>{<278>name<178>} {<278>optionkill<178>} {<278>arg<178>}<278>\n"
  568. "\n"
  569. " <178>#class {<name>} {open}\n"
  570. " <278> Open a class, closing a previously opened class. All triggers\n"
  571. " <278> added afterwards are assigned to this class.\n"
  572. " <178>#class {<name>} {clear}\n"
  573. " <278> Will delete all triggers associated with the given class.\n"
  574. " <178>#class {<name>} {close}\n"
  575. " <278> Close the given class, opening the last open class, if any.\n"
  576. " <178>#class {<name>} {kill}\n"
  577. " <278> Will clear, close, and remove the class.\n"
  578. " <178>#class {<name>} {list}\n"
  579. " <278> List all triggers associated with the given class.\n"
  580. " <178>#class {<name>} {load}\n"
  581. " <278> Will load the saved copy of the class from memory.\n"
  582. " <178>#class {<name>} {read} {<filename>\n"
  583. " <278> Will open the class, read the file, and close afterwards.\n"
  584. " <178>#class {<name>} {save}\n"
  585. " <278> Will save all triggers of the given class to memory.\n"
  586. " <178>#class {<name>} {size} {<variable>}\n"
  587. " <278> Will store the size of the class in a variable.\n"
  588. " <178>#class {<name>} {write} {<filename>}\n"
  589. " <278> Will write all triggers of the given class to file.\n"
  590. " The {kill} option will delete all triggers of the given class.\n"
  591. "\n"
  592. " Keep in mind that the kill and read option are very fast allowing\n"
  593. " them to be used to enable and disable classes.\n"
  594. "\n"
  595. "<178>Example<278>: #class extra kill;#class extra read extra.tin\n"
  596. " Deletes all triggers of 'extra' class if any. Read 'extra.tin' file,\n"
  597. " all triggers loaded will be assigned to the fresh new 'extra' class.\n",
  598. "config debug ignore info kill line message"
  599. },
  600. {
  601. "COLORS",
  602. "<178>Syntax<278>: <<888>xyz> with x, y, z being parameters\n"
  603. "\n"
  604. " Parameter 'x': VT100 code\n"
  605. "\n"
  606. " 0 - Reset all colors and codes to default\n"
  607. " 1 - Bold\n"
  608. " 2 - Dim\n"
  609. " 4 - Underscore\n"
  610. " 5 - Blink\n"
  611. " 7 - Reverse\n"
  612. " 8 - Skip (use previous code)\n"
  613. "\n"
  614. " Parameter 'y': Foreground color\n"
  615. " Parameter 'z': Background color\n"
  616. "\n"
  617. " 0 - Black 5 - Magenta\n"
  618. " 1 - Red 6 - Cyan\n"
  619. " 2 - Green 7 - White\n"
  620. " 3 - Yellow 8 - Skip\n"
  621. " 4 - Blue 9 - Default\n"
  622. "\n"
  623. " For xterm 256 colors support use <<888>aaa> to <<888>fff> for RGB foreground\n"
  624. " colors and <<888>AAA> to <<888>FFF> for RGB background colors. For the grayscale\n"
  625. " foreground colors use <<888>g00> to <<888>g23>, for grayscale background colors\n"
  626. " use <<888>G00> to <<888>G23>.\n"
  627. "\n"
  628. " The tertiary colors are as follows:\n"
  629. "\n"
  630. " <<888>acf> - Azure <<888>afc> - Jade\n"
  631. " <<888>caf> - Violet <<888>cfa> - Lime\n"
  632. " <<888>fac> - Pink <<888>fca> - Orange\n"
  633. "\n"
  634. "<178>Example<278>: #showme <<888>acf>Azure <<888>afc>Jade <<888>caf>Violet\n"
  635. "<178>Example<278>: #showme <<888>cfa>Lime <<888>fac>Pink <<888>fca>Orange\n"
  636. "\n"
  637. " For 12 bit truecolor use <<888>F000> to <<888>FFFF> for foreground colors and\n"
  638. " <<888>B000> to <<888>BFFF> for background colors.\n"
  639. "\n"
  640. " For 24 bit truecolor use <<888>F000000> to <<888>FFFFFFF> for foreground\n"
  641. " colors and <<888>B000000> to <<888>BFFFFFF> for background colors.\n"
  642. "\n"
  643. " If the color code exceeds your configured color mode it will be\n"
  644. " downgraded to the closest match.\n",
  645. "characters coordinates escape mathematics pcre"
  646. },
  647. {
  648. "COMMANDS",
  649. "<178>Command<278>: #commands <178>{<278>regex<178>}\n"
  650. "<278>\n"
  651. " Shows all commands or all commands matching the given search\n"
  652. " string.\n",
  653. "help info statements"
  654. },
  655. {
  656. "COORDINATES",
  657. "<278>\n"
  658. " When the 0,0 coordinate is in the upper left corner TinTin++ uses\n"
  659. " a y,x / rows,cols notation. When the 0,0 coordinate is in the\n"
  660. " bottom left corner tintin uses a x,y / cols/rows notation.\n"
  661. "\n"
  662. " When a square is defined this is done by specifying the upper left\n"
  663. " and bottom right corner of the square using four coordinates.\n"
  664. "\n"
  665. " The vast majority of tintin commands use row,col notation.\n",
  666. "characters colors escape mathematics pcre"
  667. },
  668. {
  669. "CONFIG",
  670. "<178>Command<278>: #config <178>{<278>option<178>} {<278>argument<178>}<278>\n"
  671. "\n"
  672. " This allows you to configure various settings, the settings can be\n"
  673. " written to file with the #write command.\n"
  674. "\n"
  675. " If you configure the global session (the one you see as you start up\n"
  676. " tintin) all sessions started will inherite these settings.\n"
  677. "\n"
  678. " It's advised to make a configuration file to read on startup if you\n"
  679. " do not like the default settings.\n"
  680. "\n"
  681. " Config options which aren't listed by default:\n"
  682. "\n"
  683. " #CONFIG {BUFFER SIZE} {SIZE} Set the scrollback buffer size.\n"
  684. " #CONFIG {CHILD LOCK} {ON|OFF} Enable or disable command input.\n"
  685. " #CONFIG {CONVERT META} {ON|OFF} Shows color codes and key bindings.\n"
  686. " #CONFIG {DEBUG TELNET} {ON|OFF} Shows telnet negotiations y/n.\n"
  687. " #CONFIG {LOG LEVEL} {LOW|HIGH} LOW logs server output before triggers.\n"
  688. " #CONFIG {INHERITANCE} {ON|OFF} Session trigger inheritance y/n.\n"
  689. " #CONFIG {MCCP} {ON|OFF} Enable or disable MCCP support.\n"
  690. " #CONFIG {PID} {NUMBER} Set the PID of the master process.\n",
  691. "class line"
  692. },
  693. {
  694. "CONTINUE",
  695. "<178>Command<278>: #continue\n"
  696. "\n"
  697. " The continue command can be used inside the #FOREACH, #LOOP, #PARSE,\n"
  698. " #WHILE and #SWITCH commands. When #CONTINUE is found, tintin will go\n"
  699. " to the end of the command and proceed as normal, which may be to\n"
  700. " reiterate the command.\n"
  701. "\n"
  702. "<178>Example<278>: #loop 1 10 cnt {#if {$cnt % 2 == 0} {#continue} {say $cnt}}\n",
  703. "break foreach list loop parse repeat return while"
  704. },
  705. {
  706. "CR",
  707. "<178>Command<278>: #cr\n"
  708. "\n"
  709. " Sends a carriage return to the session. Useful for aliases that need\n"
  710. " extra carriage returns.\n"
  711. "\n"
  712. " This command is obsolete as you can accomplish the same using #send\n"
  713. " without an argument or #send {}.\n",
  714. "forall"
  715. },
  716. {
  717. "CURSOR",
  718. "<178>Command<278>: #cursor <178>{<278>option<178>} {<278>argument<178>}<278>\n"
  719. "\n"
  720. " Typing #cursor without an option will show all available cursor\n"
  721. " options, their default binding, and an explanation of their function.\n"
  722. "\n"
  723. " The cursor command's primarly goal is adding customizable input editing\n"
  724. " with macros. Subsequently many cursor commands only work properly when\n"
  725. " used within a macro or event.\n"
  726. "\n"
  727. " <178>#cursor tab <list;scrollback> <backward|forward>\n"
  728. " <278> Tab through the given option(s) going forward or backward.\n"
  729. ,
  730. "alias history keypad macro speedwalk tab"
  731. },
  732. {
  733. "DAEMON",
  734. "<178>Command<278>: #daemon <178>{<278>attach<178>|<278>detach<178>|<278>kill<178>|<278>list<178>} <178>[<278>name<178>]\n"
  735. "\n"
  736. " <278>#daemon provides functionality similar to that of the screen and tmux\n"
  737. " utilities.\n"
  738. "\n"
  739. " <178>#daemon attach [name]\n"
  740. " <278> The attach option will try to find a daemonized tintin instance and\n"
  741. " take over control. The name argument is optional.\n"
  742. "\n"
  743. " <178>#daemon detach [name]\n"
  744. " <278> The detach option will daemonize tintin, turning it into a background\n"
  745. " process. The name argument is optional and is useful if you have\n"
  746. " several daemonized tt++ instances running so you can keep them apart.\n"
  747. "\n"
  748. " <178>#daemon kill [name]\n"
  749. " <278> Kills all daemons or daemons with matching name.\n"
  750. "\n"
  751. " <178>#daemon list [name]\n"
  752. " <278> List all daemons or daemons with matching name.\n",
  753. "script system run"
  754. },
  755. {
  756. "DEBUG",
  757. "<178>Command<278>: #debug <178>{<278>listname<178>} {<278>on<178>|<278>off<178>|<278>log<178>}<278>\n"
  758. "\n"
  759. " Toggles a list on or off. With no argument it shows your current\n"
  760. " settings, as well as the list names that you can debug.\n"
  761. "\n"
  762. " If you for example set ACTIONS to ON you will get debug information\n"
  763. " whenever an action is triggered.\n"
  764. "\n"
  765. " #debug {listname} {log} will silently write debugging information to\n"
  766. " the log file, you must be logging in order for this to work.\n"
  767. "\n"
  768. " Not every list has debug support yet.\n",
  769. "class ignore info kill message"
  770. },
  771. {
  772. "DEFAULT",
  773. "<178>Command<278>: #default <178>{<278>commands<178>}<278>\n"
  774. "\n"
  775. " The default command can only be used within the switch command. When\n"
  776. " the conditional argument of non of the case commands matches the switch\n"
  777. " command's conditional statement the default command is executed.\n",
  778. "case default else elseif if switch regex"
  779. },
  780. {
  781. "DELAY",
  782. "<178>Command<278>: #delay <178>{<278>seconds<178>} {<278>command<178>}<278>\n"
  783. "<178>Command<278>: #delay <178>{<278>name<178>} {<278>command<178>} {<278>seconds<178>}<278>\n"
  784. "\n"
  785. " Delay allows you to have tintin wait the given amount of seconds\n"
  786. " before executing the given command. tintin won't wait before\n"
  787. " executing following input commands if any.\n"
  788. "\n"
  789. " Floating point precision for milliseconds is possible.\n"
  790. "\n"
  791. "<178>Example<278>: #showme first;#delay {1} {#showme last}\n"
  792. " This will print 'first', and 'last' around one second later.\n"
  793. "\n"
  794. "<178>Comment<278>: If you want to remove a delay with the #undelay command you can add\n"
  795. " a name as the first argument, be aware this changes the syntax. If\n"
  796. " the name is a number keep in mind that delays with the same numeric\n"
  797. " name will not be overwritten\n",
  798. "event ticker"
  799. },
  800. {
  801. "DRAW",
  802. "<178>Command<278>: #draw <178>[<278>color<178>] <178>[<278>options<178>] <178><<278>type<178>> <<278>square<178>> {<278>text<178>}\n"
  803. "<278>\n"
  804. " The draw commands allows you to draw various types of lines and shapes\n"
  805. " on the screen. Common options and types with a brief description are\n"
  806. " provided when you type #draw without an argument.\n"
  807. "\n"
  808. " The square arguments should exists of two coordinates defining the\n"
  809. " upper left and bottom right corner using row, col, row, col syntax.\n"
  810. "\n"
  811. "\n You can prefix the option with a color code or color name to color the\n"
  812. " lines and shapes.\n"
  813. "\n"
  814. " You can further prefix the option as following:\n"
  815. "\n"
  816. " ASCII will draw in ASCII mode.\n"
  817. " BLANKED will blank the lines and corners.\n"
  818. " BOTTOM will draw on the bottom side if possible.\n"
  819. " BUMPED will precede the draw with an enter.\n"
  820. " CIRCLED will circle the corners.\n"
  821. " CONVERT will draw text with meta conversion.\n"
  822. " CROSSED will cross the corners.\n"
  823. " FILLED will fill circles and jewels.\n"
  824. " GRID will draw TABLE as a grid.\n"
  825. " HORIZONTAL will draw horizontal if possible.\n"
  826. " HUGE will draw text in huge letters.\n"
  827. " JEWELED will diamond the corners.\n"
  828. " JOINTED will draw corners.\n"
  829. " LEFT will draw on the left side if possible.\n"
  830. " NUMBERED will draw numbered, mostly for debugging.\n"
  831. " PRUNED will prune the corners.\n"
  832. " RIGHT will draw on the right side if possible.\n"
  833. " ROUNDED will round the corners.\n"
  834. " SHADOWED will shadow HUGE text.\n"
  835. " TEED will tee the corners.\n"
  836. " TRACED will trace HUGE text.\n"
  837. " TOP will draw on the top side if possible.\n"
  838. " TUBED will draw tubes instead of lines.\n"
  839. " UNICODE will draw in unicode mode.\n"
  840. " VERTICAL will draw vertical if possible.\n"
  841. "\n"
  842. " The following types are available.\n"
  843. "\n"
  844. " <178>[ASCII|UNICODE|HUGE] BOX {[TEXT1]} {[TEXT2]}\n"
  845. " <278> will draw a box.\n"
  846. " <178>[BLANKED|CIRCLED|CROSSED|JEWELED|ROUNDED|TEED|PRUNED] CORNER\n"
  847. " <278> will draw a corner.\n"
  848. " <178>[BLANKED|HORIZONTAL|NUMBERED|TUBED|VERTICAL] LINE {[TEXT]}\n"
  849. " <278> will draw a line.\n"
  850. " <178>RAIN {<VARIABLE>} {[SPAWN]} {[FADE]} {[LEGEND]}\n"
  851. " <278> will draw digital rain.\n"
  852. " <178>[JOINTED|TOP|LEFT|BOTTOM|RIGHT] SIDE\n"
  853. " <278> will draw one or more sides of a box.\n"
  854. " <178>[GRID] TABLE {[LIST1]} {[LIST2]}\n"
  855. " <278> will draw a table.\n"
  856. " <178>[HUGE] TILE {[TEXT1]} {[TEXT2]}\n"
  857. " <278> will draw a tile\n"
  858. "\n"
  859. " All draw types take an optional text argument as long as a valid\n"
  860. " square with enough space has been defined. Text is automatically\n"
  861. " word wrapped.\n"
  862. "\n"
  863. "<178>Example<278>: #draw Blue box 1 1 3 20 {Hello world!}\n",
  864. "buffer echo grep showme"
  865. },
  866. {
  867. "ECHO",
  868. "<178>Command<278>: #echo <178>{<278>format<178>} {<278>argument1<178>} {<278>argument2<178>} {<278>etc<178>}<278>\n"
  869. "\n"
  870. " Echo command displays text on the screen with formatting options. See\n"
  871. " the help file for the format command for more information.\n"
  872. "\n"
  873. " The echo command does not trigger actions.\n"
  874. "\n"
  875. " As with the #showme command you can split the {format} argument up into\n"
  876. " two braced arguments, in which case the 2nd argument is the row number.\n"
  877. "\n"
  878. "<178>Example<278>: #echo {The current date is %t.} {%Y-%m-%d %H:%M:%S}\n"
  879. " #echo {[%38s][%-38s]} {Hello World} {Hello World}\n"
  880. " #echo {{this is %s on the top row} {-1}} {printed}\n",
  881. "buffer format grep showme"
  882. },
  883. {
  884. "ELSE",
  885. "<178>Command<278>: #else <178>{<278>commands<178>}<278>\n"
  886. "\n"
  887. " The else statement should follow an #IF or #ELSEIF statement and is\n"
  888. " only called if the proceeding #IF or #ELSEIF is false.\n"
  889. "\n"
  890. "<178>Example<278>: #if {1d2 == 1} {smile};#else {grin}\n",
  891. "case default elseif if switch regex"
  892. },
  893. {
  894. "ELSEIF",
  895. "<178>Command<278>: #elseif <178>{<278>conditional<178>} {<278>commands<178>}<278>\n"
  896. "\n"
  897. " The elseif statement should follow an #IF or #ELSEIF statement and is\n"
  898. " only called when the statement is true and the proceeding #IF and\n"
  899. " #ELSEIF statements are false.\n"
  900. "\n"
  901. "<178>Example<278>: #if {1d3 == 1} {smirk};#elseif {1d2 == 1} {snicker}\n",
  902. "case default else if switch regex"
  903. },
  904. {
  905. "END",
  906. "<178>Command<278>: #end {<message>}\n"
  907. "\n"
  908. " Terminates tintin and return to unix. On most systems, ctrl-c has\n"
  909. " the same result.\n"
  910. "\n"
  911. " The message is optional and is printed before tintin exits. When\n"
  912. " using #end {\\} tintin will terminate silently.\n",
  913. "zap"
  914. },
  915. {
  916. "ESCAPE CODES",
  917. "<278> You may use the escape character \\ for various special characters.\n"
  918. "\n"
  919. " \\a beep the terminal.\n"
  920. " \\c send a control character, \\ca for ctrl-a.\n"
  921. " \\e start an escape sequence.\n"
  922. " \\n send a line feed.\n"
  923. " \\r send a carriage return.\n"
  924. " \\t send a horizontal tab.\n"
  925. " \\x print an 8 bit character using hexadecimal, \\xFF for example.\n"
  926. " \\x7B send the '{' character.\n"
  927. " \\x7D send the '}' character.\n"
  928. " \\u print a 16 bit unicode character, \\uFFFD for example.\n"
  929. " \\U print a 21 bit unicode character, \\U02AF21 for example.\n"
  930. " \\v send a vertical tab\n"
  931. "\n"
  932. " Ending a line with \\ will stop tintin from appending a line feed.\n"
  933. " To escape arguments in an alias or action use %%0 %%1 %%2 etc.\n",
  934. "characters colors coordinates mathematics pcre"
  935. },
  936. {
  937. "EVENT",
  938. "<178>Command<278>: #event <178>{<278>event type<178>}<278>\n"
  939. "\n"
  940. " Events allow you to create triggers for predetermined client events.\n"
  941. "\n"
  942. " Use #event without an argument to see a list of possible events with\n"
  943. " a brief description. Use #event %* to see the current list of defined\n"
  944. " events. Use #info {events} {on} to see events get thrown.\n"
  945. "\n"
  946. " Some events can be prefixed with CATCH to interrupt default behavior.\n"
  947. "\n"
  948. " CATCH <EVENT>\n"
  949. " CHAT MESSAGE %0 default %1 plain\n"
  950. " CLASS ACTIVATED %0 class name\n"
  951. " CLASS DEACTIVATED %0 class name\n"
  952. " DATE %1 month - %3 day %4 hour : %5 minute\n"
  953. " DAY <DAY> %3 day of the month\n"
  954. " DOUBLE-CLICKED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  955. " END OF PATH\n"
  956. " HOUR %4 hour\n"
  957. " IAC <VAR> <VAR>\n"
  958. " IAC SB GMCP <MODULE> %0 data %1 raw data\n"
  959. " IAC SB MSSP %0 variable %1 value\n"
  960. " IAC SB MSDP %0 variable %1 value %2 plain value\n"
  961. " IAC SB MSDP <VAR> %0 variable %1 value %2 plain value\n"
  962. " IAC SB NEW-ENVIRON %0 variable %1 value\n"
  963. " IAC SB ZMP <VAR> %0 value\n"
  964. " IAC SB <VAR> %0 raw text %1 raw data\n"
  965. " LONG-CLICKED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  966. " MAP ENTER MAP %0 new vnum\n"
  967. " MAP ENTER ROOM %0 new vnum %1 old vnum\n"
  968. " MAP ENTER ROOM <VAR> %0 new vnum %1 old vnum\n"
  969. " MAP EXIT MAP %0 old vnum\n"
  970. " MAP EXIT ROOM %0 old vnum %1 new vnum\n"
  971. " MAP EXIT ROOM <VAR> %0 old vnum %1 new vnum\n"
  972. " MAP FOLLOW MAP %0 old vnum %1 new vnum %2 exit name\n"
  973. " MAP MOUSE LOCATION %0 vnum %1 location\n"
  974. " MAP UPDATED VTMAP\n"
  975. " MINUTE %5 minute\n"
  976. " MONTH %1 month\n"
  977. " MOVED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  978. " PORT CONNECTION %0 name %1 ip %2 port\n"
  979. " PORT DISCONNECTION %0 name %1 ip %2 port\n"
  980. " PORT MESSAGE %0 data %1 plain data\n"
  981. " PORT LOG MESSAGE %0 name %1 ip %2 port %3 data %4 plain data\n"
  982. " PORT RECEIVED MESSAGE %0 name %1 ip %2 port %3 data %4 plain data\n"
  983. " PRESSED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  984. " PROGRAM START %0 startup arguments\n"
  985. " PROGRAM TERMINATION %0 goodbye message\n"
  986. " READ ERROR %0 filename %1 error message\n"
  987. " RECEIVED INPUT %0 raw text\n"
  988. " RECEIVED KEYPRESS %0 raw text %1 unicode index\n"
  989. " RECEIVED LINE %0 raw text %1 plain text\n"
  990. " RECEIVED OUTPUT %0 raw text\n"
  991. " RECEIVED PROMPT %0 raw text %1 plain text\n"
  992. " RELEASED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  993. " SCAN CSV HEADER %0 all args %1 arg1 %2 arg2 .. %99 arg99\n"
  994. " SCAN CSV LINE %0 all args %1 arg1 %2 arg3 .. %99 arg99\n"
  995. " SCAN TSV HEADER %0 all args %1 arg1 %2 arg3 .. %99 arg99\n"
  996. " SCAN TSV LINE %0 all args %1 arg1 %2 arg3 .. %99 arg99\n"
  997. " SCREEN FOCUS %0 focus (0 or 1)\n"
  998. " SCREEN LOCATION %0 rows %1 cols %2 height %3 width\n"
  999. " SCREEN MOUSE LOCATION %0-3 screen row/col %4-7 cell row/col %8 loc\n"
  1000. " SCREEN RESIZE %0 rows %1 cols %2 height %3 width\n"
  1001. " SCREEN SPLIT %0 top row %1 top col %2 bot row %3 bot col\n"
  1002. " SCREEN UNSPLIT %0 top row %1 top col %2 bot row %3 bot col\n"
  1003. " SCROLLED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1004. " SECOND %6 second\n"
  1005. " SEND OUTPUT %0 raw text %1 size\n"
  1006. " SENT OUTPUT %0 raw text %1 size\n"
  1007. " SESSION ACTIVATED %0 name\n"
  1008. " SESSION CONNECTED %0 name %1 host %2 ip %3 port\n"
  1009. " SESSION CREATED %0 name %1 host %2 ip %3 port\n"
  1010. " SESSION DEACTIVATED %0 name\n"
  1011. " SESSION DISCONNECTED %0 name %1 host %2 ip %3 port\n"
  1012. " SESSION TIMED OUT %0 name %1 host %2 ip %3 port\n"
  1013. " SHORT-CLICKED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1014. " SWIPED <DIR>\n"
  1015. " %0 dir %1 button %2 row %3 col %4 -row %5 -col %6 row %7 col %8 -row\n"
  1016. " %9 -col %10 rows %11 cols\n"
  1017. " SYSTEM ERROR %0 name %1 system msg %2 error %3 error msg\n"
  1018. " TIME %4 hour : %5 minute : %6 second\n"
  1019. " TRIPLE-CLICKED <VAR> %0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1020. " UNKNOWN COMMAND %0 raw text\n"
  1021. " VARIABLE UPDATE <VAR> %0 name %1 new value\n"
  1022. " VARIABLE UPDATED <VAR> %0 name %1 new value\n"
  1023. " VT100 SCROLL REGION %0 top row %1 bot row %2 rows %3 cols %4 wrap\n"
  1024. " WEEK <DAY> %2 day of the week\n"
  1025. " WRITE ERROR %0 filename %1 error message\n"
  1026. " YEAR %0 year\n"
  1027. "\n"
  1028. " To see all events trigger use #event info on. Since this can quite\n"
  1029. " spammy it's possible to gag event info messages.\n"
  1030. "\n"
  1031. "<178>Example<278>: #event {SESSION CONNECTED} {#read mychar.tin}\n"
  1032. "\n"
  1033. "<178>Comment<278>: You can remove an event with the #unevent command.\n",
  1034. "button delay ticker"
  1035. },
  1036. {
  1037. "FORALL",
  1038. "<178>This command is obsolete, please use foreach instead.\n",
  1039. "foreach"
  1040. },
  1041. {
  1042. "FOREACH",
  1043. "<178>Command<278>: #foreach <178>{<278>list<178>} {<278>variable<178>} {<278>commands<178>}<278>\n"
  1044. "\n"
  1045. " For each item in the provided list the foreach statement will update\n"
  1046. " the given variable and execute the command part of the statement. List\n"
  1047. " elements must be separated by braces or semicolons.\n"
  1048. "\n"
  1049. "<178>Example<278>: #foreach {bob;tim;kim} {name} {tell $name Hello}\n"
  1050. "<178>Example<278>: #foreach {{bob}{tim}{kim}} {name} {tell $name Hello}\n",
  1051. "break continue list loop parse repeat return while"
  1052. },
  1053. {
  1054. "FORMAT",
  1055. "<178>Command<278>: #format <178>{<278>variable<178>} {<278>format<178>} {<278>argument1<178>} {<278>argument2<178>} {<278>etc<178>}<278>\n"
  1056. "\n"
  1057. " Allows you to store a string into a variable in the exact same way\n"
  1058. " C's sprintf works with a few enhancements and limitations such as\n"
  1059. " no integer operations and a maximum of 30 arguments.\n"
  1060. "\n"
  1061. " If you use #format inside an alias or action you must escape %1s as\n"
  1062. " %+1s or %%1s or %\\1s so the %1 isn't substituted by the trigger.\n"
  1063. "\n"
  1064. " #format {test} {%+9s} {string} pad string with up to 9 spaces\n"
  1065. " #format {test} {%-9s} {string} post pad string with up to 9 spaces\n"
  1066. " #format {test} {%.8s} {string} copy at most 8 characters\n"
  1067. " #format {test} {%a} {number} print corresponding charset character\n"
  1068. " #format {test} {%c} {string} use a highlight color name\n"
  1069. " #format {test} {%d} {number} print a number with integer formatting\n"
  1070. " #format {test} {%f} {string} perform floating point math\n"
  1071. " #format {test} {%g} {number} perform thousand grouping on {number}\n"
  1072. " #format {test} {%h} {string} turn text into a header line\n"
  1073. " #format {test} {%l} {string} lowercase text\n"
  1074. " #format {test} {%m} {string} perform mathematical calculation\n"
  1075. " #format {test} {%n} {name} capitalize the first letter\n"
  1076. " #format {test} {%p} {string} strip leading and trailing spaces\n"
  1077. " #format {test} {%r} {string} reverse text, hiya = ayih\n"
  1078. " #format {test} {%s} {string} print given string\n"
  1079. " #format {test} {%t} {format} display time with strftime format\n"
  1080. " optional {{format}{time}} syntax\n"
  1081. " #format {test} {%u} {string} uppercase text\n"
  1082. " #format {list} {%w} {string} store word wrapped text in {list}\n"
  1083. " optional {{string}{width}} syntax\n"
  1084. " #format {test} {%x} {hex} print corresponding charset character\n"
  1085. " #format {test} {%A} {char} store corresponding character value\n"
  1086. " #format {test} {%C} {number} store number in chronological notation\n"
  1087. " #format {test} {%D} {hex} convert hex to decimal in {test}\n"
  1088. " #format {hash} {%H} {string} store a 64 bit string hash in {hash}\n"
  1089. " #format {test} {%L} {string} store the string length in {test}\n"
  1090. " #format {test} {%M} {number} convert number to metric in {test}\n"
  1091. " #format {test} {%S} {string} store the number of spelling errors\n"
  1092. " #format {time} {%T} {} store the epoch time in {time}\n"
  1093. " #format {time} {%U} {} store the micro epoch time in {time}\n"
  1094. " #format {test} {%X} {dec} convert dec to hexadecimal in {test}\n\n"
  1095. " #format {test} {%%} a literal % character\n"
  1096. "\n"
  1097. "<178>Comment<278>: See #help TIME for help on the %t argument.\n",
  1098. "cat echo function local math replace script time variable"
  1099. },
  1100. {
  1101. "FUNCTION",
  1102. "<178>Command<278>: #function <178>{<278>name<178>} {<278>operation<178>}<278>\n"
  1103. "\n"
  1104. " Functions allow you to execute a script within a line of text, and\n"
  1105. " replace the function call with the line of text generated by the\n"
  1106. " function.\n"
  1107. "\n"
  1108. " Be aware that each function should set the $result variable at the\n"
  1109. " end of the function, or call #return with the given result.\n"
  1110. "\n"
  1111. " To use a function use the @ character before the function name.\n"
  1112. " The function arguments should be placed between braces behind the\n"
  1113. " function name with argument separated by semicolons.\n"
  1114. "\n"
  1115. " The function itself can use the provided arguments which are stored\n"
  1116. " in %1 to %9, with %0 holding all arguments.\n"
  1117. "\n"
  1118. "<178>Example<278>: #function {rnd} {#math {result} {1 d (%2 - %1 + 1) + %1 - 1}}\n"
  1119. " #showme A random number between 100 and 200: @rnd{100;200}\n"
  1120. "\n"
  1121. "<178>Example<278>: #function gettime {#format result %t %H:%M}\n"
  1122. " #showme The current time is @gettime{}\n"
  1123. "\n"
  1124. "<178>Comment<278>: You can remove a function with the #unfunction command.\n",
  1125. "format local math replace script variable"
  1126. },
  1127. {
  1128. "GAG",
  1129. "<178>Command<278>: #gag <178>{<278>string<178>}<278>\n"
  1130. "\n"
  1131. " Removes any line that contains the string.\n"
  1132. "\n"
  1133. "<178>Comment<278>: See '#help action', for more information about triggers.\n"
  1134. "\n"
  1135. "<178>Comment<278>: You can remove a gag with the #ungag command.\n",
  1136. "action highlight prompt substitute"
  1137. },
  1138. {
  1139. "GREETING",
  1140. "<268> #<268>##################################################################<268>#\n"
  1141. "<268> #<278> <268>#\n"
  1142. "<268> #<278> T I N T I N + + "CLIENT_VERSION" <268>#\n"
  1143. "<268> #<278> <268>#\n"
  1144. // "<268> #<278> <268>T<278>he K<268>i<278>cki<268>n<278> <268>T<278>ickin D<268>i<278>kuMUD Clie<268>n<278>t <268> #\n"
  1145. // "<268> #<278> <268>#\n"
  1146. "<268> #<278> Code by Peter Unold, Bill Reis, and Igor van den Hoven <268>#\n"
  1147. "<268> #<278> <268>#\n"
  1148. "<268> #<268>##################################################################<268>#<288>\n",
  1149. ""
  1150. },
  1151. {
  1152. "GREP",
  1153. "<178>Command<278>: #grep <178>[<278>page<178>] {<278>search string<178>}<278>\n"
  1154. "\n"
  1155. " This command allows you to search for matching lines in your scroll\n"
  1156. " back buffer. The amount of matches shown equals your screen size. If\n"
  1157. " you want to search back further use the optional page number. You can\n"
  1158. " use wildcards for better search results. Be aware the search string\n"
  1159. " is case sensitive, which can be disabled by using %i.\n"
  1160. "\n"
  1161. " By default grep searches from the end of the scrollback buffer to the\n"
  1162. " beginning, this can be reversed by using a negative page number.\n"
  1163. "\n"
  1164. "<178>Example<278>: #grep Bubba tells you\n"
  1165. " This will show all occasions where bubba tells you something.\n",
  1166. "buffer echo showme"
  1167. },
  1168. {
  1169. "HELP",
  1170. "<178>Command<278>: #help <178>{<278>subject<178>}<278>\n"
  1171. "\n"
  1172. " Without an argument #help will list all available help subjects.\n"
  1173. "\n"
  1174. " Using #help %* will display all help entries.\n",
  1175. "commands debug ignore info message statements"
  1176. },
  1177. {
  1178. "HIGHLIGHT",
  1179. "<178>Command<278>: #highlight <178>{<278>string<178>} {<278>color names<178>} {<278>priority<178>}<278>\n"
  1180. "\n"
  1181. " The highlight command is used to allow you to highlight strings of text.\n"
  1182. "\n"
  1183. " Available color options are:\n"
  1184. "\n"
  1185. " reset - resets the color state to default\n"
  1186. " light - turns the color light in 16 color mode.\n"
  1187. " dark - turns the color dark in 16 color mode.\n"
  1188. " underscore - underscores the text.\n"
  1189. " blink - makes the text blink.\n"
  1190. " reverse - reverse foreground and background color.\n"
  1191. " b - makes next color the background color.\n"
  1192. "\n"
  1193. " Available color names are:\n"
  1194. "\n"
  1195. " <<888>F06B> - azure <<888>F08F> - Azure\n"
  1196. " <<888>F00B> - blue <<888>F00F> - Blue\n"
  1197. " <<888>F0BB> - cyan <<888>F0FF> - Cyan\n"
  1198. " <<888>F000> - ebony <<888>F666> - Ebony\n"
  1199. " <<888>F0B0> - green <<888>F0F0> - Green\n"
  1200. " <<888>F0B6> - jade <<888>F0F8> - Jade\n"
  1201. " <<888>F6B0> - lime <<888>F8F0> - Lime\n"
  1202. " <<888>FB0B> - magenta <<888>FF0F> - Magenta\n"
  1203. " <<888>FB60> - orange <<888>FF80> - Orange\n"
  1204. " <<888>FB06> - pink <<888>FF08> - Pink\n"
  1205. " <<888>FB00> - red <<888>FF00> - Red\n"
  1206. " <<888>F888> - silver <<888>FDDD> - Silver\n"
  1207. " <<888>F860> - tan <<888>FDB0> - Tan\n"
  1208. " <<888>F60B> - violet <<888>F80F> - Violet\n"
  1209. " <<888>FBBB> - white <<888>FFFF> - White\n"
  1210. " <<888>FBB0> - yellow <<888>FFF0> - Yellow\n"
  1211. "\n"
  1212. " The %1-99 variables can be used as 'wildcards' that will match with any\n"
  1213. " text. They are useful for highlighting a complete line. The %0 variable\n"
  1214. " should never be used in highlights.\n"
  1215. "\n"
  1216. " You may start the string to highlight with a ^ to only highlight text\n"
  1217. " if it begins the line.\n"
  1218. "\n"
  1219. " Besides color names also <<888>abc> color codes can be used.\n"
  1220. "\n"
  1221. "<178>Example<278>: #high {Valgar} {reverse blink}\n"
  1222. " Prints every occurrence of 'Valgar' in blinking reverse video.\n"
  1223. "\n"
  1224. "<178>Example<278>: #high {^You %1} {bold cyan}\n"
  1225. " Boldfaces any line that starts with 'You' in cyan.\n"
  1226. "\n"
  1227. "<178>Example<278>: #high {Bubba} {red underscore b green}\n"
  1228. " Highlights the name Bubba as red underscored text on green background.\n"
  1229. "\n"
  1230. "<178>Comment<278>: See '#help action', for more information about triggers.\n"
  1231. "\n"
  1232. "<178>Comment<278>: See '#help substitute', for more advanced color substitution.\n"
  1233. "\n"
  1234. "<178>Comment<278>: This command only works with ANSI/VT100 terminals or emulators.\n"
  1235. "\n"
  1236. "<178>Comment<278>: You can remove a highlight with the #unhighlight command.\n",
  1237. "action gag prompt substitute"
  1238. },
  1239. {
  1240. "HISTORY",
  1241. "<178>Command<278>: #history <178>{<278>delete<178>}<278> Delete the last command.\n"
  1242. " #history <178>{<278>insert<178>} {<278>command<178>}<278> Insert a command.\n"
  1243. " #history <178>{<278>list<178>}<278> Display the entire command history.\n"
  1244. " #history <178>{<278>read<178>} {<278>filename<178>}<278> Read a command history from file.\n"
  1245. " #history <178>{<278>write<178>} {<278>filename<178>}<278> Write a command history to file.\n"
  1246. "\n"
  1247. " Without an argument all available options are shown.\n"
  1248. "\n"
  1249. " By default all commands are saved to the history list and the history\n"
  1250. " list is saved between sessions in the ~/.tintin/history.txt file.\n"
  1251. "\n"
  1252. " You can set the character to repeat a command in the history with the\n"
  1253. " #config {REPEAT CHAR} {<character>} configuration option, by default\n"
  1254. " this is set to the exclamation mark.\n"
  1255. "\n"
  1256. " You can use ! by itself to repeat the last command, or !<text> to\n"
  1257. " repeat the last command starting with the given text.\n"
  1258. "\n"
  1259. " You can use #config {REPEAT ENTER} {ON} to repeat the last command\n"
  1260. " when you press enter on an empty line.\n"
  1261. "\n"
  1262. " You can press ctrl-r to enter an interactive regex enabled history\n"
  1263. " search mode, or by issuing #cursor {history search}.\n"
  1264. "\n"
  1265. " TinTin++ tries to bind the arrow up and down keys to scroll through\n"
  1266. " the history list by default. You can bind these with a macro yourself\n"
  1267. " using #cursor {history next} and #cursor {history prev}. Many #cursor\n"
  1268. " commands only work properly when bound with a macro.\n",
  1269. "alias cursor keypad macro speedwalk tab"
  1270. },
  1271. {
  1272. "IF",
  1273. "<178>Command<278>: #if <178>{<278>conditional<178>} {<278>commands if true<178>} {<278>commands if false<178>}<278>\n"
  1274. "\n"
  1275. " The 'if' command is one of the most powerful commands added since\n"
  1276. " TINTIN III. It works similar to an 'if' statement in other languages,\n"
  1277. " and is strictly based on the way C handles its conditional statements.\n"
  1278. " When an 'if' command is encountered, the conditional statement is\n"
  1279. " evaluated, and if TRUE (any non-zero result) the commands are executed.\n"
  1280. "\n"
  1281. " The 'if' statement is only evaluated if it is read, so you must nest\n"
  1282. " the 'if' statement inside another statement (most likely an 'action'\n"
  1283. " command). The conditional is evaluated exactly the same as in the\n"
  1284. " 'math' command only instead of storing the result, the result is used\n"
  1285. " to determine whether to execute the commands.\n"
  1286. "\n"
  1287. "<178>Example<278>: #action {%0 gives you %1 gold coins.} {#if {%1>5000} {thank %0}}\n"
  1288. " If someone gives you more than 5000 coins, thank them.\n"
  1289. "\n"
  1290. "<178>Comment<278>: See '#help math', for more information.\n",
  1291. "case default else elseif switch regex"
  1292. },
  1293. {
  1294. "IGNORE",
  1295. "<178>Command<278>: #ignore <178>{<278>listname<178>} {<278>on<178>|<278>off<178>}<278>\n"
  1296. "\n"
  1297. " Toggles a list on or off. With no arguments it shows your current\n"
  1298. " settings, as well as the list names that you can ignore.\n"
  1299. "\n"
  1300. " If you for example set ACTIONS to OFF actions will no longer trigger.\n"
  1301. " Not every list can be ignored.\n",
  1302. "class debug info kill message"
  1303. },
  1304. {
  1305. "INDEX",
  1306. "<278>"
  1307. " On this page you'll find an introduction to using TinTin++. Additional\n"
  1308. " information can be found in the individual help sections.\n"
  1309. "<128>\n"
  1310. " Starting and Ending\n"
  1311. "<278>\n"
  1312. " The syntax for starting TinTin++ is: ./tt++ [command file]\n"
  1313. "\n"
  1314. " Read more about the command file in the files section below. Remember\n"
  1315. " one thing though. All actions, aliases, substitutions, etc, defined\n"
  1316. " when starting up TinTin++ are inherited by all sessions.\n"
  1317. "\n"
  1318. " If you want to exit TinTin++ type '#end' or press ctrl-d on an empty\n"
  1319. " line.\n"
  1320. "\n"
  1321. " For the WinTin++ users, if you want to paste text use shift-insert,\n"
  1322. " text is automatically copied upon selection. This is typical Linux\n"
  1323. " behavior, but it can take some getting used to.\n"
  1324. "\n"
  1325. "<128>\n"
  1326. " Basic features\n"
  1327. "<278>\n"
  1328. " I'll start by explaining some of the very basic and important features:\n"
  1329. "\n"
  1330. " All TinTin++ commands starts with a '#'.\n"
  1331. "\n"
  1332. "<178>Example<278>: #help -- #help is a client command, and isn't send to the\n"
  1333. " server.\n"
  1334. "\n"
  1335. " All TinTin++ commands can be abbreviated when typed.\n"
  1336. "\n"
  1337. " #he -- Typing #he is the same as typing #help though it's suggested to\n"
  1338. " use at least 3 letter abbreviations just in case another command is\n"
  1339. " added that starts with 'he'.\n"
  1340. "\n"
  1341. " All commands can be separated with a ';'.\n"
  1342. "\n"
  1343. " n;l green;s;say Dan Dare is back! -- do these 4 commands\n"
  1344. " There are 3 ways ';'s can be overruled.\n"
  1345. "\n"
  1346. " \\say Hello ;) -- Lines starting with a '\\' aren't parsed by TinTin++.\n"
  1347. " say Hello \\;) -- The escape character can escape 1 letter.\n"
  1348. " #config verbatim on -- Everything is send as is except '#' commands.\n"
  1349. "<128>\n"
  1350. " Connecting to a server\n"
  1351. "<178>\n"
  1352. "Command<278>: #session <178>{<278>session name<178>} {<278>server address<178>} {<278>port<178>}<278>\n"
  1353. "\n"
  1354. " Example: #session someone tintin.sourceforge.net 4321\n"
  1355. "\n"
  1356. " You can have more than one session, in which case you can switch\n"
  1357. " between sessions typing #<session name>.\n"
  1358. "\n"
  1359. " You can get a list of all sessions by typing: #session. The current\n"
  1360. " active session is marked with (active). Snooped sessions with\n"
  1361. " (snooped). MCCP sessions (compression) with (mccp 2) and (mccp 3).\n"
  1362. "\n"
  1363. "<128>\n"
  1364. " Split\n"
  1365. "<178>\n"
  1366. "Command<278>: #split\n"
  1367. "\n"
  1368. " The split command will create a separated input and output area.\n"
  1369. "\n"
  1370. " Using the #prompt command you can capture the prompt and place it on\n"
  1371. " the split line. To get rid of the split interface you can use #unsplit\n"
  1372. " which will restore the terminal settings to default.\n"
  1373. "\n"
  1374. "<128>\n"
  1375. " Alias\n"
  1376. "<178>\n"
  1377. "Command<278>: #alias <178>{<278>name<178>} {<278>commands<178>}<278>\n"
  1378. "\n"
  1379. " The syntax of the #alias command is almost like alias in csh.\n"
  1380. " Use this command to define aliases. The variables %0, %1.. %9 contain\n"
  1381. " the arguments to the aliased command as follows:\n"
  1382. " the %0 variable contains ALL the arguments.\n"
  1383. " the %1 variable contains the 1st argument\n"
  1384. " ....\n"
  1385. " the %9 variable contains the 9th argument\n"
  1386. "\n"
  1387. "<178>Example<278>: #alias greet say Greetings, most honorable %1\n"
  1388. "\n"
  1389. " If there are no variables on the right-side of the alias definition,\n"
  1390. " any arguments following the aliases-command will be appended to the\n"
  1391. " command string.\n"
  1392. "\n"
  1393. "<178>Example<278>: #alias ff cast 'fireball' -- 'ff bob' equals: cast 'fireball' bob\n"
  1394. "\n"
  1395. " If you want an alias to execute more commands, you must use braces.\n"
  1396. "\n"
  1397. "<178>Example<278>: #alias ws <178>{<278>wake;stand<178>}<278>\n"
  1398. "\n"
  1399. " To delete an alias use the #unalias command.\n"
  1400. "\n"
  1401. " WARNING! TinTin++ doesn't baby sit, and hence does not check for\n"
  1402. " recursive aliases! You can avoid recursion by escaping the entire\n"
  1403. " line.\n"
  1404. "\n"
  1405. "<178>Example<278>: #alias put \\put %1 in %2\n"
  1406. "\n"
  1407. " Or by using the send command.\n"
  1408. "\n"
  1409. "<178>Example<278>: #send put %1 in %2\n"
  1410. "\n"
  1411. "\n"
  1412. "<128> Action\n"
  1413. "\n"
  1414. "<178>Command<278>: #action <178>{<278>action-text<178>} {<278>commands<178>}<278>\n"
  1415. "\n"
  1416. " Use this command to define an action to take place when a particular\n"
  1417. " text appears on your screen. There are 99 variables you can use as\n"
  1418. " wildcards in the action-text.\n"
  1419. "\n"
  1420. " These variables are %1, %2, %3 .... %9, %10, %11 ... %97, %98, %99.\n"
  1421. "\n"
  1422. "<178>Example<278>: #action <178>{<278>You are hungry<178>} {<278>get bread bag;eat bread<178>}<278>\n"
  1423. "\n"
  1424. "<178>Example<278>: #action <178>{<278>%1 has arrived.<178>}<278> shake %1 -- shake hands with people arriving.\n"
  1425. "\n"
  1426. "<178>Example<278>: #action <178>{<278>%1 tells you '%2'<178>}\n"
  1427. " {<278>tell bob %1 told me '%2'<178>}<278> -- forward tells.\n"
  1428. "\n"
  1429. "<178>Example<278>: #action <178>{<278>tells you<178>}<278> #bell -- beep on tell.\n"
  1430. "\n"
  1431. " You can have TinTin++ ignore actions if you type '#ignore actions on'.\n"
  1432. "\n"
  1433. " You can see what commands TinTin++ executes when an action triggers\n"
  1434. " by typing '#debug actions on'.\n"
  1435. "\n"
  1436. " You can remove actions with the #unaction command.\n"
  1437. "\n"
  1438. "<128>\n"
  1439. " Highlight\n"
  1440. "\n"
  1441. "<178>Command<278>: #highlight <178>{<278>text<178>} {<278>color<178>}<278>\n"
  1442. "\n"
  1443. " This command works a bit like #action. The purpose of this command is\n"
  1444. " to substitute text from the server with color you provide. This command\n"
  1445. " is a simplified version of the #substitute command.\n"
  1446. "\n"
  1447. "<178>Example<278>: #high <178>{<278>Snowy<178>} {<278>light yellow<178>}<278>\n"
  1448. "\n"
  1449. "<178>Example<278>: #high <178>{<278>%*Snowy%*<178>} {<278>light yellow<178>}<278>\n"
  1450. "\n"
  1451. " Use #unhigh to delete highlights.\n"
  1452. "\n"
  1453. "\n"
  1454. " Speedwalk\n"
  1455. "\n"
  1456. " If you type a command consisting ONLY of letters and numbers n, e, s,\n"
  1457. " w, u, d - then this command can be interpreted as a serie of movement\n"
  1458. " commands.\n"
  1459. "\n"
  1460. "<178>Example<278>: ssw2n -- go south, south, west, north, north\n"
  1461. "\n"
  1462. " If you have problems with typing some commands that actually ONLY\n"
  1463. " consists of these letters, then type them in CAPS. For example when\n"
  1464. " checking the NEWS or when asked to enter NEW as your name.\n"
  1465. "\n"
  1466. " You must enable speedwalking with: #config speedwalk on/off.\n"
  1467. "\n"
  1468. "<128>\n"
  1469. " Ticker\n"
  1470. "\n"
  1471. "<178>Command<278>: #ticker <178>{<278>name<178>} {<278>commands<178>} {<278>seconds<178>}<278>\n"
  1472. "\n"
  1473. " The name can be whatever you want it to be, and is only required for\n"
  1474. " the unticker command. The commands will be executed every x amount of\n"
  1475. " seconds, which is specified in the interval part.\n"
  1476. "\n"
  1477. "<178>Example<278>: #tick <178>{<278>tick<178>} {<278>#delay 50 #show 10 SECONDS TO TICK!;#show TICK!!!<178>} {<278>60<178>}<278>\n"
  1478. "\n"
  1479. " This creates a ticker with the name <178>{<278>tick<178>}<278> which will print TICK!!!,\n"
  1480. " as well as print a warning when the next tick will occure.\n"
  1481. "\n"
  1482. " You can remove tickers with #untick\n"
  1483. "\n"
  1484. "<128>\n"
  1485. " Command files\n"
  1486. "<278>\n"
  1487. " When you order TinTin++ to read a command file, it parses all the text\n"
  1488. " in the file. You can use command files to keep aliases/actions in,\n"
  1489. " login to a server (name, password etc..) and basically all kinds of\n"
  1490. " commands.\n"
  1491. "\n"
  1492. " You can make the command files with either a text editor (suggested),\n"
  1493. " or use the #write command to write out a file.\n"
  1494. "\n"
  1495. " Commands for files:\n"
  1496. "\n"
  1497. " #read filename -- read and execute the file.\n"
  1498. "\n"
  1499. " #write filename -- write all actions/aliases/substitutes/etc known for\n"
  1500. " the current session to a file.\n"
  1501. "\n"
  1502. "<128>\n"
  1503. " Repeating Commands\n"
  1504. "<278>\n"
  1505. " You can repeat a command, the syntax is: #number command\n"
  1506. "\n"
  1507. "<178>Example<278>: #5 cackle -- if you just killed bob the wizard.\n"
  1508. "<178>Example<278>: #10 <178>{<278>buy bread;put bread bag<178>}<278> -- repeat these 2 commands 10 times.\n"
  1509. "<178>Example<278>: #100 ooc w00t w00t!!!!! -- nochannel yourself.\n"
  1510. "\n"
  1511. "<128>\n"
  1512. " History\n"
  1513. "<278>\n"
  1514. " TinTin++ has a limited subset of the csh history features.\n"
  1515. "\n"
  1516. " ! -- repeat the last command\n"
  1517. " !cast -- repeat the last command starting with cast\n"
  1518. " ctrl-r -- enter the reverse history search mode.\n"
  1519. "\n"
  1520. "<128>\n"
  1521. " Map commands\n"
  1522. "<278>\n"
  1523. " TinTin++ has a powerful highly configurable automapper. Whenever\n"
  1524. " you type n/ne/e/se/s/sw/w/nw/n/u/d tt++ tries to keep track of your\n"
  1525. " movement.\n"
  1526. "\n"
  1527. " Commands for map:\n"
  1528. "\n"
  1529. " #map create -- create a map.\n"
  1530. " #map goto 1 -- go to the first room in the map, created by default.\n"
  1531. " #map map -- display the map.\n"
  1532. " #map undo -- undo your last map alteration.\n"
  1533. " #map write <filename> -- save the map to file.\n"
  1534. " #map read <filename> -- load a map from file.\n"
  1535. "\n"
  1536. " There are many other map options and it's beyond the scope of this\n"
  1537. " help section to explain everything there is to know, but I'll give\n"
  1538. " a set of commands that will get most people started.\n"
  1539. "\n"
  1540. " #map create\n"
  1541. " #split 12 1\n"
  1542. " #map flag unicode on\n"
  1543. " #map flag vt on\n"
  1544. " #map goto 1\n"
  1545. "\n"
  1546. " These commands will create a 12 row vt100 split section at the top of\n"
  1547. " your screen where a map drawn using unicode characters is displayed.\n"
  1548. "\n"
  1549. "<178>Example<278>: #action <178>{<278>There is no exit in that direction.<178>} {<278>#map undo<178>}<278>\n"
  1550. "\n"
  1551. " The map will be automatically created as you move around.\n"
  1552. "\n"
  1553. "<128>\n"
  1554. " Help\n"
  1555. "\n"
  1556. "<178>Command<278>: #help <178>{<278>subject<178>}<278>\n"
  1557. "\n"
  1558. " The help command is your friend and contains the same helpfiles\n"
  1559. " inside TinTin++ as are available on the website. If you type #help\n"
  1560. " without an argument you will see the various available help subjects\n"
  1561. " which try to explain the TinTin++ commands and features in greater\n"
  1562. " detail.\n"
  1563. "\n"
  1564. "<128>\n"
  1565. " Enjoy<278>\n",
  1566. ""
  1567. },
  1568. {
  1569. "INFO",
  1570. "<178>Command<278>: #info <178>{<278>listname<178>} {<278>LIST<178>|<278>ON<178>|<278>OFF<178>|<278>SAVE<178>}<278>\n"
  1571. "\n"
  1572. " Without an argument info displays the settings of every tintin list.\n"
  1573. "\n"
  1574. " By providing the name of a list and the LIST option it shows all\n"
  1575. " triggers/variables associated with that list. With the SAVE option\n"
  1576. " This data is written to the info variable.\n"
  1577. "\n"
  1578. " #info cpu will show information about tintin's cpu usage.\n"
  1579. " #info mccp will show information about data compression.\n"
  1580. " #info stack will show the low level debugging stack.\n"
  1581. " #info session will show some session information.\n"
  1582. " #info system will show some system information.\n"
  1583. " #info unicode will show information on the provided character.\n",
  1584. "class debug ignore kill message"
  1585. },
  1586. {
  1587. "KEYPAD",
  1588. "<278>When TinTin++ starts up it sends \\e= to the terminal to enable the terminal's\n"
  1589. "application keypad mode, which can be disabled using #showme {\\e>}\n"
  1590. "\n"
  1591. "<178> Configuration A Configuration B Configuration C<268>\n"
  1592. " ╭─────┬─────┬─────┬─────╮ ╭─────┬─────┬─────┬─────╮ ╭─────┬─────┬─────┬─────╮\n"
  1593. " │<178>num<268> │<178>/<268> │<178>*<268> │<178>-<268> │ │<178>num<268> │<178>/<268> │<178>*<268> │<178>-<268> │ │<178>Num<268> │<178>nkp/<268> │<178>nkp*<268> │<178>nkp-<268> │\n"
  1594. " ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤\n"
  1595. " │<178>7<268> │<178>8<268> │<178>9<268> │<178>+<268> │ │<178>Home<268> │<178>Up<268> │<178>PgUp<268> │<178>+<268> │ │<178>nkp7<268> │<178>nkp8<268> │<178>nkp9<268> │<178>nkp+<268> │\n"
  1596. " ├─────┼─────┼─────┤ │ ├─────┼─────┼─────┤ │ ├─────┼─────┼─────┤ │\n"
  1597. " │<178>4<268> │<178>5<268> │<178>6<268> │ │ │<178>Left<268> │<178>Cntr<268> │<178>Right<268>│ │ │<178>nkp4<268> │<178>nkp5<268> │<178>nkp6<268> │ │\n"
  1598. " ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤\n"
  1599. " │<178>1<268> │<178>2<268> │<178>3<268> │<178>Enter<268>│ │<178>End<268> │<178>Down<268> │<178>PgDn<268> │<178>Enter<268>│ │<178>nkp1<268> │<178>nkp2<268> │<178>nkp3<268> │<178>nkpEn<268>│\n"
  1600. " ├─────┴─────┼─────┤ │ ├─────┴─────┼─────┤ │ ├─────┴─────┼─────┤ │\n"
  1601. " │<178>0<268> │<178>.<268> │ │ │<178>Ins<268> │<178>Del<268><268> │ │ │<178>nkp0<268> │<178>nkp.<268> │ │\n"
  1602. " ╰───────────┴─────┴─────╯ ╰───────────┴─────┴─────╯ ╰───────────┴─────┴─────╯\n"
  1603. "<278>\n"
  1604. "With keypad mode disabled numlock on will give you configuration A, and numlock\n"
  1605. "off will give you configuration B. With keypad mode enabled you'll get\n"
  1606. "configuration C.\n"
  1607. "\n"
  1608. "<178>Terminals that support keypad mode"
  1609. "\n"
  1610. "<278>Linux Console, PuTTY, Eterm, aterm.\n"
  1611. "\n"
  1612. "<178>Terminals that do not support keypad mode\n"
  1613. "\n"
  1614. "<278>RXVT on Cygwin, Windows Console, Gnome Terminal, Konsole.\n"
  1615. "\n"
  1616. "<178>Peculiar Terminals\n"
  1617. "\n"
  1618. "<278>RXVT requires turning off numlock to enable configuration C.\n"
  1619. "\n"
  1620. "Xterm may require disabling Alt/NumLock Modifiers (num-lock) in the ctrl-left\n"
  1621. "click menu. Or edit ~/.Xresources and add XTerm*VT100.numLock:false\n"
  1622. "\n"
  1623. "Mac OS X Terminal requires enabling 'strict vt100 keypad behavior' in\n"
  1624. "Terminal -> Window Settings -> Emulation.\n",
  1625. "colors coordinates escape mathematics pcre"
  1626. },
  1627. {
  1628. "KILL",
  1629. "<178>Command<278>: #kill <178>{<278>list<178><178>} {<278>pattern<178>}<278>\n"
  1630. "\n"
  1631. " Without an argument, the kill command clears all lists. Useful if\n"
  1632. " you don't want to exit tintin to reload your command files.\n"
  1633. "\n"
  1634. " With one argument a specific list can be cleared.\n"
  1635. "\n"
  1636. " With two arguments the triggers in the chosen list that match the\n"
  1637. " given pattern will be removed.\n"
  1638. "\n"
  1639. "<178>Example<278>: #kill alias %*test*\n",
  1640. "class debug ignore info message"
  1641. },
  1642. {
  1643. "LINE",
  1644. "<178>Command<278>: #line <178>{<278>option<178>} {<278>argument<178>}<278>\n"
  1645. "\n"
  1646. " <178>#line background <argument>\n"
  1647. " <278> Prevent new session activation.\n"
  1648. "\n"
  1649. " <178>#line capture <variable> <argument.\n"
  1650. " <278> Argument is executed and output stored in <variable>.\n"
  1651. "\n"
  1652. " <178>#line debug <argument>\n"
  1653. " <278> Argument is executed in debug mode.\n"
  1654. "\n"
  1655. " <178>#line gag\n"
  1656. " <278> Gag the next line.\n"
  1657. "\n"
  1658. " <178>#line ignore {argument}\n"
  1659. " <278> Argument is executed without any triggers being checked.\n"
  1660. "\n"
  1661. " <178>#line log <filename> [text]\n"
  1662. " <278> Log the next line to file unless the [text] argument is\n"
  1663. " <278> provided.\n"
  1664. "\n"
  1665. " <178>#line logmode <option> <argument>\n"
  1666. " <278> Argument is executed using the provided logmode, available\n"
  1667. " <278> modes are: html, plain, and raw.\n"
  1668. // "\n"
  1669. // " <178>#line logverbatim {filename} {[text]} Log text without variable\n"
  1670. // " <278> substitution.\n"
  1671. "\n"
  1672. " <178>#line oneshot <argument>\n"
  1673. " <278> Argument is executed in oneshot mode, all triggers created will\n"
  1674. " <278> only fire once.\n"
  1675. "\n"
  1676. " <178>#line quiet <argument>\n"
  1677. " <278> Argument is executed with suppression of most system messages.\n"
  1678. "\n"
  1679. " <178>#line strip <argument>\n"
  1680. " <278> Argument is executed with all color codes stripped.\n"
  1681. "\n"
  1682. " <178>#line substitute <options> <argument>\n"
  1683. " <278> Argument is executed using the provided substitutions, available\n"
  1684. " <278> options are: arguments, colors, escapes, functions, secure, and\n"
  1685. " <278> variables.\n"
  1686. "\n"
  1687. " <178>#line verbatim <argument>\n"
  1688. " <278> Argument is executed verbatim, prohibiting variable and function\n"
  1689. " <278> substitutions.\n"
  1690. "\n"
  1691. " <178>#line verbose <argument>\n"
  1692. " <278> Argument is executed with most system messages enabled.\n"
  1693. "\n"
  1694. " When using #line log and logging in html format use \\c< \\c> \\c& \\c\" to\n"
  1695. " log a literal < > & and \".\n",
  1696. "class config"
  1697. },
  1698. {
  1699. "LIST",
  1700. "<178>Command<278>: #list <178>{<278>variable<178>} {<278>option<178>} {<278>argument<178>}<278>\n"
  1701. "\n"
  1702. " #list {var} {add} {item} Add {item} to the list\n"
  1703. " #list {var} {clear} Empty the given list\n"
  1704. " #list {var} {collapse} Turn list into a variable\n"
  1705. " #list {var} {create} {item} Create a list using {items}\n"
  1706. " #list {var} {delete} {index} {number} Delete the item at {index},\n"
  1707. " the {number} is optional.\n"
  1708. " #list {var} {explode} Turn list into a character list\n"
  1709. " #list {var} {insert} {index} {string} Insert {string} at given index\n"
  1710. " #list {var} {find} {string} {variable} Return the found index\n"
  1711. " #list {var} {get} {index} {variable} Copy an item to {variable}\n"
  1712. " #list {var} {shuffle} Shuffle the list\n"
  1713. " #list {var} {set} {index} {string} Change the item at {index}\n"
  1714. " #list {var} {simplify} {variable} Copy simple list to {variable}\n"
  1715. " #list {var} {size} {variable} Copy list size to {variable}\n"
  1716. " #list {var} {sort} {string} Insert item in alphabetic order\n"
  1717. " #list {var} {tokenize} {string} Create a character list\n"
  1718. "\n"
  1719. " The index should be between 1 and the list's length. You can also give\n"
  1720. " a negative value, in which case -1 equals the last item in the list, -2\n"
  1721. " the second last, etc.\n"
  1722. "\n"
  1723. " When inserting an item a positive index will prepend the item at the\n"
  1724. " given index, while a negative index will append the item.\n"
  1725. "\n"
  1726. " The add and create options allow using multiple items, as well\n"
  1727. " as semicolon separated items.\n"
  1728. "\n"
  1729. " A length of 0 is returned for an empty or non existant list.\n"
  1730. "\n"
  1731. " You can directly access elements in a list variable using $var[1],\n"
  1732. " $var[2], $var[-1], etc.\n",
  1733. "break continue foreach loop parse repeat return while"
  1734. },
  1735. {
  1736. "LOCAL",
  1737. "<178>Command<278>: #local <178>{<278>variable name<178>} {<278>text to fill variable<178>}<278>\n"
  1738. "\n"
  1739. " The local command sets a local variable. Unlike a regular variable\n"
  1740. " a local variable will only stay in memory for the duration of the\n"
  1741. " event that created it. They are accessed in the same way as a\n"
  1742. " regular variable.\n"
  1743. "\n"
  1744. " Commands that store information to a variable will use a local variable\n"
  1745. " if it exists.\n"
  1746. "\n"
  1747. " Avoid setting the result variable as local in a function.\n"
  1748. "\n"
  1749. "<178>Example<278>: #alias {swap} {#local x %0;#replace x {e} {u};#showme $x}\n",
  1750. "format function math replace script variable"
  1751. },
  1752. {
  1753. "LOG",
  1754. "<178>Command<278>: #log <178>{<278>append<178>|<278>overwrite<178>|<278>off<178>} {<278>[filename]<178>}<278>\n"
  1755. "\n"
  1756. " Logs session output to a file, you can set the data type to either\n"
  1757. " plain, raw, or html with the config command.\n",
  1758. "read scan textin write"
  1759. },
  1760. {
  1761. "LOOP",
  1762. "<178>Command<278>: #loop <178>{<278><start><178>} {<278><finish><178>} {<278><variable><178>} {<278>commands<178>}<278>\n"
  1763. "\n"
  1764. " Like a for statement, loop will loop from start to finish incrementing\n"
  1765. " or decrementing by 1 each time through. The value of the loop counter\n"
  1766. " is stored in the provided variable, which you can use in the commands.\n"
  1767. "\n"
  1768. "<178>Example<278>: #loop 1 3 loop {get all $loop\\.corpse}\n"
  1769. " This equals 'get all 1.corpse;get all 2.corpse;get all 3.corpse'.\n"
  1770. "\n"
  1771. " The . needs to be escaped so it's not treated as part of the variable.\n"
  1772. "\n"
  1773. "<178>Example<278>: #loop 3 1 cnt {drop $cnt\\.key}\n"
  1774. " This equals 'drop 3.key;drop 2.key;drop 1.key'.\n",
  1775. "break continue foreach list parse repeat return while"
  1776. },
  1777. {
  1778. "MACRO",
  1779. "<178>Command<278>: #macro <178>{<278>key sequence<178>} {<278>commands<178>}<278>\n"
  1780. "\n"
  1781. " Macros allow you to make tintin respond to function keys.\n"
  1782. "\n"
  1783. " The key sequence send to the terminal when pressing a function key\n"
  1784. " differs for every OS and terminal. To find out what sequence is send\n"
  1785. " you can enable the CONVERT META config option.\n"
  1786. "\n"
  1787. " Another option is pressing ctrl-v, which will enable CONVERT META for\n"
  1788. " the next key pressed.\n"
  1789. "\n"
  1790. " If you only want a key sequence to trigger at the start of an input\n"
  1791. " line prefix the key sequence with ^.\n"
  1792. "\n"
  1793. "<178>Example<278>: #macro {(press ctrl-v)(press F1)} {#showme \\e[2J;#buffer lock}\n"
  1794. " Clear the screen and lock the window when you press F1, useful when the\n"
  1795. " boss is near.\n"
  1796. "\n"
  1797. "<178>Example<278>: #macro {\\eOM} {#cursor enter}\n"
  1798. " Makes the keypad's enter key work as an enter in keypad mode.\n"
  1799. "\n"
  1800. "<178>Example<278>: #macro {^nn} {n}\n"
  1801. " Makes pressing n twice on an empty line execute north.\n"
  1802. "\n"
  1803. "<178>Comment<278>: Not all terminals properly initialize the keypad key sequences.\n"
  1804. " If this is the case you can still use the keypad, but instead of the\n"
  1805. " arrow keys use ctrl b, f, p, and n.\n"
  1806. "\n"
  1807. "<178>Comment<278>: You can remove a macro with the #unmacro command.\n",
  1808. "alias cursor history keypad speedwalk tab"
  1809. },
  1810. {
  1811. "MAP",
  1812. "<178>Command<278>: #map\n"
  1813. "\n"
  1814. " The map command is the backbone of the auto mapping feature.\n"
  1815. "\n"
  1816. " <178>#map at <exit|vnum> <command>\n"
  1817. " <278> Execute the command at the given exit or vnum.\n"
  1818. "\n"
  1819. " <178>#map center <x> <y> <z>\n"
  1820. " <278> Sets displaying center of the map viewer, default is 0 0 0.\n"
  1821. "\n"
  1822. " <178>#map color <field> [value]\n"
  1823. " <278> Sets the map color for the given color field.\n"
  1824. "\n"
  1825. " <178>#map create <size>\n"
  1826. " <278> Creates a new map and room 1. The default size is 50000 rooms.\n"
  1827. "\n"
  1828. " <178>#map destroy {area|world} <name>\n"
  1829. " <278> Deletes the map or given area.\n"
  1830. "\n"
  1831. " <178>#map delete <exit|vnum>\n"
  1832. " <278> Deletes the room for the given exit or vnum.\n"
  1833. "\n"
  1834. " <178>#map dig <exit|vnum> [new|<vnum>]\n"
  1835. " <278> Creates an exit for the given exit name. If no valid exit name\n"
  1836. " <278> is given or no existing room is found a new room is created.\n"
  1837. " <278> Useful for portal links and other alternative forms of\n"
  1838. " <278> transportation. If the 'new' argument is provided all existing\n"
  1839. " <278> rooms are ignored and a new room is created. If a room vnum is\n"
  1840. " <278> given as the second argument an exit will be created leading\n"
  1841. " <278> to the given room vnum. If the room vnum doesn't exist a new\n"
  1842. " <278> room is created.\n"
  1843. "\n"
  1844. " <178>#map entrance <exit> [option] [arg]\n"
  1845. " <278> Set the entrance data for the given exit. You must specify a\n"
  1846. " <278> valid two-way exit for this to work.\n"
  1847. "\n"
  1848. " <178>#map exit <exit> <option> <arg>\n"
  1849. " <278> Set the exit data. Useful with a closed door where you can\n"
  1850. " <278> set the exit command: '#map exit e command {open east;e}'.\n"
  1851. " <278> Use #map exit <exit> for a list of available options.\n"
  1852. "\n"
  1853. " <178>#map exitflag <exit> <AVOID|BLOCK|HIDE|INVIS> [on|off]\n"
  1854. " <278> Set exit flags. See #map roomflag for more info.\n"
  1855. "\n"
  1856. " <178>#map explore <exit>\n"
  1857. " <278> Explores the given exit until a dead end or an\n"
  1858. " <278> intersection is found. The route is stored in #path and can\n"
  1859. " <278> subsequently be used with #walk. Useful for long roads.\n"
  1860. "\n"
  1861. " <178>#map find <name> <exits> <desc> <area> <note> <terrain> <flag>\n"
  1862. " <278> searches for the given room name. If found the shortest path\n"
  1863. " <278> from your current location to the destination is calculated.\n"
  1864. " <278> The route is stored in #path and can subsequently be used with\n"
  1865. " <278> the various #path commands. If <exits> is provided all exits\n"
  1866. " <278> must be matched, if <roomdesc>, <roomarea> or <roomnote> or\n"
  1867. " <278> <roomterrain> or <roomflag> is provided these are matched as\n"
  1868. " <278> well against the room to be found.\n"
  1869. " <278> These options are also available to the at, delete, goto\n"
  1870. " <278> link, list and run commands.\n"
  1871. "\n"
  1872. " <178>#map flag asciigraphics\n"
  1873. " <278> Takes up more space but draws a more detailed\n"
  1874. " <278> map that displays the ne se sw nw exits and room symbols.\n"
  1875. "\n"
  1876. " <178>#map flag asciivnums\n"
  1877. " <278> Display room vnums if asciigraphics is enabled.\n"
  1878. "\n"
  1879. " <178>#map flag nofollow\n"
  1880. " <278> When you enter movement commands the map will no longer\n"
  1881. " <278> automatically follow along. Useful for MSDP and GMCP\n"
  1882. " <278> automapping scripts.\n"
  1883. "\n"
  1884. " <178>#map flag static\n"
  1885. " <278> Will make the map static so new rooms are no longer\n"
  1886. " <278> created when walking into an unmapped direction. Useful when\n"
  1887. " <278> you're done mapping and regularly bump into walls accidentally\n"
  1888. " <278> creating a new room. #map dig etc will still work.\n"
  1889. "\n"
  1890. " <178>#map flag vtgraphics\n"
  1891. " <278> Enables vt line drawing on some terminals\n"
  1892. "\n"
  1893. " <178>#map flag vtmap\n"
  1894. " <278> Will enable the vtmap which is shown in the top split\n"
  1895. " <278> screen if you have one. You can create a 16 rows high top\n"
  1896. " <278> screen by using '#split 16 1'.\n"
  1897. "\n"
  1898. " <178>#map get <option> <variable> [vnum]\n"
  1899. " <278> Store a map value into a variable, if no vnum is given the\n"
  1900. " <278> current room is used. Use 'all' as the option to store all\n"
  1901. " <278> values as a table.\n"
  1902. "\n"
  1903. " <178>#map get roomexits <variable>\n"
  1904. " <278> Store all room exits into variable.\n"
  1905. "\n"
  1906. " <178>#map global <room vnum>\n"
  1907. " <278> Set the vnum of a room that contains global\n"
  1908. " <278> exits, for example an exit named 'recall' that leads to the\n"
  1909. " <278> recall location. The room can contain multiple exits, in case\n"
  1910. " <278> there are multiple commands that are similar to recall.\n"
  1911. "\n"
  1912. " <178>#map goto <room vnum> [dig]\n"
  1913. " <278> Takes you to the given room vnum, with the\n"
  1914. " <278> dig argument a new room will be created if none exists.\n"
  1915. "\n"
  1916. " <178>#map goto <name> <exits> <desc> <area> <note> <terrain>\n"
  1917. " <278> Takes you to the given room name, if you provide exits those\n"
  1918. " <278> must match.\n"
  1919. "\n"
  1920. " <178>#map info\n"
  1921. " <278> Gives information about the map and room you are in.\n"
  1922. "\n"
  1923. " <178>#map insert <direction> [roomflag]\n"
  1924. " <278> Insert a room in the given direction. Most useful for inserting\n"
  1925. " <278> void rooms.\n"
  1926. "\n"
  1927. " <178>#map jump <x> <y> <z>\n"
  1928. " <278> Jump to the given coordinate, which is relative\n"
  1929. " <278> to your current room.\n"
  1930. "\n"
  1931. " <178>#map landmark <name> <vnum> [description] [size]\n"
  1932. " <278> Creates an alias to target the provided room vnum. The\n"
  1933. " <278> description is optional and should be brief. The size\n"
  1934. " <278> determines from how many rooms away the landmark can be\n"
  1935. " <278> seen.\n"
  1936. "\n"
  1937. " <178>#map leave\n"
  1938. " <278> Makes you leave the map. Useful when entering a maze. You\n"
  1939. " <278> can return to your last known room using #map return.\n"
  1940. "\n"
  1941. " <178>#map legend <legend> [symbols|reset]\n"
  1942. " <178>#map legend <legend> <index> [symbol]\n"
  1943. " <278> There are several legends and sub-legends available for\n"
  1944. " <278> drawing maps to suit personal preference and character sets.\n"
  1945. " <278> Use #map legend all to see the legend as currently defined.\n"
  1946. " <278> Use #map legend <legend> <reset> to set the default legend.\n"
  1947. " <278> Use #map legend <legend> <character list> to create a custom\n"
  1948. " <278> legend. Custom legends are automatically saved and loaded by\n"
  1949. " <278> using #map read and #map write.\n"
  1950. "\n"
  1951. " <178>#map link <direction> <room name> [both]\n"
  1952. " <278> Links two rooms. If the both\n"
  1953. " <278> argument and a valid direction is given the link is two ways.\n"
  1954. "\n"
  1955. " <178>#map list <name> <exits> <desc> <area> <note> <terrain>\n"
  1956. " <278> Lists all matching rooms and their distance. The following\n"
  1957. " <278> search keywords are supported.\n"
  1958. "\n"
  1959. " <278> {roomarea} <arg> will list rooms with matching area name.\n"
  1960. " <278> {roomdesc} <arg> will list rooms with matching room desc.\n"
  1961. " <278> {roomexits} <arg> will list rooms with identical room exits.\n"
  1962. " <278> {roomflag} <arg> will list rooms with matching room flags.\n"
  1963. " <278> {roomid} <arg> will list rooms with identical id name.\n"
  1964. " <278> {roomname} <arg> will list rooms with matching room name.\n"
  1965. " <278> {roomnote} <arg> will list rooms with matching room note.\n"
  1966. " <278> {roomterrain} <arg> will list rooms with matching room terrain.\n"
  1967. " <278> {variable} <arg> will save the output to given variable.\n"
  1968. "\n"
  1969. " <178>#map map <rows> <cols> <append|overwrite|list|variable> <name>\n"
  1970. " <278> Display a drawing of the map of the given height and width.\n"
  1971. " <278> All arguments are optional. If {rows} or {cols} are set to {}\n"
  1972. " <278> or {0} they will use the scrolling window size as the default.\n"
  1973. " <278> If {rows} or {cols} are a negative number this number is\n"
  1974. " <278> subtracted from the scrolling window size.\n"
  1975. "\n"
  1976. " <178>#map map <rows> <cols> draw <square>\n"
  1977. " <278> Display a drawing of the map of the given height and width.\n"
  1978. " <278> The square argument exists of 4 numbers formulating the top\n"
  1979. " <278> left corner and bottom right corner of a square.\n"
  1980. "\n"
  1981. " <278> If you use {append|overwrite} the map is written to the specified\n"
  1982. " <278> file name which must be given as the 4th argument.\n"
  1983. " <278> If you use {list|variable} the map is saved to the specified\n"
  1984. " <278> variable name.\n"
  1985. "\n"
  1986. " <178>#map move <direction>\n"
  1987. " <278> This does the same as an actual movement\n"
  1988. " <278> command, updating your location on the map and creating new\n"
  1989. " <278> rooms. Useful when you are following someone and want the map\n"
  1990. " <278> to follow. You will need to create actions using '#map move',\n"
  1991. " <278> for this to work.\n"
  1992. "\n"
  1993. " <178>#map offset <row> <col> <row> <col>\n"
  1994. " <278> Define the offset of the vtmap as a square. Without an argument\n"
  1995. " <278> it defaults to the entire top split region.\n"
  1996. "\n"
  1997. " <178>#map read <filename>\n"
  1998. " <278> Will load the given map file.\n"
  1999. "\n"
  2000. " <178>#map resize <size>\n"
  2001. " <278> Resize the map, setting the maximum number of rooms.\n"
  2002. "\n"
  2003. " <178>#map return\n"
  2004. " <278> Returns you to your last known room after leaving the map\n"
  2005. " <278> or loading a map.\n"
  2006. "\n"
  2007. " <178>#map roomflag <flags> <get|on|off>\n"
  2008. " <278>\n"
  2009. " <178>#map roomflag avoid\n"
  2010. " <278> When set, '#map find' will avoid a route leading\n"
  2011. " <278> through that room. Useful for locked doors, etc.\n"
  2012. " <178>#map roomflag block\n"
  2013. " <278> When set the automapper will prevent movement into or through\n"
  2014. " <278> the room. Useful for death traps.\n"
  2015. " <178>#map roomflag hide\n"
  2016. " <278> When set, '#map' will not display the map beyond\n"
  2017. " <278> this room. When mapping overlapping areas or areas that aren't\n"
  2018. " <278> build consistently you need this flag as well to stop\n"
  2019. " <278> auto-linking, unless you use void rooms.\n"
  2020. " <178>#map roomflag invis\n"
  2021. " <278> When set the room will be colored with the INVIS color.\n"
  2022. " <178>#map roomflag leave\n"
  2023. " <278> When entering a room with this flag, you will\n"
  2024. " <278> automatically leave the map. Useful when set at the entrance\n"
  2025. " <278> of an unmappable maze.\n"
  2026. " <178>#map roomflag noglobal\n"
  2027. " <278> This marks a room as not allowing global\n"
  2028. " <278> transportation, like norecall rooms that block recall.\n"
  2029. " <178>#map roomflag void\n"
  2030. " <278> When set the room becomes a spacing room that can\n"
  2031. " <278> be used to connect otherwise overlapping areas. A void room\n"
  2032. " <278> should only have two exits. When entering a void room you are\n"
  2033. " <278> moved to the connecting room until you enter a non void room.\n"
  2034. " <178>#map roomflag static\n"
  2035. " <278> When set the room will no longer be autolinked\n"
  2036. " <278> when walking around. Useful for mapping mazes.\n"
  2037. "\n"
  2038. " <178>#map run <room name> [delay]\n"
  2039. " <278> Calculates the shortest path to the destination and walks you\n"
  2040. " <278> there. The delay is optional and requires using braces. Besides\n"
  2041. " <278> the room name a list of exits can be provided for more precise\n"
  2042. " <278> matching.\n"
  2043. "\n"
  2044. " <178>#map set <option> <value> [vnum]\n"
  2045. " <278> Set a map value for your current room, or given room if a room\n"
  2046. " <278> vnum is provided.\n"
  2047. "\n"
  2048. " <178>#map sync <filename>\n"
  2049. " <278> Similar to #map read except the current map won't be unloaded\n"
  2050. " <278> or overwritten.\n"
  2051. "\n"
  2052. " <178>#map terrain <name> <symbol> [flag]\n"
  2053. " <278> Set the terrain symbol and flag.\n"
  2054. "\n"
  2055. " <178>#map terrain <name> <symbol> [DENSE|SPARSE|SCANT]\n"
  2056. " <278> Determine symbol density, omit for the default.\n"
  2057. "\n"
  2058. " <178>#map terrain <name> <symbol> [NARROW|WIDE|VAST]\n"
  2059. " <278> Determine symbol spread range, omit for the default.\n"
  2060. "\n"
  2061. " <178>#map terrain <name> <symbol> [FADEIN|FADEOUT]\n"
  2062. " <278> Determine symbol spread density, omit for the default.\n"
  2063. "\n"
  2064. " <178>#map terrain <name> <symbol> [DOUBLE]\n"
  2065. " <278> You're using two characters for the symbol.\n"
  2066. "\n"
  2067. " <178>#map travel <direction> <delay>\n"
  2068. " <278> Follows the direction until a dead end or an intersection is\n"
  2069. " <278> found. Use braces around the direction if you use the delay,\n"
  2070. " <278> which will add the given delay between movements.\n"
  2071. " <278> Use #path stop to stop a delayed run.\n"
  2072. "\n"
  2073. " <178>#map undo\n"
  2074. " <278> Will undo your last move. If this created a room or a link\n"
  2075. " <278> they will be deleted, otherwise you'll simply move back a\n"
  2076. " <278> room. Useful if you walked into a non existant direction.\n"
  2077. "\n"
  2078. " <178>#map uninsert <direction>\n"
  2079. " <278> Exact opposite of the insert command.\n"
  2080. "\n"
  2081. " <178>#map unlandmark <name>\n"
  2082. " <278> Removes a landmark.\n"
  2083. "\n"
  2084. " <178>#map unlink <direction> [both]\n"
  2085. " <278> Will remove the exit, this isn't two way so you can have the\n"
  2086. " <278> properly display no exit rooms and mazes.\n"
  2087. " <278> If you use the both argument the exit is removed two-ways.\n"
  2088. "\n"
  2089. " <178>#map unterrain <name>\n"
  2090. " <278> Removes a terrain.\n"
  2091. "\n"
  2092. " <178>#map update\n"
  2093. " <278> Sets the vtmap to update within the next 0.1 seconds.\n"
  2094. "\n"
  2095. " <178>#map vnum <low> [high]\n"
  2096. " <278> Change the room vnum to the given number, if a range is\n"
  2097. " <278> provided the first available room in that range is selected.\n"
  2098. "\n"
  2099. " <178>#map write <filename> [force]\n"
  2100. " <278> Will save the map, if you want to save a map to a .tin file\n"
  2101. " <278> you must provide the {force} argument.\n",
  2102. "path pathdir"
  2103. },
  2104. {
  2105. "MATH",
  2106. "<178>Command<278>: #math <178>{<278>variable<178>} {<278>expression<178>}<278>\n"
  2107. "\n"
  2108. " Performs math operations and stores the result in a variable. The math\n"
  2109. " follows a C-like precedence, as follows, with the top of the list\n"
  2110. " having the highest priority.\n"
  2111. "\n"
  2112. " Operators Priority Function\n"
  2113. " ------------------------------------------------\n"
  2114. " ! 0 logical not\n"
  2115. " ~ 0 bitwise not\n"
  2116. " * 1 integer multiply\n"
  2117. " ** 1 integer power\n"
  2118. " / 1 integer divide\n"
  2119. " // 1 integer sqrt // 2 or cbrt // 3\n"
  2120. " % 1 integer modulo\n"
  2121. " d 1 integer random dice roll\n"
  2122. " + 2 integer addition\n"
  2123. " - 2 integer subtraction\n"
  2124. " << 3 bitwise shift\n"
  2125. " >> 3 bitwise shift\n"
  2126. " .. 3 bitwise ellipsis\n"
  2127. " > 4 logical greater than\n"
  2128. " >= 4 logical greater than or equal\n"
  2129. " < 4 logical less than\n"
  2130. " <= 4 logical less than or equal\n"
  2131. " == 5 logical equal (can use regex)\n"
  2132. " === 5 logical equal (never regex)\n"
  2133. " != 5 logical not equal (can use regex)\n"
  2134. " !== 5 logical not equal (never regex)\n"
  2135. " & 6 bitwise and\n"
  2136. " ^ 7 bitwise xor\n"
  2137. " | 8 bitwise or\n"
  2138. " && 9 logical and\n"
  2139. " ^^ 10 logical xor\n"
  2140. " || 11 logical or\n"
  2141. "\n"
  2142. " True is any non-zero number, and False is zero. Parentheses () have\n"
  2143. " highest precedence, so inside the () is always evaluated first.\n"
  2144. " Strings must be enclosed in { } and use regex with == and !=,\n"
  2145. " in the case of <= and >= the alphabetic order is compared.\n"
  2146. "\n"
  2147. " The #if and #switch commands use #math. Several commands accepting\n"
  2148. " integer input allow math operations as well.\n"
  2149. "\n"
  2150. " Floating point precision is added by using the decimal . operator.\n"
  2151. " Time in seconds is calculated using [day]:[hour]:<minute>:<second>.\n"
  2152. "\n"
  2153. "<178>Example<278>: #math {heals} {$mana / 40}\n"
  2154. " Assuming there is a variable $mana, divides its value by 40 and stores\n"
  2155. " the result in $heals.\n"
  2156. "\n"
  2157. "<178>Example<278>: #action {^You receive %0 experience} {updatexp %0}\n"
  2158. " #alias updatexp {#math {xpneed} {$xpneed - %0}\n"
  2159. " Let's say you have a variable which stores xp needed for your next\n"
  2160. " level. The above will modify that variable after every kill, showing\n"
  2161. " the amount still needed.\n"
  2162. "\n"
  2163. "<178>Example<278>: #action {%0 tells %1}\n"
  2164. " {#if {{%0} == {Bubba} && $afk} {reply I'm away, my friend.}}\n"
  2165. " When you are away from keyboard, it will only reply to your friend.\n",
  2166. "cat format function local mathematics replace script variable"
  2167. },
  2168. {
  2169. "MATHEMATICS",
  2170. "<178>Number operations\n"
  2171. "<278>"
  2172. " Operators Priority Function\n"
  2173. " ------------------------------------------------\n"
  2174. " ! 0 logical not\n"
  2175. " ~ 0 bitwise not\n"
  2176. " * 1 integer multiply\n"
  2177. " ** 1 integer power\n"
  2178. " / 1 integer divide\n"
  2179. " // 1 integer sqrt // 2 or cbrt // 3\n"
  2180. " % 1 integer modulo\n"
  2181. " d 1 integer random dice roll\n"
  2182. " + 2 integer addition\n"
  2183. " - 2 integer subtraction\n"
  2184. " << 3 bitwise shift\n"
  2185. " >> 3 bitwise shift\n"
  2186. " > 4 logical greater than\n"
  2187. " >= 4 logical greater than or equal\n"
  2188. " < 4 logical less than\n"
  2189. " <= 4 logical less than or equal\n"
  2190. " == 5 logical equal\n"
  2191. " != 5 logical not equal\n"
  2192. " & 6 bitwise and\n"
  2193. " ^ 7 bitwise xor\n"
  2194. " | 8 bitwise or\n"
  2195. " && 9 logical and\n"
  2196. " ^^ 10 logical xor\n"
  2197. " || 11 logical or\n"
  2198. "\n"
  2199. "Operator priority can be ignored by using parentheses, for example (1 + 1) * 2\n"
  2200. "equals 4, while 1 + 1 * 2 equals 3.\n"
  2201. "\n"
  2202. "<178>String operations<278>\n"
  2203. "<278>"
  2204. " Operators Priority Function\n"
  2205. " ------------------------------------------------\n"
  2206. " > 4 alphabetical greater than\n"
  2207. " >= 4 alphabetical greater than or equal\n"
  2208. " < 4 alphabetical less than\n"
  2209. " <= 4 alphabetical less than or equal\n"
  2210. " == 5 alphabetical equal (can use regex)\n"
  2211. " != 5 alphabetical not equal (can use regex)\n"
  2212. "\n"
  2213. "Strings must be encased in double quotes or braces. The > >= < <= operators\n"
  2214. "perform basic string comparisons. The == != operators perform regular\n"
  2215. "expressions, with the argument on the left being the string, and the argument\n"
  2216. "on the right being the regex. For example {bla} == {%*a} would evaluate as 1.\n",
  2217. "math"
  2218. },
  2219. {
  2220. "MESSAGE",
  2221. "<178>Command<278>: #message <178>{<278>listname<178>} {<278>on<178>|<278>off<178>}<278>\n"
  2222. "\n"
  2223. " This will show the message status of all your lists if typed without an\n"
  2224. " argument. If you set for example VARIABLES to OFF you will no longer be\n"
  2225. " spammed when correctly using the #VARIABLE and #UNVARIABLE commands.\n",
  2226. "class debug ignore info kill"
  2227. },
  2228. {
  2229. "METRIC SYSTEM",
  2230. " Name Symbol Factor\n"
  2231. "--------------------------------------------------\n"
  2232. // " Yotta Y 1 000 000 000 000 000 000 000 000\n"
  2233. // " Zetta Z 1 000 000 000 000 000 000 000\n"
  2234. // " Exa E 1 000 000 000 000 000 000\n"
  2235. // " Peta P 1 000 000 000 000 000\n"
  2236. // " Tera T 1 000 000 000 000\n"
  2237. // " Giga G 1 000 000 000\n"
  2238. " Mega M 1 000 000\n"
  2239. " Kilo K 1 000\n"
  2240. "\n"
  2241. " milli m 0.001\n"
  2242. " micro u 0.000 001\n",
  2243. // " nano n 0.000 000 001\n"
  2244. // " pico p 0.000 000 000 001\n"
  2245. // " femto f 0.000 000 000 000 001\n"
  2246. // " atto a 0.000 000 000 000 000 001\n"
  2247. // " zepto z 0.000 000 000 000 000 000 001\n"
  2248. // " yocto y 0.000 000 000 000 000 000 000 001\n",
  2249. "echo format math"
  2250. },
  2251. {
  2252. "MSDP",
  2253. "<278>\n"
  2254. " MSDP is part of the #port functionality. See #help event for\n"
  2255. " additional documentation as all MSDP events are available as\n"
  2256. " regular events.\n"
  2257. "\n"
  2258. " Available MSDP events can be queried using the MSDP protocol\n"
  2259. " as described in the specification.\n"
  2260. "<178>\n"
  2261. " https://tintin.sourceforge.io/protocols/msdp\n",
  2262. "event port"
  2263. },
  2264. {
  2265. "NOP",
  2266. "<178>Command<278>: #nop <178>{<278>whatever<178>}<278>\n"
  2267. "\n"
  2268. " Short for 'no operation', and is ignored by the client. It is useful\n"
  2269. " for commenting in your coms file, any text after the nop and before a\n"
  2270. " semicolon or end of line is ignored. You shouldn't put braces { } in it\n"
  2271. " though, unless you close them properly.\n"
  2272. "\n"
  2273. "<178>Comment<278>: By using braces you can comment out multiple lines of code in a script\n"
  2274. " file.\n"
  2275. "\n"
  2276. " For commenting out an entire trigger and especially large sections of\n"
  2277. " triggers you would want to use /* text */\n"
  2278. "\n"
  2279. "<178>Example<278>: #nop This is the start of my script file.\n",
  2280. "read"
  2281. },
  2282. {
  2283. "PARSE",
  2284. "<178>Command<278>: #parse <178>{<278>string<178>} {<278>variable<178>} {<278>commands<178>}<278>\n"
  2285. "\n"
  2286. " Like the loop statement, parse will loop from start to finish through\n"
  2287. " the given string. The value of the current character is stored in the\n"
  2288. " provided variable.\n"
  2289. "\n"
  2290. "<178>Example<278>: #parse {hello world} {char} {#showme $char}\n",
  2291. "break continue foreach list loop repeat return while"
  2292. },
  2293. {
  2294. "PATH",
  2295. "<178>Command<278>: #path <178>{<278>option<178>} {<278>argument<178>}<278>\n"
  2296. "\n"
  2297. " create Will clear the path and start path mapping.\n"
  2298. " delete Will delete the last move of the path.\n"
  2299. " describe Describe the path and current position.\n"
  2300. " destroy Will clear the path and stop path mapping.\n"
  2301. " goto Go the the start, end, or given position index.\n"
  2302. " insert Add the given argument to the path.\n"
  2303. " load Load the given variable as the new path.\n"
  2304. " map Display the map and the current position.\n"
  2305. " move Move the position forward or backward. If a number is given\n"
  2306. " the position is changed by the given number of steps.\n"
  2307. " run Execute the current path, with an optional floating point\n"
  2308. " delay in seconds as the second argument.\n"
  2309. " save Save the path to a variable. You must specify whether you\n"
  2310. " want to save the path 'forward' or 'backward'. If you use\n"
  2311. " the 'length' or 'position' keywords the current length or\n"
  2312. " position is saved.\n"
  2313. " swap Switch the forward and backward path.\n"
  2314. " unzip Load the given speedwalk as the new path.\n"
  2315. " walk Take one step forward or backward.\n"
  2316. " zip Turn the path into a speedwalk.\n"
  2317. "\n"
  2318. "<178>Example<278>: #path ins {unlock n;open n} {unlock s;open s}\n",
  2319. "map pathdir"
  2320. },
  2321. {
  2322. "PATHDIR",
  2323. "<178>Command<278>: #pathdir <178>{<278>dir<178>} {<278>reversed dir<178>} {<278>coord<178>}<278>\n"
  2324. "\n"
  2325. " By default tintin sets the most commonly used movement commands\n"
  2326. " meaning you generally don't really have to bother with pathdirs.\n"
  2327. " Pathdirs are used by the #path and #map commands.\n"
  2328. "\n"
  2329. " The first argument is a direction, the second argument is the reversed\n"
  2330. " direction. The reverse direction of north is south, etc.\n"
  2331. "\n"
  2332. " The third argument is a spatial coordinate which is a power of two.\n"
  2333. " 'n' is 1, 'e' is 2, 's' is 4, 'w' is '8', 'u' is 16, 'd' is 32. The\n"
  2334. " exception is for compound directions, whose value should be the sum\n"
  2335. " of the values of each cardinal direction it is composed of. For\n"
  2336. " example, 'nw' is the sum of 'n' and 'w' which is 1 + 8, so 'nw'\n"
  2337. " needs to be given the value of 9. This value is required for the\n"
  2338. " #map functionality to work properly.\n"
  2339. "\n"
  2340. "<178>Example<278>: #pathdir {ue} {dw} {18}\n"
  2341. " #pathdir {dw} {ue} {40}\n"
  2342. "\n"
  2343. "<178>Comment<278>: You can remove a pathdir with the #unpathdir command.\n",
  2344. "map path"
  2345. },
  2346. {
  2347. "PCRE",
  2348. "<278>\n"
  2349. " A regular expression, regex or regexp is a sequence of characters that\n"
  2350. " defines a search pattern. Since the 1980s, different syntaxes for\n"
  2351. " writing regular expressions exist, the two most widely used ones being\n"
  2352. " the POSIX syntax and the similar but more advanced Perl standard.\n"
  2353. " TinTin++ supports the Perl standard known as PCRE (Perl Compatible\n"
  2354. " Regular Expressions).\n"
  2355. "\n"
  2356. " Regular expressions are an integral part of TinTin++, but keep in mind\n"
  2357. " that tintin doesn't allow you to use regular expressions directly,\n"
  2358. " instead it uses a simpler intermediate syntax that still allows more\n"
  2359. " complex expressions when needed.\n"
  2360. "\n"
  2361. " Commands that utilize regular expressions are: action, alias, elseif,\n"
  2362. " gag, grep, highlight, if, kill, local, math, prompt, regexp, replace,\n"
  2363. " substitute, switch, variable and while. Several other commands use\n"
  2364. " regular expressions in minor ways. Fortunately the basics are very\n"
  2365. " easy to learn.\n"
  2366. "\n"
  2367. "<178> TinTin++ Regular Expression<278>\n"
  2368. "\n"
  2369. " The following support is available for regular expressions.\n"
  2370. "\n"
  2371. " ^ match start of line.\n"
  2372. " $ match of end of line.\n"
  2373. " \\ escape one character.\n"
  2374. "\n"
  2375. " %1-%99 match of any text, stored in the corresponding index.\n"
  2376. " %0 should be avoided in the regex, contains all matched text.\n"
  2377. " { } embed a perl compatible regular expression, matches are stored.\n"
  2378. " %!{ } embed a perc compatible regular expression, matches are not stored.\n"
  2379. "\n"
  2380. "[ ] . + | ( ) ? * are treated as normal text unless used within braces. Keep in\n"
  2381. "mind that { } is replaced with ( ) automatically unless %!{ } is used.\n"
  2382. "<178>\n"
  2383. " TinTin++ Description POSIX<278>\n"
  2384. " %d Match zero to any number of digits ([0-9]*?)\n"
  2385. " %D Match zero to any number of non-digits ([^0-9]*?)\n"
  2386. " %i Matches become case insensitive (?i)\n"
  2387. " %I Matches become case sensitive (default) (?-i)\n"
  2388. " %s Match zero to any number of spaces ([\\r\\n\\t ]*?)\n"
  2389. " %w Match zero to any number of word characters ([A-Za-z0-9_]*?)\n"
  2390. " %W Match zero to any number of non-word characters ([^A-Za-z0-9_]*?)\n"
  2391. " %? Match zero or one character (.\?\?)\n"
  2392. " %. Match one character (.)\n"
  2393. " %+ Match one to any number of characters (.+?)\n"
  2394. " %* Match zero to any number of characters (.*?)\n"
  2395. "<178>\n"
  2396. " Variables<278>\n"
  2397. "\n"
  2398. " If you use %1 in an action to perform a match the matched string is\n"
  2399. " stored in the %1 variable which can be used in the action body.\n"
  2400. "\n"
  2401. "Example: %1 says 'Tickle me'} {tickle %1}\n"
  2402. "\n"
  2403. " If you use %2 the match is stored in %2, etc. If you use an unnumbered\n"
  2404. " match like %* or %S the match is stored at the last used index\n"
  2405. " incremented by one.\n"
  2406. "\n"
  2407. "Example: %3 says '%*'} {#if {\"%4\" == \"Tickle me\"} {tickle %3}}\n"
  2408. "\n"
  2409. " The maximum variable index is 99. If you begin an action with %* the\n"
  2410. " match is stored in %1. You should never use %0 in the trigger part of\n"
  2411. " an action, when used in the body of an action %0 contains all the parts\n"
  2412. " of the string that were matched.\n"
  2413. "\n"
  2414. " To prevent a match from being stored use %!*, %!w, etc.\n"
  2415. "<178>\n"
  2416. " Perl Compatible Regular Expressions<278>\n"
  2417. "\n"
  2418. " You can embed a PCRE (Perl Compatible Regular Expression) using curley\n"
  2419. " braces { }, these braces are replaced with parentheses ( ) unless you\n"
  2420. " use %!{ }.\n"
  2421. "<178>\n"
  2422. " Or<278>\n"
  2423. "\n"
  2424. " You can separate alternatives within a PCRE using the | character.\n"
  2425. "\n"
  2426. "Example: #act {%* raises {his|her|its} eyebrows.} {say 42..}\n"
  2427. "<178>\n"
  2428. " Brackets<278>\n"
  2429. "\n"
  2430. " You can group alternatives and ranges within a PCRE using brackets.\n"
  2431. "\n"
  2432. "Example: #act {%* says 'Who is number {[1-9]}} {say $number[%2] is number %2}\n"
  2433. "\n"
  2434. " The example only triggers if someone provides a number between 1 and\n"
  2435. " 9. Any other character will cause the action to not trigger.\n"
  2436. "\n"
  2437. "Example: #act {%* says 'Set password to {[^0-9]*}$} {say The password must\n"
  2438. " contain at least one number, not for security reasons, but just to\n"
  2439. " annoy you.} {4}\n"
  2440. "\n"
  2441. " When the ^ character is used within brackets it creates an inverse\n"
  2442. " search, [^0-9] matches every character except for a number between 0\n"
  2443. " and 9.\n"
  2444. "<178>\n"
  2445. " Quantification<278>\n"
  2446. "\n"
  2447. " A quantifier placed after a match specifies how often the match is\n"
  2448. " allowed to occur.\n"
  2449. "\n"
  2450. " ? repeat zero or one time.\n"
  2451. " * repeat zero or multiple times.\n"
  2452. " + repeat once or multiple times.\n"
  2453. " {n} repeat exactly n times, n must be a number.\n"
  2454. " {n,} repeat at least n times, n must be a number.\n"
  2455. " {n,o} repeat between n and o times, n and o must be a number.\n"
  2456. "\n"
  2457. "Example: #act {%* says 'Who is number {[1-9][0-9]{0,2}} {Say $number[%2] is\n"
  2458. " number %2}\n"
  2459. "\n"
  2460. " The example only triggers if someone provides a number between 1 and\n"
  2461. " 999.\n"
  2462. "\n"
  2463. " <178>Parantheses<278>\n"
  2464. "\n"
  2465. " TinTin Regular Expressions automatically add parenthesis, for example\n"
  2466. " %* translates to (.*?) in PCRE unless the %* is found at the start or\n"
  2467. " end of the line, in which cases it translates to (.*). Paranthesis in\n"
  2468. " PCRE causes a change in execution priority similar to mathematical\n"
  2469. " expressions, but parentheses also causes the match to be stored to a\n"
  2470. " variable.\n"
  2471. "\n"
  2472. " When nesting multiple sets of parentheses each nest is assigned its\n"
  2473. " numerical variable in order of appearance.\n"
  2474. "\n"
  2475. "Example: #act {%* chats '{Mu(ha)+}'} {chat %2ha!}\n"
  2476. "\n"
  2477. " If someone chats Muha you will chat Muhaha! If someone chats Muhaha\n"
  2478. " you will chat Muhahaha!\n"
  2479. "\n"
  2480. " <178>Lazy vs Greedy<278>\n"
  2481. "\n"
  2482. " By default regex matches are greedy, meaning {.*} will capture as much\n"
  2483. " text as possible.\n"
  2484. "\n"
  2485. "Example: #regex {bli bla blo} {^{.*} {.*}$} {#showme Arg1=(&1) Arg2=(&2)}\n"
  2486. "\n"
  2487. " This will display: Arg1=(bli bla) Arg2=(blo)\n"
  2488. "\n"
  2489. " By appending a ? behind a regex it becomes lazy, meaning {.*?} will\n"
  2490. " capture as little text as possible.\n"
  2491. "\n"
  2492. "Example: #regex {bli bla blo} {^{.*?} {.*?}$} {#showme Arg1=(&1) Arg2=(&2)}\n"
  2493. "\n"
  2494. " This will display: Arg1=(bli) Arg2=(bla blo).\n"
  2495. "\n"
  2496. " <178>Escape Codes<278>\n"
  2497. "\n"
  2498. " PCRE support the following escape codes.\n"
  2499. "<178>\n"
  2500. " PCRE Description POSIX<278>\n"
  2501. " \\A Match start of string ^\n"
  2502. " \\b Match word boundaries (^|\\r|\\n|\\t| |$)\n"
  2503. " \\B Match non-word boundaries [^\\r\\n\\t ]\n"
  2504. " \\c Insert control character \\c\n"
  2505. " \\d Match digits [0-9]\n"
  2506. " \\D Match non-digits [^0-9]\n"
  2507. " \\e Insert escape character \\e\n"
  2508. " \\f Insert form feed character \\f\n"
  2509. " \\n Insert line feed character \\n\n"
  2510. " \\r Insert carriage return character \\r\n"
  2511. " \\s Match spaces [\\r\\n\\t ]\n"
  2512. " \\S Match non-spaces [^\\r\\n\\t ]\n"
  2513. " \\t Insert tab character \\t\n"
  2514. " \\w Match letters, numbers, and underscores [A-Za-z0-9_]\n"
  2515. " \\W Match non-letters, numbers, and underscores [^A-Za-z0-9_]\n"
  2516. " \\x Insert hex character \\x\n"
  2517. " \\Z Match end of string $\n"
  2518. "\n"
  2519. " \\s matches one space, \\s+ matches one or multiple spaces.\n"
  2520. "\n"
  2521. " <178>Color triggers<278>\n"
  2522. "\n"
  2523. " To make matching easier text triggers (Actions, Gags, Highlights,\n"
  2524. " Prompts, and Substitutes) have their color codes stripped. If you\n"
  2525. " want to create a color trigger you must start the triggers with a ~\n"
  2526. " (tilda). To make escape codes visible use #config {convert meta} on.\n"
  2527. "\n"
  2528. "Example: #action {~\\e[1;37m%1} {#var roomname %1}\n"
  2529. "\n"
  2530. " If the room name is the only line on the server in bright white\n"
  2531. " white color trigger will save the roomname.\n"
  2532. "\n"
  2533. "\n"
  2534. " This covers the basics. PCRE has more options, most of which are\n"
  2535. " somewhat obscure, so you'll have to read a PCRE manual for additional\n"
  2536. " information.\n",
  2537. "map path"
  2538. },
  2539. {
  2540. "PORT",
  2541. "<178>Command<278>: #port <178>{<278>option<178>} {<278>argument<178>}<278>\n"
  2542. "\n"
  2543. " <178>#port {init} {name} {port} {file}\n"
  2544. " <278> Initilize a port session.\n"
  2545. "\n"
  2546. " <178>#port {call} {address} {port}\n"
  2547. " <278> Connect to a remote socket.\n"
  2548. "\n"
  2549. " <178>#port {color} {color names}\n"
  2550. " <278> Set the default color of port messages.\n"
  2551. "\n"
  2552. " <178>#port {dnd}\n"
  2553. " <278> Do Not Disturb. Decline new connections\n"
  2554. "\n"
  2555. " <178>#port {group} {name} {group}\n"
  2556. " <278> Assign a socket group.\n"
  2557. "\n"
  2558. " <178>#port {ignore} {name}\n"
  2559. " <278> Ignore a socket\n"
  2560. "\n"
  2561. " <178>#port {info}\n"
  2562. " <278> Display information about the port session.\n"
  2563. "\n"
  2564. " <178>#port {name} {name}\n"
  2565. " <278> Change socket name.\n"
  2566. "\n"
  2567. " <178>#port {prefix} {text}\n"
  2568. " <278> Set prefix before each message.\n"
  2569. "\n"
  2570. " <178>#port {send} {name|all} {text}\n"
  2571. " <278> Send data to socket\n"
  2572. "\n"
  2573. " <178>#port {uninitialize}\n"
  2574. " <278> Uninitialize the port session.\n"
  2575. "\n"
  2576. " <178>#port {who}\n"
  2577. " <278> Show all connections\n"
  2578. "\n"
  2579. " <178>#port {zap} {name}\n"
  2580. " <278> Close a connection\n"
  2581. "\n"
  2582. " The port command is very similar to chat except that it creates a\n"
  2583. " new session dedicated to receiving socket connections at the given\n"
  2584. " port number without built-in support for a communication protocol.\n"
  2585. "\n"
  2586. " You can init with 0 as the port number to create a dummy session.\n",
  2587. "all chat run session sessionname snoop ssl zap"
  2588. },
  2589. {
  2590. "PROMPT",
  2591. "<178>Command<278>: #prompt <178>{<278>text<178>} {<278>new text<178>} {<278>row #<178>} <178>{<278>col #<178>}<278>\n"
  2592. "\n"
  2593. " Prompt is a feature for split window mode, which will capture a line\n"
  2594. " received from the server and display it on the status bar of your\n"
  2595. " split screen terminal. You would define <text> and <new text> the\n"
  2596. " same way as with a substitution.\n"
  2597. "\n"
  2598. " The row number is optional and useful if you use a non standard split\n"
  2599. " mode. A positive row number draws #row lines from the top while a\n"
  2600. " negative number draws #row lines from the bottom. Without an argument\n"
  2601. " #prompt will write to the default split line, which is at row -2.\n"
  2602. "\n"
  2603. " The col number is optional and can be used to set the column index.\n"
  2604. " A positive col number draws the given number of columns from the left,\n"
  2605. " while a negative col number draws from the right. If you leave the\n"
  2606. " column argument empty tintin will clear the row before printing at\n"
  2607. " the start of the row.\n"
  2608. "\n"
  2609. " The #showme command takes a row and col argument as well so it's also\n"
  2610. " possible to place text on your split lines using #showme.\n"
  2611. "\n"
  2612. "<178>Comment<278>: See <178>#help split<278> for more information on split mode.\n"
  2613. "\n"
  2614. "<178>Comment<278>: See <178>#help substitute<278> for more information on text\n"
  2615. " substitutions.\n"
  2616. "\n"
  2617. "<178>Comment<278>: You can remove a prompt with the #unprompt command.\n",
  2618. "action gag highlight substitute"
  2619. },
  2620. {
  2621. "READ",
  2622. "<178>Command<278>: #read <178>{<278>filename<178>}<278>\n"
  2623. "\n"
  2624. " Reads a commands file into memory. The coms file is merged in with\n"
  2625. " the currently loaded commands. Duplicate commands are overwritten.\n"
  2626. "\n"
  2627. " If you uses braces, { and } you can use several lines for 1 commands.\n"
  2628. " This however means you must always match every { with a } for the read\n"
  2629. " command to work.\n"
  2630. "\n"
  2631. " You can comment out triggers using /* text */\n",
  2632. "log scan textin write"
  2633. },
  2634. {
  2635. "REGEXP",
  2636. "<178>Command<278>: #regexp <178>{<278>string<178>} {<278>expression<178>} {<278>true<178>} {<278>false<178>}<278>\n"
  2637. "\n"
  2638. " Compares the string to the given regular expression.\n"
  2639. "\n"
  2640. " Variables are stored in &1 to &99 with &0 holding the matched substring.\n"
  2641. "\n"
  2642. " ^ force match of start of line.\n"
  2643. " $ force match of end of line.\n"
  2644. " \\ escape one character.\n"
  2645. " %1-%99 lazy match of any text, available at %1-%99.\n"
  2646. " %0 should be avoided in triggers, and if left alone lists all matches.\n"
  2647. " { } embed a raw regular expression, matches are stored to %1-%99.\n"
  2648. " %!{ } embed a raw regular expression, matches are not stored.\n"
  2649. " [ ] . + | ( ) ? * are treated as normal text unlessed used within\n"
  2650. " braces. Keep in mind that { } is replaced with ( ) automatically\n"
  2651. " unless %!{ } is used.\n"
  2652. "\n"
  2653. " Of the following the (lazy) match is available at %1-%99 + 1\n"
  2654. "\n"
  2655. " %a match zero to any number of characters except newlines.\n"
  2656. " %A match zero to any number of newlines.\n"
  2657. " %d match zero to any number of digits.\n"
  2658. " %D match zero to any number of non digits.\n"
  2659. " %p match zero to any number of printable characters.\n"
  2660. " %P match zero to any number of non printable characters.\n"
  2661. " %s match zero to any number of spaces.\n"
  2662. " %S match zero to any number of non spaces.\n"
  2663. " %u match zero to any number of unicode characters.\n"
  2664. " %U match zero to any number of non unicode characters.\n"
  2665. " %w match zero to any number of word characters.\n"
  2666. " %W match zero to any number of non word characters.\n"
  2667. "\n"
  2668. " If you want to match 1 digit use %+1d, if you want to match between 3\n"
  2669. " and 5 spaces use %+3..5s, if you want to match between 0 and 1 word\n"
  2670. " characters use %+0..1w\n"
  2671. "\n"
  2672. " %+ match one to any number of characters.\n"
  2673. " %? match zero or one character.\n"
  2674. " %. match one character.\n"
  2675. " %* match zero to any number of characters.\n"
  2676. "\n"
  2677. " %i matching becomes case insensitive.\n"
  2678. " %I matching becomes case sensitive (default).\n"
  2679. "\n"
  2680. " The match is automatically stored to a value between %1 and %99\n"
  2681. " starting at %1 and incrementing by 1 for every regex. If you use\n"
  2682. " %15 as a regular expression, the next unnumbered regular expression\n"
  2683. " would be %16. To prevent a match from being stored use %!*, %!w, etc.\n"
  2684. "\n"
  2685. "<178>Example<278>: #regexp {bli bla blo} {bli {.*} blo} {#showme &1}\n",
  2686. "case default else elseif if switch"
  2687. },
  2688. {
  2689. "REPEAT",
  2690. "<178>Command<278>: #<178>[<078>number<178>] {<278>commands<178>}<278>\n"
  2691. "\n"
  2692. "Sometimes you want to repeat the same command multiple times. This is the\n"
  2693. "easiest way to accomplish that.\n"
  2694. "\n"
  2695. "<178>Example<278>: #10 {buy bread}\n",
  2696. "break continue foreach list loop parse return while"
  2697. },
  2698. {
  2699. "REPLACE",
  2700. "<178>Command<278>: #replace <178>{<278>variable<178>} {<278>oldtext<178>} {<278>newtext<178>}<278>\n"
  2701. "\n"
  2702. " Searches the variable text replacing each occurrence of 'oldtext' with\n"
  2703. " 'newtext'.\n",
  2704. "cat format function local math script variable"
  2705. },
  2706. {
  2707. "RETURN",
  2708. "<178>Command<278>: #return <178>{<278>text<178>}<278>\n"
  2709. "\n"
  2710. " This command can be used to break out of a command string being\n"
  2711. " executed.\n"
  2712. "\n"
  2713. " If used inside a #function you can use #return with an argument to both\n"
  2714. " break out of the function and set the result variable.\n",
  2715. "break continue foreach list loop parse repeat while"
  2716. },
  2717. {
  2718. "RUN",
  2719. "<178>Command<278>: #run <178>{<278>name<178>} {<278>shell command<178>} {<278>file<178>}<278>\n"
  2720. "\n"
  2721. " The run command works much like the system command except that it\n"
  2722. " runs the command in a pseudo terminal. The run command also creates\n"
  2723. " a session that treats the given shell command as a server. This\n"
  2724. " allows you to run ssh, as well as any other shell application, with\n"
  2725. " full tintin scripting capabilities. If a file name is given the file\n"
  2726. " is loaded prior to execution.\n"
  2727. "\n"
  2728. "<178>Example<278>: #run {somewhere} {ssh someone@somewhere.com}\n"
  2729. "<178>Example<278>: #run {something} {tail -f chats.log}\n",
  2730. "all port session sessionname snoop ssl zap"
  2731. },
  2732. {
  2733. "SCAN",
  2734. "<178>Command<278>: #scan <178>{<278>abort<178>|<278>csv<178><178>|<278>tsv<178><178>|<278>txt<178>} {<278>filename<178>}<278>\n"
  2735. "\n"
  2736. " The scan command is a file loading utility.\n"
  2737. "\n"
  2738. " <178>#scan {abort}\n"
  2739. " <278> This command must be called from with a SCAN event and will\n"
  2740. " <278> abort the scan if one is in progress.\n"
  2741. "\n"
  2742. " <178>#scan {csv} <filename>\n"
  2743. " <278> The scan csv command reads in a comma separated value file\n"
  2744. " without printing the content to the screen. Instead it triggers one\n"
  2745. " of two events.\n"
  2746. "\n"
  2747. " The SCAN CSV HEADER event is triggered on the first line of the csv\n"
  2748. " file. The SCAN CSV LINE event is triggered on the second and each\n"
  2749. " subsequent line of the csv file. The %0 argument contains the entire\n"
  2750. " line, with %1 containing the first value, %2 the second value, etc,\n"
  2751. " all the way up to %99.\n"
  2752. "\n"
  2753. " Values containing spaces must be surrounded with quotes, keep in mind\n"
  2754. " newlines within quotes are not supported. Use two quotes to print one\n"
  2755. " literal quote character.\n"
  2756. "\n"
  2757. " <178>#scan {tsv} <filename>\n"
  2758. "\n"
  2759. " <278> The scan tsv <filename> command reads in a tab separated value file\n"
  2760. " without printing the content to the screen. Instead it triggers the\n"
  2761. " SCAN TSV HEADER event for the first line and SCAN TSV LINE for all\n"
  2762. " subsequent lines.\n"
  2763. "\n"
  2764. " <178>#scan {file} <filename> {commands}\n"
  2765. "\n"
  2766. " <278> The scan file command reads the given files and executes the\n"
  2767. " commands argument. &0 contains the raw content of the file and\n"
  2768. " &1 contains the plain content. &2 contains the raw byte size of the\n"
  2769. " file and &3 the plain byte size. &5 contains the line count.\n"
  2770. "\n"
  2771. " <178>#scan {txt} <filename>\n"
  2772. "\n"
  2773. " <278> The scan txt <filename> command reads in a file and sends its content\n"
  2774. " to the screen as if it was send by a server. After using scan you can\n"
  2775. " use page-up and down to view the file.\n"
  2776. "\n"
  2777. " This command is useful to convert ansi color files to html or viewing\n"
  2778. " raw log files.\n"
  2779. "\n"
  2780. " Actions, highlights, and substitutions will trigger as normal, and it\n"
  2781. " is possible to create an action to execute #scan abort to prematurely\n"
  2782. " stop the scan.\n",
  2783. "read textin"
  2784. },
  2785. {
  2786. "SCREEN",
  2787. "<178>Command<278>: #screen <178>{<278>option<178>}<178> {<278>argument<178>}\n"
  2788. "\n"
  2789. " <278>The screen command offers a variety of screen manipulation\n"
  2790. " commands and utilities.\n"
  2791. "\n"
  2792. " <178>#screen blur\n"
  2793. " <278> Move the terminal to the back of the stack.\n"
  2794. "\n"
  2795. " <178>#screen clear [all|scroll region|square] <args>\n"
  2796. " <278> Provide 4 arguments defining the top left and bottom right corner\n"
  2797. " <888> when erasing a square.\n"
  2798. "\n"
  2799. " <178>#screen focus\n"
  2800. " <278> Move the terminal to the front of the stack.\n"
  2801. "\n"
  2802. " <178>#screen fullscreen [on|off]\n"
  2803. " <278> Toggles fullscreen mode when used without an argument.\n"
  2804. "\n"
  2805. " <178>#screen get <rows|cols|height|width> <var>\n"
  2806. " <278> Get the rows/cols size in characters or height/width in pixels.\n"
  2807. "\n"
  2808. " <178>#screen get <top_row|bot_row|top_split|bot_split> <var>\n"
  2809. " <278> Get the top and bot row of the scrolling region or the height\n"
  2810. " <888> of the top and bot split bars.\n"
  2811. "\n"
  2812. " <178>#screen info\n"
  2813. " <278> Debugging information.\n"
  2814. "\n"
  2815. " <178>#screen load <both|label|title>\n"
  2816. " <278> Reload the saved title, label, or both.\n"
  2817. "\n"
  2818. " <178>#screen minimize <on|off>\n"
  2819. " <278> Minimize with on, restore with off.\n"
  2820. "\n"
  2821. " <178>#screen maximize [on|off]\n"
  2822. " <278> Maximize with on, restore with off.\n"
  2823. "\n"
  2824. " <178>#screen move <height> <width>\n"
  2825. " <278> Move the upper left corner of the terminal to pixel coordinate.\n"
  2826. "\n"
  2827. " <178>#screen raise <event>\n"
  2828. " <278> This will raise several screen events with %1 and %2 arguments.\n"
  2829. "\n"
  2830. " <178>#screen refresh\n"
  2831. " <278> Terminal dependant, may do nothing.\n"
  2832. "\n"
  2833. " <178>#screen rescale <height> <width>\n"
  2834. " <278> Resize the screen to the given height and width in pixels.\n"
  2835. "\n"
  2836. " <178>#screen resize <rows> <cols>\n"
  2837. " <278> Resize the screen to the given height and width in characters.\n"
  2838. "\n"
  2839. " <178>#screen save <both|label|title>\n"
  2840. " <278> Save the title, label, or both.\n"
  2841. "\n"
  2842. " <178>#screen set <both|label|title>\n"
  2843. " <278> Set the title, label, or both. Only title works on Windows.\n",
  2844. "bell"
  2845. },
  2846. {
  2847. "SCREEN READER",
  2848. "<178>Command<278>: #config <178>{<278>SCREEN READER<178>} {<278>ON|OFF<178>}<278>\n"
  2849. "\n"
  2850. " Screen reader mode is enabled by using #config screen on. The main\n"
  2851. " purpose of the screen reader mode is to report to servers that a\n"
  2852. " screen reader is being used by utilizing the MTTS standard. The MTTS\n"
  2853. " specification is available at:\n"
  2854. "\n"
  2855. " http://tintin.sourceforge.net/protocols/mtts\n"
  2856. "\n"
  2857. " With the screen reader mode enabled TinTin++ will try to remove visual\n"
  2858. " elements where possible.\n",
  2859. "config"
  2860. },
  2861. {
  2862. "SCRIPT",
  2863. "<178>Command<278>: #script <178>{<278>variable<178>}<178> {<278>shell command<178>}<278>\n"
  2864. "\n"
  2865. " The script command works much like the system command except that it\n"
  2866. " treats the generated echos as commands if no variable is provided.\n"
  2867. "\n"
  2868. " This is useful for running php, perl, ruby, and python scripts. You\n"
  2869. " can run these scrips either from file or from within tintin if the\n"
  2870. " scripting language allows this.\n"
  2871. "\n"
  2872. " If you provide a variable the output of the script is stored as a list.\n"
  2873. "\n"
  2874. "<178>Example<278>: #script {ruby -e 'print \"#showme hello world\"'}\n"
  2875. "<178>Example<278>: #script {python -c 'print \"#showme hello world\"'}\n"
  2876. "<178>Example<278>: #script {php -r 'echo \"#showme hello world\"'}\n"
  2877. "<178>Example<278>: #script {path} {pwd};#showme The path is $path[1].\n",
  2878. "format function local math replace variable"
  2879. },
  2880. {
  2881. "SEND",
  2882. "<178>Command<278>: #send <178>{<278>text<178>}<278>\n"
  2883. "\n"
  2884. " Sends the text directly to the server, useful if you want to start\n"
  2885. " with an escape code.\n",
  2886. "textin"
  2887. },
  2888. {
  2889. "SESSION",
  2890. "<178>Command<278>: #session <178>{<278>name<178>} {<278>host<178>} {<278>port<178>} {<278>file<178>}<278>\n"
  2891. "\n"
  2892. " Starts a telnet session with the given name, host, port, and optional\n"
  2893. " file name. The name can be anything you want, except the name of an\n"
  2894. " already existant session, a number, or the keywords '+', '-' and 'self'.\n"
  2895. "\n"
  2896. " If a file name is given the file is only read if the session succesfully\n"
  2897. " connects.\n"
  2898. "\n"
  2899. " Without an argument #session shows the currently defined sessions.\n"
  2900. "\n"
  2901. " If you have more than one session, you can use the following commands:\n"
  2902. "\n"
  2903. " #session {-} Switch to the previous session.\n"
  2904. " #session {+} Switch to the next session.\n"
  2905. " #session {<number>} Switch to the given session. Session 0 is the\n"
  2906. " startup session, +1 the first, +2 the second, and\n"
  2907. " -1 is the last session. Sessions are (currently)\n"
  2908. " sorted in order of creation.\n"
  2909. " #gts Switch to the startup session. The name gts stands\n"
  2910. " for global tintin session.\n"
  2911. " #ats Switch to the active session. The name ats stands\n"
  2912. " for active tintin session.\n"
  2913. " not necessarily the calling session.\n"
  2914. " #{name} Activates to the session with the given name.\n"
  2915. " #{name} {command}: Executes a command with the given session without\n"
  2916. " changing the active session.\n"
  2917. " @<name>{text}: Parse text in the given session, substituting the\n"
  2918. " variables and functions, and print the result in\n"
  2919. " the current active session.\n"
  2920. "\n"
  2921. " The startup session is named 'gts' and can be used for relog scripts. Do\n"
  2922. " keep in mind that tickers do not work in the startup session.\n"
  2923. "\n"
  2924. "<178>Example<278>: #event {SESSION DISCONNECTED} {#gts #delay 10 #ses %0 tintin.net 4321}\n",
  2925. "all port run sessionname snoop ssl zap"
  2926. },
  2927. {
  2928. "SESSIONNAME",
  2929. "<178>Syntax<278>: #[sessionname] <178>{<278>commands<178>}<278>\n"
  2930. "\n"
  2931. "You can create multiple sessions with the #session command. By default only one\n"
  2932. "session is active, meaning commands you input are executed in the active\n"
  2933. "session. While all sessions receive output, only output sent to the active\n"
  2934. "session is displayed.\n"
  2935. "\n"
  2936. "When you create a session with the #session command you must specify a session\n"
  2937. "name, the session name, prepended with a hashtag, can be used to activate the\n"
  2938. "session when used without an argument. If an argument is given it will be\n"
  2939. "executed by that session as a command, the session will not be activated.\n"
  2940. "\n"
  2941. "<178>Example<278>: #ses one tintin.net 23;#ses two tintin.net 23;#one;#two grin\n"
  2942. "\n"
  2943. "This will create two sessions, the session that was created last (two in this\n"
  2944. "case) will be automatically activated upon creation. Using #one, session one is\n"
  2945. "activated. Using #two grin, the grin social will be executed by session two,\n"
  2946. "session one will remain the active session.\n",
  2947. "all port run session snoop ssl zap"
  2948. },
  2949. {
  2950. "SHOWME",
  2951. "<178>Command<278>: #showme <178>{<278>string<178>} {<278>row<178>} <178>{<278>col<178>}<278>\n"
  2952. "\n"
  2953. " Display the string to the terminal, do not send to the server. Useful\n"
  2954. " for status, warnings, etc. The {row} and col number are optional and\n"
  2955. " work the same way as the row number of the #prompt trigger.\n"
  2956. "\n"
  2957. " Actions can be triggered by the showme command. If you want to avoid\n"
  2958. " this from happening use: #line ignore #showme {<string>}.\n"
  2959. "\n"
  2960. "<178>Example<278>: #tick {TICK} {#delay 50 #showme 10 SECONDS TO TICK!!!} {60}\n"
  2961. "\n"
  2962. "<178>Comment<278>: The #prompt helpfile contains more information on using the\n"
  2963. " option {row} and {col} arguments.\n",
  2964. "buffer draw echo grep"
  2965. },
  2966. {
  2967. "SNOOP",
  2968. "<178>Command<278>: #snoop <178>{<278>session name<178>} <178>{<278>on<178>|<278>off<178>}<278>\n"
  2969. "\n"
  2970. " If there are multiple sessions active, this command allows you to monitor\n"
  2971. " what is going on in the sessions that are not currently active. The\n"
  2972. " line of text from other sessions will be prefixed by the session's name.\n"
  2973. "\n"
  2974. " You can toggle off snoop mode by executing #snoop a second time.\n",
  2975. "all port run session sessionname ssl zap"
  2976. },
  2977. {
  2978. "SPEEDWALK",
  2979. " <278>Speedwalking allows you to enter multiple directions without using\n"
  2980. " semicolons. Directions should be prefixed with a number and will be\n"
  2981. " executed the given number of times.\n"
  2982. "\n"
  2983. " You can enable speedwalking with #CONFIG {SPEEDWALK} {ON}.\n"
  2984. "\n"
  2985. "<178>Example<278>: Without speedwalk, you have to type:\n"
  2986. " s;s;w;w;w;w;w;s;s;s;w;w;w;n;n;w\n"
  2987. " With speedwalk, you only have to type:\n"
  2988. " 2s5w3s3w2n1w\n",
  2989. "alias cursor history keypad macro tab"
  2990. },
  2991. {
  2992. "SPLIT",
  2993. "<178>Command<278>: #split <178>{<278>top bar<178>} {<278>bottom bar<178>}\n"
  2994. "<178>Command<278>: #split <178>{<278><square><178>}\n"
  2995. "\n"
  2996. " This option requires for your terminal to support VT100 emulation.\n"
  2997. "\n"
  2998. " #split allows the creation of a top status bar, a scrolling region, a\n"
  2999. " bottom status bar, and an input line.\n"
  3000. "\n"
  3001. " <178>--top status bar--------\n"
  3002. "\n"
  3003. " <278> scrolling region\n"
  3004. "\n"
  3005. " <178>--bottom status bar----------\n"
  3006. " <278> input line\n"
  3007. "\n"
  3008. " By default the bottom status bar is filled with dashes --- and\n"
  3009. " subsequently it is also known as the split line. The scrolling\n"
  3010. " region is also known as the main screen and this is where all\n"
  3011. " incoming text is displayed by default.\n"
  3012. "\n"
  3013. " If you use #split without an argument it will set the height of the\n"
  3014. " top status bar to 0 lines and the bottom status bar to 1 line.\n"
  3015. "\n"
  3016. " If you use #split with one argument it will set the height of the top\n"
  3017. " status bar to the given number of lines and the bottom status bar will\n"
  3018. " be set to 1 line.\n"
  3019. "\n"
  3020. " If you use two arguments the first argument is the height of the top\n"
  3021. " status bar and the second argument the height of the bottom status bar.\n"
  3022. "\n"
  3023. " The third and fourth argument are optional and tintin will interpret\n"
  3024. " four arguments as a square argument existing of two coordinates\n"
  3025. " defining the upper left corner and bottom right corner of the\n"
  3026. " scrolling region.\n"
  3027. "\n"
  3028. "<178>Example<278>: #split 0 0\n"
  3029. " This will create a split screen with just a scrolling regino and an\n"
  3030. " input line. Great for the minimalist.\n"
  3031. "\n"
  3032. "<178>Comment<278>: You can display text on the split line(s) with the #prompt and\n"
  3033. " #showme {line} {row} commands.\n"
  3034. "\n"
  3035. "<178>Comment<278>: You can remove split mode with the #unsplit command.\n",
  3036. "echo prompt showme"
  3037. },
  3038. {
  3039. "SSL",
  3040. "<178>Command<278>: #ssl <178>{<278>name<178>} {<278>host<178>} {<278>port<178>} {<278>file<178>}\n"
  3041. "\n"
  3042. " Starts a secure socket telnet session with the given name, host, port,\n"
  3043. " and optional file name.\n",
  3044. "all port run sessionname snoop ssl zap"
  3045. },
  3046. {
  3047. "STATEMENTS",
  3048. " TinTin++ knows the following statements.\n"
  3049. "<278>\n"
  3050. " #break\n"
  3051. " #case {value} {true}\n"
  3052. " #continue\n"
  3053. " #default {commands}\n"
  3054. " #else {commands}\n"
  3055. " #elseif {expression} {true}\n"
  3056. " #foreach {list} {variable} {commands}\n"
  3057. " #if {expression} {true}\n"
  3058. " #loop {min} {max} {variable} {commands}\n"
  3059. " #parse {string} {variable} {commands}\n"
  3060. " #return {value}\n"
  3061. " #switch {expression} {commands}\n"
  3062. " #while {expression} {commands}\n",
  3063. "commands help info"
  3064. },
  3065. {
  3066. "SUBSTITUTE",
  3067. "<178>Command<278>: #substitute <178>{<278>text<178>} {<278>new text<178>} {<278>priority<178>}<278>\n"
  3068. "\n"
  3069. " Allows you to replace text from the server with the new text.\n"
  3070. " This is helpful for complex coloring and making things more readable.\n"
  3071. " The %1-%99 variables can be used to capture text and use it as part of\n"
  3072. " the new output, and the ^ char is valid to only check the beginning of\n"
  3073. " the line for the text specified.\n"
  3074. "\n"
  3075. " If only one argument is given, all active substitutions that match the\n"
  3076. " strings are displayed. The '%*' char is valid in this instance. See\n"
  3077. " '#help regex', for advanced wildcard information.\n"
  3078. "\n"
  3079. " If no argument is given, all subs are displayed.\n"
  3080. "\n"
  3081. "<178>Example<278>: #sub {Zoe} {ZOE}\n"
  3082. " Any instance of Zoe will be replaced with ZOE.\n"
  3083. "\n"
  3084. "<178>Example<278>: #sub {~\\e[0;34m} {\\e[1;34m}\n"
  3085. " Replace generic dark blue color codes with bright blue ones.\n"
  3086. "\n"
  3087. "<178>Example<278>: #sub {%1massacres%2} {<<888>018>%1<<888>118>MASSACRES<<888>018>%2}\n"
  3088. " Replaces all occurrences of 'massacres' with 'MASSACRES' in red.\n"
  3089. "\n"
  3090. "<178>Comment<278>: See '#help action', for more information about triggers.\n"
  3091. "\n"
  3092. "<178>Comment<278>: See '#help colors', for more information.\n"
  3093. "\n"
  3094. "<178>Comment<278>: You can remove a substitution with the #unsubstitute command.\n",
  3095. "action gag highlight prompt"
  3096. },
  3097. {
  3098. "SUSPEND",
  3099. "<178>Command<278>: #cursor suspend\n"
  3100. "\n"
  3101. " Temporarily suspends tintin and returns you to your shell. To\n"
  3102. " return to tintin, type 'fg' at the shell prompt.\n"
  3103. "\n"
  3104. " While suspended your tintin sessions will freeze. To keep a\n"
  3105. " suspended session running use the #detach command.\n",
  3106. "end"
  3107. },
  3108. {
  3109. "SWITCH",
  3110. "<178>Command<278>: #switch <178>{<278>conditional<178>} {<278>arguments<178>}<278>\n"
  3111. "\n"
  3112. " The switch command works similar to the switch statement in other\n"
  3113. " languages. When the 'switch' command is encountered its body is parsed\n"
  3114. " and each 'case' command found will be compared to the conditional\n"
  3115. " argument of the switch and executed if there is a match.\n"
  3116. "\n"
  3117. " When comparing strings the switch and case arguments must be enclosed\n"
  3118. " in quote characters.\n"
  3119. "\n"
  3120. " If the 'default' command is found and no 'case' statement has been\n"
  3121. " matched the default command's argument is executed.\n"
  3122. "\n"
  3123. "<178>Example<278>: #switch {1d4} {#case 1 cackle;#case 2 smile;#default giggle}\n",
  3124. "statements"
  3125. },
  3126. {
  3127. "SYSTEM",
  3128. "<178>Command<278>: #system <178>{<278>command<178>}<278>\n"
  3129. "\n"
  3130. " Executes the command specified as a shell command.\n",
  3131. "detach script run"
  3132. },
  3133. {
  3134. "TAB",
  3135. "<178>Command<278>: #tab <178>{<278>word<178>}<278>\n"
  3136. "\n"
  3137. " Adds a word to the tab completion list, alphabetically sorted.\n"
  3138. "\n"
  3139. " If no tabs are defined tintin will use the scrollback buffer\n"
  3140. " for auto tab completion.\n"
  3141. "\n"
  3142. "<178>Comment<278>: You can remove a tab with the #untab command.\n",
  3143. "alias cursor history keypad macro speedwalk"
  3144. },
  3145. {
  3146. "TEXTIN",
  3147. "<178>Command<278>: #textin <178>{<278>filename<178>} {<278>delay<178>}<278>\n"
  3148. "\n"
  3149. " Textin allows the user to read in a file, and send its contents\n"
  3150. " directly to the server. Useful for doing online creation, or message\n"
  3151. " writing.\n"
  3152. "\n"
  3153. " The delay is in seconds and takes a floating point number which is\n"
  3154. " cumulatively applied to each outgoing line.\n",
  3155. "scan send"
  3156. },
  3157. {
  3158. "TICKER",
  3159. "<178>Command<278>: #ticker <178>{<278>name<178>} {<278>commands<178>} {<278>interval in seconds<178>}<278>\n"
  3160. "\n"
  3161. " Executes given command every # of seconds.\n"
  3162. "\n"
  3163. "<178>Comment<278>: Tickers don't work in the startup session.\n"
  3164. "\n"
  3165. "<178>Comment<278>: You can remove a ticker with the #unticker command.\n",
  3166. "delay event"
  3167. },
  3168. {
  3169. "TIME",
  3170. "<178>Command<278>: #format <178>{<278>variable<178>} {<278>%t<178>} {<278>argument<178>}<278>\n"
  3171. "\n"
  3172. " The %t format specifier of the #format command allows printing dates\n"
  3173. " using the strftime() format specifiers. By default the time stamp used\n"
  3174. " is the current time, if you want to print a past or future date use:\n"
  3175. "\n"
  3176. "<178>Command<278>: #format <178>{<278>variable<178>} {<278>%t<178>} {{<278>argument<178>} <178>{{<278>epoch time<178>}}<278>\n"
  3177. "\n"
  3178. " The current epoch time value is obtained using #format {time} {%T}.\n"
  3179. "\n"
  3180. " When using %t the argument should contain strftime format specifiers.\n"
  3181. " The output may differ depending on your locale.\n"
  3182. "\n"
  3183. " %a Abbreviated name of the day of the week (mon ... sun).\n"
  3184. " %A Full name of the day of the week. (Monday ... Sunday)\n"
  3185. " %b Abbreviated name of the month (Jan ... Dec)\n"
  3186. " %B Full name of the month. (January ... December)\n"
  3187. " %C 2 digit numeric century. (19 ... 20)\n"
  3188. " %d 2 digit numeric day of the month (01 ... 31)\n"
  3189. " %H 2 digit numeric 24-hour clock hour. (00 ... 23)\n"
  3190. " %I 2 digit numeric 12-hour clock hour. (01 ... 12)\n"
  3191. " %j 3 digit numeric day of the year (001 ... 366)\n"
  3192. " %m 2 digit numeric month of the year (01 ... 12)\n"
  3193. " %M 2 digit numeric minute of the hour (00 ... 59)\n"
  3194. " %p Abbreviated 12 hour clock period (AM ... PM)\n"
  3195. " %P Abbreviated 12 hour clock period (am ... pm)\n"
  3196. " %S 2 digit numeric second of the minute (00 ...59\n"
  3197. " %u 1 digit numeric day of the week (1 ... 7)\n"
  3198. " %U 2 digit numeric Sunday week of the year (00 ... 53\n"
  3199. " %w 1 digit numeric day of the week (0 ... 6)\n"
  3200. " %W 2 digit numeric Monday week of the year (00 ... 53\n"
  3201. " %y 2 digit numeric year. (70 ... 38)\n"
  3202. " %Y 4 digit numeric year. (1970 ... 2038)\n"
  3203. " %z 5 digit timezone offset. (-1200 ... +1400)\n"
  3204. " %Z Abbreviated name of the time zone.\n",
  3205. "echo format"
  3206. },
  3207. {
  3208. "VARIABLE",
  3209. "<178>Command<278>: #variable <178>{<278>variable name<178>} {<278>text to fill variable<178>}<278>\n"
  3210. "\n"
  3211. " Variables differ from the %0-99 arguments in the fact that you can\n"
  3212. " specify a full word as a variable, and they stay in memory for the\n"
  3213. " full session unless they are changed. They can be saved in the\n"
  3214. " coms file, and can be set to different values if you have two or\n"
  3215. " more sessions running at the same time. Variables are global for\n"
  3216. " each session and can be accessed by adding a $ before the variable\n"
  3217. " name.\n"
  3218. "\n"
  3219. "<178>Example<278>: #alias {target} {#var target %0}\n"
  3220. " #alias {x} {kick $target}\n"
  3221. "\n"
  3222. " The name of a variable must exist of only letters, numbers and\n"
  3223. " underscores in order to be substituted. If you do not meet these\n"
  3224. " requirements do not panic, simply encapsulate the variable in braces:\n"
  3225. "\n"
  3226. "<178>Example<278>: #variable {cool website} {http://tintin.sourceforge.net}\n"
  3227. " #chat I was on ${cool website} yesterday!.\n"
  3228. "\n"
  3229. " Variables can be nested using brackets or dots:\n"
  3230. "\n"
  3231. "<178>Example<278>: #var hp[self] 34;#var hp[target] 46\n"
  3232. "\n"
  3233. " You can see the first nest of a variable using $variable[+1] and the\n"
  3234. " last nest using $variable[-1]. Using $variable[-2] will report the\n"
  3235. " second last variable, and so on. To show all indices use $variable[].\n"
  3236. " To show all values use $variable[%*] or a less generic regex.\n"
  3237. "\n"
  3238. " Nested variables are also known as tables, table generally being used\n"
  3239. " to refer to several variables nested within one specific variable.\n"
  3240. "\n"
  3241. "<178>Example<278>: #showme {Targets starting with the letter A: $targets[A%*]\n"
  3242. "\n"
  3243. " To see the internal index of a variable use &<variable name>. To see\n"
  3244. " the size of a table you would use: &targets[] or &targets[%*]. A non\n"
  3245. " existent nested variable will report itself as 0.\n"
  3246. "\n"
  3247. "<178>Example<278>: #showme {Number of targets starting with A: &targets[A%*]\n"
  3248. "\n"
  3249. " In some scripts you need to know the name of a nested variable. This\n"
  3250. " is also known as the key, and you can get it using *variable. For\n"
  3251. " example *target[+1]. To get the first variable's name use *{+1}.\n"
  3252. "\n"
  3253. " It's also possible to declare a table using brace notation. Using\n"
  3254. " #var hp[self] 34 is the equivalent of #var {hp} {{self}{34}}. This\n"
  3255. " also allows merging tables. #var hp[self] 34;#var hp[target] 46 is\n"
  3256. " the equivalent of #var {hp} {{self}{34} {target}{46}} as well as\n"
  3257. " #var {hp} {{self}{34}} {{target}{46}} or if you want to get creative\n"
  3258. " the equivalent of #var hp[self] 34;#var {hp} {$hp} {{target}{46}}.\n"
  3259. "\n"
  3260. "<178>Comment<278>: You can remove a variable with the #unvariable command.\n",
  3261. "cat format function local math replace script"
  3262. },
  3263. {
  3264. "WHILE",
  3265. "<178>Command<278>: #while <178>{<278>conditional<178>} {<278>commands<178>}<278>\n"
  3266. "\n"
  3267. " This command works similar to a 'while' statement in other languages.\n"
  3268. "\n"
  3269. " When a 'while' command is encourated, the conditional is evaluated,\n"
  3270. " and if TRUE (any non-zero result) the commands are executed. The\n"
  3271. " 'while' loop will be repeated indefinitely until the conditional is\n"
  3272. " FALSE or the #BREAK or #RETURN commands are found.\n"
  3273. "\n"
  3274. " The 'while' statement is only evaluated if it is read, so you must\n"
  3275. " nest it inside a trigger, like an alias or action.\n"
  3276. "\n"
  3277. " The conditional is evaluated exactly the same as in the 'math' command.\n"
  3278. "\n"
  3279. "<178>Example<278>: #math cnt 0;#while {$cnt < 20} {#math cnt $cnt + 1;say $cnt}\n"
  3280. "\n"
  3281. "<178>Comment<278>: See '#help math', for more information.\n",
  3282. "statements"
  3283. },
  3284. {
  3285. "WRITE",
  3286. "<178>Command<278>: #write <178>{<278><filename><178>} {<278>[FORCE]<178>}<278>\n"
  3287. "\n"
  3288. " Writes all current actions, aliases, subs, highlights, and variables\n"
  3289. " to a command file, specified by filename.\n"
  3290. "\n"
  3291. " By default you cannot write to .map files to prevent accidentally\n"
  3292. " overwriting a map file. Use the FORCE argument to ignore this\n"
  3293. " protection.\n",
  3294. "log read scan textin"
  3295. },
  3296. {
  3297. "ZAP",
  3298. "<178>Command<278>: #zap {[session]}\n"
  3299. "\n"
  3300. " Kill your current session. If there is no current session, it will\n"
  3301. " cause the program to terminate. If you provide an argument it'll zap\n"
  3302. " the given session instead.\n",
  3303. "all port run session sessionname snoop ssl"
  3304. },
  3305. {
  3306. "",
  3307. "",
  3308. ""
  3309. }
  3310. };