help.c 259 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319
  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. int type;
  29. char * text;
  30. char * also;
  31. };
  32. struct help_type help_table[];
  33. size_t help_size();
  34. int find_help(char *keyword)
  35. {
  36. unsigned int bot, mid, top;
  37. bot = 0;
  38. top = help_size();
  39. while (top > 1)
  40. {
  41. mid = top / 2;
  42. if (is_abbrev_cmp(keyword, help_table[bot + mid].name) >= 0)
  43. {
  44. bot += mid;
  45. }
  46. top -= mid;
  47. }
  48. if (!is_abbrev_cmp(keyword, help_table[bot].name))
  49. {
  50. return bot;
  51. }
  52. show_error(gtd->ses, LIST_COMMAND, "find_help: Could not find '%s' in help_table.", keyword);
  53. return help_size();
  54. }
  55. char *help_related(struct session *ses, int index, int html)
  56. {
  57. char *arg, *tmp, *link;
  58. static char buf[INPUT_SIZE];
  59. int hlp;
  60. push_call("help_related(%p,%d,%d)",ses,index,html);
  61. tmp = str_alloc_stack(0);
  62. link = str_alloc_stack(0);
  63. arg = help_table[index].also;
  64. buf[0] = 0;
  65. while (*arg)
  66. {
  67. arg = get_arg_in_braces(ses, arg, tmp, GET_ONE);
  68. if (html == 1)
  69. {
  70. sprintf(link, "\\c<a href='%s.php'\\c>%s\\c</a\\c>", tmp, tmp);
  71. }
  72. else if (html == 2)
  73. {
  74. sprintf(link, "\\c<a href='#%s'\\c>%s\\c</a\\c>", capitalize(tmp), tmp);
  75. }
  76. else if (html == 3)
  77. {
  78. hlp = find_help(tmp);
  79. if (hlp == help_size())
  80. {
  81. printf("error: unknown help entry: %s see also: %s\n", help_table[index].name, tmp);
  82. }
  83. if (help_table[hlp].type != TOKEN_TYPE_STRING)
  84. {
  85. sprintf(link, "\\c<a href='help.html#%s'\\c>%s\\c</a\\c>", capitalize(tmp), tmp);
  86. }
  87. else
  88. {
  89. sprintf(link, "\\c<a href='#%s'\\c>%s\\c</a\\c>", capitalize(tmp), tmp);
  90. }
  91. }
  92. else if (HAS_BIT(gtd->flags, TINTIN_FLAG_MOUSETRACKING))
  93. {
  94. sprintf(link, "\e]68;6;;%s\a\e[4m%s\e[24m", tmp, tmp);
  95. }
  96. else
  97. {
  98. strcpy(link, tmp);
  99. }
  100. if (*buf == 0)
  101. {
  102. sprintf(buf, "<178>Related<278>: %s", link);
  103. }
  104. else
  105. {
  106. if (*arg)
  107. {
  108. cat_sprintf(buf, ", %s", link);
  109. }
  110. else
  111. {
  112. cat_sprintf(buf, " and %s.", link);
  113. }
  114. }
  115. }
  116. pop_call();
  117. return buf;
  118. }
  119. DO_COMMAND(do_help)
  120. {
  121. char buf[BUFFER_SIZE], color[COLOR_SIZE], tmp[INPUT_SIZE];
  122. int cnt, tut, found, rows, cols, size, col, row;
  123. arg = get_arg_in_braces(ses, arg, arg1, GET_ALL);
  124. if (*arg1 == 0)
  125. {
  126. tintin_header(ses, 0, " %s ", "HELP");
  127. *buf = 0;
  128. size = help_size();
  129. rows = UMAX(1, ses->wrap / 16);
  130. cols = size / rows + (size % rows > 0);
  131. for (cnt = col = 0 ; col < cols ; col++)
  132. {
  133. if (!HAS_BIT(ses->config_flags, CONFIG_FLAG_SCREENREADER))
  134. {
  135. cnt = col;
  136. }
  137. for (row = 0 ; row < rows ; row++)
  138. {
  139. switch (help_table[cnt].type)
  140. {
  141. case TOKEN_TYPE_STATEMENT:
  142. // strcpy(color, COLOR_STATEMENT);
  143. // break;
  144. case TOKEN_TYPE_CONFIG:
  145. // strcpy(color, COLOR_CONFIG);
  146. // break;
  147. case TOKEN_TYPE_COMMAND:
  148. strcpy(color, COLOR_COMMAND);
  149. break;
  150. case TOKEN_TYPE_STRING:
  151. strcpy(color, COLOR_STRING);
  152. break;
  153. default:
  154. strcpy(color, "");
  155. break;
  156. }
  157. if (HAS_BIT(gtd->flags, TINTIN_FLAG_MOUSETRACKING))
  158. {
  159. cat_sprintf(buf, "\e]68;6;;%s\a\e[4m%s%s\e[24m%.*s", help_table[cnt].name, color, help_table[cnt].name, 16 - (int) strlen(help_table[cnt].name), " ");
  160. }
  161. else
  162. {
  163. cat_sprintf(buf, "%s%-16s", color, help_table[cnt].name);
  164. }
  165. cnt += HAS_BIT(ses->config_flags, CONFIG_FLAG_SCREENREADER) ? 1 : cols;
  166. if (row + 1 == rows || cnt >= size)
  167. {
  168. print_lines(ses, SUB_COL, "", "<088>%s<088>\n", buf);
  169. *buf = 0;
  170. break;
  171. }
  172. }
  173. }
  174. if (*buf)
  175. {
  176. print_lines(ses, SUB_COL, "", "<088>%s<088>\n", buf);
  177. }
  178. tintin_header(ses, 0, "");
  179. }
  180. else if (!strcasecmp(arg1, "dump"))
  181. {
  182. // help
  183. FILE *logfile = fopen("../docs/help.html", "w");
  184. script_driver(ses, LIST_COMMAND, "#config {log} {html}");
  185. if (HAS_BIT(ses->log->mode, LOG_FLAG_HTML))
  186. {
  187. write_html_header(ses, logfile);
  188. }
  189. *buf = 0;
  190. command(ses, do_function, "clink {#format result {%%+%%1h} {%%2};#replace result {#} { };#replace result {%%2} {\\c<a href='%%3'\\c>%%2\\c</a\\c>}}");
  191. command(ses, do_line, "log {../docs/help.html} {<138> ╭──────────────────────────────────────────────────────────────────────╮}");
  192. command(ses, do_line, "log {../docs/help.html} {<138> │@clink{70;Home;index.html}│}");
  193. command(ses, do_line, "log {../docs/help.html} {<138> ╰──────────────────────────────────────────────────────────────────────╯\n}");
  194. fseek(logfile, 0, SEEK_END);
  195. size = help_size();
  196. rows = 4;
  197. cols = size / rows + (size % rows > 0);
  198. for (cnt = col = 0 ; col < cols ; col++)
  199. {
  200. cnt = col;
  201. for (row = 0 ; row < rows ; row++)
  202. {
  203. filename_string(help_table[cnt].name, tmp);
  204. cat_sprintf(buf, " \\c<a href='#%s'\\c>%-16s\\c</a\\c> ", tmp, help_table[cnt].name);
  205. cnt += cols;
  206. if (row + 1 == rows || cnt >= size)
  207. {
  208. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  209. logit(ses, " ", logfile, 0);
  210. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  211. *buf = 0;
  212. break;
  213. }
  214. }
  215. }
  216. cat_sprintf(buf, "\n\n");
  217. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  218. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  219. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  220. {
  221. filename_string(help_table[cnt].name, tmp);
  222. sprintf(buf, "\\c<a name='%.100s'\\c>\\c</a\\c>\n", tmp);
  223. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  224. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  225. sprintf(buf, "<138> %s\n", help_table[cnt].name);
  226. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  227. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  228. substitute(ses, help_table[cnt].text, buf, SUB_COL);
  229. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  230. if (*help_table[cnt].also)
  231. {
  232. substitute(ses, help_related(ses, cnt, 2), buf, SUB_ESC|SUB_COL);
  233. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  234. }
  235. }
  236. fclose(logfile);
  237. // tutorial
  238. int tutorial[size];
  239. logfile = fopen("../docs/tutorial.html", "w");
  240. if (HAS_BIT(ses->log->mode, LOG_FLAG_HTML))
  241. {
  242. write_html_header(ses, logfile);
  243. }
  244. command(ses, do_line, "log {../docs/tutorial.html} {<138> ╭──────────────────────────────────────────────────────────────────────╮}");
  245. command(ses, do_line, "log {../docs/tutorial.html} {<138> │@clink{70;Home;index.html}│}");
  246. command(ses, do_line, "log {../docs/tutorial.html} {<138> ╰──────────────────────────────────────────────────────────────────────╯\n}");
  247. fseek(logfile, 0, SEEK_END);
  248. tut = 2;
  249. for (cnt = 0 ; cnt < size ; cnt++)
  250. {
  251. if (help_table[cnt].type != TOKEN_TYPE_STRING)
  252. {
  253. continue;
  254. }
  255. if (is_abbrev("INDEX", help_table[cnt].name))
  256. {
  257. tutorial[0] = cnt;
  258. }
  259. else if (is_abbrev("INTRODUCTION", help_table[cnt].name))
  260. {
  261. tutorial[1] = cnt;
  262. }
  263. else
  264. {
  265. tutorial[tut++] = cnt;
  266. }
  267. }
  268. size = tut;
  269. rows = 4;
  270. cols = size / rows + (size % rows > 0);
  271. *buf = 0;
  272. for (cnt = col = 0 ; col < cols ; col++)
  273. {
  274. cnt = col;
  275. for (row = 0 ; row < rows ; row++)
  276. {
  277. tut = tutorial[cnt];
  278. filename_string(help_table[tut].name, tmp);
  279. cat_sprintf(buf, " \\c<a href='#%s'\\c>%-16s\\c</a\\c> ", tmp, help_table[tut].name);
  280. cnt += cols;
  281. if (row + 1 == rows || cnt >= size)
  282. {
  283. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  284. logit(ses, " ", logfile, 0);
  285. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  286. *buf = 0;
  287. break;
  288. }
  289. }
  290. }
  291. cat_sprintf(buf, "\n\n");
  292. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  293. logit(ses, " ", logfile, 0);
  294. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  295. for (cnt = 0 ; cnt < size ; cnt++)
  296. {
  297. tut = tutorial[cnt];
  298. filename_string(help_table[tut].name, tmp);
  299. sprintf(buf, "\\c<a name='%.100s'\\c>\\c</a\\c>\n", tmp);
  300. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  301. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  302. sprintf(buf, "<138> %s\n", help_table[tut].name);
  303. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  304. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  305. substitute(ses, help_table[tut].text, buf, SUB_COL);
  306. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  307. if (*help_table[tut].also)
  308. {
  309. substitute(ses, help_related(ses, tut, 3), buf, SUB_ESC|SUB_COL);
  310. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  311. }
  312. }
  313. fclose(logfile);
  314. }
  315. else if (!strcasecmp(arg1, "dump.php"))
  316. {
  317. FILE *logfile;
  318. script_driver(ses, LIST_COMMAND, "#config {log} {html}");
  319. *buf = 0;
  320. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  321. {
  322. filename_string(help_table[cnt].name, arg1);
  323. lowerstring(arg1);
  324. sprintf(buf, "../../manual/%s.php", arg1);
  325. logfile = fopen(buf, "w");
  326. fprintf(logfile, "<?php\n\tinclude 'manual.php';\n\n\tshow_head(\"%s.php\");\n\n\tshow_example(\"\n", arg1);
  327. if (*help_table[cnt].also)
  328. {
  329. sprintf(buf, "<128> %s\n", help_table[cnt].name);
  330. substitute(ses, buf, buf, SUB_ESC|SUB_COL);
  331. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  332. }
  333. substitute(ses, help_table[cnt].text, buf, SUB_COL);
  334. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  335. if (*help_table[cnt].also)
  336. {
  337. substitute(ses, help_related(ses, cnt, 1), buf, SUB_ESC|SUB_COL);
  338. logit(ses, buf, logfile, LOG_FLAG_LINEFEED);
  339. }
  340. fprintf(logfile, "\n\t\");\n\n");
  341. fprintf(logfile, "\tshow_tail();\n?>\n");
  342. fclose(logfile);
  343. }
  344. }
  345. else
  346. {
  347. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  348. {
  349. if (is_abbrev(arg1, help_table[cnt].name))
  350. {
  351. if (!check_all_events(ses, EVENT_FLAG_CATCH, 1, 0, "CATCH HELP %s", help_table[cnt].name))
  352. {
  353. print_lines(ses, SUB_COL, "", /*COLOR_HELP_DIM,*/ "%s<088>\n", help_table[cnt].text);
  354. }
  355. if (*help_table[cnt].also)
  356. {
  357. print_lines(ses, SUB_COL, "", "%s<088>\n\n", help_related(ses, cnt, 0));
  358. }
  359. return ses;
  360. }
  361. }
  362. found = FALSE;
  363. for (cnt = 0 ; *help_table[cnt].name != 0 ; cnt++)
  364. {
  365. if (match(ses, help_table[cnt].name, arg1, SUB_VAR|SUB_FUN))
  366. {
  367. print_lines(ses, SUB_COL, "", /*COLOR_HELP_DIM,*/ "%s<088>\n", help_table[cnt].text);
  368. if (*help_table[cnt].also)
  369. {
  370. print_lines(ses, SUB_COL, "", "%s<088>\n\n", help_related(ses, cnt, 0));
  371. }
  372. found = TRUE;
  373. }
  374. }
  375. if (found == FALSE)
  376. {
  377. show_message(ses, LIST_COMMAND, "#HELP: NO MATCHES FOUND FOR {%s}.", arg1);
  378. }
  379. }
  380. return ses;
  381. }
  382. struct help_type help_table[] =
  383. {
  384. {
  385. "ACTION",
  386. TOKEN_TYPE_CONFIG,
  387. "<178>Command<278>: #action <178>{<278>message<178>} {<278>commands<178>} {<278>priority<178>}\n"
  388. "\n"
  389. "<278> The #action command can be used to respond with one or several\n"
  390. "<278> commands to a specific message sent by the server. The %1-%99\n"
  391. "<278> variables are substituted from the message and can be used in the\n"
  392. "<278> command part of the action.\n"
  393. "\n"
  394. "<278> If the message starts with a ~ color codes must be matched. You can\n"
  395. "<278> enable #config {convert meta} on to display meta characters.\n"
  396. "\n"
  397. "<278> For more information on pattern matching see the section on PCRE.\n"
  398. "\n"
  399. "<178>Example<278>: #action {%1 tells you '%2'} {tell %1 I'm afk.}\n"
  400. "\n"
  401. "<278> Actions can be triggered by the #show command. If you don't want a\n"
  402. "<278> #show to get triggered use: #line ignore #show {text}\n"
  403. "\n"
  404. "<278> Actions are ordered alphabetically and only one action can trigger at\n"
  405. "<278> a time. To change the order you can assign a priority, which defaults\n"
  406. "<278> to 5, with a lower number indicating a higher priority. The priority\n"
  407. "<278> can be a floating point number and should be between 1 and 9.\n"
  408. "\n"
  409. "<278> To remove an action with %* as the message, use #unaction {%%*} or\n"
  410. "<278> #unaction {\\%*}. Alternatively you could wrap the action inside a\n"
  411. "<278> class, and kill that class when you no longer need the action.\n"
  412. "\n"
  413. "<178>Comment<278>: You can remove an action with the #unaction command.\n"
  414. ,
  415. "pcre gag highlight prompt substitute"
  416. },
  417. {
  418. "ALIAS",
  419. TOKEN_TYPE_CONFIG,
  420. "<178>Command<278>: #alias <178>{<278>name<178>} {<278>commands<178>} {<278>priority<178>}\n"
  421. "\n"
  422. "<278> The #alias command can be used to shorten up long or oftenly used\n"
  423. "<278> commands. The %1-99 variables are substituted from the arguments when\n"
  424. "<278> using an alias and represent the 1st till 99th word which can be used\n"
  425. "<278> in the commands part of the alias. If %0 is used it will contain all\n"
  426. "<278> arguments. The priority part is optional and determines the priority\n"
  427. "<278> of the alias, it defaults to 5.\n"
  428. "\n"
  429. "<278> If no % variable is used in the commands section any argument will be\n"
  430. "<278> appended to the end as if %0 was used. This feature might be removed\n"
  431. "<278> in the future, and shouldn't be used.\n"
  432. "\n"
  433. "<178>Example<278>: #alias {k} {kill %1;kick}\n"
  434. "\n"
  435. "<278> Typing 'k orc' would result in attacking the orc followed by a kick.\n"
  436. "\n"
  437. "<278> You can create multi-word aliases by using variables in the name\n"
  438. "<278> section.\n"
  439. "\n"
  440. "<178>Example<278>: #alias {k %1 with %2} {draw %2;attack %1;slash %1 with %2;\n"
  441. "<278> kick at %2;strike %1 with %2}\n"
  442. "\n"
  443. "<278> Using the above alias you could type k blue smurf with battle axe\n"
  444. "\n"
  445. "<278> To have an alias that matches all user input, use %* as the name.\n"
  446. "\n"
  447. "<178>Example<278>: #alias {%*} {#show You wrote: %0}\n"
  448. "\n"
  449. "<278> Aliases are ordered alphabetically and only one alias can trigger at\n"
  450. "<278> a time. To change the order you can assign a priority, which defaults\n"
  451. "<278> to 5, with a lower number indicating a higher priority. The priority\n"
  452. "<278> can be a floating point number.\n"
  453. "\n"
  454. "<278> To remove an alias with %* as the name, use #unalias {%%*} or #unalias\n"
  455. "<278> {\\%*}. Alternatively you can wrap the alias inside a class, and kill\n"
  456. "<278> that class when you no longer need the alias.\n"
  457. "\n"
  458. "<278> For more information on pattern matching see the section on PCRE.\n"
  459. "\n"
  460. "<178>Comment<278>: You can remove an alias with the #unalias command.\n"
  461. ,
  462. "cursor history keypad macro speedwalk tab"
  463. },
  464. {
  465. "ALL",
  466. TOKEN_TYPE_COMMAND,
  467. "<178>Command<278>: #all <178>{<278>string<178>}\n"
  468. "\n"
  469. "<278> If you have multiple sessions in one terminal you can use #all to\n"
  470. "<278> execute the command with all sessions, excluding the startup session.\n"
  471. "\n"
  472. "<178>Example<278>: #all quit\n"
  473. "\n"
  474. "<278> Sends 'quit' to all sessions.\n"
  475. ,
  476. "port run session sessionname snoop ssl zap"
  477. },
  478. {
  479. "BELL",
  480. TOKEN_TYPE_COMMAND,
  481. "<178>Command<278>: #bell <178>{<278>flash<178>|<278>focus<178>|<278>margin<178>|<278>ring<178>|<278>volume<178>} {<278>argument<178>}\n"
  482. "\n"
  483. "<278> The #bell command without an argument will ring the terminal bell.\n"
  484. "\n"
  485. "<178>Example<278>: #action {Bubba tells you} {#bell}\n"
  486. "\n"
  487. "<278> If you aren't watching the screen this could be useful if you don't\n"
  488. "<278> want to miss out on a conversation with Bubba. Alternatively you can\n"
  489. "<278> use #system to play a sound file.\n"
  490. "\n"
  491. "<278> Some terminals will allow you to use VT100 Operating System Commands\n"
  492. "<278> to change the terminal's bell behavior which can be used to flash the\n"
  493. "<278> taskbar icon and or focus the window on receival of a bell.\n"
  494. "\n"
  495. "<178>Example<278>: #action {Bubba tells you} {#screen save title;#screen set title Tell!;\n"
  496. "<278> #bell ring;#delay 10 #screen load title}\n"
  497. "\n"
  498. "<278> The above example will save your window title, change the title to\n"
  499. "<278> 'Tell!', ring the bell, next reset the window title after 10 seconds.\n"
  500. "\n"
  501. "<278> It's possible to set the terminal to pop to the foreground upon\n"
  502. "<278> ringing of the alarm bell.\n"
  503. "\n"
  504. "<178>Example<278>: #bell focus on;#bell ring;#bell focus off\n"
  505. "\n"
  506. "<278> It's possible to adjust the alarm bell volume on some terminals.\n"
  507. "\n"
  508. "<178>Example<278>: #loop {1} {8} {cnt} {#line substitute variables\n"
  509. "<278> #delay {$cnt} {#show Volume $cnt: #bell volume $cnt;#bell}\n"
  510. ,
  511. "screen"
  512. },
  513. {
  514. "BREAK",
  515. TOKEN_TYPE_STATEMENT,
  516. "<178>Command<278>: #break\n"
  517. "\n"
  518. "<278> The break command can be used inside the #else, #elseif, #if, #foreach,\n"
  519. "<278> #loop, #parse, #switch, and #while statements. When #break is found,\n"
  520. "<278> tintin will stop executing the statement it is currently in and move on\n"
  521. "<278> to the next.\n"
  522. "\n"
  523. "<178>Example<278>: #while {1} {#math cnt $cnt + 1;#if {$cnt == 20} {#break}}\n",
  524. "statements"
  525. },
  526. {
  527. "BUFFER",
  528. TOKEN_TYPE_COMMAND,
  529. "<178>Command<278>: #buffer <178>{<278>option<178>} {<278>argument<178>}\n"
  530. "\n"
  531. "<278> The buffer command has various options to manipulate your scrollback\n"
  532. "<278> buffer.\n"
  533. "\n"
  534. "<278> The size of the scrollback buffer can be configured using #config\n"
  535. "<278> buffer_size <size>. The size must be either 100, 1000, 10000, 100000\n"
  536. "<278> or 1000000 lines.\n"
  537. "\n"
  538. "<278> While scrolling through the scrollback buffer incoming text is not\n"
  539. "<278> displayed, this can be disabled using #config scroll_lock off. The\n"
  540. "<278> scroll lock is automatically disabled when manual input is received,\n"
  541. "<278> subsequently #buffer up and down only work properly when used in a\n"
  542. "<278> macro or mouse event.\n"
  543. "\n"
  544. "<278> <178>#buffer {clear} {[lower bound]} {[upper bound]}\n"
  545. "\n"
  546. "<278> Without an argument this will clear the entire scrollback buffer.\n"
  547. "<278> Otherwise it will clear the given range.\n"
  548. "\n"
  549. "<278> Positive numbers are measured from the start of the scrollback buffer,\n"
  550. "<278> negative numbers from the end.\n"
  551. "\n"
  552. "<278> <178>#buffer {down} [lines]\n"
  553. "\n"
  554. "<278> Moves your scrollback buffer down one page and displays the page. If\n"
  555. "<278> a line number is provided it will scroll down the given number of\n"
  556. "<278> lines.\n"
  557. "\n"
  558. "<278> <178>#buffer {end}\n"
  559. "\n"
  560. "<278> Moves you to the end of your scrollback buffer and displays the page.\n"
  561. "<278> Disables scroll lock mode. Most useful when used in a #macro.\n"
  562. "\n"
  563. "<278> <178>#buffer {find} {[number]} {<string>} {[variable]}\n"
  564. "\n"
  565. "<278> Moves the buffer to the given string which can contain a regular\n"
  566. "<278> expression. Optionally you can provide the number of matches to skip,\n"
  567. "<278> allowing you to jump further back in the buffer.\n"
  568. "\n"
  569. "<278> A positive number searches from the start of the buffer, a negative\n"
  570. "<278> number from the end. If you provide a variable the location will be\n"
  571. "<278> stored and no jump takes place.\n"
  572. "\n"
  573. "<278> <178>#buffer {get} {<variable>} {<lower bound>} {[upper bound]}\n"
  574. "\n"
  575. "<278> Allows you to store one or several lines from your scrollback buffer\n"
  576. "<278> (including color codes) into a variable. The lower and upper bound\n"
  577. "<278> must be between 1 and the size of the buffer. If the upper bound is\n"
  578. "<278> omitted the given line is stored as a standard variable. If an upper\n"
  579. "<278> bound is given the lines between the two bounds are stored as a list.\n"
  580. "\n"
  581. "<278> Positive numbers are measured from the start of the scrollback buffer,\n"
  582. "<278> negative numbers from the end.\n"
  583. "\n"
  584. "<278> <178>#buffer {home}\n"
  585. "\n"
  586. "<278> Moves you to the top of your scrollback buffer and displays the page.\n"
  587. "<278> Enables scroll lock mode. Most useful when used in a #macro.\n"
  588. "\n"
  589. "<278> <178>#buffer {info} {[save]} {[variable]}\n"
  590. "\n"
  591. "<278> Display buffer info, optionally save the data to a variable.\n"
  592. "\n"
  593. "<278> <178>#buffer {jump} {<location>}\n"
  594. "\n"
  595. "<278> Moves the buffer to the given location. A positive number jumps from\n"
  596. "<278> the start of the buffer, a negative number from the end.\n"
  597. "\n"
  598. "<278> <178>#buffer {lock} {on|off}\n"
  599. "\n"
  600. "<278> Toggles the lock on the scrollback buffer. When locked, newly incoming\n"
  601. "<278> text won't be displayed, any command will disable the lock, though\n"
  602. "<278> several buffer commands will re-enable the lock. When unlocking it'll\n"
  603. "<278> move you to the end of your scrollback buffer and display the page.\n"
  604. "\n"
  605. "<278> <178>#buffer {refresh}\n"
  606. "\n"
  607. "<278> Marks the buffer as needing to be refreshed, only useful while in\n"
  608. "<278> vertical split mode.\n"
  609. "\n"
  610. "<278> <178>#buffer {up} [lines]\n"
  611. "\n"
  612. "<278> Moves your scrollback buffer up one page and displays the page.\n"
  613. "<278> Enables scroll lock mode. Most useful when used in a #macro. You\n"
  614. "<278> can use #buffer {up} {1} to move the scrollback buffer up 1 line.\n"
  615. "\n"
  616. "<278> <178>#buffer {write} {<filename>}\n"
  617. "\n"
  618. "<278> Writes the scrollback buffer to the given file.\n"
  619. "\n"
  620. "<178>Example<278>: #macro {\\e[F} {#buffer end}\n"
  621. ,
  622. "echo grep macro showme screen"
  623. },
  624. {
  625. "BUTTON",
  626. TOKEN_TYPE_CONFIG,
  627. "<178>Command<278>: #button <178>{<278>square<178>} {<278>commands<178>} {<278>priority<178>}\n"
  628. "\n"
  629. "<278> The #button command can be used to respond with one or several\n"
  630. "<278> commands to a mouse click received within the specified square.\n"
  631. "<278> The click coordinates are stored in %0-%3 and can be used in the\n"
  632. "<278> command part of the button.\n"
  633. "\n"
  634. "<278> The square part should exists of two coordinates defining the\n"
  635. "<278> upper left and bottom right corner using row, col, row, col syntax.\n"
  636. "<278> The square arguments should be separated by spaces, semi-colons or\n"
  637. "<278> braces.\n"
  638. "\n"
  639. "<278> By default the button is set to respond to a mouse button press, to\n"
  640. "<278> respond to other button presses you must add a 5th argument to the\n"
  641. "<278> square that defines the button press type. You can enable #info\n"
  642. "<278> button on to see button events and their type as they happen.\n"
  643. "\n"
  644. "<278> The priority part is optional and determines the priority of the\n"
  645. "<278> button, it defaults to 5.\n"
  646. "\n"
  647. "<278> You must enable #config {mouse tracking} on for buttons to work.\n"
  648. "\n"
  649. "<278> This command draws no visible button, you'll have to do so separately\n"
  650. "<278> if needed.\n"
  651. "\n"
  652. "<178>Example<278>: #button {1;1;2;2} {#show You clicked the upper left corner.}\n"
  653. "\n"
  654. "<278> Buttons are ordered alphabetically and only one button can trigger at\n"
  655. "<278> a time. To change the order you can assign a priority, which defaults\n"
  656. "<278> to 5, with a lower number indicating a higher priority. The priority\n"
  657. "<278> can be a floating point number.\n"
  658. "\n"
  659. "<178>Comment<278>: To see button clicks trigger use #info button on.\n"
  660. "\n"
  661. "<178>Comment<278>: You can remove a button with the #unbutton command.\n"
  662. ,
  663. "delay event ticker"
  664. },
  665. {
  666. "CASE",
  667. TOKEN_TYPE_STATEMENT,
  668. "<178>Command<278>: #case <178>{<278>conditional<178>} {<278>arguments<178>}\n"
  669. "\n"
  670. "<278> The case command must be used within the #switch command. When the\n"
  671. "<278> conditional argument of the case command matches the conditional\n"
  672. "<278> argument of the switch command the body of the case is executed.\n"
  673. "\n"
  674. "<278> When comparing strings both the switch and case arguments must be\n"
  675. "<278> surrounded in quotes.\n"
  676. "\n"
  677. "<178>Example<278>:\n"
  678. "\n"
  679. "<278> #function {reverse_direction}\n"
  680. "<278> {\n"
  681. "<278> #switch {\"%1\"}\n"
  682. "<278> {\n"
  683. "<278> #case {\"north\"} {#return south};\n"
  684. "<278> #case {\"east\"} {#return west};\n"
  685. "<278> #case {\"south\"} {#return north};\n"
  686. "<278> #case {\"west\"} {#return east};\n"
  687. "<278> #case {\"up\"} {#return down};\n"
  688. "<278> #case {\"down\"} {#return up}\n"
  689. "<278> }\n"
  690. "<278> }\n"
  691. "\n"
  692. "<278> This function returns the reverse direction. @reverse_direction{north}\n"
  693. "<278> would return south.\n"
  694. ,
  695. "default match statements switch"
  696. },
  697. {
  698. "CAT",
  699. TOKEN_TYPE_COMMAND,
  700. "<178>Command<278>: #cat <178>{<278>variable<178>} {<278>argument<178>}\n"
  701. "\n"
  702. "<278> The cat command will concatenate the argument to the given variable.\n"
  703. ,
  704. "format function local math replace script variable"
  705. },
  706. {
  707. "CHARACTERS",
  708. TOKEN_TYPE_STRING,
  709. "\n"
  710. "<278> The following special characters are defined:\n"
  711. "\n"
  712. "<178># <278>The hashtag is the default character for starting a command and is\n"
  713. "<278> subsequently known as the command character or tintin character.\n"
  714. "<278> When loading a command file the command character is set to the\n"
  715. "<278> first character in the file. The character can also be redefined\n"
  716. "<278> using #config.\n"
  717. "\n"
  718. "<178>; <278>The semi-colon is used as the command separator and can be used to\n"
  719. "<278> separate two commands. Multiple commands can be strung together as\n"
  720. "<278> well. Trailing semi-colons are ignored when reading a script file\n"
  721. "<278> as this is a common error.\n"
  722. "\n"
  723. "<178>{ } <278>Curly brackets aka braces are used for separating multi word command\n"
  724. "<278> arguments, nesting commands, and nesting variables. Braces cannot\n"
  725. "<278> easily be escaped and must always be used in pairs.\n"
  726. "\n"
  727. "<178>\" \" <278>Quote characters are used for strings in the #math, #if, #switch,\n"
  728. "<278> and #case commands. It is however suggested to use a set of braces\n"
  729. "<278> { } to define strings instead, particularly when checking strings\n"
  730. "<278> that may contain quotes.\n"
  731. "\n"
  732. "<178>! <278>The exclamation sign is used to repeat commands, see #help history.\n"
  733. "<278> The character can be redefined using #config.\n"
  734. "\n"
  735. "<178>\\ <278>An input line starting with a backslash is sent verbatim if you are\n"
  736. "<278> connected to a server. This character can be configured with\n"
  737. "<278> #config, and is itself sent verbatim when the verbatim config mode\n"
  738. "<278> is enabled.\n"
  739. ,
  740. "colors escape_codes function mathematics pcre variable"
  741. },
  742. {
  743. "CHAT",
  744. TOKEN_TYPE_COMMAND,
  745. "<178>Command<278>: #chat <178>{<278>option<178>} {<278>argument<178>}\n"
  746. "\n"
  747. "<278> The #chat command is used to create peer to peer connections to other\n"
  748. "<278> clients, typically for the purpose of chatting and sending files.\n"
  749. "<278> This is a decentralized chat system, meaning you have to exchange ip\n"
  750. "<278> addresses and port numbers with other users in order to connect to\n"
  751. "<278> them.\n"
  752. "\n"
  753. "<278> <178>#chat {init} {port}\n"
  754. "<278> #chat initialize launches your chat server. The port number is\n"
  755. "<278> optional, and by default 4050 is used as your port. After using\n"
  756. "<278> this command other people can connect to your chat server using\n"
  757. "<278> your ip address and port number, and in turn you can connect to\n"
  758. "<278> other people.\n"
  759. "<278> <178>#chat {name} {name}\n"
  760. "<278> By default your name is set to TinTin, but most servers will\n"
  761. "<278> reject you if there is already someone with the name TinTin\n"
  762. "<278> connected, so one of the first things you'd want to do is\n"
  763. "<278> change your chat name. Your name can include color codes. Some\n"
  764. "<278> names aren't accepted by tt++ chat servers, like the name 'all'\n"
  765. "<278> and names longer than 20 characters.\n"
  766. "<278> <178>#chat {message} {buddy|all} {text}\n"
  767. "<278> This is the main command used for communication. If you use\n"
  768. "<278> #chat message all, the message is marked as public and sent to\n"
  769. "<278> everyone you are connected to.\n"
  770. "<278> <178>#chat {accept} {buddy} {boost}\n"
  771. "<278> Accept a file transfer from a buddy. The boost is optional and\n"
  772. "<278> must be a value between 1 and 1000.\n"
  773. "<278> <178>#chat {call} {address} {port}\n"
  774. "<278> #chat call is used to connect to another chat server. If you\n"
  775. "<278> omit the port argument the default port (4050) is used.\n"
  776. "<278> #chat {cancel} {buddy} Cancel a file transfer\n"
  777. "<278> #chat {color} {color names} Set the default color\n"
  778. "<278> #chat {decline} {buddy} Decline a file transfer\n"
  779. "<278> #chat {dnd} Decline new connections\n"
  780. "<278> #chat {download} {directory} Set your download directory\n"
  781. "<278> #chat {emote} {buddy|all} {text} Send an emote message\n"
  782. "<278> #chat {forward} {buddy} Forward all chat messages\n"
  783. "<278> #chat {forwardall} {buddy} Forward all session output\n"
  784. "<278> #chat {filestat} {buddy} Show file transfer data\n"
  785. "<278> #chat {group} {buddy} {name} Assign a chat group\n"
  786. "<278> #chat {ignore} {buddy} Ignores someone\n"
  787. "<278> #chat {info} Displays your info\n"
  788. "<278> #chat {ip} {address} Changes your IP address\n"
  789. "<278> #chat {paste} {buddy|all} {text} Pastes a block of text\n"
  790. "<278> #chat {peek} {buddy} Show one's public connections\n"
  791. "<278> #chat {ping} {buddy} Display response time\n"
  792. "<278> #chat {private} {buddy|all} Make a connection private\n"
  793. "<278> #chat {public} {buddy|all} Make a connection public\n"
  794. "<278> #chat {reply} {text} Reply to last private message\n"
  795. "<278> #chat {request} {buddy} Request one's public connections\n"
  796. "<278> #chat {send} {buddy|all} {text} Sends a raw data string\n"
  797. "<278> #chat {sendfile} {buddy} {filename} Start a file transfer\n"
  798. "<278> #chat {serve} {buddy} Forward all public chat messages\n"
  799. "<278> #chat {uninitialize} Uninitialize the chat port.\n"
  800. "<278> <178>#chat {who}\n"
  801. "<278> #chat who shows all people you are connected to. The first\n"
  802. "<278> column shows a reference number for the connection, which can be\n"
  803. "<278> used instead of the connection's name when sending someone a message\n"
  804. "<278> The second column shows the connection's name. The third column\n"
  805. "<278> shows flags set for the connection, (P)rivate, (I)gnore, (S)erve,\n"
  806. "<278> (F)orward to user, and (f)orward from user. The next columns show\n"
  807. "<278> ip, port, and client name.\n"
  808. "<278> <178>#chat {zap} {buddy} Close a connection\n",
  809. "port"
  810. },
  811. {
  812. "CLASS",
  813. TOKEN_TYPE_CONFIG,
  814. "<178>Command<278>: #class <178>{<278>name<178>} {<278>option<178>} {<278>arg<178>}\n"
  815. "\n"
  816. "<278> The class command is primarily used to assign groups of triggers and\n"
  817. "<278> variables a label so they can be easily removed.\n"
  818. "\n"
  819. "<278> <178>#class {<name>} {assign} {<argument>}\n"
  820. "<278> Will open the class, execute argument, and close afterwards.\n"
  821. "<278> <178>#class {<name>} {clear}\n"
  822. "<278> Will delete all triggers associated with the given class.\n"
  823. "<278> <178>#class {<name>} {close}\n"
  824. "<278> Close the given class, opening the last open class, if any.\n"
  825. "<278> <178>#class {<name>} {kill}\n"
  826. "<278> Will clear, close, and remove the class.\n"
  827. "<278> <178>#class {<name>} {list}\n"
  828. "<278> List all triggers associated with the given class.\n"
  829. "<278> <178>#class {<name>} {load}\n"
  830. "<278> Will load the saved copy of the class from memory.\n"
  831. "<278> <178>#class {<name>} {open}\n"
  832. "<278> Open a class, closing a previously opened class. All triggers\n"
  833. "<278> added afterwards are assigned to this class.\n"
  834. "<278> <178>#class {<name>} {read} {<filename>\n"
  835. "<278> Will open the class, read the file, and close afterwards.\n"
  836. "<278> <178>#class {<name>} {save}\n"
  837. "<278> Will save all triggers of the given class to memory.\n"
  838. "<278> <178>#class {<name>} {size} {<variable>}\n"
  839. "<278> Will store the size of the class in a variable.\n"
  840. "<278> <178>#class {<name>} {write} {<filename>}\n"
  841. "<278> Will write all triggers of the given class to file.\n"
  842. "\n"
  843. "<278> Keep in mind that you need to use #class save before using\n"
  844. "<278> #class clear and #class load\n"
  845. "\n"
  846. "<178>Example<278>: #class rich kill;#class rich read poor.tin\n"
  847. "<278> Deletes all triggers of 'rich' class if any. Read 'poor.tin' file,\n"
  848. "<278> all triggers loaded will be assigned to the 'rich' class.\n",
  849. "config debug ignore info kill line message"
  850. },
  851. {
  852. "COLORS",
  853. TOKEN_TYPE_STRING,
  854. "<178>Syntax<278>: <<888>xyz> with x, y, z being parameters\n"
  855. "\n"
  856. "<278> Parameter 'x': VT100 code\n"
  857. "\n"
  858. "<278> 0 - Reset all colors and codes to default\n"
  859. "<278> 1 - Bold\n"
  860. "<278> 2 - Dim\n"
  861. "<278> 3 - Italic\n"
  862. "<278> 4 - Underscore\n"
  863. "<278> 5 - Blink\n"
  864. "<278> 7 - Reverse\n"
  865. "<278> 8 - Skip (use previous code)\n"
  866. "\n"
  867. "<278> Parameter 'y': Foreground color\n"
  868. "<278> Parameter 'z': Background color\n"
  869. "\n"
  870. "<278> 0 - Black 5 - Magenta\n"
  871. "<278> 1 - Red 6 - Cyan\n"
  872. "<278> 2 - Green 7 - White\n"
  873. "<278> 3 - Yellow 8 - Skip\n"
  874. "<278> 4 - Blue 9 - Default\n"
  875. "\n"
  876. "<178>Example<278>: #show <<888>125>Bold green on a magenta background.\n"
  877. "\n"
  878. "<278> For xterm 256 colors support use <<888>aaa> to <<888>fff> for RGB foreground\n"
  879. "<278> colors and <<888>AAA> to <<888>FFF> for RGB background colors. For the grayscale\n"
  880. "<278> foreground colors use <<888>g00> to <<888>g23>, for grayscale background colors\n"
  881. "<278> use <<888>G00> to <<888>G23>.\n"
  882. "\n"
  883. "<278> The tertiary colors are as follows:\n"
  884. "\n"
  885. "<278> <<888>acf> - Azure <<888>afc> - Jade\n"
  886. "<278> <<888>caf> - Violet <<888>cfa> - Lime\n"
  887. "<278> <<888>fac> - Pink <<888>fca> - Orange\n"
  888. "\n"
  889. "<178>Example<278>: #show <<888>acf>Azure <<888>afc>Jade <<888>caf>Violet\n"
  890. "<178>Example<278>: #show <<888>cfa>Lime <<888>fac>Pink <<888>fca>Orange\n"
  891. "\n"
  892. "<278> For 12 bit truecolor use <<888>F000> to <<888>FFFF> for foreground colors and\n"
  893. "<278> <<888>B000> to <<888>BFFF> for background colors.\n"
  894. "\n"
  895. "<278> For 24 bit truecolor use <<888>F000000> to <<888>FFFFFFF> for foreground\n"
  896. "<278> colors and <<888>B000000> to <<888>BFFFFFF> for background colors.\n"
  897. "\n"
  898. "<278> If the color code exceeds your configured color mode it will be\n"
  899. "<278> downgraded to the closest match.\n"
  900. ,
  901. "characters coordinates escape_codes mathematics pcre"
  902. },
  903. {
  904. "COMMANDS",
  905. TOKEN_TYPE_COMMAND,
  906. "<178>Command<278>: #commands <178>{<278>abbreviation<178>}\n"
  907. "\n"
  908. "<278> Shows all commands, or all commands starting with the given\n"
  909. "<278> abbreviation.\n"
  910. ,
  911. "help info statements"
  912. },
  913. {
  914. "CONFIG",
  915. TOKEN_TYPE_CONFIG,
  916. "<178>Command<278>: #config <178>{<278>option<178>} {<278>argument<178>}\n"
  917. "\n"
  918. "<278> This allows you to configure various settings, the settings can be\n"
  919. "<278> written to file with the #write command.\n"
  920. "\n"
  921. "<278> If you configure the global session (the one you see as you start up\n"
  922. "<278> tintin) all sessions started will inherite these settings.\n"
  923. "\n"
  924. "<278> It's advised to make a configuration file to read on startup if you\n"
  925. "<278> do not like the default settings.\n"
  926. "\n"
  927. "<278> Use #config without an argument to see your current configuration as\n"
  928. "<278> well as a brief explanation of each config option.\n"
  929. "\n"
  930. "<278> The following config options are not listed by default:\n"
  931. "\n"
  932. "<278> #CONFIG {AUTO TAB} {NUMBER} Buffer lines used for tab completion\n"
  933. "<278> #CONFIG {CHILD LOCK} {ON|OFF} Enable or disable command input.\n"
  934. "<278> #CONFIG {CONNECT RETRY} {NUMBER} Seconds to try to connect on failure.\n"
  935. "<278> #CONFIG {CONVERT META} {ON|OFF} Shows color codes and key bindings.\n"
  936. "<278> #CONFIG {DEBUG TELNET} {ON|OFF} Shows telnet negotiations y/n.\n"
  937. "<278> #CONFIG {HIBERNATE} {ON|OFF} Enable or disable low CPU usage mode.\n"
  938. "<278> #CONFIG {LOG LEVEL} {LOW|HIGH} LOW logs server output before triggers.\n"
  939. "<278> #CONFIG {INHERITANCE} {ON|OFF} Session trigger inheritance y/n.\n"
  940. "<278> #CONFIG {MCCP} {ON|OFF} Enable or disable MCCP support.\n"
  941. "<278> #CONFIG {RANDOM SEED} {NUMBER} Seed value used for random numbers.\n"
  942. "<278> #CONFIG {TAB WIDTH} {NUMBER} Number of spaces used for a tab\n"
  943. "<278> #CONFIG {TINTIN CHAR} {SYMBOL} Character used for TinTin++ commands.\n"
  944. ,
  945. "class line"
  946. },
  947. {
  948. "CONTINUE",
  949. TOKEN_TYPE_STATEMENT,
  950. "<178>Command<278>: #continue\n"
  951. "\n"
  952. "<278> The continue command can be used inside the #FOREACH, #LOOP, #PARSE,\n"
  953. "<278> #WHILE and #SWITCH commands. When #CONTINUE is found, tintin will go\n"
  954. "<278> to the end of the command and proceed as normal, which may be to\n"
  955. "<278> reiterate the command.\n"
  956. "\n"
  957. "<178>Example<278>: #loop 1 10 cnt {#if {$cnt % 2 == 0} {#continue} {say $cnt}}\n",
  958. "break foreach list loop parse repeat return while"
  959. },
  960. {
  961. "COORDINATES",
  962. TOKEN_TYPE_STRING,
  963. "\n"
  964. "<278> When the 0,0 coordinate is in the upper left corner TinTin++ uses\n"
  965. "<278> a y,x / row,col notation, starting at 1,1. Subsequently -1,-1\n"
  966. "<278> will indicate the bottom right corner. This type of argument is\n"
  967. "<278> used by the #showme command.\n"
  968. "\n"
  969. "<278> When the 0,0 coordinate is in the bottom left corner tintin uses\n"
  970. "<278> a standard x,y notation. This type of argument is used by the\n"
  971. "<278> #map jump command.\n"
  972. "\n"
  973. "<278> The vast majority of tintin commands use y,x / row,col notation,\n"
  974. "<278> primarily because that is the notation used by the VT100 standard\n"
  975. "<278> used for terminal emulation.\n"
  976. "\n"
  977. "<278> <128>Squares\n"
  978. "\n"
  979. "<278> A square argument takes 2 coordinates. The first coordinate defines\n"
  980. "<278> the upper left corner, the last coordinate defines the bottom\n"
  981. "<278> right corner. The upper left corner of the terminal is defined as\n"
  982. "<278> 1,1 and the bottom right corner as -1,-1. This type of argument is\n"
  983. "<278> used by #draw, #button and #map offset.\n"
  984. "\n"
  985. "<278> <128>Panes\n"
  986. "\n"
  987. "<278> A pane argument takes 4 size values, which are: top pane, bottom\n"
  988. "<278> pane, left pane, right pane. When a negative value is provided the\n"
  989. "<278> size is the maximum size, minus the value. This type of argument\n"
  990. "<278> is used by the #split command.\n"
  991. "\n"
  992. "<278> <128>Ranges\n"
  993. "\n"
  994. "<278> A range argument takes 2 values known as the upper bound and lower\n"
  995. "<278> bound. The upper bound (first value) defines the start of the\n"
  996. "<278> range, the lower bound (second value) the end. The first index of\n"
  997. "<278> a range is defined as 1. When a negative value is provides the last\n"
  998. "<278> index is defined as -1. This type of argument is used by #buffer\n"
  999. "<278> and #variable.\n"
  1000. ,
  1001. "characters colors escape_codes mathematics pcre"
  1002. },
  1003. {
  1004. "CR",
  1005. TOKEN_TYPE_COMMAND,
  1006. "<178>Command<278>: #cr\n"
  1007. "\n"
  1008. "<278> Sends a carriage return to the session. Useful for aliases that need\n"
  1009. "<278> extra carriage returns.\n"
  1010. "\n"
  1011. "<278> This command is obsolete as you can accomplish the same using #send\n"
  1012. "<278> without an argument or #send {}.\n"
  1013. ,
  1014. "forall"
  1015. },
  1016. {
  1017. "CURSOR",
  1018. TOKEN_TYPE_COMMAND,
  1019. "<178>Command<278>: #cursor <178>{<278>option<178>} {<278>argument<178>}\n"
  1020. "\n"
  1021. "<278> Typing #cursor without an option will show all available cursor\n"
  1022. "<278> options, their default binding, and an explanation of their function.\n"
  1023. "\n"
  1024. "<278> The cursor command's primarly goal is adding customizable input editing\n"
  1025. "<278> with macros. Subsequently many cursor commands only work properly when\n"
  1026. "<278> used within a macro or event.\n"
  1027. "\n"
  1028. "<278> <178>#cursor flag\n"
  1029. "\n"
  1030. "<278> EOL end of line character(s)\n"
  1031. "<278> ECHO local echo\n"
  1032. "<278> OVERTYPE overtype mode\n"
  1033. "\n"
  1034. "<278> <178>#cursor macro\n"
  1035. "\n"
  1036. "<278> PRESERVE do not erase the macro from the macro input buffer\n"
  1037. "<278> RESET erase the macro input buffer\n"
  1038. "\n"
  1039. "<278> <178>#cursor tab\n"
  1040. "\n"
  1041. "<278> CASELESS makes tab completion caseless\n"
  1042. "<278> COMPLETE makes tab completion work while editing\n"
  1043. "\n"
  1044. "<278> DICTIONARY performs tab completion on the dictionary\n"
  1045. "<278> LIST performs tab completion on the tab completion list\n"
  1046. "<278> SCROLLBACK performs tab completion on the scrollback buffer\n"
  1047. "\n"
  1048. "<278> BACKWARD specifies tab completion to go backward\n"
  1049. "<278> FORWARD specifies tab completion to go forward\n"
  1050. "\n"
  1051. "<278> Multiple options can/must be specified at once.\n"
  1052. ,
  1053. "alias history keypad macro speedwalk tab"
  1054. },
  1055. {
  1056. "DAEMON",
  1057. TOKEN_TYPE_COMMAND,
  1058. "<178>Command<278>: #daemon <178>{<278>attach<178>|<278>detach<178>|<278>kill<178>|<278>list<178>} <178>[<278>name<178>]\n"
  1059. "\n"
  1060. "<278> #daemon provides functionality similar to that of the screen and tmux\n"
  1061. "<278> utilities.\n"
  1062. "\n"
  1063. "<278> <178>#daemon attach [name]\n"
  1064. "<278> The attach option will try to find a daemonized tintin instance and\n"
  1065. "<278> take over control. The name argument is optional.\n"
  1066. "\n"
  1067. "<278> <178>#daemon detach [name]\n"
  1068. "<278> The detach option will daemonize tintin, turning it into a background\n"
  1069. "<278> process. The name argument is optional and is useful if you have\n"
  1070. "<278> several daemonized tt++ instances running so you can keep them apart.\n"
  1071. "\n"
  1072. "<278> <178>#daemon kill [name]\n"
  1073. "<278> Kills all daemons or daemons with matching name.\n"
  1074. "\n"
  1075. "<278> <178>#daemon list [name]\n"
  1076. "<278> List all daemons or daemons with matching name.\n"
  1077. "\n"
  1078. "<278> You can launch tintin and attach the first daemonized instance using\n"
  1079. "<278> tt++ -R. To attach a named instance use tt++ -R<name>.\n",
  1080. "script system run"
  1081. },
  1082. {
  1083. "DEBUG",
  1084. TOKEN_TYPE_COMMAND,
  1085. "<178>Command<278>: #debug <178>{<278>listname<178>} {<278>on<178>|<278>off<178>|<278>log<178>}\n"
  1086. "\n"
  1087. "<278> Toggles a list on or off. With no argument it shows your current\n"
  1088. "<278> settings, as well as the list names that you can debug.\n"
  1089. "\n"
  1090. "<278> If you for example set ACTIONS to ON you will get debug information\n"
  1091. "<278> whenever an action is triggered.\n"
  1092. "\n"
  1093. "<278> #debug {listname} {log} will silently write debugging information to\n"
  1094. "<278> the log file, you must be logging in order for this to work.\n"
  1095. "\n"
  1096. "<278> Not every list has debug support yet.\n",
  1097. "class ignore info kill message"
  1098. },
  1099. {
  1100. "DEFAULT",
  1101. TOKEN_TYPE_STATEMENT,
  1102. "<178>Command<278>: #default <178>{<278>commands<178>}\n"
  1103. "\n"
  1104. "<278> The default command can only be used within the switch command. When\n"
  1105. "<278> the conditional argument of non of the case commands matches the switch\n"
  1106. "<278> command's conditional statement the default command is executed.\n",
  1107. "case default else elseif if match switch regexp"
  1108. },
  1109. {
  1110. "DELAY",
  1111. TOKEN_TYPE_CONFIG,
  1112. "<178>Command<278>: #delay <178>{<278>seconds<178>} {<278>command<178>}\n"
  1113. "<178>Command<278>: #delay <178>{<278>name<178>} {<278>command<178>} {<278>seconds<178>}\n"
  1114. "\n"
  1115. "<278> Delay allows you to have tintin wait the given amount of seconds\n"
  1116. "<278> before executing the given command.\n"
  1117. "\n"
  1118. "<278> Nanosecond floating point precision is allowed. Delays will fire in\n"
  1119. "<278> 0.01 second intervals.\n"
  1120. "\n"
  1121. "<278> Named delays are treated as one-shot tickers, see #help tick.\n"
  1122. "\n"
  1123. "<178>Example<278>: #delay {1} {#show last};#show first\n"
  1124. "<278> This will print 'first', and 'last' around one second later.\n"
  1125. "\n"
  1126. "<178>Comment<278>: If you want to remove a delay with the #undelay command you can add\n"
  1127. "<278> a name as the first argument, be aware this changes the syntax. If\n"
  1128. "<278> the name is a number keep in mind that delays with the same numeric\n"
  1129. "<278> name will not be overwritten\n",
  1130. "event ticker"
  1131. },
  1132. {
  1133. "DRAW",
  1134. TOKEN_TYPE_COMMAND,
  1135. "<178>Command<278>: #draw <178>[<278>line color<178>] <178>[<278>options<178>] <178><<278>type<178>> <<278>square<178>> {<278>text<178>}\n"
  1136. "\n"
  1137. "<278> The draw commands allows you to draw various types of lines and shapes\n"
  1138. "<278> on the screen. The types with a brief description are provided when you\n"
  1139. "<278> type #draw without an argument.\n"
  1140. "\n"
  1141. "<278> The <square> arguments should exists of two coordinates defining the\n"
  1142. "<278> upper left and bottom right corner using row, col, row, col syntax.\n"
  1143. "\n"
  1144. "<278> The square arguments can be negative, in which case the coordinates\n"
  1145. "<278> are calculated from the opposite side of the screen. In the case the\n"
  1146. "<278> screen is 80 columns wide using #draw box 1 60 10 70 will be the\n"
  1147. "<278> equivalent of #draw box 1 -21 10 -11, but with different screen\n"
  1148. "<278> widths the boxes would be drawn in different places.\n"
  1149. "\n"
  1150. "<278> You can prefix the option with a color code or color name to color the\n"
  1151. "<278> lines and shapes.\n"
  1152. "\n"
  1153. "<278> You can further prefix the option as following:\n"
  1154. "\n"
  1155. "<278> ASCII draw in ASCII mode.\n"
  1156. "<278> BALIGN bottom align text.\n"
  1157. "<278> BLANKED blank the lines and corners.\n"
  1158. "<278> BOTTOM draw on the bottom side if possible.\n"
  1159. "<278> BOXED draw a box along the square.\n"
  1160. "<278> BUMPED precede the draw with an enter.\n"
  1161. "<278> CALIGN both LALIGN and RALIGN to center text.\n"
  1162. "<278> CIRCLED circle the corners.\n"
  1163. "<278> CONVERT draw text with meta conversion.\n"
  1164. "<278> CROSSED cross the corners.\n"
  1165. "<278> CURSIVE draw text with cursive letters.\n"
  1166. "<278> FAT draw text with fat letters.\n"
  1167. "<278> FILLED fill circles and jewels.\n"
  1168. "<278> FOREGROUND draw even if session is not active.\n"
  1169. "<278> GRID draw TABLE as a grid.\n"
  1170. "<278> HORIZONTAL draw horizontal if possible.\n"
  1171. "<278> HUGE draw text in huge letters.\n"
  1172. "<278> JEWELED diamond the corners.\n"
  1173. "<278> JOINTED draw corners.\n"
  1174. "<278> LALIGN left align text.\n"
  1175. "<278> LEFT draw on the left side if possible.\n"
  1176. "<278> NUMBERED draw numbers instead of lines.\n"
  1177. "<278> PRUNED prune the corners.\n"
  1178. "<278> RALIGN right align text.\n"
  1179. "<278> RIGHT draw on the right side if possible.\n"
  1180. "<278> ROUNDED round the corners.\n"
  1181. "<278> SANSSERIF draw text with sansserif letters.\n"
  1182. "<278> SCALED fit the square to the text size.\n"
  1183. "<278> SCROLL draw in the scrolling region.\n"
  1184. "<278> SHADOWED shadow HUGE text.\n"
  1185. "<278> TALIGN top align text too large to fit.\n"
  1186. "<278> TEED tee the corners.\n"
  1187. "<278> TOP draw on the top side if possible.\n"
  1188. "<278> TRACED trace HUGE text.\n"
  1189. "<278> TUBED draw tubes instead of lines.\n"
  1190. "<278> UALIGN unwrap and rewrap text.\n"
  1191. "<278> UNICODE draw in unicode mode.\n"
  1192. "<278> VERTICAL draw vertical if possible.\n"
  1193. "\n"
  1194. "<278> The following types are available.\n"
  1195. "\n"
  1196. "<278> [HORIZONTAL] <178>BAR<278> {<MIN>;<MAX>;[COLOR]}\n"
  1197. "<278> will draw a bar, use two 256 color codes for a color gradient.\n"
  1198. "<278> [ASCII|UNICODE|HUGE] <178>BOX<278> {[TEXT1]} {[TEXT2]}\n"
  1199. "<278> will draw a box.\n"
  1200. "<278> [BOXED|FOREGROUND] <178>BUFFER\n"
  1201. "<278> will draw the scrollback buffer.\n"
  1202. "<278> [BLANKED|CIRCLED|CROSSED|JEWELED|ROUNDED|TEED|PRUNED] <178>CORNER\n"
  1203. "<278> will draw a corner.\n"
  1204. "<278> [BLANKED|HORIZONTAL|NUMBERED|TUBED|VERTICAL] <178>LINE<278> {[TEXT]}\n"
  1205. "<278> will draw a line.\n"
  1206. "<278> [BOXED] <178>MAP\n"
  1207. "<278> will draw the map\n"
  1208. "<278> <178>RAIN<278> {<VARIABLE>} {[SPAWN]} {[FADE]} {[LEGEND]}\n"
  1209. "<278> will draw digital rain.\n"
  1210. "<278> [JOINTED|TOP|LEFT|BOTTOM|RIGHT] <178>SIDE\n"
  1211. "<278> will draw one or more sides of a box.\n"
  1212. "<278> [GRID] <178>TABLE<278> {[LIST1]} {[LIST2]}\n"
  1213. "<278> will draw a table.\n"
  1214. "<278> [CURSIVE|FAT|HUGE|SANSSERIF] <178>TILE<278> {[TEXT1]} {[TEXT2]}\n"
  1215. "<278> will draw a tile\n"
  1216. "\n"
  1217. "<278> All draw types take an optional text argument as long as a valid\n"
  1218. "<278> square with enough space has been defined. Text is automatically\n"
  1219. "<278> word wrapped and text formatting can be customized with the\n"
  1220. "<278> BALIGN, TALIGN, LALIGN, RALIGN, and UALIGN options.\n"
  1221. "\n"
  1222. "<178>Example<278>: #draw Blue box 1 1 3 20 {Hello world!}\n"
  1223. ,
  1224. "buffer echo grep showme"
  1225. },
  1226. {
  1227. "ECHO",
  1228. TOKEN_TYPE_COMMAND,
  1229. "<178>Command<278>: #echo <178>{<278>format<178>} {<278>argument1<178>} {<278>argument2<178>} {<278>etc<178>}\n"
  1230. "\n"
  1231. "<278> Echo command displays text on the screen with formatting options. See\n"
  1232. "<278> the help file for the format command for more information.\n"
  1233. "\n"
  1234. "<278> The echo command does not trigger actions.\n"
  1235. "\n"
  1236. "<278> As with the #show command you can split the {format} argument up into\n"
  1237. "<278> two braced arguments, in which case the 2nd argument is the row number.\n"
  1238. "\n"
  1239. "<178>Example<278>: #echo {The current date is %t.} {%Y-%m-%d %H:%M:%S}\n"
  1240. "<278> #echo {[%38s][%-38s]} {Hello World} {Hello World}\n"
  1241. "<278> #echo {{this is %s on the top row} {1}} {printed}\n",
  1242. "buffer format grep showme"
  1243. },
  1244. {
  1245. "EDIT",
  1246. TOKEN_TYPE_COMMAND,
  1247. "<178>Command<278>: #edit <178>{<278>option<178>} <178>[<278>argument<178>]\n"
  1248. "\n"
  1249. "<278> The edit command can be used to turn the default line editor into a\n"
  1250. "<278> text editor.\n"
  1251. "\n"
  1252. "<278> <178>#edit create [filename] [arguments]\n"
  1253. "<278> Create an editor, initialize using the provided arguments.\n"
  1254. "\n"
  1255. "<278> <178>#edit load <variable>\n"
  1256. "<278> Create an editor, initialize using the provided list variable.\n"
  1257. "\n"
  1258. "<278> <178>#edit read <filename>\n"
  1259. "<278> Create an editor, initialize using the provided file.\n"
  1260. "\n"
  1261. "<278> <178>#edit resume\n"
  1262. "<278> Resume editing after a suspension.\n"
  1263. "\n"
  1264. "<278> <178>#edit save <variable>\n"
  1265. "<278> Save the editor to the provided variable.\n"
  1266. "\n"
  1267. "<278> <178>#edit suspend\n"
  1268. "<278> Suspend editing, similar to pressing enter except that no\n"
  1269. "<278> events are triggered.\n"
  1270. "\n"
  1271. "<278> <178>#edit write [filename]\n"
  1272. "<278> Write the editor content to file.\n"
  1273. "\n"
  1274. "<178>Example<278>: #edit create {bla.txt} {line 1} {line 2}\n",
  1275. "cursor macro"
  1276. },
  1277. {
  1278. "EDITING",
  1279. TOKEN_TYPE_STRING,
  1280. "\n"
  1281. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1282. "<268>│<178>alt b <268>││<178>cursor backward word <268>│\n"
  1283. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1284. "<268>│<178>alt f <268>││<178>cursor forward word <268>│\n"
  1285. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1286. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1287. "<268>│<178>ctrl a <268>││<178>cursor home <268>│\n"
  1288. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1289. "<268>│<178>ctrl b <268>││<178>cursor backward <268>│\n"
  1290. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1291. "<268>│<178>ctrl c <268>││<178>clear line <268>│\n"
  1292. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1293. "<268>│<178>ctrl d <268>││<178>delete or exit <268>│\n"
  1294. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1295. "<268>│<178>ctrl e <268>││<178>cursor end <268>│\n"
  1296. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1297. "<268>│<178>ctrl f <268>││<178>cursor forward <268>│\n"
  1298. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1299. "<268>│<178>ctrl g <268>││<178> <268>│\n"
  1300. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1301. "<268>│<178>ctrl h <268>││<178>backspace <268>│\n"
  1302. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1303. "<268>│<178>ctrl i <268>││<178>tab <268>│\n"
  1304. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1305. "<268>│<178>ctrl j <268>││<178>enter <268>│\n"
  1306. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1307. "<268>│<178>ctrl k <268>││<178>clear line right <268>│\n"
  1308. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1309. "<268>│<178>ctrl l <268>││<178>redraw input <268>│\n"
  1310. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1311. "<268>│<178>ctrl m <268>││<178>enter <268>│\n"
  1312. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1313. "<268>│<178>ctrl n <268>││<178>input history next <268>│\n"
  1314. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1315. "<268>│<178>ctrl o <268>││<178> <268>│\n"
  1316. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1317. "<268>│<178>ctrl p <268>││<178>input history prev <268>│\n"
  1318. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1319. "<268>│<178>ctrl q <268>││<178> <268>│\n"
  1320. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1321. "<268>│<178>ctrl r <268>││<178>input history search <268>│\n"
  1322. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1323. "<268>│<178>ctrl s <268>││<178> <268>│\n"
  1324. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1325. "<268>│<178>ctrl t <268>││<178>scroll buffer lock <268>│\n"
  1326. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1327. "<268>│<178>ctrl u <268>││<178>clear line left <268>│\n"
  1328. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1329. "<268>│<178>ctrl v <268>││<178>convert meta characters <268>│\n"
  1330. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1331. "<268>│<178>ctrl w <268>││<178>delete word left <268>│\n"
  1332. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1333. "<268>│<178>ctrl x <268>││<178> <268>│\n"
  1334. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1335. "<268>│<178>ctrl y <268>││<178>paste <268>│\n"
  1336. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1337. "<268>│<178>ctrl z <268>││<178>suspend <268>│\n"
  1338. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1339. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1340. "<268>│<178>arrow left <268>││<178>cursor left <268>│\n"
  1341. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1342. "<268>│<178>arrow right <268>││<178>cursor right <268>│\n"
  1343. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1344. "<268>│<178>arrow up <268>││<178>previous input line <268>│\n"
  1345. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1346. "<268>│<178>arrow down <268>││<178>next input line <268>│\n"
  1347. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1348. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1349. "<268>│<178>ctrl arrow left <268>││<178>cursor left word <268>│\n"
  1350. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1351. "<268>│<178>ctrl arrow right <268>││<178>cursor right word <268>│\n"
  1352. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1353. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1354. "<268>│<178>backspace <268>││<178>backspace <268>│\n"
  1355. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1356. "<268>│<178>alt backspace <268>││<178>clear line left <268>│\n"
  1357. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1358. "<268>│<178>ctrl backspace <268>││<178>clear line <268>│\n"
  1359. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1360. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1361. "<268>│<178>delete <268>││<178>delete <268>│\n"
  1362. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1363. "<268>│<178>ctrl delete <268>││<178>delete word right <268>│\n"
  1364. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1365. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1366. "<268>│<178>end <268>││<178>cursor end <268>│\n"
  1367. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1368. "<268>│<178>ctrl end <268>││<178>scroll buffer end <268>│\n"
  1369. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1370. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1371. "<268>│<178>enter <268>││<178>enter <268>│\n"
  1372. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1373. "<268>│<178>shift-enter <268>││<178>soft enter <268>│\n"
  1374. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1375. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1376. "<268>│<178>home <268>││<178>cursor home <268>│\n"
  1377. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1378. "<268>│<178>ctrl home <268>││<178>scroll buffer home <268>│\n"
  1379. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1380. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1381. "<268>│<178>page up <268>││<178>scroll buffer up <268>│\n"
  1382. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1383. "<268>│<178>page down <268>││<178>scroll buffer down <268>│\n"
  1384. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1385. "<268>┌─────────────────────────┐┌────────────────────────────────────────────┐\n"
  1386. "<268>│<178>tab <268>││<178>complete word forward <268>│\n"
  1387. "<268>├─────────────────────────┤├────────────────────────────────────────────┤\n"
  1388. "<268>│<178>shift-tab <268>││<178>complete word backward <268>│\n"
  1389. "<268>└─────────────────────────┘└────────────────────────────────────────────┘\n"
  1390. ,
  1391. "cursor edit macro"
  1392. },
  1393. {
  1394. "ELSE",
  1395. TOKEN_TYPE_STATEMENT,
  1396. "<178>Command<278>: #else <178>{<278>commands<178>}\n"
  1397. "\n"
  1398. "<278> The else statement should follow an #IF or #ELSEIF statement and is\n"
  1399. "<278> only called if the proceeding #IF or #ELSEIF is false.\n"
  1400. "\n"
  1401. "<178>Example<278>: #if {1d2 == 1} {smile};#else {grin}\n",
  1402. "case default elseif if switch regexp"
  1403. },
  1404. {
  1405. "ELSEIF",
  1406. TOKEN_TYPE_STATEMENT,
  1407. "<178>Command<278>: #elseif <178>{<278>conditional<178>} {<278>commands<178>}\n"
  1408. "\n"
  1409. "<278> The elseif statement should follow an #IF or #ELSEIF statement and is\n"
  1410. "<278> only called when the statement is true and the proceeding #IF and\n"
  1411. "<278> #ELSEIF statements are false.\n"
  1412. "\n"
  1413. "<178>Example<278>: #if {1d3 == 1} {smirk};#elseif {1d2 == 1} {snicker}\n",
  1414. "case default else if switch regexp"
  1415. },
  1416. {
  1417. "END",
  1418. TOKEN_TYPE_COMMAND,
  1419. "<178>Command<278>: #end {<message>}\n"
  1420. "\n"
  1421. "<278> Terminates tintin and return to unix. On most systems, ctrl-c has\n"
  1422. "<278> the same result.\n"
  1423. "\n"
  1424. "<278> The message is optional and is printed before tintin exits. When\n"
  1425. "<278> using #end {\\} tintin will terminate silently.\n",
  1426. "zap"
  1427. },
  1428. {
  1429. "ESCAPE CODES",
  1430. TOKEN_TYPE_STRING,
  1431. "<278> You may use the escape character \\ for various special characters.\n"
  1432. "\n"
  1433. "<278> \\a beep the terminal.\n"
  1434. "<278> \\c send a control character, \\ca for ctrl-a.\n"
  1435. "<278> \\e start an escape sequence.\n"
  1436. "<278> \\f send a form feed.\n"
  1437. "<278> \\n send a line feed.\n"
  1438. "<278> \\r send a carriage return.\n"
  1439. "<278> \\t send a horizontal tab.\n"
  1440. "<278> \\x print an 8 bit character using hexadecimal, \\xFF for example.\n"
  1441. "<278> \\x7B send the '{' character.\n"
  1442. "<278> \\x7D send the '}' character.\n"
  1443. "<278> \\u print a 16 bit unicode character, \\uFFFD for example.\n"
  1444. "<278> \\u{} print a 8-21 bit unicode character, \\u{2AF21} for example.\n"
  1445. "<278> \\U print a 21 bit unicode character, \\U02AF21 for example.\n"
  1446. "<278> \\v send a vertical tab\n"
  1447. "\n"
  1448. "<278> Ending a line with \\ will stop tintin from appending a line feed.\n"
  1449. "<278> To escape arguments in an alias or action use %%0 %%1 %%2 etc.\n",
  1450. "characters colors coordinates mathematics pcre"
  1451. },
  1452. {
  1453. "EVENT",
  1454. TOKEN_TYPE_CONFIG,
  1455. "<178>Command<278>: #event <178>{<278>event type<178>}<278> <178>{<278>commands<178>}\n"
  1456. "\n"
  1457. "<278> Events allow you to create triggers for predetermined client events.\n"
  1458. "\n"
  1459. "<278> Use #event without an argument to see a list of possible events with\n"
  1460. "<278> a brief description. Use #event %* to see the current list of defined\n"
  1461. "<278> events. Use #info {events} {on} to see events get thrown.\n"
  1462. "\n"
  1463. "<278> Events, like triggers in general, are case sensitive and event names\n"
  1464. "<278> must be defined using all upper case letters. Only one event can be\n"
  1465. "<278> defined for each event type.\n"
  1466. "\n"
  1467. "<278> To enable mouse events use #config mouse_tracking on, to see mouse\n"
  1468. "<278> events use #config mouse_tracking info.\n"
  1469. "\n"
  1470. "<278> <128>CATCH EVENTS\n"
  1471. "\n"
  1472. "<278> <178>CATCH <EVENT>\n"
  1473. "<278> Some events can be prefixed with CATCH to interrupt default\n"
  1474. "<278> behavior.\n"
  1475. "\n"
  1476. "<278> <128>CLASS EVENTS\n"
  1477. "\n"
  1478. "<278> <178>CLASS ACTIVATED [CLASS], CLASS_CLEAR [CLASS], CLASS CREATED [CLASS],\n"
  1479. "<278> <178>CLASS DEACTIVATED [CLASS], CLASS DESTROYED [CLASS],\n"
  1480. "<278> <178>CLASS_LOAD [CLASS]\n"
  1481. "<278> %0 class name\n"
  1482. "\n"
  1483. "<278> <128>FORMAT EVENTS\n"
  1484. "\n"
  1485. "<278> <178>REFORMAT <MESSAGE> <278>Use #return to change MESSAGE\n"
  1486. "\n"
  1487. "<278> <128>GAG EVENTS\n"
  1488. "\n"
  1489. "<278> <178>GAG <EVENT>\n"
  1490. "<278> Some events can be prefixed with GAG to gag default system\n"
  1491. "<278> messages.\n"
  1492. "\n"
  1493. "<278> <128>INPUT EVENTS\n"
  1494. "\n"
  1495. "<278> <178>EDIT STARTED, EDIT FINISHED\n"
  1496. "<278> %0 name %1 lines %2 size %3 data\n"
  1497. "\n"
  1498. "<278> <178>HISTORY UPDATE\n"
  1499. "<278> %0 command\n"
  1500. "\n"
  1501. "<278> <178>RECEIVED KEYPRESS, PROCESSED KEYPRESS\n"
  1502. "<278> %0 character %1 unicode index %2 edit row %3 edit column\n"
  1503. "\n"
  1504. "<278> <178>RECEIVED INPUT [NAME]\n"
  1505. "<278> %0 raw text\n"
  1506. "\n"
  1507. "<278> <178>RECEIVED INPUT CHARACTER\n"
  1508. "<278> %0 character %1 unicode index %2 size %3 width\n"
  1509. "\n"
  1510. "<278> <178>NO SESSION ACTIVE<278> %0 raw text %1 size\n"
  1511. "<278> <178>SEND OUTPUT<278> %0 raw text %1 size\n"
  1512. "<278> <178>SENT OUTPUT<278> %0 raw text %1 size\n"
  1513. "\n"
  1514. "<278> <128>MAP EVENTS\n"
  1515. "\n"
  1516. "<278> <178>END OF PATH, END OF RUN, MAP UPDATED VTMAP\n"
  1517. "<278> These events have no additional arguments.\n"
  1518. "\n"
  1519. "<278> <178>MAP CREATE EXIT, MAP DELETE EXIT\n"
  1520. "<278> %0 vnum %1 exit name %2 exit cmd %3 exit vnum\n"
  1521. "\n"
  1522. "<278> <178>MAP CREATE ROOM, MAP DELETE ROOM\n"
  1523. "<278> %0 vnum %1 name\n"
  1524. "\n"
  1525. "<278> <178>MAP ENTER MAP, MAP EXIT MAP\n"
  1526. "<278> %0 vnum\n"
  1527. "\n"
  1528. "<278> <178>MAP ENTER ROOM [VNUM]\n"
  1529. "<278> %0 new vnum %1 old vnum %2 direction\n"
  1530. "\n"
  1531. "<278> <178>MAP EXIT ROOM [VNUM]\n"
  1532. "<278> %0 old vnum %1 new vnum %2 direction\n"
  1533. "\n"
  1534. "<278> <178>MAP FOLLOW MAP\n"
  1535. "<278> %0 old vnum %1 new vnum %2 exit name\n"
  1536. "\n"
  1537. "<278> <178>MAP REGION <MOUSE>, MAP ROOM <MOUSE>\n"
  1538. "<278> %0 row %1 col %2 -row %3 -col %4 vnum %5 info\n"
  1539. "\n"
  1540. "<278> <128>MOUSE EVENTS\n"
  1541. "\n"
  1542. "<278> <178>DOUBLE-CLICKED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1543. "<278> <178>LONG-CLICKED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1544. "<278> <178>MOVED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1545. "<278> <178>PRESSED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1546. "<278> <178>SHORT-CLICKED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1547. "<278> <178>RELEASED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1548. "<278> <178>SCROLLED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1549. "<278> <178>TRIPLE-CLICKED <MOUSE> <278>%0 row %1 col %2 -row %3 -col %4 word %5 line\n"
  1550. "\n"
  1551. "<278> <178>MAP <MOUSE EVENT>\n"
  1552. "<278> Mouse events can be prefixed with MAP to only trigger when the mouse\n"
  1553. "<278> event occurs inside the VT100 map region.\n"
  1554. "\n"
  1555. "<278> <178>SWIPED [DIR]\n"
  1556. "<278> %0 dir %1 button %2 row %3 col %4 -row %5 -col\n"
  1557. "<278> %6 row %7 col %8 -row %9 -col %10 rows %11 cols\n"
  1558. "\n"
  1559. "<278> <128>OUTPUT EVENTS\n"
  1560. "\n"
  1561. "<278> <178>BUFFER UPDATE<278>, <178>DISPLAY UPDATE\n"
  1562. "<278> These events have no additional arguments.\n"
  1563. "\n"
  1564. "<278> <178>PROCESSED LINE <278>%0 raw text %1 plain text %2 prompt (0 or 1)\n"
  1565. "\n"
  1566. "<278> <178>RECEIVED LINE <278>%0 raw text %1 plain text\n"
  1567. "<278> <178>RECEIVED OUTPUT <278>%0 raw text %1 plain text\n"
  1568. "<278> <178>RECEIVED PROMPT <278>%0 raw text %1 plain text\n"
  1569. "\n"
  1570. "<278> <128>PORT EVENTS\n"
  1571. "\n"
  1572. "<278> <178>CHAT MESSAGE<278>, <178>PORT MESSAGE\n"
  1573. "<278> %0 raw text %1 plain text\n"
  1574. "\n"
  1575. "<278> <178>PORT CONNECTION <278>%0 name %1 ip %2 port\n"
  1576. "<278> <178>PORT DISCONNECTION <278>%0 name %1 ip %2 port\n"
  1577. "<278> <178>PORT LOG MESSAGE <278>%0 name %1 ip %2 port %3 data %4 plain data\n"
  1578. "<278> <178>PORT RECEIVED MESSAGE <278>%0 name %1 ip %2 port %3 data %4 plain data\n"
  1579. "<278> <178>PORT RECEIVED DATA <278>%0 name %1 ip %2 port %3 data %4 size\n"
  1580. "\n"
  1581. "<278> <128>SCAN EVENTS\n"
  1582. "\n"
  1583. "<278> <178>SCAN CSV HEADER <278>%0 all args %1 arg1 %2 arg2 .. %99 arg99\n"
  1584. "<278> <178>SCAN CSV LINE <278>%0 all args %1 arg1 %2 arg3 .. %99 arg99\n"
  1585. "<278> <178>SCAN TSV HEADER <278>%0 all args %1 arg1 %2 arg3 .. %99 arg99\n"
  1586. "<278> <178>SCAN TSV LINE <278>%0 all args %1 arg1 %2 arg3 .. %99 arg99\n"
  1587. "\n"
  1588. "<278> <128>SCREEN EVENTS\n"
  1589. "\n"
  1590. "<278> <178>SCREEN DIMENSIONS <278>%0 height %1 width\n"
  1591. "<278> <178>SCREEN FOCUS <278>%0 focus (0 or 1)\n"
  1592. "<278> <178>SCREEN LOCATION <278>%0 rows %1 cols %2 height %3 width\n"
  1593. "\n"
  1594. "<278> <178>SCREEN MOUSE LOCATION\n"
  1595. "<278> %0 row %1 col %2 -row %3 -col %4 pix row %5 pix col\n"
  1596. "<278> %6 -pix row %7 -pix col %8 location\n"
  1597. "\n"
  1598. "<278> <178>SCREEN RESIZE <278>%0 rows %1 cols %2 height %3 width\n"
  1599. "<278> <178>SCREEN SIZE <278>%0 rows %1 cols\n"
  1600. "<278> <178>SCREEN SPLIT <278>%0 top row %1 top col %2 bot row %3 bot col\n"
  1601. "<278> <178>SCREEN UNSPLIT <278>%0 top row %1 top col %2 bot row %3 bot col\n"
  1602. "\n"
  1603. "<278> <128>SESSION EVENTS\n"
  1604. "\n"
  1605. "<278> <178>SESSION ACTIVATED <278>%0 name\n"
  1606. "<278> <178>SESSION CONNECTED <278>%0 name %1 host %2 ip %3 port %4 file\n"
  1607. "<278> <178>SESSION CREATED <278>%0 name %1 host %2 ip %3 port %4 file\n"
  1608. "<278> <178>SESSION DEACTIVATED <278>%0 name\n"
  1609. "<278> <178>SESSION DISCONNECTED <278>%0 name %1 host %2 ip %3 port\n"
  1610. "<278> <178>SESSION TIMED OUT <278>%0 name %1 host %2 ip %3 port\n"
  1611. "\n"
  1612. "<278> <128>SYSTEM EVENTS\n"
  1613. "\n"
  1614. "<278> <178>CONFIG <278>%0 name %1 value\n"
  1615. "\n"
  1616. "<278> <178>DAEMON ATTACH TIMEOUT <278>%0 file %1 pid\n"
  1617. "<278> <178>DAEMON ATTACHED <278>%0 file %1 pid\n"
  1618. "<278> <178>DAEMON DETACHED <278>%0 file %1 pid\n"
  1619. "<278> <178>PROGRAM START <278>%0 startup arguments\n"
  1620. "<278> <178>PROGRAM TERMINATION <278>%0 goodbye message\n"
  1621. "\n"
  1622. "<278> <178>READ ERROR <278>%0 filename %1 error message\n"
  1623. "<278> <178>READ FILE <278>%0 filename\n"
  1624. "<278> <178>WRITE ERROR <278>%0 filename %1 error message\n"
  1625. "<278> <178>WRITE FILE <278>%0 filename\n"
  1626. "\n"
  1627. "<278> <178>SYSTEM CRASH <278>%0 message\n"
  1628. "<278> <178>SYSTEM ERROR <278>%0 name %1 system msg %2 error %3 error msg\n"
  1629. "<278> <178>UNKNOWN COMMAND <278>%0 raw text\n"
  1630. "<278> <178>SIGUSR <278>%0 signal\n"
  1631. "\n"
  1632. "<278> <128>TELNET EVENTS\n"
  1633. "\n"
  1634. "<278> <178>IAC <EVENT>\n"
  1635. "<278> IAC TELNET events are made visible using #config telnet info.\n"
  1636. "\n"
  1637. "<278> <178>IAC SB GMCP <278>%0 module %1 data %2 plain data\n"
  1638. "<278> <178>IAC SB GMCP <MODULE> <278> %1 data %2 plain data\n"
  1639. "<278> <178>IAC SB MSSP <278>%0 variable %1 data\n"
  1640. "<278> <178>IAC SB MSDP <278>%0 variable %1 data %2 plain data\n"
  1641. "<278> <178>IAC SB MSDP [VAR] <278>%0 variable %1 data %2 plain data\n"
  1642. "<278> <178>IAC SB NEW-ENVIRON <278>%0 variable %1 data %2 plain data\n"
  1643. "<278> <178>IAC SB ZMP <VAR> <278>%0 variable %1 data\n"
  1644. "<278> <178>IAC SB <VAR> <278>%0 variable %1 raw data %2 plain data\n"
  1645. "\n"
  1646. "<278> <128>TIME EVENTS\n"
  1647. "\n"
  1648. "<278> <178>DATE <MONTH-DAY OF MONTH> [HOUR:MINUTE], DAY [DAY OF MONTH],\n"
  1649. "<278> <178>HOUR [HOUR], MONTH [DAY OF MONTH], TIME <HOUR:MINUTE>[:SECOND],\n"
  1650. "<278> <178>WEEK [DAY OF WEEK], YEAR [YEAR]\n"
  1651. "<278> %0 year %1 month %2 day of week %3 day of month %4 hour\n"
  1652. "<278> %5 minute %6 second\n"
  1653. "\n"
  1654. "<278> <128>VARIABLE EVENTS\n"
  1655. "\n"
  1656. "<278> <178>VARIABLE UPDATE <VAR> <278>%0 name %1 new value %2 path\n"
  1657. "<278> <178>VARIABLE UPDATED <VAR> <278>%0 name %1 new value %2 path\n"
  1658. "\n"
  1659. "<278> <128>VT100 EVENTS\n"
  1660. "\n"
  1661. "<278> <178>VT100 SCROLL REGION <278>%0 top row %1 bot row %2 rows %3 cols %4 wrap\n"
  1662. "\n"
  1663. "<278> To see all events trigger use #info event on. Since this can get\n"
  1664. "<278> rather spammy it's possible to gag event info messages.\n"
  1665. "\n"
  1666. "<178>Example<278>: #event {SESSION CONNECTED} {#read mychar.tin}\n"
  1667. "\n"
  1668. "<178>Comment<278>: You can remove an event with the #unevent command.\n",
  1669. "button delay ticker"
  1670. },
  1671. {
  1672. "FOREACH",
  1673. TOKEN_TYPE_STATEMENT,
  1674. "<178>Command<278>: #foreach <178>{<278>list<178>} {<278>variable<178>} {<278>commands<178>}\n"
  1675. "\n"
  1676. "<278> For each item in the provided list the foreach statement will update\n"
  1677. "<278> the given variable and execute the command part of the statement. List\n"
  1678. "<278> elements must be separated by braces or semicolons.\n"
  1679. "\n"
  1680. "<178>Example<278>: #foreach {bob;tim;kim} {name} {tell $name Hello}\n"
  1681. "<178>Example<278>: #foreach {{bob}{tim}{kim}} {name} {tell $name Hello}\n",
  1682. "break continue list loop parse repeat return while"
  1683. },
  1684. {
  1685. "FORMAT",
  1686. TOKEN_TYPE_COMMAND,
  1687. "<178>Command<278>: #format <178>{<278>variable<178>} {<278>format<178>} {<278>argument1<178>} {<278>argument2<178>} {<278>etc<178>}\n"
  1688. "\n"
  1689. "<278> Allows you to store a string into a variable in the exact same way\n"
  1690. "<278> C's sprintf works with a few enhancements and limitations like a\n"
  1691. "<278> maximum of 30 arguments.\n"
  1692. "\n"
  1693. "<278> If you use #format inside an alias or action you must escape %1s as\n"
  1694. "<278> %+1s or %%1s or %\\1s so the %1 isn't substituted by the trigger.\n"
  1695. "\n"
  1696. "<278> #format {test} {%+9s} {string} pad string with up to 9 spaces\n"
  1697. "<278> #format {test} {%-9s} {string} post pad string with up to 9 spaces\n"
  1698. "<278> #format {test} {%.8s} {string} copy at most 8 characters\n"
  1699. "<278> #format {test} {%a} {number} print corresponding charset character\n"
  1700. "<278> #format {test} {%c} {string} use a highlight color name\n"
  1701. "<278> #format {test} {%d} {number} print a number with integer formatting\n"
  1702. "<278> #format {test} {%f} {string} perform floating point math\n"
  1703. "<278> #format {test} {%g} {number} perform thousand grouping on {number}\n"
  1704. "<278> #format {test} {%h} {string} turn text into a header line\n"
  1705. "<278> #format {test} {%l} {string} lowercase text\n"
  1706. "<278> #format {test} {%m} {string} perform mathematical calculation\n"
  1707. "<278> #format {test} {%n} {name} capitalize the first letter\n"
  1708. "<278> #format {test} {%p} {string} strip leading and trailing spaces\n"
  1709. "<278> #format {test} {%r} {string} reverse text, hiya = ayih\n"
  1710. "<278> #format {test} {%s} {string} print given string\n"
  1711. "<278> #format {test} {%t} {format} display time with strftime format\n"
  1712. "<278> optional {{format}{time}} syntax\n"
  1713. "<278> #format {test} {%u} {string} uppercase text\n"
  1714. "<278> #format {list} {%w} {string} store word wrapped text in {list}\n"
  1715. "<278> optional {{string}{width}} syntax\n"
  1716. "<278> #format {test} {%x} {hex} print corresponding charset character\n"
  1717. "<278> #format {test} {%A} {char} store corresponding character value\n"
  1718. "<278> #format {test} {%D} {hex} convert hex to decimal in {test}\n"
  1719. "<278> #format {hash} {%H} {string} store a 64 bit string hash in {hash}\n"
  1720. "<278> #format {test} {%L} {string} store the string length in {test}\n"
  1721. "<278> #format {test} {%M} {number} convert number to metric in {test}\n"
  1722. "<278> #format {test} {%P} {string} strip ESCAPE CODES and COLORs\n"
  1723. "<278> #format {test} {%S} {string} store the number of spelling errors\n"
  1724. "<278> #format {time} {%T} {} store the epoch time in {time}\n"
  1725. "<278> #format {time} {%U} {} store the micro epoch time in {time}\n"
  1726. "<278> #format {test} {%W} {string} get the screen width of string\n"
  1727. "<278> #format {test} {%X} {dec} convert dec to hexadecimal in {test}\n\n"
  1728. "<278> #format {test} {%%} a literal % character\n"
  1729. "\n"
  1730. "<178>Comment<278>: See #help TIME for help on the %t argument.\n",
  1731. "cat echo function local math replace script time variable"
  1732. },
  1733. {
  1734. "FUNCTION",
  1735. TOKEN_TYPE_CONFIG,
  1736. "<178>Command<278>: #function <178>{<278>name<178>} {<278>operation<178>}\n"
  1737. "\n"
  1738. "<278> Functions allow you to execute a script within a line of text, and\n"
  1739. "<278> replace the function call with the line of text generated by the\n"
  1740. "<278> function.\n"
  1741. "\n"
  1742. "<278> Be aware that each function should use the #return command at the\n"
  1743. "<278> end of the function with the result, or set the {result} variable.\n"
  1744. "\n"
  1745. "<278> To use a function use the @ character before the function name.\n"
  1746. "<278> The function arguments should be placed between braces behind the\n"
  1747. "<278> function name with argument separated by semicolons.\n"
  1748. "\n"
  1749. "<278> Functions can be escaped by adding additional @ signs.\n"
  1750. "\n"
  1751. "<178>Example<278>: #function test #return 42;#showme @@test{}\n"
  1752. "\n"
  1753. "<278> The function itself can use the provided arguments which are stored\n"
  1754. "<278> in %1 to %99, with %0 holding all arguments.\n"
  1755. "\n"
  1756. "<178>Example<278>: #function {rnd} {#math {result} {1 d (%2 - %1 + 1) + %1 - 1}}\n"
  1757. "<278> #show A random number between 100 and 200: @rnd{100;200}\n"
  1758. "\n"
  1759. "<178>Example<278>: #function gettime {#format result %t %H:%M}\n"
  1760. "<278> #show The current time is @gettime{}\n"
  1761. "\n"
  1762. "<178>Comment<278>: You can remove a function with the #unfunction command.\n",
  1763. "format local math replace script variable"
  1764. },
  1765. {
  1766. "GAG",
  1767. TOKEN_TYPE_CONFIG,
  1768. "<178>Command<278>: #gag <178>{<278>string<178>}\n"
  1769. "\n"
  1770. "<278> Removes any line that contains the string.\n"
  1771. "\n"
  1772. "<178>Comment<278>: See '#help action', for more information about triggers.\n"
  1773. "\n"
  1774. "<278> There are a system messages that can be gagged using gag events.\n"
  1775. "\n"
  1776. "<178>Comment<278>: You can remove a gag with the #ungag command.\n",
  1777. "action highlight prompt substitute"
  1778. },
  1779. {
  1780. "GREETING",
  1781. TOKEN_TYPE_STRING,
  1782. "<268> #<268>##################################################################<268>#\n"
  1783. "<268> #<278> <268>#\n"
  1784. "<268> #<278> T I N T I N + + "CLIENT_VERSION"<278> <268>#\n"
  1785. "<268> #<278> <268>#\n"
  1786. // "<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"
  1787. // "<268> #<278> <268>#\n"
  1788. "<268> #<278> Code by Peter Unold, Bill Reis, and Igor van den Hoven <268>#\n"
  1789. "<268> #<278> <268>#\n"
  1790. "<268> #<268>##################################################################<268>#<288>\n",
  1791. ""
  1792. },
  1793. {
  1794. "GREP",
  1795. TOKEN_TYPE_COMMAND,
  1796. "<178>Command<278>: #grep <178>[<278>page<178>] {<278>search string<178>}\n"
  1797. "\n"
  1798. "<278> This command allows you to search for matching lines in your scroll\n"
  1799. "<278> back buffer. The amount of matches shown equals your screen size. If\n"
  1800. "<278> you want to search back further use the optional page number. You can\n"
  1801. "<278> use wildcards for better search results. Be aware the search string\n"
  1802. "<278> is case sensitive, which can be disabled by using %i.\n"
  1803. "\n"
  1804. "<278> By default grep searches from the end of the scrollback buffer to the\n"
  1805. "<278> beginning, this can be reversed by using a negative page number.\n"
  1806. "\n"
  1807. "<178>Example<278>: #grep Bubba tells you\n"
  1808. "<278> This will show all occasions where bubba tells you something.\n",
  1809. "buffer echo showme"
  1810. },
  1811. {
  1812. "HELP",
  1813. TOKEN_TYPE_COMMAND,
  1814. "<178>Command<278>: #help <178>{<278>subject<178>}\n"
  1815. "\n"
  1816. "<278> Without an argument #help will list all available help subjects.\n"
  1817. "\n"
  1818. "<278> Using #help %* will display all help entries.\n",
  1819. "commands debug ignore info message statements"
  1820. },
  1821. {
  1822. "HIGHLIGHT",
  1823. TOKEN_TYPE_CONFIG,
  1824. "<178>Command<278>: #highlight <178>{<278>string<178>} {<278>color names<178>} {<278>priority<178>}\n"
  1825. "\n"
  1826. "<278> The highlight command is used to change the color of incoming text.\n"
  1827. "\n"
  1828. "<278> Available color options are:\n"
  1829. "\n"
  1830. "<278> reset - resets the color state to default\n"
  1831. "<278> light - turns the color light.\n"
  1832. "<278> dark - turns the color dark.\n"
  1833. "<278> underscore - underscores the text.\n"
  1834. "<278> blink - makes the text blink.\n"
  1835. "<278> reverse - reverse foreground and background color.\n"
  1836. "<278> b - makes next color the background color.\n"
  1837. "\n"
  1838. "<278> Available color names are:\n"
  1839. "\n"
  1840. "<278> <<888>abd> - azure <<888>acf> - Azure\n"
  1841. "<278> <<888>aad> - blue <<888>aaf> - Blue\n"
  1842. "<278> <<888>add> - cyan <<888>aff> - Cyan\n"
  1843. "<278> <<888>aaa> - ebony <<888>bbb> - Ebony\n"
  1844. "<278> <<888>ada> - green <<888>afa> - Green\n"
  1845. "<278> <<888>adb> - jade <<888>afc> - Jade\n"
  1846. "<278> <<888>bda> - lime <<888>cfa> - Lime\n"
  1847. "<278> <<888>dad> - magenta <<888>faf> - Magenta\n"
  1848. "<278> <<888>dba> - orange <<888>fca> - Orange\n"
  1849. "<278> <<888>dab> - pink <<888>fac> - Pink\n"
  1850. "<278> <<888>daa> - red <<888>faa> - Red\n"
  1851. "<278> <<888>ccc> - silver <<888>eee> - Silver\n"
  1852. "<278> <<888>cba> - tan <<888>eda> - Tan\n"
  1853. "<278> <<888>bad> - violet <<888>caf> - Violet\n"
  1854. "<278> <<888>ddd> - white <<888>fff> - White\n"
  1855. "<278> <<888>dda> - yellow <<888>ffa> - Yellow\n"
  1856. "\n"
  1857. "<278> Colors can be provided as either a color code or one of the valid color\n"
  1858. "<278> names. If the color name is in all lower case a dark color is printed.\n"
  1859. "<278> If the first letter of the color name is capitalized a light color is\n"
  1860. "<278> printed.\n"
  1861. "\n"
  1862. "<278> The %1-99 variables can be used as 'wildcards' that will match with any\n"
  1863. "<278> text. They are useful for highlighting a complete line. The %0 variable\n"
  1864. "<278> should never be used in highlights.\n"
  1865. "\n"
  1866. "<278> You may start the string to highlight with a ^ to only highlight text\n"
  1867. "<278> if it begins the line.\n"
  1868. "\n"
  1869. "<278> Besides color names also <<888>abc> color codes can be used.\n"
  1870. "\n"
  1871. "<178>Example<278>: #high {Valgar} {reverse underscore Jade}\n"
  1872. "<278> Prints every occurrence of 'Valgar' in underscored reverse video Jade.\n"
  1873. "\n"
  1874. "<178>Example<278>: #high {^You{|r} %1} {light cyan}\n"
  1875. "<278> Prints every line that starts with 'You' in light cyan.\n"
  1876. "\n"
  1877. "<178>Example<278>: #high {Bubba} {red underscore b Green}\n"
  1878. "<278> Highlights the name Bubba as red underscored text on green background.\n"
  1879. "\n"
  1880. "<178>Comment<278>: See '#help action', for more information about triggers.\n"
  1881. "\n"
  1882. "<178>Comment<278>: See '#help substitute', for more advanced color substitution.\n"
  1883. "\n"
  1884. "<178>Comment<278>: This command only works with ANSI/VT100 terminals or emulators.\n"
  1885. "\n"
  1886. "<178>Comment<278>: You can remove a highlight with the #unhighlight command.\n",
  1887. "action gag prompt substitute"
  1888. },
  1889. {
  1890. "HISTORY",
  1891. TOKEN_TYPE_COMMAND,
  1892. "<178>Command<278>: #history <178>{<278>delete<178>}<278> Delete the last command.\n"
  1893. "<278> #history <178>{<278>get<178>} {<278>variable<178>} {<278>range<178>}<278> Store list in variable.\n"
  1894. "<278> #history <178>{<278>insert<178>} {<278>command<178>}<278> Insert a command.\n"
  1895. "<278> #history <178>{<278>list<178>} <278> Display the command history.\n"
  1896. "<278> #history <178>{<278>read<178>} {<278>filename<178>}<278> Read a command history from file.\n"
  1897. "<278> #history <178>{<278>write<178>} {<278>filename<178>}<278> Write a command history to file.\n"
  1898. "\n"
  1899. "<278> Without an argument all available options are shown.\n"
  1900. "\n"
  1901. "<278> By default all commands are saved to the history list and the history\n"
  1902. "<278> list is saved between sessions in the ~/.tintin/history.txt file.\n"
  1903. "\n"
  1904. "<278> You can set the character to repeat a command in the history with the\n"
  1905. "<278> #config {REPEAT CHAR} {<character>} configuration option, by default\n"
  1906. "<278> this is set to the exclamation mark.\n"
  1907. "\n"
  1908. "<278> You can use ! by itself to repeat the last command, or !<text> to\n"
  1909. "<278> repeat the last command starting with the given text.\n"
  1910. "\n"
  1911. "<278> You can use #config {REPEAT ENTER} {ON} to repeat the last command\n"
  1912. "<278> when you press enter on an empty line.\n"
  1913. "\n"
  1914. "<278> You can press ctrl-r to enter an interactive regex enabled history\n"
  1915. "<278> search mode, or by issuing #cursor {history search}.\n"
  1916. "\n"
  1917. "<278> TinTin++ tries to bind the arrow up and down keys to scroll through\n"
  1918. "<278> the history list by default. You can bind these with a macro yourself\n"
  1919. "<278> using #cursor {history next} and #cursor {history prev}. Many #cursor\n"
  1920. "<278> commands only work properly when bound with a macro.\n",
  1921. "alias cursor keypad macro speedwalk tab"
  1922. },
  1923. {
  1924. "IF",
  1925. TOKEN_TYPE_COMMAND,
  1926. "<178>Command<278>: #if <178>{<278>conditional<178>} {<278>commands if true<178>} {<278>commands if false<178>}\n"
  1927. "\n"
  1928. "<278> The #if command works similar to an if statement in other languages,\n"
  1929. "<278> and is based on the way C handles its conditional statements.\n"
  1930. "<278> When an #if command is encountered, the conditional statement is\n"
  1931. "<278> evaluated, and if TRUE (any non-zero result) the commands are executed.\n"
  1932. "\n"
  1933. "<278> The conditional is evaluated exactly the same as in the #math command,\n"
  1934. "<278> if the conditional evaluates as anything except 0 the commands are\n"
  1935. "<278> executed. See the 'math' helpfile for more information.\n"
  1936. "\n"
  1937. "<278> To handle the case where an if statement is false it can be followed\n"
  1938. "<278> by the #else command. Alternatively, the else can be provided as the\n"
  1939. "<278> third argument.\n"
  1940. "\n"
  1941. "<178>Example<278>: #action {%0 gives you %1 gold coins.} {#if {%1 > 5000} {thank %0}}\n"
  1942. "<278> If someone gives you more than 5000 coins, thank them.\n"
  1943. "\n"
  1944. "<178>Example<278>: #alias {k} {#if {\"%0\" == \"\"} {kill $target};#else {kill %0}}\n"
  1945. "\n"
  1946. "<178>Example<278>: #if {\"%0\" == \"{bli|bla}\"} {#showme %0 is either bli or bla.}\n",
  1947. "case default else elseif math switch regexp"
  1948. },
  1949. {
  1950. "IGNORE",
  1951. TOKEN_TYPE_COMMAND,
  1952. "<178>Command<278>: #ignore <178>{<278>listname<178>} {<278>on<178>|<278>off<178>}\n"
  1953. "\n"
  1954. "<278> Toggles a list on or off. With no arguments it shows your current\n"
  1955. "<278> settings, as well as the list names that you can ignore.\n"
  1956. "\n"
  1957. "<278> If you for example use #IGNORE ACTIONS ON actions will no longer\n"
  1958. "<278> trigger. Not every list can be ignored.\n"
  1959. ,
  1960. "class debug info kill message"
  1961. },
  1962. {
  1963. "INDEX",
  1964. TOKEN_TYPE_STRING,
  1965. "<acf>"
  1966. "<acf> ████████┐██████┐███┐ ██┐████████┐██████┐███┐ ██┐\n"
  1967. "<acf> └──██┌──┘└─██┌─┘████┐ ██│└──██┌──┘└─██┌─┘████┐ ██│\n"
  1968. "<acf> ██│ ██│ ██┌██┐ ██│ ██│ ██│ ██┌██┐ ██│\n"
  1969. "<acf> ██│ ██│ ██│└██┐██│ ██│ ██│ ██│└██┐██│\n"
  1970. "<acf> ██│ ██████┐██│ └████│ ██│ ██████┐██│ └████│\n"
  1971. "<acf> └─┘ └─────┘└─┘ └───┘ └─┘ └─────┘└─┘ └───┘\n"
  1972. "<acf> ██┐ ██┐\n"
  1973. "<acf> ██│ ██│\n"
  1974. "<acf> ████████┐████████┐\n"
  1975. "<acf> └──██┌──┘└──██┌──┘\n"
  1976. "<acf> ██│ ██│\n"
  1977. "<acf> └─┘ └─┘\n"
  1978. "\n"
  1979. "<278> <acf>(<abd>T<acf>)<abd>he K<acf>(<abd>I<acf>)<abd>cki<acf>(<abd>N<acf>)<abd> <acf>(<abd>T)ickin D<acf>(<abd>I<acf>)<abd>kumud Clie<acf>(<abd>N<acf>)<abd>t\n"
  1980. "\n"
  1981. "\n"
  1982. "<278> <128>What is TinTin++?\n"
  1983. "\n"
  1984. "<278> TinTin++ is a client program specialized to help playing muds. This is\n"
  1985. "<278> a souped up version of TINTIN III with many new features.\n"
  1986. "\n"
  1987. "<278> <128>Giving Credit Where Credit is Due\n"
  1988. "\n"
  1989. "<278> None of this work would be possible, without the work done by Peter\n"
  1990. "<278> Unold. He was the author of TINTIN III, the base of TinTin++. Hats off\n"
  1991. "<278> to ya Peter. You started the ball rolling.\n"
  1992. "\n"
  1993. "<278> <128>Introduction\n"
  1994. "\n"
  1995. "<278> If you're new to TinTin++ a good place to start is the introduction,\n"
  1996. "<278> which should be linked below.\n"
  1997. ,
  1998. "introduction"
  1999. },
  2000. {
  2001. "INFO",
  2002. TOKEN_TYPE_COMMAND,
  2003. "<178>Command<278>: #info <178>{<278>listname<178>} {<278>LIST<178>|<278>ON<178>|<278>OFF<178>|<278>SAVE<178>}\n"
  2004. "\n"
  2005. "<278> Without an argument info displays the settings of every tintin list.\n"
  2006. "\n"
  2007. "<278> By providing the name of a list and the LIST option it shows all\n"
  2008. "<278> triggers/variables associated with that list. With the SAVE option\n"
  2009. "<278> this data is written to the info variable.\n"
  2010. "\n"
  2011. "<278> #info arguments will show matched trigger arguments.\n"
  2012. "<278> #info big5toutf will show the big5 to utf8 translation table.\n"
  2013. "<278> #info cpu will show information about tintin's cpu usage.\n"
  2014. "<278> #info environ will show the environment variables.\n"
  2015. "<278> #info input will show information about the input line.\n"
  2016. "<278> #info matches will show matched command arguments.\n"
  2017. "<278> #info mccp will show information about data compression.\n"
  2018. "<278> #info memory will show information about the memory stack.\n"
  2019. "<278> #info output will show information about the mud output buffers.\n"
  2020. "<278> #info stack will show the low level debugging stack.\n"
  2021. "<278> #info session will show information on the session.\n"
  2022. "<278> #info sessions will show information on all sessions.\n"
  2023. "<278> #info system will show some system information.\n"
  2024. "<278> #info tokenizer will show information about the script stack.\n"
  2025. "<278> #info unicode will show information on the provided character.\n"
  2026. ,
  2027. "class debug ignore kill message"
  2028. },
  2029. {
  2030. "INTRODUCTION",
  2031. TOKEN_TYPE_STRING,
  2032. "<278> On this page you'll find an introduction to using TinTin++. Additional\n"
  2033. "<278> information can be found in the individual help sections.\n"
  2034. "\n"
  2035. "<278> <128>Starting and Ending\n"
  2036. "\n"
  2037. "<278> The syntax for starting TinTin++ is: ./tt++ [command file]\n"
  2038. "\n"
  2039. "<278> Read more about the command file in the files section below. Remember\n"
  2040. "<278> one thing though. All actions, aliases, substitutions, etc, defined\n"
  2041. "<278> when starting up TinTin++ are inherited by all sessions.\n"
  2042. "\n"
  2043. "<278> If you want to exit TinTin++ type '#end' or press ctrl-d on an empty\n"
  2044. "<278> line.\n"
  2045. "\n"
  2046. "<278> For the WinTin++ users, if you want to paste text use shift-insert,\n"
  2047. "<278> text is automatically copied upon selection. This is typical Linux\n"
  2048. "<278> behavior, but it can take some getting used to.\n"
  2049. "\n"
  2050. "\n"
  2051. "<278> <128>Basic features\n"
  2052. "\n"
  2053. "<278> I'll start by explaining some of the very basic and important features:\n"
  2054. "\n"
  2055. "<278> All TinTin++ commands starts with a '#'.\n"
  2056. "\n"
  2057. "<178>Example<278>: #help -- #help is a client command, and isn't sent to the server.\n"
  2058. "\n"
  2059. "<278> All TinTin++ commands can be abbreviated when typed.\n"
  2060. "\n"
  2061. "<278> #he -- Typing #he is the same as typing #help though it's suggested to\n"
  2062. "<278> use at least 3 letter abbreviations just in case another command is\n"
  2063. "<278> added that starts with 'he'.\n"
  2064. "\n"
  2065. "<278> All commands can be separated with a ';'.\n"
  2066. "\n"
  2067. "<278> n;l dragon;s;say Dan Dare is back! -- do these 4 commands\n"
  2068. "<278> There are 3 ways ';'s can be overruled.\n"
  2069. "\n"
  2070. "<278> \\say Hello ;) -- Lines starting with a '\\' aren't parsed by TinTin++.\n"
  2071. "<278> say Hello \\;) -- The escape character can escape 1 letter.\n"
  2072. "<278> #config verbatim on -- Everything is sent as is except '#' commands.\n"
  2073. "\n"
  2074. "<278> <128>Connecting to a server\n"
  2075. "\n"
  2076. "<178>Command<278>: #session <178>{<278>session name<178>} {<278>server address<178>} {<278>port<178>}\n"
  2077. "\n"
  2078. "<178>Example<278>: #session someone tintin.sourceforge.net 4321\n"
  2079. "\n"
  2080. "<278> You can have more than one session, in which case you can switch\n"
  2081. "<278> between sessions typing #<session name>.\n"
  2082. "\n"
  2083. "<278> You can get a list of all sessions by typing: #session. The current\n"
  2084. "<278> active session is marked with (active). Snooped sessions with\n"
  2085. "<278> (snooped). MCCP sessions (compression) with (mccp 2) and (mccp 3).\n"
  2086. "\n"
  2087. "\n"
  2088. "<278> <128>Split\n"
  2089. "\n"
  2090. "<178>Command<278>: #split\n"
  2091. "\n"
  2092. "<278> The split command will create a separated input and output area.\n"
  2093. "\n"
  2094. "<278> Using the #prompt command you can capture the prompt and place it on\n"
  2095. "<278> the split line. To get rid of the split interface you can use #unsplit\n"
  2096. "<278> which will restore the terminal settings to default.\n"
  2097. "\n"
  2098. "\n"
  2099. "<278> <128>Alias\n"
  2100. "\n"
  2101. "<178>Command<278>: #alias <178>{<278>name<178>} {<278>commands<178>}\n"
  2102. "\n"
  2103. "<278> The syntax of the #alias command is almost like alias in csh.\n"
  2104. "<278> Use this command to define aliases. The variables %0, %1.. %9 contain\n"
  2105. "<278> the arguments to the aliased command as follows:\n"
  2106. "<278> the %0 variable contains all the arguments.\n"
  2107. "<278> the %1 variable contains the 1st argument\n"
  2108. "<278> ....\n"
  2109. "<278> the %9 variable contains the 9th argument\n"
  2110. "\n"
  2111. "<178>Example<278>: #alias greet say Greetings, most honorable %1\n"
  2112. "\n"
  2113. "<278> If you want an alias to execute more commands, you must use braces.\n"
  2114. "\n"
  2115. "<178>Example<278>: #alias ws <178>{<278>wake;stand<178>}\n"
  2116. "\n"
  2117. "<278> To delete an alias use the #unalias command.\n"
  2118. "\n"
  2119. "<278> WARNING! TinTin++ doesn't baby sit, and hence does not check for\n"
  2120. "<278> recursive aliases! You can avoid recursion by escaping the entire\n"
  2121. "<278> line.\n"
  2122. "\n"
  2123. "<178>Example<278>: #alias put \\put %1 in %2\n"
  2124. "\n"
  2125. "<278> Or by using the send command.\n"
  2126. "\n"
  2127. "<178>Example<278>: #alias put #send put %1 in %2\n"
  2128. "\n"
  2129. "\n"
  2130. "<128> Action\n"
  2131. "\n"
  2132. "<178>Command<278>: #action <178>{<278>action-text<178>} {<278>commands<178>}\n"
  2133. "\n"
  2134. "<278> Use this command to define an action to take place when a particular\n"
  2135. "<278> text appears on your screen. There are 99 variables you can use as\n"
  2136. "<278> wildcards in the action-text.\n"
  2137. "\n"
  2138. "<278> These variables are %1, %2, %3 .... %9, %10, %11 ... %97, %98, %99.\n"
  2139. "\n"
  2140. "<178>Example<278>: #action <178>{<278>You are hungry<178>} {<278>get bread bag;eat bread<178>}\n"
  2141. "\n"
  2142. "<178>Example<278>: #action <178>{<278>%1 has arrived.<178>}<278> shake %1 -- shake hands with people arriving.\n"
  2143. "\n"
  2144. "<178>Example<278>: #action <178>{<278>%1 tells you '%2'<178>}\n"
  2145. "<278> <178>{<278>tell bob %1 told me '%2'<178>}<278> -- forward tells.\n"
  2146. "\n"
  2147. "<178>Example<278>: #action <178>{<278>tells you<178>}<278> #bell -- beep on tell.\n"
  2148. "\n"
  2149. "<278> You can have TinTin++ ignore actions if you type '#ignore actions on'.\n"
  2150. "\n"
  2151. "<278> You can see what commands TinTin++ executes when an action triggers\n"
  2152. "<278> by typing '#debug actions on'.\n"
  2153. "\n"
  2154. "<278> You can remove actions with the #unaction command.\n"
  2155. "\n"
  2156. "\n"
  2157. "<278> <128>Command files\n"
  2158. "\n"
  2159. "<278> When you order TinTin++ to read a command file, it parses all the text\n"
  2160. "<278> in the file. You can use command files to keep aliases/actions in,\n"
  2161. "<278> login to a server (name, password etc..) and basically all kinds of\n"
  2162. "<278> commands.\n"
  2163. "\n"
  2164. "<278> You can make the command files with either a text editor (suggested),\n"
  2165. "<278> or use the #write command to write out a file.\n"
  2166. "\n"
  2167. "<278> Commands for files:\n"
  2168. "\n"
  2169. "<278> #read filename -- read and execute the file.\n"
  2170. "\n"
  2171. "<278> #write filename -- write all actions/aliases/substitutes/etc known for\n"
  2172. "<278> the current session to a file.\n"
  2173. "\n"
  2174. "<178>Example<278>:\n"
  2175. "<278> #session x mymud.com 1234\n"
  2176. "<278> myname\n"
  2177. "<278> mypassword\n"
  2178. "<278> #split\n"
  2179. "<278> #action {^You are hungry.} {eat bread}\n"
  2180. "\n"
  2181. "<278> If you save the above five lines to a file named 'mymud.tin' you can\n"
  2182. "<278> use 'tt++ mymud.tin' to start tintin and execute the file, connecting\n"
  2183. "<278> you to your mud, logging in, enabling split mode, and setting an action\n"
  2184. "<278> to eat a bread whenever you go hungry.\n"
  2185. "\n"
  2186. "<278> <128>Highlight\n"
  2187. "\n"
  2188. "<178>Command<278>: #highlight <178>{<278>text<178>} {<278>color<178>}\n"
  2189. "\n"
  2190. "<278> This command works a bit like #action. The purpose of this command is\n"
  2191. "<278> to substitute text from the server with color you provide. This command\n"
  2192. "<278> is a simplified version of the #substitute command.\n"
  2193. "\n"
  2194. "<178>Example<278>: #high <178>{<278>Snowy<178>} {<278>light yellow<178>}\n"
  2195. "\n"
  2196. "<178>Example<278>: #high <178>{<278>%*Snowy%*<178>} {<278>light yellow<178>}\n"
  2197. "\n"
  2198. "<278> Use #unhigh to delete highlights.\n"
  2199. "\n"
  2200. "\n"
  2201. "<128> Speedwalk\n"
  2202. "\n"
  2203. "<278> If you type a command consisting ONLY of letters and numbers n, e, s,\n"
  2204. "<278> w, u, d - then this command can be interpreted as a serie of movement\n"
  2205. "<278> commands.\n"
  2206. "\n"
  2207. "<178>Example<278>: ssw2n -- go south, south, west, north, north\n"
  2208. "\n"
  2209. "<278> If you have problems with typing some commands that actually ONLY\n"
  2210. "<278> consists of these letters, then type them in CAPS. For example when\n"
  2211. "<278> checking the NEWS or when asked to enter NEW as your name.\n"
  2212. "\n"
  2213. "<278> You must enable speedwalking with: #config speedwalk on.\n"
  2214. "\n"
  2215. "\n"
  2216. "<278> <128>Ticker\n"
  2217. "\n"
  2218. "<178>Command<278>: #ticker <178>{<278>name<178>} {<278>commands<178>} {<278>seconds<178>}\n"
  2219. "\n"
  2220. "<278> The name can be whatever you want it to be, and is only required for\n"
  2221. "<278> the unticker command. The commands will be executed every x amount of\n"
  2222. "<278> seconds, which is specified in the interval part.\n"
  2223. "\n"
  2224. "<178>Example<278>: #tick <178>{<278>tick<178>} {<278>#delay 50 #show 10 SECONDS TO TICK!;#show TICK!!!<178>} {<278>60<178>}\n"
  2225. "\n"
  2226. "<278> This creates a ticker with the name <178>{<278>tick<178>}<278> which will print TICK!!!,\n"
  2227. "<278> as well as print a warning when the next tick will occure.\n"
  2228. "\n"
  2229. "<278> You can remove tickers with #untick\n"
  2230. "\n"
  2231. "\n"
  2232. "<278> <128>Repeating Commands\n"
  2233. "\n"
  2234. "<278> You can repeat a command, the syntax is: #number command\n"
  2235. "\n"
  2236. "<178>Example<278>: #5 cackle -- if you just killed bob the wizard.\n"
  2237. "<178>Example<278>: #10 <178>{<278>buy bread;put bread bag<178>}<278> -- repeat these 2 commands 10 times.\n"
  2238. "<178>Example<278>: #100 ooc w00t w00t!!!!! -- nochannel yourself.\n"
  2239. "\n"
  2240. "\n"
  2241. "<278> <128>History\n"
  2242. "\n"
  2243. "<278> TinTin++ has a limited subset of the csh history features.\n"
  2244. "\n"
  2245. "<278> ! -- repeat the last command\n"
  2246. "<278> !cast -- repeat the last command starting with cast\n"
  2247. "<278> ctrl-r -- enter the reverse history search mode.\n"
  2248. "\n"
  2249. "\n"
  2250. "<278> <128>Map commands\n"
  2251. "\n"
  2252. "<278> TinTin++ has a powerful highly configurable automapper. Whenever\n"
  2253. "<278> you type n/ne/e/se/s/sw/w/nw/n/u/d tt++ tries to keep track of your\n"
  2254. "<278> movement.\n"
  2255. "\n"
  2256. "<278> Commands for map:\n"
  2257. "\n"
  2258. "<278> #map create -- create a map.\n"
  2259. "<278> #map goto 1 -- go to the first room in the map, created by default.\n"
  2260. "<278> #map map -- display the map.\n"
  2261. "<278> #map undo -- undo your last map alteration.\n"
  2262. "<278> #map write <filename> -- save the map to file.\n"
  2263. "<278> #map read <filename> -- load a map from file.\n"
  2264. "\n"
  2265. "<278> There are many other map options and it's beyond the scope of this\n"
  2266. "<278> help section to explain everything there is to know, but I'll give\n"
  2267. "<278> a set of commands that will get most people started.\n"
  2268. "\n"
  2269. "<278> #map create\n"
  2270. "<278> #split 12 1\n"
  2271. "<278> #map flag unicode on\n"
  2272. "<278> #map flag vt on\n"
  2273. "<278> #map goto 1\n"
  2274. "\n"
  2275. "<278> These commands will create a 12 row vt100 split section at the top of\n"
  2276. "<278> your screen where a map drawn using unicode characters is displayed.\n"
  2277. "\n"
  2278. "<178>Example<278>: #action <178>{<278>There is no exit in that direction.<178>} {<278>#map undo<178>}\n"
  2279. "\n"
  2280. "<278> The map will be automatically created as you move around.\n"
  2281. "\n"
  2282. "\n"
  2283. "<278> <128>Help\n"
  2284. "\n"
  2285. "<178>Command<278>: #help <178>{<278>subject<178>}\n"
  2286. "\n"
  2287. "<278> The help command is your friend and contains the same helpfiles\n"
  2288. "<278> inside TinTin++ as are available on the website. If you type #help\n"
  2289. "<278> without an argument you will see the various available help subjects\n"
  2290. "<278> which try to explain the TinTin++ commands and features in greater\n"
  2291. "<278> detail. Entries in cyan describe commands, while entries in white\n"
  2292. "<278> describe various features, often in greater detail.\n"
  2293. "\n"
  2294. "\n"
  2295. "<278> <128>That's all for the introduction, enjoy\n"
  2296. ,
  2297. "characters colors coordinates editing escape_codes greeting keypad lists mapping mathematics screen_reader sessionname speedwalk statements suspend time"
  2298. },
  2299. {
  2300. "KEYPAD",
  2301. TOKEN_TYPE_STRING,
  2302. "<278> When TinTin++ starts up it sends \\e= to the terminal to enable the\n"
  2303. "<278> terminal's application keypad mode, which can be disabled using #show {\\e>}\n"
  2304. "\n"
  2305. "<178> Configuration A Configuration B Configuration C\n"
  2306. "<268> ╭─────┬─────┬─────┬─────╮ ╭─────┬─────┬─────┬─────╮ ╭─────┬─────┬─────┬─────╮\n"
  2307. "<268> │<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"
  2308. "<268> ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤\n"
  2309. "<268> │<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"
  2310. "<268> ├─────┼─────┼─────┤ │ ├─────┼─────┼─────┤ │ ├─────┼─────┼─────┤ │\n"
  2311. "<268> │<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"
  2312. "<268> ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤\n"
  2313. "<268> │<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"
  2314. "<268> ├─────┴─────┼─────┤ │ ├─────┴─────┼─────┤ │ ├─────┴─────┼─────┤ │\n"
  2315. "<268> │<178>0<268> │<178>.<268> │ │ │<178>Ins<268> │<178>Del<268><268> │ │ │<178>nkp0<268> │<178>nkp.<268> │ │\n"
  2316. "<268> ╰───────────┴─────┴─────╯ ╰───────────┴─────┴─────╯ ╰───────────┴─────┴─────╯\n"
  2317. "\n"
  2318. "<278> With keypad mode disabled numlock on will give you configuration A,\n"
  2319. "<278> and numlock off will give you configuration B. With keypad mode\n"
  2320. "<278> enabled you'll get configuration C.\n"
  2321. "\n"
  2322. "<178> Terminals that support keypad mode\n"
  2323. "\n"
  2324. "<278> Linux Console, PuTTY, MinTTY, Eterm, aterm.\n"
  2325. "\n"
  2326. "<178> Terminals that do not support keypad mode\n"
  2327. "\n"
  2328. "<278> RXVT on Cygwin, Windows Console, Gnome Terminal, Konsole.\n"
  2329. "\n"
  2330. "<178> Peculiar Terminals\n"
  2331. "\n"
  2332. "<278> RXVT requires turning off numlock to enable configuration C.\n"
  2333. "\n"
  2334. "<278> Xterm may require disabling Alt/NumLock Modifiers (num-lock) in the\n"
  2335. "<278> ctrl left-click menu. Or edit ~/.Xresources and add\n"
  2336. "<278> XTerm*VT100.numLock:false\n"
  2337. "\n"
  2338. "<278> Mac OS X Terminal requires enabling 'strict vt100 keypad behavior' in\n"
  2339. "<278> Terminal -> Window Settings -> Emulation.\n"
  2340. ,
  2341. "colors coordinates escape_codes mathematics pcre"
  2342. },
  2343. {
  2344. "KILL",
  2345. TOKEN_TYPE_COMMAND,
  2346. "<178>Command<278>: #kill <178>{<278>list<178><178>} {<278>pattern<178>}\n"
  2347. "\n"
  2348. "<278> Without an argument, the kill command clears all lists. Useful if\n"
  2349. "<278> you don't want to exit tintin to reload your command files.\n"
  2350. "\n"
  2351. "<278> With one argument a specific list can be cleared.\n"
  2352. "\n"
  2353. "<278> With two arguments the triggers in the chosen list that match the\n"
  2354. "<278> given pattern will be removed.\n"
  2355. "\n"
  2356. "<178>Example<278>: #kill alias %*test*\n"
  2357. ,
  2358. "class debug ignore info message"
  2359. },
  2360. {
  2361. "LINE",
  2362. TOKEN_TYPE_COMMAND,
  2363. "<178>Command<278>: #line <178>{<278>option<178>} {<278>argument<178>}\n"
  2364. "\n"
  2365. "<278> <128>Line options that alter the argument.\n"
  2366. "\n"
  2367. "<278> <178>#line json <variable> <argument>\n"
  2368. "<278> The variable is translated to json and the argument is executed\n"
  2369. "<278> with &0 holding the json data.\n"
  2370. "\n"
  2371. "<278> <178>#line strip <argument>\n"
  2372. "<278> Argument is executed with all color codes stripped.\n"
  2373. "\n"
  2374. "<278> <178>#line substitute <options> <argument>\n"
  2375. "<278> Argument is executed using the provided substitutions, available\n"
  2376. "<278> options are: arguments, braces, colors, escapes, functions, secure,\n"
  2377. "<278> and variables.\n"
  2378. "\n"
  2379. "<278> <128>Line options that alter how the line is executed.\n"
  2380. "\n"
  2381. "<278> <178>#line background <argument>\n"
  2382. "<278> Prevent new session activation.\n"
  2383. "\n"
  2384. "<278> <178>#line benchmark <argument>\n"
  2385. "<278> Argument is executed and the elapsed time is reported after.\n"
  2386. "\n"
  2387. "<278> <178>#line capture <variable> <argument>\n"
  2388. "<278> Argument is executed and output stored in <variable>.\n"
  2389. "\n"
  2390. "<278> <178>#line convert <argument>\n"
  2391. "<278> Argument is executed with escaped meta characters.\n"
  2392. "\n"
  2393. "<278> <178>#line debug <argument>\n"
  2394. "<278> Argument is executed in debug mode.\n"
  2395. "\n"
  2396. "<278> <178>#line gag [amount]\n"
  2397. "<278> Gag the next line, or given lines. Use + or - to increase\n"
  2398. "<278> or decrease the current amount.\n"
  2399. "\n"
  2400. "<278> <178>#line ignore {argument}\n"
  2401. "<278> Argument is executed without any triggers being checked.\n"
  2402. "\n"
  2403. "<278> <178>#line local {argument}\n"
  2404. "<278> Argument is executed with all newly and indirectly\n"
  2405. "<278> created variables being local.\n"
  2406. "\n"
  2407. "<278> <178>#line log <filename> [text]\n"
  2408. "<278> Log the next line to file unless the [text] argument is\n"
  2409. "<278> provided.\n"
  2410. "\n"
  2411. "<278> <178>#line logmode <option> <argument>\n"
  2412. "<278> Argument is executed using the provided logmode, available\n"
  2413. "<278> modes are: html, plain, raw, and stamp.\n"
  2414. "\n"
  2415. "<278> <178>#line msdp <argument>\n"
  2416. "<278> Turn the argument into an msdp telnet sequence, starting at the\n"
  2417. "<278> first opening brace. Will turn tintin tables into msdp tables,\n"
  2418. "<278> with semicolons being used to create msdp arrays.\n"
  2419. "\n"
  2420. "<278> <178>#line multishot <number> <argument>\n"
  2421. "<278> Argument is executed in multishot mode, all triggers created\n"
  2422. "<278> will only fire the given number of times.\n"
  2423. "\n"
  2424. "<278> <178>#line oneshot <argument>\n"
  2425. "<278> Argument is executed in oneshot mode, all triggers created will\n"
  2426. "<278> only fire once.\n"
  2427. "\n"
  2428. "<278> <178>#line quiet <argument>\n"
  2429. "<278> Argument is executed with suppression of most system messages.\n"
  2430. "\n"
  2431. "<278> <178>#line verbatim <argument>\n"
  2432. "<278> Argument is executed verbatim, prohibiting variable and function\n"
  2433. "<278> substitutions.\n"
  2434. "\n"
  2435. "<278> <178>#line verbose <argument>\n"
  2436. "<278> Argument is executed with most system messages enabled.\n"
  2437. "\n"
  2438. "<278> When using #line log and logging in html format use \\c< \\c> \\c& \\c\" to\n"
  2439. "<278> log a literal < > & and \".\n"
  2440. ,
  2441. "class config"
  2442. },
  2443. {
  2444. "LIST",
  2445. TOKEN_TYPE_COMMAND,
  2446. "<178>Command<278>: #list <178>{<278>variable<178>} {<278>option<178>} {<278>argument<178>}\n"
  2447. "\n"
  2448. "<278> #list {var} {add} <items> Add <items> to the list\n"
  2449. "<278> #list {var} {clear} Empty the given list\n"
  2450. "<278> #list {var} {collapse} <separator> Turn list into a variable\n"
  2451. "<278> #list {var} {copy} <variable> Copy variable to the list\n"
  2452. "<278> #list {var} {create} <items> Create a list using <items>\n"
  2453. "<278> #list {var} {delete} <index> [amount] Delete the item at <index>,\n"
  2454. "<278> the [amount] is optional.\n"
  2455. "<278> #list {var} {explode} <separator> Turn variable into a list\n"
  2456. "<278> #list {var} {indexate} [key] Index a list table for sorting\n"
  2457. "<278> #list {var} {insert} <index> <item> Insert <item> at given index\n"
  2458. "<278> #list {var} {filter} <keep> [remove] Filter with keep / remove regex\n"
  2459. "<278> #list {var} {find} <regex> <variable> Return the found index\n"
  2460. "<278> #list {var} {get} <index> <variable> Copy an item to {variable}\n"
  2461. "<278> #list {var} {numerate} Renumber a table or list\n"
  2462. "<278> #list {var} {order} [items] Sort list alphanumerically\n"
  2463. "<278> #list {var} {refine} <keep> [remove] Filter with keep / remove math\n"
  2464. "<278> with &0 holding the value\n"
  2465. "<278> #list {var} {reverse} Reverse the list\n"
  2466. "<278> #list {var} {shuffle} Shuffle the list\n"
  2467. "<278> #list {var} {set} <index> <item> Change the item at {index}\n"
  2468. "<278> #list {var} {simplify} [items] Turn list into a simple list\n"
  2469. "<278> #list {var} {size} <variable> Copy list size to {variable}\n"
  2470. "<278> #list {var} {sort} [items] Sort list alphabetically, if\n"
  2471. "<278> an item is given it's added.\n"
  2472. "<278> #list {var} {swap} <index> <index> Swap two items\n"
  2473. "<278> #list {var} {tokenize} <string> Create a character list\n"
  2474. "\n"
  2475. "<278> The index should be between +1 and the list's size. You can also give\n"
  2476. "<278> a negative value, in which case -1 equals the last item in the list,\n"
  2477. "<278> -2 the second last, etc.\n"
  2478. "\n"
  2479. "<278> When inserting an item a positive index will prepend the item at the\n"
  2480. "<278> given index, while a negative index will append the item.\n"
  2481. "\n"
  2482. "<278> The add and create options allow using multiple items, as well\n"
  2483. "<278> as semicolon separated items.\n"
  2484. "\n"
  2485. "<278> The get option will return the item or the indexation. Use\n"
  2486. "<278> $var[<index>] to retrieve the nested data of a list table.\n"
  2487. "\n"
  2488. "<278> The order, sort and simplify options will perform the operation on\n"
  2489. "<278> the given list. Optional items can be provided which are added to\n"
  2490. "<278> the new or existing list before the operation is executed. Sorting\n"
  2491. "<278> and ordering are stable.\n"
  2492. "\n"
  2493. "<278> The indexate option prepares a table or list table for order, sort,\n"
  2494. "<278> filter, refine, and find operations for the given key. It is similar\n"
  2495. "<278> to the SELECT option in SQL. All entries must contain the given key.\n"
  2496. "\n"
  2497. "<278> A size of 0 is returned for an empty or non-existent list. You can\n"
  2498. "<278> directly access the size of a list using &var[].\n"
  2499. "\n"
  2500. "<278> You can directly access elements in a list variable using $var[+1],\n"
  2501. "<278> $var[+2], $var[-1], etc.\n"
  2502. ,
  2503. "break continue foreach loop parse repeat return while"
  2504. },
  2505. {
  2506. "LISTS",
  2507. TOKEN_TYPE_STRING,
  2508. "<278> There are several different types of lists in tintin which behave in a\n"
  2509. "<278> fairly universal manner. To properly explain lists it's easiest to\n"
  2510. "<278> explain the most basic variable type first before discussing more\n"
  2511. "<278> complex types.\n"
  2512. "\n"
  2513. " - Basic variable: The standard key = value variable.\n"
  2514. "\n"
  2515. " - Simple list: A string that contains semicolon delimited fields.\n"
  2516. "<278> {a;b;c}. Can be saved as a variable.\n"
  2517. "\n"
  2518. " - Brace list: A string in which fields are delimited with braces.\n"
  2519. "<278> {a}{b}{c}. Brace lists cannot be stored as a variable because tables\n"
  2520. "<278> use braces as well, they must be stored as a simple list instead.\n"
  2521. "\n"
  2522. " - Table: Think of this as variables nested within another variable. Or\n"
  2523. "<278> as variables contained within another variable.\n"
  2524. "\n"
  2525. " - List: A table that uses integers for its indexes. Also known as an\n"
  2526. "<278> array. The #list command is a utility command for using tables as\n"
  2527. "<278> arrays.\n"
  2528. "\n"
  2529. "<128> Simple Variables\n"
  2530. "\n"
  2531. "<178>Example<278>:\n"
  2532. "<278> #variable {simple} {Hello World!}\n"
  2533. "<278> #show $simple\n"
  2534. "\n"
  2535. "<278> To see if the 'simple' variable exists you can use &{simple} which\n"
  2536. "<278> will display 0 if the variable does not exist, or the variable's index\n"
  2537. "<278> if it exists.\n"
  2538. "\n"
  2539. "<278> If you have multiple variables they are sorted alphabetically and\n"
  2540. "<278> numerically. While it's not all that relevant for simple variables,\n"
  2541. "<278> the first variable has index 1, the second variable index 2, and so\n"
  2542. "<278> on.\n"
  2543. "\n"
  2544. "<278> Variable names need to start with a letter and only exist of letters,\n"
  2545. "<278> numbers, and underscores. If you need to use a non standard variable\n"
  2546. "<278> name this is possible using braces.\n"
  2547. "\n"
  2548. "<178>Example<278>: #variable {:)} {Happy Happy!};#show ${:)}\n"
  2549. "\n"
  2550. "<278> Variables can be accessed using their index. While primarily useful\n"
  2551. "<278> for tables it is possible to do this for simple variables. Use +1 for\n"
  2552. "<278> the first variable, +2 for the second variable, etc. Use -1 for the\n"
  2553. "<278> last variable, -2 for the second last variable, etc.\n"
  2554. "\n"
  2555. "<178>Example<278>: #show The first variable is: *{+1} with value: ${+1}\n"
  2556. "\n"
  2557. "<128> Removing Variables\n"
  2558. "\n"
  2559. "<278> To remove a variable, use #unvariable or #unvar (every command can be\n"
  2560. "<278> abbreviated). It's possible to remove multiple variables at once\n"
  2561. "<278> using #unvar {var 1} {var 2} {etc}\n"
  2562. "\n"
  2563. "<278> Variables are unique to each session, so if you have multiple\n"
  2564. "<278> sessions, removing a variable from one session won't remove it from\n"
  2565. "<278> other sessions.\n"
  2566. "\n"
  2567. "<278> If you remove a table variable, all variables contained within that\n"
  2568. "<278> table variable are removed as well.\n"
  2569. "\n"
  2570. "<128> Simple Lists\n"
  2571. "\n"
  2572. "<278> A simple list is a string that contains semicolon delimited fields.\n"
  2573. "<278> Commands can be entered as simple lists, for example:\n"
  2574. "<278> #show {a};#show {b} will execute a single line as two commands.\n"
  2575. "\n"
  2576. "<278> Several commands take a simple list as their input, these are:\n"
  2577. "<278> #foreach, #line substitute, #path load, #list create, and #highlight.\n"
  2578. "\n"
  2579. "<128> Brace Lists\n"
  2580. "\n"
  2581. "<278> A brace list is a string in which fields are delimited with braces.\n"
  2582. "<278> Most commands take a brace list for their arguments, for example:\n"
  2583. "<278> #session {x} {mud.com} {1234} {mud.tin}. The session command takes\n"
  2584. "<278> 4 arguments, the 4th argument (command file) is optional.\n"
  2585. "\n"
  2586. "<278> Commands that take a simple list as their input will also accept a\n"
  2587. "<278> brace list, keep in mind you'll have to embed the brace list in an\n"
  2588. "<278> extra set of braces, for example: #path load {{n}{s}{w}{w}}, which is\n"
  2589. "<278> identical to: #path load {n;s;w;w}.\n"
  2590. "\n"
  2591. "<278> Brace lists cannot be stored as variables because TinTin++ will\n"
  2592. "<278> confuse them with tables. You can convert a brace list to a table\n"
  2593. "<278> variable using: #list {bracelist} {create} {{a}{b}{c}} this will look\n"
  2594. "<278> internally as: {{1}{a}{2}{b}{3}{c}}. You can then convert this table\n"
  2595. "<278> back to a simple list using: #list {bracelist} {simplify} which will\n"
  2596. "<278> change it to {a;b;c}.\n"
  2597. "\n"
  2598. "<278> Braces cannot easily be escaped in TinTin++. Using \\{ or \\} will not\n"
  2599. "<278> work. The reason for this is due to several factors, but primarily\n"
  2600. "<278> backward compatibility. To escape braces you must define them using\n"
  2601. "<278> hexadecimal notation using \\x7B and \\x7D. See #help escape for a list\n"
  2602. "<278> of escape options, and the help file will also remind you of how to\n"
  2603. "<278> escape braces.\n"
  2604. "\n"
  2605. "<128> Tables\n"
  2606. "\n"
  2607. "<278> Tables are key/value pairs stored within a variable. Tables are also\n"
  2608. "<278> known as associative arrays, dictionaries, maps, nested variables,\n"
  2609. "<278> structures, and probably a couple of other names. There are several\n"
  2610. "<278> ways to create and access tables.\n"
  2611. "\n"
  2612. "<178>Example<278>: #variable {friendlist} {{bob}{bob@mail.com} {bubba}{sunset@gmail.com}}\n"
  2613. "\n"
  2614. "<278> This will create a friendlist with two entries, the key is the name of\n"
  2615. "<278> the friend, the value is the email address of the friend. You can see\n"
  2616. "<278> the email address of bob using: #show {$friendlist[bob]}. You can\n"
  2617. "<278> also define this table as following:\n"
  2618. "\n"
  2619. "<178>Example<278>:\n"
  2620. "<278> #variable {friendlist[bob]} {bob@mail.com}\n"
  2621. "<278> #variable {friendlist[bubba]} {sunset@gmail.com}\n"
  2622. "\n"
  2623. "<278> This would create the exact same table as the single line declaration\n"
  2624. "<278> used previously. To see the first key in the table use:\n"
  2625. "<278> *friendlist[+1], to see the first value in the table use:\n"
  2626. "<278> $friendlist[+1]. To see the size of the table use &friendlist[]. To\n"
  2627. "<278> print a bracelist of all friends use *friendlist[], to print a\n"
  2628. "<278> bracelist of all friends whose name starts with the letter 'a' you\n"
  2629. "<278> would use: *friendlist[a%*]. Similarly to see the number of friends\n"
  2630. "<278> you have whose name ends with the letter 'b' you would use:\n"
  2631. "<278> &friendlist[%*b].\n"
  2632. "\n"
  2633. "<278> See #help regexp for a brief overview of regular expression options.\n"
  2634. "<278> While TinTin++ supports PCRE (perl-compatible regular expressions), it\n"
  2635. "<278> embeds them within its own regular expression syntax that is simpler\n"
  2636. "<278> and less invasive, while still allowing the full power of PCRE for\n"
  2637. "<278> those who need it.\n"
  2638. "\n"
  2639. "<178>Example<278>: #unvariable {friendlist[bubba]}\n"
  2640. "\n"
  2641. "<278> This would remove {bubba} from the friendlist. To remove the entire\n"
  2642. "<278> friendlist you would use: #unvariable {friendlist}.\n"
  2643. "\n"
  2644. "<178>Example<278>: #variable {friendlist} {{bob} {{email}{bob@ma.il} {phone}{123456789}}}\n"
  2645. "\n"
  2646. "<278> There is no limit to the number of nests, simply add more braces. To\n"
  2647. "<278> see Bob's email in this example you would use:\n"
  2648. "<278> #show {$friendlist[bob][email]}.\n"
  2649. "\n"
  2650. "<278> To merge two tables the #cat command can be used.\n"
  2651. "<178>Example<278>:\n"
  2652. "<278> #variable {bli} {{a}{1}{b}{2}}\n"
  2653. "<278> #variable {blo} {{c}{3}{d}{4}}\n"
  2654. "<278> #cat {blo} {$bli}\n"
  2655. "\n"
  2656. "<128> Lists\n"
  2657. "\n"
  2658. "<278> Tables are sorted alphabetically with the exception of numbers which\n"
  2659. "<278> are sorted numerically. If you want to determine the sorting order\n"
  2660. "<278> yourself you can use use the #list command which helps you to use\n"
  2661. "<278> tables as arrays.\n"
  2662. "\n"
  2663. "<178>Example<278>: #action {%1 chats %2} {#list chats add {%0}}\n"
  2664. "\n"
  2665. "<278> Each time a chat is received it's added to the end of the 'chats' list\n"
  2666. "<278> variable. If you type #variable chats this might look like:\n"
  2667. "\n"
  2668. "<278> <138>#<168>VARIABLE <258>{<178>chats<258>}\n"
  2669. "<278> <258>{\n"
  2670. "<278> <258>{<178>1<258>} {<178>Bubba chats Hi<258>}\n"
  2671. "<278> <258>{<178>2<258>} {<178>Bob chats Hi bub<258>}\n"
  2672. "<278> <258>{<178>3<258>} {<178>Bubba chats Bye<258>}\n"
  2673. "<278> <258>{<178>4<258>} {<178>Bob chats bub bye<258>}\n"
  2674. "<278> <258>}\n"
  2675. "\n"
  2676. "<128> Parsing\n"
  2677. "\n"
  2678. "<278> There are various ways to parse lists and tables, using either #loop,\n"
  2679. "<278> #foreach, #while, or #<number>.\n"
  2680. "\n"
  2681. "<278> #loop takes two numeric arguments, incrementing or decrementing the\n"
  2682. "<278> first number until it matches the second number. The value of the loop\n"
  2683. "<278> counter is stored in the provided variable.\n"
  2684. "\n"
  2685. "<278> #foreach takes either a simple list or a brace list as its first\n"
  2686. "<278> argument. Foreach will go through each item in the list and store the\n"
  2687. "<278> value in the provided variable.\n"
  2688. "\n"
  2689. "<278> #while will perform an if check on the first argument, if the result\n"
  2690. "<278> is true it will execute the commands in the second argument. Then it\n"
  2691. "<278> performs an if check on the first argument again. It will continue to\n"
  2692. "<278> repeat until the if check returns 0 or the loop is interrupted with a\n"
  2693. "<278> control flow command. It takes special care to avoid infinite loops.\n"
  2694. "\n"
  2695. "<278> #<number> will execute the provided argument 'number' times. For\n"
  2696. "<278> example: #4 {#show beep! \\a}\n"
  2697. "\n"
  2698. "<278> Here are some examples.\n"
  2699. "\n"
  2700. "<178>Example<278>: #list friends create {bob;bubba;zorro}\n"
  2701. "\n"
  2702. "<278> Internally this looks like {{1}{bob}{2}{bubba}{3}{zorro}} and the\n"
  2703. "<278> list can be parsed in various ways.\n"
  2704. "\n"
  2705. "<178>Example<278>: #foreach {$friends[%*]} {name} {#show $name}\n"
  2706. "\n"
  2707. "<178>Example<278>: #foreach {*friends[%*]} {i} {#show $friends[$i]}\n"
  2708. "\n"
  2709. "<178>Example<278>: #loop {1} {&friends[]} {i} {#show $friends[+$i]}\n"
  2710. "\n"
  2711. "<178>Example<278>: #math i 1;#while {&friends[+$i]} {#show $friends[+$i];\n"
  2712. "<278> #math i $i + 1}\n"
  2713. "\n"
  2714. "<178>Example<278>: #math i 1;#&friends[] {#show $friends[+$i];#math i $i + 1}\n"
  2715. "\n"
  2716. "<278> Each of the five examples above performs the same task; printing the\n"
  2717. "<278> three names in the friends list.\n"
  2718. "\n"
  2719. "<278> If you want to get a better look at what goes on behind the scenes\n"
  2720. "<278> while executing scripts you can use '#debug all on'. To stop seeing\n"
  2721. "<278> debug information use '#debug all off'.\n"
  2722. "\n"
  2723. "<128> List Tables\n"
  2724. "\n"
  2725. "<278> List tables are also known as databases and the #list command has\n"
  2726. "<278> several options to manipulate them.\n"
  2727. "\n"
  2728. "<278> For these options to work properly all tables need to have identical\n"
  2729. "<278> keys. Here is an example list table.\n"
  2730. "\n"
  2731. "<278> #var {friendlist}\n"
  2732. "<278> {\n"
  2733. "<278> {1}{{name}{bob} {age}{54}}\n"
  2734. "<278> {2}{{name}{bubba} {age}{21}}\n"
  2735. "<278> {3}{{name}{pamela} {age}{36}}\n"
  2736. "<278> }\n"
  2737. "\n"
  2738. "<278> To sort the list table by age you would use:\n"
  2739. "\n"
  2740. "<278> #list friendlist indexate age\n"
  2741. "<278> #list friendlist order\n"
  2742. "\n"
  2743. "<278> To remove everyone whose name starts with a 'b' you would use:\n"
  2744. "\n"
  2745. "<278> #list friendlist indexate name\n"
  2746. "<278> #list friendlist filter {} {b%*}\n"
  2747. "\n"
  2748. "<278> The filter option only supports regular expressions. To filter\n"
  2749. "<278> using mathematics you would loop through the list backwards:\n"
  2750. "\n"
  2751. "<278> #loop &friendlist[] 1 index\n"
  2752. "<278> {\n"
  2753. "<278> #if {$friendlist[+$index][age] < 30}\n"
  2754. "<278> {\n"
  2755. "<278> #list friendlist delete $index\n"
  2756. "<278> }\n"
  2757. "<278> }\n"
  2758. "\n"
  2759. "<278> Alternatively you can use the refine option.\n"
  2760. "\n"
  2761. "<278> #list friendlist indexate age\n"
  2762. "<278> #list friendlist refine {&0 >= 30}\n"
  2763. "\n"
  2764. "<278> To add an item to a list table there are two options:\n"
  2765. "\n"
  2766. "<278> #list friendlist add {{{name}{hobo} {age}{42}}}\n"
  2767. "<278> #list friendlist insert -1 {{name}{hobo} {age}{42}}\n"
  2768. "\n"
  2769. "<128> Optimization\n"
  2770. "\n"
  2771. "<278> TinTin++ tables are exceptionally fast while they remain under 100\n"
  2772. "<278> items. Once a table grows beyond 10000 items there can be performance\n"
  2773. "<278> issues when inserting and removing items in the beginning or middle of\n"
  2774. "<278> the table.\n"
  2775. "\n"
  2776. "<278> The plan is to eventually implement an indexable and flexible data\n"
  2777. "<278> structure for large tables.\n"
  2778. "\n"
  2779. "<278> If you load a large table from file it's important to make sure it's\n"
  2780. "<278> sorted, when using #write to save a table it's automatically sorted.\n"
  2781. "\n"
  2782. "<278> If you notice performance issues on large tables it's relatively easy\n"
  2783. "<278> to create a hash table.\n"
  2784. "\n"
  2785. "<178>Example<278>:\n"
  2786. "\n"
  2787. "<278> #alias {sethash}\n"
  2788. "<278> {\n"
  2789. "<278> #format hash %H %1;\n"
  2790. "<278> #math hash1 $hash % 100;\n"
  2791. "<278> #math hash2 $hash / 100 % 100;\n"
  2792. "<278> #var hashtable[$hash1][$hash2][%1] %2\n"
  2793. "<278> }\n"
  2794. "\n"
  2795. "<278> #function {gethash}\n"
  2796. "<278> {\n"
  2797. "<278> #format hash %H %1;\n"
  2798. "<278> #math hash1 $hash % 100;\n"
  2799. "<278> #math hash2 $hash / 100 % 100;\n"
  2800. "<278> #return $hashtable[$hash1][$hash2][%1]\n"
  2801. "<278> }\n"
  2802. "\n"
  2803. "<278> #alias {test}\n"
  2804. "<278> {\n"
  2805. "<278> sethash bli hey;\n"
  2806. "<278> sethash bla hi;\n"
  2807. "<278> sethash blo hello;\n"
  2808. "<278> #show The value of bla is: @gethash{bla}\n"
  2809. "<278> }\n"
  2810. "\n"
  2811. "<278> The above script will rapidly store and retrieve over 1 million items.\n"
  2812. "<278> Looping through a hash table is relatively easy as well.\n"
  2813. "\n"
  2814. "<178>Example<278>:\n"
  2815. "\n"
  2816. "<278> #alias {showhash}\n"
  2817. "<278> {\n"
  2818. "<278> #foreach {*hashtable[%*]} {hash1}\n"
  2819. "<278> {\n"
  2820. "<278> #foreach {*hashtable[$hash1][%*]} {hash2}\n"
  2821. "<278> {\n"
  2822. "<278> #echo {%-20s = %s}\n"
  2823. "<278> {hashtable[$hash1][$hash2]}\n"
  2824. "<278> {$hashtable[$hash1][$hash2]}\n"
  2825. "<278> }\n"
  2826. "<278> }\n"
  2827. " }\n",
  2828. "break continue foreach loop parse repeat return while"
  2829. },
  2830. {
  2831. "LOCAL",
  2832. TOKEN_TYPE_COMMAND,
  2833. "<178>Command<278>: #local <178>{<278>variable name<178>} {<278>text to fill variable<178>}\n"
  2834. "\n"
  2835. "<278> The local command sets a local variable. Unlike a regular variable\n"
  2836. "<278> a local variable will only stay in memory for the duration of the\n"
  2837. "<278> event that created it. They are accessed in the same way as a\n"
  2838. "<278> regular variable.\n"
  2839. "\n"
  2840. "<278> Commands that store information to a variable will use a local variable\n"
  2841. "<278> if it exists.\n"
  2842. "\n"
  2843. "<278> Avoid setting the result variable as local in a function. Similarly,\n"
  2844. "<278> it is best to avoid setting a local variable that is identical to an\n"
  2845. "<278> existing regular variable.\n"
  2846. "\n"
  2847. "<178>Example<278>: #alias {swap} {#local x %0;#replace x {e} {u};#show $x}\n"
  2848. "\n"
  2849. "<178>Comment<278>: You can remove a local variable with the #unlocal command.\n"
  2850. ,
  2851. "format function math replace script variable"
  2852. },
  2853. {
  2854. "LOG",
  2855. TOKEN_TYPE_COMMAND,
  2856. "<178>Command<278>: #log <178>{<278>option<178>} {<278>argument<178>}\n"
  2857. "\n"
  2858. "<278> The log command allows logging session output to file.\n"
  2859. "\n"
  2860. "<278> <178>#config log_level <low|high>\n"
  2861. "<278> Default is high. Low, logs server output before triggers.\n"
  2862. "\n"
  2863. "<278> <178>#config log_mode <html|plain|raw>\n"
  2864. "<278> Set the log's data type to either html, plain, or raw.\n"
  2865. "\n"
  2866. "<278> <178>#log append <filename>\n"
  2867. "<278> Start logging to the given file, if the file already exists it won't\n"
  2868. "<278> be overwritten and data will be appended to the end.\n"
  2869. "\n"
  2870. "<278> <178>#log make <directory>\n"
  2871. "<278> Create the given directory.\n"
  2872. "\n"
  2873. "<278> <178>#log move <filename_1> <filename_2>\n"
  2874. "<278> Move filename_1 to filename_2. This can be any file and doesn't need\n"
  2875. "<278> to be a log file.\n"
  2876. "\n"
  2877. "<278> <178>#log overwrite <filename>\n"
  2878. "<278> Start logging to the given file, if the file already exists it will\n"
  2879. "<278> be overwritten.\n"
  2880. "\n"
  2881. "<278> <178>#log off\n"
  2882. "<278> Stop logging.\n"
  2883. "\n"
  2884. "<278> <178>#log remove <filename>\n"
  2885. "<278> Remove the file. This can be any file and doesn't need to be a log\n"
  2886. "<278> file.\n"
  2887. "\n"
  2888. "<278> <178>#log timestamp <format>\n"
  2889. "<278> When set the timestamp will be prepended to each line logged to file.\n"
  2890. "<278> The format will be formatted as a date using the strftime format\n"
  2891. "<278> specifiers as described in #help time.\n"
  2892. ,
  2893. "read scan textin time write"
  2894. },
  2895. {
  2896. "LOOP",
  2897. TOKEN_TYPE_STATEMENT,
  2898. "<178>Command<278>: #loop <178>{<278><start><178>} {<278><finish><178>} {<278><variable><178>} {<278>commands<178>}\n"
  2899. "\n"
  2900. "<278> Like a for statement, loop will loop from start to finish incrementing\n"
  2901. "<278> or decrementing by 1 each time through. The value of the loop counter\n"
  2902. "<278> is stored in the provided variable, which you can use in the commands.\n"
  2903. "\n"
  2904. "<178>Example<278>: #loop 1 3 loop {get all $loop.corpse}\n"
  2905. "<278> This equals 'get all 1.corpse;get all 2.corpse;get all 3.corpse'.\n"
  2906. "\n"
  2907. "<178>Example<278>: #loop 3 1 cnt {drop $cnt\\.key}\n"
  2908. "<278> This equals 'drop 3.key;drop 2.key;drop 1.key'.\n"
  2909. ,
  2910. "break continue foreach list parse repeat return while"
  2911. },
  2912. {
  2913. "MACRO",
  2914. TOKEN_TYPE_CONFIG,
  2915. "<178>Command<278>: #macro <178>{<278>key sequence<178>} {<278>commands<178>}\n"
  2916. "\n"
  2917. "<278> Macros allow you to make tintin respond to function keys.\n"
  2918. "\n"
  2919. "<278> The key sequence sent to the terminal when pressing a function key\n"
  2920. "<278> differs for every OS and terminal. To find out what sequence is sent\n"
  2921. "<278> you can enable the CONVERT META config option.\n"
  2922. "\n"
  2923. "<278> Another option is pressing ctrl-v, which will enable CONVERT META for\n"
  2924. "<278> the next key pressed.\n"
  2925. "\n"
  2926. "<278> If you only want a key sequence to trigger at the start of an input\n"
  2927. "<278> line prefix the key sequence with ^.\n"
  2928. "\n"
  2929. "<178>Example<278>: #macro {(press ctrl-v)(press F1)} {#show \\e[2J;#buffer lock}\n"
  2930. "<278> Clear the screen and lock the window when you press F1, useful when the\n"
  2931. "<278> boss is near.\n"
  2932. "\n"
  2933. "<178>Example<278>: #macro {\\eOM} {#cursor enter}\n"
  2934. "<278> Makes the keypad's enter key work as an enter in keypad mode.\n"
  2935. "\n"
  2936. "<178>Example<278>: #macro {^nn} {n}\n"
  2937. "<278> Makes pressing n twice on an empty line execute north.\n"
  2938. "\n"
  2939. "<178>Comment<278>: Not all terminals properly initialize the keypad key sequences.\n"
  2940. "<278> If this is the case you can still use the keypad, but instead of the\n"
  2941. "<278> arrow keys use ctrl b, f, p, and n.\n"
  2942. "\n"
  2943. "<178>Comment<278>: You can remove a macro with the #unmacro command.\n"
  2944. ,
  2945. "alias cursor history keypad speedwalk tab"
  2946. },
  2947. {
  2948. "MAP",
  2949. TOKEN_TYPE_COMMAND,
  2950. "<178>Command<278>: #map\n"
  2951. "\n"
  2952. "<278> The map command is the backbone of the auto mapping feature.\n"
  2953. "\n"
  2954. "<278> <178>#map at <exit|vnum> <command>\n"
  2955. "<278> Execute the command at the given exit or vnum.\n"
  2956. "\n"
  2957. "<278> <178>#map center <x> <y> <z>\n"
  2958. "<278> Sets displaying center of the map viewer, default is 0 0 0.\n"
  2959. "\n"
  2960. "<278> <178>#map color <field> [value]\n"
  2961. "<278> Sets the map color for the given color field. Use #map color reset\n"
  2962. "<278> to restore colors to default.\n"
  2963. "\n"
  2964. "<278> <178>#map create <size>\n"
  2965. "<278> Creates a new map and room 1. The default size is 50000 rooms.\n"
  2966. "\n"
  2967. "<278> <178>#map destroy {area|world} <name>\n"
  2968. "<278> Deletes the map or given area.\n"
  2969. "\n"
  2970. "<278> <178>#map delete <exit|vnum>\n"
  2971. "<278> Deletes the room for the given exit or vnum.\n"
  2972. "\n"
  2973. "<278> <178>#map dig <exit|vnum> [new|<vnum>]\n"
  2974. "<278> Creates an exit for the given exit name. If no valid exit name\n"
  2975. "<278> is given or no existing room is found a new room is created.\n"
  2976. "<278> Useful for portal links and other alternative forms of\n"
  2977. "<278> transportation. If the 'new' argument is provided all existing\n"
  2978. "<278> rooms are ignored and a new room is created. If a room vnum is\n"
  2979. "<278> given as the second argument an exit will be created leading\n"
  2980. "<278> to the given room vnum. If the room vnum doesn't exist a new\n"
  2981. "<278> room is created.\n"
  2982. "\n"
  2983. "<278> <178>#map entrance <exit> <option> <arg> [both]\n"
  2984. "<278> Set the entrance data for the given exit. You must specify a\n"
  2985. "<278> valid two-way exit for this to work.\n"
  2986. "\n"
  2987. "<278> <178>#map exit <exit> <option> <arg> [both]\n"
  2988. "<278> Set the exit data. Useful with a closed door where you can\n"
  2989. "<278> set the exit command: '#map exit e command {open east;e}'.\n"
  2990. "<278> Use #map exit <exit> for a list of available options.\n"
  2991. "<278> Use #map exit <exit> save to save all exit data.\n"
  2992. "\n"
  2993. "<278> <178>#map exitflag <exit> <AVOID|BLOCK|HIDE|INVIS> [on|off]\n"
  2994. "<278> Set exit flags. See #map roomflag for more info.\n"
  2995. "\n"
  2996. "<278> <178>#map explore <exit>\n"
  2997. "<278> Explores the given exit until a dead end or an\n"
  2998. "<278> intersection is found. The route is stored in #path and can\n"
  2999. "<278> subsequently be used with #walk. Useful for long roads.\n"
  3000. "\n"
  3001. "<278> <178>#map find <name> <exits> <desc> <area> <note> <terrain> <flag>\n"
  3002. "<278> searches for the given room name. If found the shortest path\n"
  3003. "<278> from your current location to the destination is calculated.\n"
  3004. "<278> The route is stored in #path and can subsequently be used with\n"
  3005. "<278> the various #path commands. If #map flag nofollow is set it\n"
  3006. "<278> will store the exit commands instead of the exit names.\n"
  3007. "\n"
  3008. "<278> If <exits> is provided all exits must be matched, if\n"
  3009. "<278> <roomdesc>, <roomarea> or <roomnote> or <roomterrain> or\n"
  3010. "<278> <roomflag> is provided these are matched as well against the\n"
  3011. "<278> room to be found.\n"
  3012. "\n"
  3013. "<278> These search options are also available for the at, delete,\n"
  3014. "<278> goto, link, list and run commands.\n"
  3015. "\n"
  3016. "<278> <178>#map flag asciigraphics\n"
  3017. "<278> Takes up more space but draws a more detailed\n"
  3018. "<278> map that displays the ne se sw nw exits and room symbols.\n"
  3019. "\n"
  3020. "<278> <178>#map flag asciivnums\n"
  3021. "<278> Display room vnums if asciigraphics is enabled.\n"
  3022. "\n"
  3023. "<278> <178>#map flag direction\n"
  3024. "<278> Display an arrow on the map showing the direction of your\n"
  3025. "<278> last movement command.\n"
  3026. "\n"
  3027. "<278> <178>#map flag fast\n"
  3028. "<278> Limit coordinate searches to a 50 room radius. Useful to\n"
  3029. "<278> speed up map drawing and room creation on large maps.\n"
  3030. "\n"
  3031. "<278> <178>#map flag nofollow\n"
  3032. "<278> When you enter movement commands the map will no longer\n"
  3033. "<278> automatically follow along. Useful for MSDP and GMCP\n"
  3034. "<278> automapping scripts. When you use #map find in nofollow\n"
  3035. "<278> mode it will store the exit command instead of the exit\n"
  3036. "<278> name into the path.\n"
  3037. "\n"
  3038. "<278> <178>#map flag pancake\n"
  3039. "<278> Makes the map display rooms above or below you. You can use\n"
  3040. "<278> #map color room <aaa><fff> for a color gradient.\n"
  3041. "\n"
  3042. "<278> <178>#map flag quiet\n"
  3043. "<278> Silence map messages when creating new rooms through movement.\n"
  3044. "\n"
  3045. "<278> <178>#map flag static\n"
  3046. "<278> Will make the map static so new rooms are no longer\n"
  3047. "<278> created when walking into an unmapped direction. Useful when\n"
  3048. "<278> you're done mapping and regularly bump into walls accidentally\n"
  3049. "<278> creating a new room. #map dig etc will still work.\n"
  3050. "\n"
  3051. "<278> <178>#map flag symbolgraphics\n"
  3052. "<278> Draw a 1x1 map using the defined room symbols.\n"
  3053. "\n"
  3054. "<278> <178>#map flag terrain\n"
  3055. "<278> Fill up empty space surrounding rooms with terrain symbols\n"
  3056. "\n"
  3057. "<278> <178>#map flag vtgraphics\n"
  3058. "<278> Enables vt line drawing on some terminals\n"
  3059. "\n"
  3060. "<278> <178>#map flag vtmap\n"
  3061. "<278> Will enable the vtmap which is shown in the top split\n"
  3062. "<278> screen if you have one. You can create a 16 rows high top\n"
  3063. "<278> screen by using '#split 16 1'.\n"
  3064. "\n"
  3065. "<278> <178>#map get <option> <variable> [vnum]\n"
  3066. "<278> Store a map value into a variable, if no vnum is given the\n"
  3067. "<278> current room is used. Use 'all' as the option to store all\n"
  3068. "<278> values as a table.\n"
  3069. "\n"
  3070. "<278> <178>#map get roomexits <variable>\n"
  3071. "<278> Store all room exits into variable.\n"
  3072. "\n"
  3073. "<278> <178>#map global <room vnum>\n"
  3074. "<278> Set the vnum of a room that contains global\n"
  3075. "<278> exits, for example an exit named 'recall' that leads to the\n"
  3076. "<278> recall location. The room can contain multiple exits, in case\n"
  3077. "<278> there are multiple commands that are similar to recall.\n"
  3078. "\n"
  3079. "<278> <178>#map goto <room vnum> [dig]\n"
  3080. "<278> Takes you to the given room vnum, with the\n"
  3081. "<278> dig argument a new room will be created if none exists.\n"
  3082. "\n"
  3083. "<278> <178>#map goto <name> <exits> <desc> <area> <note> <terrain>\n"
  3084. "<278> Takes you to the given room name, if you provide exits those\n"
  3085. "<278> must match.\n"
  3086. "\n"
  3087. "<278> <178>#map info [save]\n"
  3088. "<278> Gives information about the map and room you are in. If the save\n"
  3089. "<278> argument is given the map data is saved to the info[map] variable.\n"
  3090. "\n"
  3091. "<278> <178>#map insert <direction> [roomflag]\n"
  3092. "<278> Insert a room in the given direction. Most useful for inserting\n"
  3093. "<278> void rooms.\n"
  3094. "\n"
  3095. "<278> <178>#map jump <x> <y> <z>\n"
  3096. "<278> Jump to the given coordinate, which is relative\n"
  3097. "<278> to your current room.\n"
  3098. "\n"
  3099. "<278> <178>#map landmark <name> <vnum> [description] [size]\n"
  3100. "<278> Creates an alias to target the provided room vnum. The\n"
  3101. "<278> description is optional and should be brief. The size\n"
  3102. "<278> determines from how many rooms away the landmark can be\n"
  3103. "<278> seen.\n"
  3104. "\n"
  3105. "<278> <178>#map leave\n"
  3106. "<278> Makes you leave the map. Useful when entering a maze. You\n"
  3107. "<278> can return to your last known room using #map return.\n"
  3108. "\n"
  3109. "<278> <178>#map legend <legend> [symbols|reset]\n"
  3110. "<278> <178>#map legend <legend> <index> [symbol]\n"
  3111. "<278> There are several legends and sub-legends available for\n"
  3112. "<278> drawing maps to suit personal preference and character sets.\n"
  3113. "<278> Use #map legend all to see the legend as currently defined.\n"
  3114. "<278> Use #map legend <legend> <reset> to set the default legend.\n"
  3115. "<278> Use #map legend <legend> <character list> to create a custom\n"
  3116. "<278> legend. Custom legends are stored in the map file and can be\n"
  3117. "<278> saved and loaded using #map write and #map read.\n"
  3118. "\n"
  3119. "<278> <178>#map link <direction> <room name> [both]\n"
  3120. "<278> Links two rooms. If the both\n"
  3121. "<278> argument and a valid direction is given the link is two ways.\n"
  3122. "\n"
  3123. "<278> <178>#map list <name> <exits> <desc> <area> <note> <terrain>\n"
  3124. "<278> Lists all matching rooms and their distance. The following\n"
  3125. "<278> search keywords are supported.\n"
  3126. "\n"
  3127. "<278> {distance} <arg> will list rooms within given distance.\n"
  3128. "<278> {roomarea} <arg> will list rooms with matching area name.\n"
  3129. "<278> {roomdesc} <arg> will list rooms with matching room desc.\n"
  3130. "<278> {roomexits} <arg> will list rooms with identical room exits.\n"
  3131. "<278> Use * as an exit to ignore non pathdir exits.\n"
  3132. "<278> {roomflag} <arg> will list rooms with matching room flags.\n"
  3133. "<278> {roomid} <arg> will list rooms with identical id name.\n"
  3134. "<278> {roomname} <arg> will list rooms with matching room name.\n"
  3135. "<278> {roomnote} <arg> will list rooms with matching room note.\n"
  3136. "<278> {roomterrain} <arg> will list rooms with matching room terrain.\n"
  3137. "<278> {variable} <arg> will save the output to given variable.\n"
  3138. "\n"
  3139. "<278> <178>#map map <rows> <cols> <append|overwrite|list|variable> <name>\n"
  3140. "<278> Display a drawing of the map of the given height and width.\n"
  3141. "<278> All arguments are optional. If {rows} or {cols} are set to {}\n"
  3142. "<278> or {0} they will use the scrolling window size as the default.\n"
  3143. "<278> If {rows} or {cols} are a negative number this number is\n"
  3144. "<278> subtracted from the scrolling window size.\n"
  3145. "\n"
  3146. "<278> <178>#map map <rows> <cols> draw <square>\n"
  3147. "<278> Display a drawing of the map of the given height and width.\n"
  3148. "<278> The square argument exists of 4 numbers formulating the top\n"
  3149. "<278> left corner and bottom right corner of a square.\n"
  3150. "\n"
  3151. "<278> If you use {append|overwrite} the map is written to the specified\n"
  3152. "<278> file name which must be given as the 4th argument.\n"
  3153. "<278> If you use {list|variable} the map is saved to the specified\n"
  3154. "<278> variable name.\n"
  3155. "\n"
  3156. "<278> <178>#map move <direction>\n"
  3157. "<278> This does the same as an actual movement command, updating your\n"
  3158. "<278> location on the map and creating new rooms. Useful when you are\n"
  3159. "<278> following someone and want the map to follow along. You will need\n"
  3160. "<278> to create actions using '#map move', for this to work.\n"
  3161. "\n"
  3162. "<278> <178>#map offset <row> <col> <row> <col>\n"
  3163. "<278> Define the offset of the vtmap as a square. Without an argument\n"
  3164. "<278> it defaults to the entire top split region.\n"
  3165. "\n"
  3166. "<278> <178>#map read <filename>\n"
  3167. "<278> Will load the given map file.\n"
  3168. "\n"
  3169. "<278> <178>#map resize <size>\n"
  3170. "<278> Resize the map, setting the maximum number of rooms.\n"
  3171. "\n"
  3172. "<278> <178>#map return\n"
  3173. "<278> Returns you to your last known room after leaving the map\n"
  3174. "<278> or loading a map.\n"
  3175. "\n"
  3176. "<278> <178>#map roomflag <flags> <get|on|off>\n"
  3177. "<278> \n"
  3178. "<278> <178>#map roomflag avoid\n"
  3179. "<278> When set, '#map find' will avoid a route leading\n"
  3180. "<278> through that room. Useful for locked doors, etc.\n"
  3181. "<278> <178>#map roomflag block\n"
  3182. "<278> When set the automapper will prevent movement into or through\n"
  3183. "<278> the room. Useful for death traps.\n"
  3184. "<278> <178>#map roomflag hide\n"
  3185. "<278> When set, '#map' will not display the map beyond\n"
  3186. "<278> this room. When mapping overlapping areas or areas that aren't\n"
  3187. "<278> build consistently you need this flag as well to stop\n"
  3188. "<278> auto-linking, unless you use void rooms.\n"
  3189. "<278> <178>#map roomflag invis\n"
  3190. "<278> When set the room will be colored with the INVIS color.\n"
  3191. "<278> <178>#map roomflag leave\n"
  3192. "<278> When entering a room with this flag, you will\n"
  3193. "<278> automatically leave the map. Useful when set at the entrance\n"
  3194. "<278> of an unmappable maze.\n"
  3195. "<278> <178>#map roomflag noglobal\n"
  3196. "<278> This marks a room as not allowing global\n"
  3197. "<278> transportation, like norecall rooms that block recall.\n"
  3198. "<278> <178>#map roomflag void\n"
  3199. "<278> When set the room becomes a spacing room that can\n"
  3200. "<278> be used to connect otherwise overlapping areas. A void room\n"
  3201. "<278> should only have two exits. When entering a void room you are\n"
  3202. "<278> moved to the connecting room until you enter a non void room.\n"
  3203. "<278> <178>#map roomflag static\n"
  3204. "<278> When set the room will no longer be autolinked\n"
  3205. "<278> when walking around. Useful for mapping mazes.\n"
  3206. "\n"
  3207. "<278> <178>#map run <room name> [delay]\n"
  3208. "<278> Calculates the shortest path to the destination and walks you\n"
  3209. "<278> there. The delay is optional and requires using braces. Besides\n"
  3210. "<278> the room name a list of exits can be provided for more precise\n"
  3211. "<278> matching.\n"
  3212. "\n"
  3213. "<278> <178>#map set <option> <value> [vnum]\n"
  3214. "<278> Set a map value for your current room, or given room if a room\n"
  3215. "<278> vnum is provided.\n"
  3216. "\n"
  3217. "<278> <178>#map sync <filename>\n"
  3218. "<278> Similar to #map read except the current map won't be unloaded\n"
  3219. "<278> or overwritten.\n"
  3220. "\n"
  3221. "<278> <178>#map terrain <name> <symbol> [flag]\n"
  3222. "<278> Set the terrain symbol and flag.\n"
  3223. "\n"
  3224. "<278> <178>#map terrain <name> <symbol> [DENSE|SPARSE|SCANT]\n"
  3225. "<278> Determine symbol density, omit for the default.\n"
  3226. "\n"
  3227. "<278> <178>#map terrain <name> <symbol> [NARROW|WIDE|VAST]\n"
  3228. "<278> Determine symbol spread range, omit for the default.\n"
  3229. "\n"
  3230. "<278> <178>#map terrain <name> <symbol> [FADEIN|FADEOUT]\n"
  3231. "<278> Determine symbol spread density, omit for the default.\n"
  3232. "\n"
  3233. "<278> <178>#map terrain <name> <symbol> [DOUBLE]\n"
  3234. "<278> You're using two characters for the symbol.\n"
  3235. "\n"
  3236. "<278> <178>#map travel <direction> <delay>\n"
  3237. "<278> Follows the direction until a dead end or an intersection is\n"
  3238. "<278> found. Use braces around the direction if you use the delay,\n"
  3239. "<278> which will add the given delay between movements.\n"
  3240. "<278> Use #path stop to stop a delayed run.\n"
  3241. "\n"
  3242. "<278> <178>#map undo\n"
  3243. "<278> Will undo your last move. If this created a room or a link\n"
  3244. "<278> they will be deleted, otherwise you'll simply move back a\n"
  3245. "<278> room. Useful if you walked into a non-existent direction.\n"
  3246. "\n"
  3247. "<278> <178>#map uninsert <direction>\n"
  3248. "<278> Exact opposite of the insert command.\n"
  3249. "\n"
  3250. "<278> <178>#map unlandmark <name>\n"
  3251. "<278> Removes a landmark.\n"
  3252. "\n"
  3253. "<278> <178>#map unlink <direction> [both]\n"
  3254. "<278> Will remove the exit, this isn't two way so you can have the\n"
  3255. "<278> properly display no exit rooms and mazes.\n"
  3256. "<278> If you use the both argument the exit is removed two-ways.\n"
  3257. "\n"
  3258. "<278> <178>#map unterrain <name>\n"
  3259. "<278> Removes a terrain.\n"
  3260. "\n"
  3261. "<278> <178>#map update [now]\n"
  3262. "<278> Sets the vtmap to update within the next 0.1 seconds, or\n"
  3263. "<278> instantly with the now argument.\n"
  3264. "\n"
  3265. "<278> <178>#map vnum <low> [high]\n"
  3266. "<278> Change the room vnum to the given number, if a range is\n"
  3267. "<278> provided the first available room in that range is selected.\n"
  3268. "\n"
  3269. "<278> <178>#map write <filename> [force]\n"
  3270. "<278> Will save the map, if you want to save a map to a .tin file\n"
  3271. "<278> you must provide the {force} argument.\n"
  3272. ,
  3273. "path pathdir speedwalk"
  3274. },
  3275. {
  3276. "MAPPING",
  3277. TOKEN_TYPE_STRING,
  3278. "\n"
  3279. "<278> TinTin++ has a powerful automapper that uses a room system similar to\n"
  3280. "<278> Diku MUDs which means that odd map layouts and weird exit\n"
  3281. "<278> configurations aren't a problem. The mapper provides tools to improve\n"
  3282. "<278> the visual map display. For basic path tracking see #help PATH.\n"
  3283. "\n"
  3284. "<178> #map create [size]\n"
  3285. "\n"
  3286. "<278> This command creates the initial map. The size is 50,000 by default\n"
  3287. "<278> and can be changed at any time with the #map resize command. If you\n"
  3288. "<278> play a MUD that uses MSDP or GMCP to provide room numbers you'll have\n"
  3289. "<278> to increase it to the highest reported room number. Increasing the\n"
  3290. "<278> size of the map doesn't decrease performance.\n"
  3291. "\n"
  3292. "<178> #map goto <location>\n"
  3293. "\n"
  3294. "<278> When you create the map you are not automatically inside the map. By\n"
  3295. "<278> default room number (vnum) 1 is created, so you can go to it using\n"
  3296. "<278> #map goto 1. Once you are inside the map new rooms are automatically\n"
  3297. "<278> created as you move around. Movement commands are defined with the\n"
  3298. "<278> #pathdir command. By default n, ne, e, se, s, sw, w, nw, u, d are\n"
  3299. "<278> defined.\n"
  3300. "\n"
  3301. "<278> <178>#map map <rows> <cols> <append|overwrite|list|variable> <name>\n"
  3302. "\n"
  3303. "<278> To see the map you can use #map map. It's annoying to have to\n"
  3304. "<278> constantly type #map map however. Instead it's possible to use #split\n"
  3305. "<278> to display a vt100 map. To do so execute:\n"
  3306. "\n"
  3307. "<278> <178>#split 16 1\n"
  3308. "<278> #map flag vtmap on\n"
  3309. "\n"
  3310. "<278> The first command sets the top split lines to 16 and the bottom split\n"
  3311. "<278> line to 1. If you want a smaller or larger map display you can use a\n"
  3312. "<278> different value than 16.\n"
  3313. "\n"
  3314. "<278> If you don't need to display diagonal exits and prefer a more compact\n"
  3315. "<278> look you can use #map flag AsciiGraphics off. This will enable the\n"
  3316. "<278> standard display which uses UTF-8 box drawing characters, results may\n"
  3317. "<278> vary depending on the font used.\n"
  3318. "\n"
  3319. "<278> If your terminal supports UTF-8 you can also give #map flag unicode on\n"
  3320. "<278> a try.\n"
  3321. "\n"
  3322. "<278> If you want to display the map in a different location of the screen\n"
  3323. "<278> use something like:\n"
  3324. "\n"
  3325. "<278> <178>#split 0 1 0 -80\n"
  3326. "<278> #map offset 1 81 -4 -1\n"
  3327. "\n"
  3328. "<278> This will display the map on the right side of the screen, if the\n"
  3329. "<278> width of the screen is wide enough.\n"
  3330. "\n"
  3331. "<278> <178>#map undo\n"
  3332. "\n"
  3333. "<278> If you accidentally walk into the wall on your MUD the mapper will\n"
  3334. "<278> still create a new room. You can easily fix this mistake by using\n"
  3335. "<278> #map undo. If you want to move around on the map without moving around\n"
  3336. "<278> on the MUD you can use: #map move {direction}. To delete a room\n"
  3337. "<278> manually you can use: #map delete {direction}. To create a room\n"
  3338. "<278> manually you can use: #map dig {direction}.\n"
  3339. "\n"
  3340. "<278> <178>#map write <filename>\n"
  3341. "\n"
  3342. "<278> You can save your map using #map write, to load a map you can use\n"
  3343. "<278> #map read <filename>. You can return to the room you were in when\n"
  3344. "<278> the map was last saved by using #map return. You can use #event to\n"
  3345. "<278> automatically read and write the map on session start and end.\n"
  3346. "\n"
  3347. "<278> <178>#map set <option> <value>\n"
  3348. "\n"
  3349. "<278> You can set the room name using #map set roomname <name>. You either\n"
  3350. "<278> have to do this manually or create triggers to set the room name\n"
  3351. "<278> automatically. Once the room name is set you can use #map goto with\n"
  3352. "<278> the room name to visit it. If there are two rooms with the same name\n"
  3353. "<278> #map goto will go to the most nearby room. If you want to always go\n"
  3354. "<278> to the same room you should memorize the room number or create a\n"
  3355. "<278> landmark.\n"
  3356. "\n"
  3357. "<278> <178>#map landmark firstroom 1\n"
  3358. "\n"
  3359. "<278> You can further narrow down the matches by providing additional\n"
  3360. "<278> arguments, for example:\n"
  3361. "\n"
  3362. "<278> <178>#map goto {dark alley} {roomexits} {n;e} {roomarea} {Haddock Ville}\n"
  3363. "\n"
  3364. "<278> You can set the room weight using #map set roomweight {value}. The\n"
  3365. "<278> weight by default is set to 1.0 and it represents the difficulty of\n"
  3366. "<278> traversing the room. If you have a lake as an alternative route, and\n"
  3367. "<278> traversing water rooms is 4 times slower than regular rooms, then you\n"
  3368. "<278> could set the weight of the lake rooms to 4.0. If the lake is 3 rooms\n"
  3369. "<278> wide the total weight is 12. If walking around the lake has a weight\n"
  3370. "<278> less than 12 the mapper will go around the lake, if the weight is\n"
  3371. "<278> greater than 12 the mapper will take a route through the lake.\n"
  3372. "\n"
  3373. "<278> You can set the room symbol using #map set roomsymbol {value}. The\n"
  3374. "<278> symbol should be one, two, or three characters, which can be\n"
  3375. "<278> colorized. You can for example mark shops with an 'S' and colorize the\n"
  3376. "<278> 'S' depending on what type of shop it is.\n"
  3377. "\n"
  3378. "<278> <178>#map run <location> <delay>\n"
  3379. "\n"
  3380. "<278> The run command will have tintin find the shortest path to the given\n"
  3381. "<278> location and execute the movement commands to get there. You can\n"
  3382. "<278> provide a delay in seconds with floating point precision, for example:\n"
  3383. "\n"
  3384. "<278> <178>#map run {dark alley} {0.5}\n"
  3385. "\n"
  3386. "<278> This will make you walk towards the nearest dark alley with 0.5 second\n"
  3387. "<278> intervals. Typical MUDs accept commands at 0.25 second intervals.\n"
  3388. "\n"
  3389. "<278> <178>#map insert {direction} {flag}\n"
  3390. "\n"
  3391. "<278> The insert command is useful for adding spacer rooms called void rooms.\n"
  3392. "<278> Often rooms overlap, and by adding void rooms you can stretch out\n"
  3393. "<278> exits. For example: #map insert north void. You cannot enter void rooms\n"
  3394. "<278> once they've been created, so you'll have to use #map info in an\n"
  3395. "<278> adjacent room to find the room vnum, then use #map goto {vnum} to\n"
  3396. "<278> visit.\n"
  3397. "\n"
  3398. "<278> It's also possible to align rooms using void rooms. This is easily\n"
  3399. "<278> done using #map insert north void.\n"
  3400. ,
  3401. "map path pathdir"
  3402. },
  3403. {
  3404. "MATCH",
  3405. TOKEN_TYPE_STATEMENT,
  3406. "<178>Command<278>: #match <178>{<278>regex<178>} {<278>commands<178>}\n"
  3407. "\n"
  3408. "<278> The #match command must be used within the #switch command. It works\n"
  3409. "<278> much like #case, the only difference is that #match will prepare the\n"
  3410. "<278> capture group in the regex for commands.\n"
  3411. "\n"
  3412. "<178>Example<278>:\n"
  3413. "\n"
  3414. "<278> #function {get_room_exits}\n"
  3415. "<278> {\n"
  3416. "<278> #switch {\"%1\"}\n"
  3417. "<278> {\n"
  3418. "<278> #match {\"Here the obvious exits are %*\"} {#return &1};\n"
  3419. "<278> #match {\"Here the only exit is %*\"} {#return &1};\n"
  3420. "<278> #match {\"The exits here are %* and %*\"} {#return {&1;&2}};\n"
  3421. "<278> }\n"
  3422. "<278> }\n"
  3423. "\n"
  3424. "<278> This function can extract exit information from several different\n"
  3425. "<278> room exit descriptions.\n"
  3426. ,
  3427. "case default regexp statements switch"
  3428. },
  3429. {
  3430. "MATH",
  3431. TOKEN_TYPE_COMMAND,
  3432. "<178>Command<278>: #math <178>{<278>variable<178>} {<278>expression<178>}\n"
  3433. "\n"
  3434. "<278> Performs math operations and stores the result in a variable. The math\n"
  3435. "<278> follows a C-like precedence, as follows, with the top of the list\n"
  3436. "<278> having the highest priority.\n"
  3437. "\n"
  3438. "<278> Operators Priority Function\n"
  3439. "<278> ------------------------------------------------\n"
  3440. "<278> ! 0 logical not\n"
  3441. "<278> ~ 0 bitwise not\n"
  3442. "<278> d 1 integer random dice\n"
  3443. "<278> * 2 integer multiply\n"
  3444. "<278> ** 2 integer power\n"
  3445. "<278> / 2 integer divide\n"
  3446. "<278> // 2 integer sqrt // 2 or cbrt // 3\n"
  3447. "<278> % 2 integer modulo\n"
  3448. "<278> + 3 integer addition\n"
  3449. "<278> - 3 integer subtraction\n"
  3450. "<278> << 4 bitwise shift\n"
  3451. "<278> >> 4 bitwise shift\n"
  3452. "<278> .. 4 integer range\n"
  3453. "<278> > 5 logical greater than\n"
  3454. "<278> >= 5 logical greater than or equal\n"
  3455. "<278> < 5 logical less than\n"
  3456. "<278> <= 5 logical less than or equal\n"
  3457. "<278> == 6 logical equal (can use regex)\n"
  3458. "<278> === 6 logical equal (never regex)\n"
  3459. "<278> != 6 logical not equal (can use regex)\n"
  3460. "<278> !== 6 logical not equal (never regex)\n"
  3461. "<278> & 7 bitwise and\n"
  3462. "<278> ^ 8 bitwise xor\n"
  3463. "<278> | 9 bitwise or\n"
  3464. "<278> && 10 logical and\n"
  3465. "<278> ^^ 11 logical xor\n"
  3466. "<278> || 12 logical or\n"
  3467. "<278> ? 13 logical ternary if (unfinished code)\n"
  3468. "<278> : 14 logical ternary else \n"
  3469. "\n"
  3470. "<278> True is any non-zero number, and False is zero. Parentheses () have\n"
  3471. "<278> highest precedence, so inside the () is always evaluated first.\n"
  3472. "\n"
  3473. "<278> Strings must be enclosed in \" \" or { } and in the case of an == or\n"
  3474. "<278> != operation a regex is performed with the regular expression in the\n"
  3475. "<278> right-hand string. In the case of a <= or >= operation the alphabetic\n"
  3476. "<278> order is compared.\n"
  3477. "\n"
  3478. "<278> The #if and #switch commands use #math. Several commands accepting\n"
  3479. "<278> numeric input allow math operations as well, such as #delay.\n"
  3480. "\n"
  3481. "<278> Floating point precision is added by using the decimal . operator or\n"
  3482. "<278> using #format with the %f flag character.\n"
  3483. "\n"
  3484. "<178>Example<278>: #math {heals} {$mana / 40}\n"
  3485. "<278> Assuming there is a variable $mana, divides its value by 40 and stores\n"
  3486. "<278> the result in $heals.\n"
  3487. "\n"
  3488. "<178>Example<278>: #action {^You receive %0 experience} {updatexp %0}\n"
  3489. "<278> #alias updatexp {#math {xpneed} {$xpneed - %0}\n"
  3490. "<278> Let's say you have a variable which stores xp needed for your next\n"
  3491. "<278> level. The above will modify that variable after every kill, showing\n"
  3492. "<278> the amount still needed.\n"
  3493. "\n"
  3494. "<178>Example<278>: #action {%0 tells %1}\n"
  3495. "<278> {#if {{%0} == {Bubba} && $afk} {reply I'm away, my friend.}}\n"
  3496. "<278> When you are away from keyboard, it will only reply to your friend.\n"
  3497. ,
  3498. "cat format function local mathematics replace script variable"
  3499. },
  3500. {
  3501. "MATHEMATICS",
  3502. TOKEN_TYPE_STRING,
  3503. "<278> <178>Number operations\n"
  3504. "\n"
  3505. "<278> Operators Priority Function\n"
  3506. "<278> ------------------------------------------------\n"
  3507. "<278> ! 0 logical not\n"
  3508. "<278> ~ 0 bitwise not\n"
  3509. "<278> * 1 integer multiply\n"
  3510. "<278> ** 1 integer power\n"
  3511. "<278> / 1 integer divide\n"
  3512. "<278> // 1 integer sqrt // 2 or cbrt // 3\n"
  3513. "<278> % 1 integer modulo\n"
  3514. "<278> d 1 integer random dice roll\n"
  3515. "<278> + 2 integer addition\n"
  3516. "<278> - 2 integer subtraction\n"
  3517. "<278> << 3 bitwise shift\n"
  3518. "<278> >> 3 bitwise shift\n"
  3519. "<278> > 4 logical greater than\n"
  3520. "<278> >= 4 logical greater than or equal\n"
  3521. "<278> < 4 logical less than\n"
  3522. "<278> <= 4 logical less than or equal\n"
  3523. "<278> == 5 logical equal\n"
  3524. "<278> != 5 logical not equal\n"
  3525. "<278> & 6 bitwise and\n"
  3526. "<278> ^ 7 bitwise xor\n"
  3527. "<278> | 8 bitwise or\n"
  3528. "<278> && 9 logical and\n"
  3529. "<278> ^^ 10 logical xor\n"
  3530. "<278> || 11 logical or\n"
  3531. "\n"
  3532. "<278> Operator priority can be ignored by using parentheses, for example\n"
  3533. "<278> (1 + 1) * 2 equals 4, while 1 + 1 * 2 equals 3.\n"
  3534. "\n"
  3535. "<278> <178>String operations\n"
  3536. "\n"
  3537. "<278> Operators Priority Function\n"
  3538. "<278> ------------------------------------------------\n"
  3539. "<278> > 4 alphabetical greater than\n"
  3540. "<278> >= 4 alphabetical greater than or equal\n"
  3541. "<278> < 4 alphabetical less than\n"
  3542. "<278> <= 4 alphabetical less than or equal\n"
  3543. "<278> == 5 alphabetical equal using regex\n"
  3544. "<278> != 5 alphabetical not equal using regex\n"
  3545. "<278> === 5 alphabetical equal\n"
  3546. "<278> !== 5 alphabetical not equal\n"
  3547. "\n"
  3548. "<278> Strings must be encased in double quotes or braces. The > >= < <=\n"
  3549. "<278> operators perform basic string comparisons. The == != operators perform\n"
  3550. "<278> regular expressions, with the argument on the left being the string,\n"
  3551. "<278> and the argument on the right being the regex. For example\n"
  3552. "<278> {bla} == {%*a} would evaluate as 1.\n"
  3553. ,
  3554. "math regexp"
  3555. },
  3556. {
  3557. "MESSAGE",
  3558. TOKEN_TYPE_COMMAND,
  3559. "<178>Command<278>: #message <178>{<278>listname<178>} {<278>on<178>|<278>off<178>}\n"
  3560. "\n"
  3561. "<278> This will show the message status of all your lists if typed without an\n"
  3562. "<278> argument. If you set for example VARIABLES to OFF you will no longer be\n"
  3563. "<278> spammed when correctly using the #VARIABLE and #UNVARIABLE commands.\n"
  3564. ,
  3565. "class debug ignore info kill"
  3566. },
  3567. {
  3568. "METRIC SYSTEM",
  3569. TOKEN_TYPE_STRING,
  3570. "<278> The #math command supports using 1K, 1M, 1m, and 1u to make large and\n"
  3571. "<278> small number handling a little easier. These are case sensitive. Only\n"
  3572. "<278> four symbols are supported to keep false positives to a minimum.\n"
  3573. "\n"
  3574. "<268> ╭─────────┬────────┬─────────────────────────────────╮\n"
  3575. "<268> <268>│<178> Name <268>│<178> Symbol <268>│<178> Factor<268>│\n"
  3576. "<268> ├─────────┼────────┼─────────────────────────────────┤\n"
  3577. // "<268> │<178> Yotta <268>│<178> Y <268>│<178>1 000 000 000 000 000 000 000 000<268>│\n"
  3578. // "<268> │<178> Zetta <268>│<178> Z <268>│<178> 1 000 000 000 000 000 000 000<268>│\n"
  3579. // "<268> │<178> Exa <268>│<178> E <268>│<178> 1 000 000 000 000 000 000<268>│\n"
  3580. // "<268> │<178> Peta <268>│<178> P <268>│<178> 1 000 000 000 000 000<268>│\n"
  3581. // "<268> │<178> Tera <268>│<178> T <268>│<178> 1 000 000 000 000<268>│\n"
  3582. // "<268> │<178> Giga <268>│<178> G <268>│<178> 1 000 000 000<268>│\n"
  3583. "<268> │<178> Mega <268>│<178> M <268>│<178> 1 000 000<268>│\n"
  3584. "<268> │<178> Kilo <268>│<178> K <268>│<178> 1 000<268>│\n"
  3585. "<268> │<178> <268>│<178> <268>│<178> <268>│\n"
  3586. "<268> │<178> milli <268>│<178> m <268>│<178> 0.001<268>│\n"
  3587. "<268> │<178> micro <268>│<178> u <268>│<178> 0.000 001<268>│\n"
  3588. // "<268> │<178> nano <268>│<178> n <268>│<178> 0.000 000 001<268>│\n"
  3589. // "<268> │<178> pico <268>│<178> p <268>│<178> 0.000 000 000 001<268>│\n"
  3590. // "<268> │<178> femto <268>│<178> f <268>│<178> 0.000 000 000 000 001<268>│\n"
  3591. // "<268> │<178> atto <268>│<178> a <268>│<178> 0.000 000 000 000 000 001<268>│\n"
  3592. // "<268> │<178> zepto <268>│<178> z <268>│<178> 0.000 000 000 000 000 000 001<268>│\n"
  3593. // "<268> │<178> yocto <268>│<178> y <268>│<178>0.000 000 000 000 000 000 000 001<268>│\n"
  3594. "<268> ╰─────────┴────────┴─────────────────────────────────╯\n"
  3595. ,
  3596. "echo format math"
  3597. },
  3598. {
  3599. "MOUSE",
  3600. TOKEN_TYPE_STRING,
  3601. "\n"
  3602. "<278> To enable xterm mouse tracking use #CONFIG MOUSE ON.\n"
  3603. "\n"
  3604. "<278> To see mouse events as they happen use #CONFIG MOUSE INFO. This\n"
  3605. "<278> information can then be used to create mouse events with the #event\n"
  3606. "<278> command and buttons with the #button command.\n"
  3607. "\n"
  3608. "<278> Visual buttons and pop-ups can be drawn on the screen with the #draw\n"
  3609. "<278> command.\n"
  3610. "\n"
  3611. "<278> The input field can be changed and renamed using #screen inputregion,\n"
  3612. "<278> which allows creating named events for enter handling.\n"
  3613. "\n"
  3614. "<278> Links can be created using the MSLP protocol which will generate link\n"
  3615. "<278> specific events when clicked.\n"
  3616. "\n"
  3617. "<278> In order to copy/paste, most terminals require that you press the shift\n"
  3618. "<278> key during selection.\n"
  3619. "\n",
  3620. "button draw event MSLP"
  3621. },
  3622. {
  3623. "MSDP",
  3624. TOKEN_TYPE_STRING,
  3625. "\n"
  3626. "<278> MSDP (Mud Server Data Protocol) is part of the #port functionality.\n"
  3627. "<278> See #help event for additional documentation as all MSDP events are\n"
  3628. "<278> available as regular events.\n"
  3629. "\n"
  3630. "<278> Available MSDP events can be queried using the MSDP protocol\n"
  3631. "<278> as described in the specification.\n"
  3632. "\n"
  3633. "<278> <168>https://tintin.mudhalla.net/protocols/msdp\n"
  3634. ,
  3635. "event port"
  3636. },
  3637. {
  3638. "MSLP",
  3639. TOKEN_TYPE_STRING,
  3640. "\n"
  3641. "<278> MSLP (Mud Server Link Protocol) requires enabling #config mouse on,\n"
  3642. "<278> and creating the appropriate LINK events.\n"
  3643. "\n"
  3644. "<278> The simplest link can be created by surrounding a keyword with the\n"
  3645. "<278> \\e[4m and \\e[24m tags.\n"
  3646. "\n"
  3647. "<178>Example<278>: #substitute {\\b{n|e|s|w|u|d}\\b} {\\e[4m%1\\e[24m}\n"
  3648. "\n"
  3649. "<278> This would display 'Exits: n, e, w.' as 'Exits: \e[4mn\e[24m, \e[4me\e[24m, \e[4mw\e[24m.'.\n"
  3650. "\n"
  3651. "<278> When clicked this would trigger the PRESSED LINK MOUSE BUTTON ONE\n"
  3652. "<278> event of which %4 will hold the link command and %6 holds the\n"
  3653. "<278> link name, which in the case of a simple link will be empty.\n"
  3654. "\n"
  3655. "<178>Example<278>: #event {PRESSED LINK MOUSE BUTTON ONE} {#send {%4}}\n"
  3656. "\n"
  3657. "<278> Keep in mind that if you change PRESSED to DOUBLE-CLICKED the link\n"
  3658. "<278> will only work if the text does not scroll in between clicks.\n"
  3659. "\n"
  3660. "<278> If you want to create a complex link use an OSC code.\n"
  3661. "\n"
  3662. "<178>Example<278>: #sub {\\bsmurf\\b} {\\e]68;1;;say I hate smurfs!\\a\\e[4m%0\\e[24m}\n"
  3663. "\n"
  3664. "<278> If you have the LINK event of the previous example set, the %4\n"
  3665. "<278> argument will contain 'say I hate smurfs!'.\n"
  3666. "\n"
  3667. "<178>Example<278>: #sub {\\bgoblin\\b} {\\e]68;1;SEND;kill goblin\\a\\e[4m%0\\e[24m}\n"
  3668. "\n"
  3669. "<278> Notice the previous instance of ;; has been replaced with ;SEND;\n"
  3670. "<278> which will name the link. This will generate a named event.\n"
  3671. "\n"
  3672. "<178>Example<278>: #event {PRESSED LINK SEND MOUSE BUTTON ONE} {#send {%4}}\n"
  3673. "\n"
  3674. "<278> By naming links you can organize things a little bit better instead\n"
  3675. "<278> of tunneling everything through the same event.\n"
  3676. "\n"
  3677. "<278> Keep in mind that the server is allowed to use \\e]68;1;\\a as well,\n"
  3678. "<278> subsequently various security measures are in place.\n"
  3679. "\n"
  3680. "<278> To create secure links, which are filtered out when sent by a server,\n"
  3681. "<278> you need to use \\e]68;2;\\a, and they instead trigger the SECURE LINK\n"
  3682. "<278> event.\n"
  3683. "\n"
  3684. "<278> To create a link that is not underlined, use \\e]4;24m text \\e]24m.\n"
  3685. "\n"
  3686. "<178>Example<278>: #sub {%* tells %*} {\\e]68;2;EXEC;#cursor set tell %1 \\a\\e[4;24m%0\\e[24m}\n"
  3687. "<178> <278> #event {PRESSED SECURE LINK EXEC MOUSE BUTTON ONE} {%4}\n"
  3688. "\n"
  3689. "<278> This would make you start a reply when clicking on a tell.\n"
  3690. "\n"
  3691. "<178>Website<278>: https://tintin.mudhalla.net/protocols/mslp\n"
  3692. ,
  3693. "event port"
  3694. },
  3695. {
  3696. "NOP",
  3697. TOKEN_TYPE_COMMAND,
  3698. "<178>Command<278>: #nop <178>{<278>whatever<178>}\n"
  3699. "\n"
  3700. "<278> Short for 'no operation', and is ignored by the client. It is useful\n"
  3701. "<278> for commenting in your coms file, any text after the nop and before a\n"
  3702. "<278> semicolon or end of line is ignored. You shouldn't put braces { } in it\n"
  3703. "<278> though, unless you close them properly.\n"
  3704. "\n"
  3705. "<278> A valid alternative for #nop is #0.\n"
  3706. "\n"
  3707. "<178>Comment<278>: By using braces you can comment out multiple lines of code in a script\n"
  3708. "<278> file.\n"
  3709. "\n"
  3710. "<278> For commenting out an entire trigger and especially large sections of\n"
  3711. "<278> triggers you would want to use /* text */\n"
  3712. "\n"
  3713. "<178>Example<278>: #nop This is the start of my script file.\n"
  3714. ,
  3715. "read"
  3716. },
  3717. {
  3718. "PARSE",
  3719. TOKEN_TYPE_STATEMENT,
  3720. "<178>Command<278>: #parse <178>{<278>string<178>} {<278>variable<178>} {<278>commands<178>}\n"
  3721. "\n"
  3722. "<278> Like the loop statement, parse will loop from start to finish through\n"
  3723. "<278> the given string. The value of the current character is stored in the\n"
  3724. "<278> provided variable.\n"
  3725. "\n"
  3726. "<178>Example<278>: #parse {hello world} {char} {#show $char}\n"
  3727. ,
  3728. "break continue foreach list loop repeat return while"
  3729. },
  3730. {
  3731. "PATH",
  3732. TOKEN_TYPE_COMMAND,
  3733. "<178>Command<278>: #path <178>{<278>option<178>} {<278>argument<178>}\n"
  3734. "\n"
  3735. "<278> create Will clear the path and start path mapping.\n"
  3736. "<278> delete Will delete the last move of the path.\n"
  3737. "<278> describe Describe the path and current position.\n"
  3738. "<278> destroy Will clear the path and stop path mapping.\n"
  3739. "<278> get Will get either the length or position.\n"
  3740. "<278> goto Go the the start, end, or given position index.\n"
  3741. "<278> insert Add the given argument to the path.\n"
  3742. "<278> load Load the given variable as the new path.\n"
  3743. "<278> map Display the map and the current position.\n"
  3744. "<278> move Move the position forward or backward. If a number is given\n"
  3745. "<278> the position is changed by the given number of steps.\n"
  3746. "<278> run Execute the current path, with an optional floating point\n"
  3747. "<278> delay in seconds as the second argument.\n"
  3748. "<278> save Save the path to a variable. You must specify whether you\n"
  3749. "<278> want to save the path 'forward' or 'backward'.\n"
  3750. "<278> start Start path mapping.\n"
  3751. "<278> stop Stop path mapping, can also abort #path run.\n"
  3752. "<278> swap Switch the forward and backward path.\n"
  3753. "<278> unzip Load the given speedwalk as the new path.\n"
  3754. "<278> walk Take one step forward or backward.\n"
  3755. "<278> zip Turn the path into a speedwalk.\n"
  3756. "\n"
  3757. "<178>Example<278>: #path ins {unlock n;open n} {unlock s;open s}\n"
  3758. ,
  3759. "map pathdir speedwalk"
  3760. },
  3761. {
  3762. "PATHDIR",
  3763. TOKEN_TYPE_CONFIG,
  3764. "<178>Command<278>: #pathdir <178>{<278>dir<178>} {<278>reversed dir<178>} {<278>coord<178>}\n"
  3765. "\n"
  3766. "<278> By default tintin sets the most commonly used movement commands\n"
  3767. "<278> meaning you generally don't really have to bother with pathdirs.\n"
  3768. "<278> Pathdirs are used by the #path and #map commands.\n"
  3769. "\n"
  3770. "<278> The first argument is a direction, the second argument is the reversed\n"
  3771. "<278> direction. The reverse direction of north is south, etc.\n"
  3772. "\n"
  3773. "<278> The third argument is a spatial coordinate which is a power of two.\n"
  3774. "<278> 'n' is 1, 'e' is 2, 's' is 4, 'w' is '8', 'u' is 16, 'd' is 32. The\n"
  3775. "<278> exception is for compound directions, whose value should be the sum\n"
  3776. "<278> of the values of each cardinal direction it is composed of. For\n"
  3777. "<278> example, 'nw' is the sum of 'n' and 'w' which is 1 + 8, so 'nw'\n"
  3778. "<278> needs to be given the value of 9. This value is required for the\n"
  3779. "<278> #map functionality to work properly.\n"
  3780. "\n"
  3781. "<178>Example<278>: #pathdir {ue} {dw} {18}\n"
  3782. "<278> #pathdir {dw} {ue} {40}\n"
  3783. "\n"
  3784. "<178>Comment<278>: You can remove a pathdir with the #unpathdir command.\n",
  3785. "map path"
  3786. },
  3787. {
  3788. "PCRE",
  3789. TOKEN_TYPE_STRING,
  3790. "\n"
  3791. "<278> A regular expression, regex or regexp is a sequence of characters that\n"
  3792. "<278> defines a search pattern. Since the 1980s, different syntaxes for\n"
  3793. "<278> writing regular expressions exist, the two most widely used ones being\n"
  3794. "<278> the POSIX syntax and the similar but more advanced Perl standard.\n"
  3795. "<278> TinTin++ supports the Perl standard known as PCRE (Perl Compatible\n"
  3796. "<278> Regular Expressions).\n"
  3797. "\n"
  3798. "<278> Regular expressions are an integral part of TinTin++, but keep in mind\n"
  3799. "<278> that tintin doesn't allow you to use regular expressions directly,\n"
  3800. "<278> instead it uses a simpler intermediate syntax that still allows more\n"
  3801. "<278> complex expressions when needed.\n"
  3802. "\n"
  3803. "<278> Commands that utilize regular expressions are: action, alias, elseif,\n"
  3804. "<278> gag, grep, highlight, if, kill, local, math, prompt, regexp, replace,\n"
  3805. "<278> substitute, switch, variable and while. Several other commands use\n"
  3806. "<278> regular expressions in minor ways. Fortunately the basics are very\n"
  3807. "<278> easy to learn.\n"
  3808. "\n"
  3809. "<128> TinTin++ Regular Expression\n"
  3810. "\n"
  3811. "<278> The following support is available for regular expressions.\n"
  3812. "\n"
  3813. "<178> ^ <278>match start of line.\n"
  3814. "<178> $ <278>match of end of line.\n"
  3815. "<178> \\ <278>escape one character.\n"
  3816. "\n"
  3817. "<178> %1-%99 <278>match of any text, stored in the corresponding index.\n"
  3818. "<178> %0 <278>should be avoided in the regex, contains all matched text.\n"
  3819. "<178> { } <278>embed a perl compatible regular expression, matches are stored.\n"
  3820. "<178> %!{ } <278>embed a perl compatible regular expression, matches are not stored.\n"
  3821. "\n"
  3822. "<278> [ ] . + | ( ) ? * are treated as normal text unless used within braces.\n"
  3823. "<278> Keep in mind that { } is replaced with ( ) automatically unless %!{ }\n"
  3824. "<278> is used.\n"
  3825. "\n"
  3826. "<178>TinTin++ <178>Description POSIX\n"
  3827. "<178> %a <278>Match zero or more characters including newlines ([^\\0]*?)\n"
  3828. "<178> %A <278>Match zero or more newlines ([\\n]*?)\n"
  3829. "<178> %c <278>Match zero or more ansi color codes ((?:\\e\\[[0-9;]*m)*?)\n"
  3830. "<178> %d <278>Match zero or more digits ([0-9]*?)\n"
  3831. "<178> %D <278>Match zero or more non-digits ([^0-9]*?)\n"
  3832. "<178> %i <278>Matches become case insensitive (?i)\n"
  3833. "<178> %I <278>Matches become case sensitive (default) (?-i)\n"
  3834. "<178> %s <278>Match zero or more spaces ([\\r\\n\\t ]*?)\n"
  3835. "<178> %S <278>Match zero or more non-spaces ([^\\r\\n\\t ]*?)\n"
  3836. "<178> %w <278>Match zero or more word characters ([A-Za-z0-9_]*?)\n"
  3837. "<178> %W <278>Match zero or more non-word characters ([^A-Za-z0-9_]*?)\n"
  3838. "<178> %? <278>Match zero or one character (.\?\?)\n"
  3839. "<178> %. <278>Match one character (.)\n"
  3840. "<178> %+ <278>Match one or more characters (.+?)\n"
  3841. "<178> %* <278>Match zero or more characters excluding newlines (.*?)\n"
  3842. "\n"
  3843. "<278> <128>Ranges\n"
  3844. "\n"
  3845. "<278> If you want to match 1 digit use %+1d, if you want to match between 3\n"
  3846. "<278> and 5 spaces use %+3..5s, if you want to match 1 or more word\n"
  3847. "<278> characters use %+1..w, etc.\n"
  3848. "\n"
  3849. "<278> <128>Variables\n"
  3850. "\n"
  3851. "<278> If you use %1 in an action to perform a match the matched string is\n"
  3852. "<278> stored in the %1 variable which can be used in the action body.\n"
  3853. "\n"
  3854. "<178>Example<278>: #act {%1 says 'Tickle me'} {tickle %1}\n"
  3855. "\n"
  3856. "<278> If you use %2 the match is stored in %2, etc. If you use an unnumbered\n"
  3857. "<278> match like %* or %S the match is stored at the last used index\n"
  3858. "<278> incremented by one.\n"
  3859. "\n"
  3860. "<178>Example<278>: #act {%3 says '%*'} {#if {\"%4\" == \"Tickle me\"} {tickle %3}}\n"
  3861. "\n"
  3862. "<278> The maximum variable index is 99. If you begin an action with %* the\n"
  3863. "<278> match is stored in %1. You should never use %0 in the trigger part of\n"
  3864. "<278> an action, when used in the body of an action %0 contains all the parts\n"
  3865. "<278> of the string that were matched.\n"
  3866. "\n"
  3867. "<278> To prevent a match from being stored use %!*, %!w, etc.\n"
  3868. "\n"
  3869. "<278> <128>Perl Compatible Regular Expressions\n"
  3870. "\n"
  3871. "<278> You can embed a PCRE (Perl Compatible Regular Expression) using curley\n"
  3872. "<278> braces { }, these braces are replaced with parentheses ( ) unless you\n"
  3873. "<278> use %!{ }.\n"
  3874. "\n"
  3875. "<278> <128>Or\n"
  3876. "\n"
  3877. "<278> You can separate alternatives within a PCRE using the | character.\n"
  3878. "\n"
  3879. "<178>Example<278>: #act {%* raises {his|her|its} eyebrows.} {say 42..}\n"
  3880. "\n"
  3881. "<278> <128>Brackets\n"
  3882. "\n"
  3883. "<278> You can group alternatives and ranges within a PCRE using brackets.\n"
  3884. "\n"
  3885. "<178>Example<278>: #act {%* says 'Who is number {[1-9]}?} {say $number[%2] is number %2}\n"
  3886. "\n"
  3887. "<278> The example only triggers if someone provides a number between 1 and\n"
  3888. "<278> 9. Any other character will cause the action to not trigger.\n"
  3889. "\n"
  3890. "<178>Example<278>: #act {%* says 'Set password to {[^0-9]*}$} {say The password must\n"
  3891. "<278> contain at least one number, not for security reasons, but just to\n"
  3892. "<278> annoy you.} {4}\n"
  3893. "\n"
  3894. "<278> When the ^ character is used within brackets it creates an inverse\n"
  3895. "<278> search, [^0-9] matches every character except for a number between 0\n"
  3896. "<278> and 9.\n"
  3897. "\n"
  3898. "<278> <128>Quantification\n"
  3899. "\n"
  3900. "<278> A quantifier placed after a match specifies how often the match is\n"
  3901. "<278> allowed to occur.\n"
  3902. "\n"
  3903. "<178> ? <278>repeat zero or one time.\n"
  3904. "<178> * <278>repeat zero or multiple times.\n"
  3905. "<178> + <278>repeat once or multiple times.\n"
  3906. "<178> {n} <278>repeat exactly n times, n must be a number.\n"
  3907. "<178> {n,} <278>repeat at least n times, n must be a number.\n"
  3908. "<178> {n,o} <278>repeat between n and o times, n and o must be a number.\n"
  3909. "\n"
  3910. "<178>Example<278>: #act {%* says 'Who is number {[1-9][0-9]{0,2}}?} {Say $number[%2] is\n"
  3911. "<278> number %2}\n"
  3912. "\n"
  3913. "<278> The example only triggers if someone provides a number between 1 and\n"
  3914. "<278> 999.\n"
  3915. "\n"
  3916. "<278> <128>Parantheses\n"
  3917. "\n"
  3918. "<278> TinTin Regular Expressions automatically add parenthesis, for example\n"
  3919. "<278> %* translates to (.*?) in PCRE unless the %* is found at the start or\n"
  3920. "<278> end of the line, in which cases it translates to (.*). Paranthesis in\n"
  3921. "<278> PCRE causes a change in execution priority similar to mathematical\n"
  3922. "<278> expressions, but parentheses also causes the match to be stored to a\n"
  3923. "<278> variable.\n"
  3924. "\n"
  3925. "<278> When nesting multiple sets of parentheses each nest is assigned its\n"
  3926. "<278> numerical variable in order of appearance.\n"
  3927. "\n"
  3928. "<178>Example<278>: #act {%* chats '{Mu(ha)+}'} {chat %2ha!}\n"
  3929. "\n"
  3930. "<278> If someone chats Muha you will chat Muhaha! If someone chats Muhaha\n"
  3931. "<278> you will chat Muhahaha!\n"
  3932. "\n"
  3933. "<278> <128>Lazy vs Greedy\n"
  3934. "\n"
  3935. "<278> By default regex matches are greedy, meaning {.*} will capture as much\n"
  3936. "<278> text as possible.\n"
  3937. "\n"
  3938. "<178>Example<278>: #regex {bli bla blo} {^{.*} {.*}$} {#show Arg1=(&1) Arg2=(&2)}\n"
  3939. "\n"
  3940. "<278> This will display: Arg1=(bli bla) Arg2=(blo)\n"
  3941. "\n"
  3942. "<278> By appending a ? behind a regex it becomes lazy, meaning {.*?} will\n"
  3943. "<278> capture as little text as possible.\n"
  3944. "\n"
  3945. "<178>Example<278>: #regex {bli bla blo} {^{.*?} {.*?}$} {#show Arg1=(&1) Arg2=(&2)}\n"
  3946. "\n"
  3947. "<278> This will display: Arg1=(bli) Arg2=(bla blo).\n"
  3948. "\n"
  3949. "<278> <128>Escape Codes\n"
  3950. "\n"
  3951. "<278> PCRE support the following escape codes.\n"
  3952. "\n"
  3953. "<178> PCRE Description POSIX\n"
  3954. "<178> \\A <278>Match start of string ^\n"
  3955. "<178> \\b <278>Match word boundaries (^|\\r|\\n|\\t| |$)\n"
  3956. "<178> \\B <278>Match non-word boundaries [^\\r\\n\\t ]\n"
  3957. "<178> \\c <278>Insert control character \\c\n"
  3958. "<178> \\d <278>Match digits [0-9]\n"
  3959. "<178> \\D <278>Match non-digits [^0-9]\n"
  3960. "<178> \\e <278>Insert escape character \\e\n"
  3961. "<178> \\f <278>Insert form feed character \\f\n"
  3962. "<178> \\n <278>Insert line feed character \\n\n"
  3963. "<178> \\r <278>Insert carriage return character \\r\n"
  3964. "<178> \\s <278>Match spaces [\\r\\n\\t ]\n"
  3965. "<178> \\S <278>Match non-spaces [^\\r\\n\\t ]\n"
  3966. "<178> \\t <278>Insert tab character \\t\n"
  3967. "<178> \\w <278>Match letters, numbers, and underscores [A-Za-z0-9_]\n"
  3968. "<178> \\W <278>Match non-letters, numbers, and underscores [^A-Za-z0-9_]\n"
  3969. "<178> \\x <278>Insert hex character \\x\n"
  3970. "<178> \\Z <278>Match end of string $\n"
  3971. "<178> \\\\ <278>Match a backslash \\\\\n"
  3972. "\n"
  3973. "<278> \\s matches one space, \\s+ matches one or multiple spaces, the use\n"
  3974. "<278> of {\\s+} is required for this sequence to work in tintin, \\s by\n"
  3975. "<278> itself will work outside of a set of braces.\n"
  3976. "\n"
  3977. "<278> Use \\% to forcibly match a literal % character.\n"
  3978. "\n"
  3979. "<278> <128>Color triggers\n"
  3980. "\n"
  3981. "<278> To make matching easier text triggers (Actions, Gags, Highlights,\n"
  3982. "<278> Prompts, and Substitutes) have their color codes stripped. If you\n"
  3983. "<278> want to create a color trigger you must start the triggers with a ~\n"
  3984. "<278> (tilde). To make escape codes visible use #config {convert meta} on.\n"
  3985. "\n"
  3986. "<178>Example<278>: #action {~\\e[1;37m%1} {#var roomname %1}\n"
  3987. "\n"
  3988. "<278> If the room name is the only line on the server in bright white\n"
  3989. "<278> white color trigger will save the roomname.\n"
  3990. "\n"
  3991. "\n"
  3992. "<278> This covers the basics. PCRE has more options, most of which are\n"
  3993. "<278> somewhat obscure, so you'll have to read a PCRE manual for additional\n"
  3994. "<278> information.\n"
  3995. ,
  3996. "map path"
  3997. },
  3998. {
  3999. "PORT",
  4000. TOKEN_TYPE_COMMAND,
  4001. "<178>Command<278>: #port <178>{<278>option<178>} {<278>argument<178>}\n"
  4002. "\n"
  4003. "<278> <178>#port {init} {name} {port} {file}\n"
  4004. "<278> Initilize a port session.\n"
  4005. "\n"
  4006. "<278> <178>#port {call} {address} {port}\n"
  4007. "<278> Connect to a remote socket.\n"
  4008. "\n"
  4009. "<278> <178>#port {color} {color names}\n"
  4010. "<278> Set the default color of port messages.\n"
  4011. "\n"
  4012. "<278> <178>#port {dnd}\n"
  4013. "<278> Do Not Disturb. Decline new connections\n"
  4014. "\n"
  4015. "<278> <178>#port {group} {name} {group}\n"
  4016. "<278> Assign a socket group.\n"
  4017. "\n"
  4018. "<278> <178>#port {ignore} {name}\n"
  4019. "<278> Ignore a socket\n"
  4020. "\n"
  4021. "<278> <178>#port {info}\n"
  4022. "<278> Display information about the port session.\n"
  4023. "\n"
  4024. "<278> <178>#port {name} {name}\n"
  4025. "<278> Change socket name.\n"
  4026. "\n"
  4027. "<278> <178>#port {prefix} {text}\n"
  4028. "<278> Set prefix before each message.\n"
  4029. "\n"
  4030. "<278> <178>#port {send} {name|all} {text}\n"
  4031. "<278> Send data to socket\n"
  4032. "\n"
  4033. "<278> <178>#port {uninitialize}\n"
  4034. "<278> Uninitialize the port session.\n"
  4035. "\n"
  4036. "<278> <178>#port {who}\n"
  4037. "<278> Show all connections\n"
  4038. "\n"
  4039. "<278> <178>#port {zap} {name}\n"
  4040. "<278> Close a connection\n"
  4041. "\n"
  4042. "<278> The port command is very similar to chat except that it creates a\n"
  4043. "<278> new session dedicated to receiving socket connections at the given\n"
  4044. "<278> port number without built-in support for a communication protocol.\n"
  4045. "\n"
  4046. "<278> You can init with 0 as the port number to create a dummy session.\n"
  4047. ,
  4048. "all chat run session sessionname snoop ssl zap"
  4049. },
  4050. {
  4051. "PROMPT",
  4052. TOKEN_TYPE_CONFIG,
  4053. "<178>Command<278>: #prompt <178>{<278>text<178>} {<278>new text<178>} {<278>row #<178>} <178>{<278>col #<178>}\n"
  4054. "\n"
  4055. "<278> Prompt is a feature for split window mode, which will capture a line\n"
  4056. "<278> received from the server and display it on the status bar of your\n"
  4057. "<278> split screen terminal. You would define <text> and <new text> the\n"
  4058. "<278> same way as you would with #substitute.\n"
  4059. "\n"
  4060. "<278> The row number is optional and useful if you use a non standard split\n"
  4061. "<278> mode. A positive row number draws #row lines from the top while a\n"
  4062. "<278> negative number draws #row lines from the bottom. Without an argument\n"
  4063. "<278> #prompt will write to the default split line, which is one row above\n"
  4064. "<278> the input line, typically at row -2.\n"
  4065. "\n"
  4066. "<278> If the row number is set to 0, #prompt will behave like #substitute.\n"
  4067. "<278> This is useful to let tintin know that a prompt was received so you\n"
  4068. "<278> can use #config packet_patch with minimal interference.\n"
  4069. "\n"
  4070. "<278> The col number is optional and can be used to set the column index.\n"
  4071. "<278> A positive col number draws the given number of columns from the left,\n"
  4072. "<278> while a negative col number draws from the right. If you leave the\n"
  4073. "<278> col number empty tintin will clear the row before printing at the\n"
  4074. "<278> start of the row.\n"
  4075. "\n"
  4076. "<278> The #show command takes a row and col argument as well so it's also\n"
  4077. "<278> possible to place text on your split lines using #show.\n"
  4078. "\n"
  4079. "<178>Example<278>: #prompt {[%*] %* (%*) > } {[%1] %2 (%3)}\n"
  4080. "<178>Example<278>: #prompt {[%*] %* (%*) > } {} {-2}\n"
  4081. "<278> If the <new text> argument is left empty the original text is used,\n"
  4082. "<278> including colors. Use {\\} for a blank line.\n"
  4083. "\n"
  4084. "<178>Comment<278>: See <178>#help split<278> for more information on split mode.\n"
  4085. "\n"
  4086. "<178>Comment<278>: See <178>#help substitute<278> for more information on text\n"
  4087. "<278> substitutions.\n"
  4088. "\n"
  4089. "<178>Comment<278>: You can remove a prompt with the #unprompt command.\n"
  4090. ,
  4091. "action gag highlight substitute"
  4092. },
  4093. {
  4094. "READ",
  4095. TOKEN_TYPE_COMMAND,
  4096. "<178>Command<278>: #read <178>{<278>filename<178>}\n"
  4097. "\n"
  4098. "<278> Reads a commands file into memory. The coms file is merged in with\n"
  4099. "<278> the currently loaded commands. Duplicate commands are overwritten.\n"
  4100. "\n"
  4101. "<278> If you uses braces, { and } you can use several lines for 1 commands.\n"
  4102. "<278> This however means you must always match every { with a } for the read\n"
  4103. "<278> command to work.\n"
  4104. "\n"
  4105. "<278> You can comment out triggers using /* text */\n"
  4106. ,
  4107. "log scan textin write"
  4108. },
  4109. {
  4110. "REGEXP",
  4111. TOKEN_TYPE_COMMAND,
  4112. "<178>Command<278>: #regexp <178>{<278>string<178>} {<278>expression<178>} {<278>true<178>} {<278>false<178>}\n"
  4113. "\n"
  4114. "<278> Compares the string to the given regular expression.\n"
  4115. "\n"
  4116. "<278> The expression can contain escapes, and if you want to match a literal\n"
  4117. "<278> \\ character you'll have to use \\\\ to match a single backslash.\n"
  4118. "\n"
  4119. "<278> Variables are stored in &1 to &99 with &0 holding the matched\n"
  4120. "<278> substring.\n"
  4121. "\n"
  4122. "<278> The #regex command is not a proper statement like #if, when using\n"
  4123. "<278> #return or #break in the {true} argument it won't terminate any loop\n"
  4124. "<278> the #regex command is nested within.\n"
  4125. "\n"
  4126. "<178> ^ <278>force match of start of line.\n"
  4127. "<178> $ <278>force match of end of line.\n"
  4128. "<178> \\ <278>escape one character.\n"
  4129. "<178> %1-%99 <278>lazy match of any text, available at %1-%99.\n"
  4130. "<178> %0 <278>should be avoided in triggers, and if left alone lists all matches.\n"
  4131. "<178> { } <278>embed a raw regular expression, matches are stored to %1-%99.\n"
  4132. "<178> %!{ } <278>embed a raw regular expression, matches are not stored.\n"
  4133. "\n"
  4134. "<178> <278>[ ] . + | ( ) ? * are treated as normal text unlessed used within\n"
  4135. "<178> <278>braces. Keep in mind that { } is replaced with ( ) automatically\n"
  4136. "<178> <278>unless %!{ } is used.\n"
  4137. "\n"
  4138. "<278> Of the following the (lazy) match is available at %1-%99 + 1\n"
  4139. "\n"
  4140. "<178> %a <278>match zero or more characters including newlines.\n"
  4141. "<178> %A <278>match zero or more newlines.\n"
  4142. "<178> %c <278>match zero or more ansi color codes.\n"
  4143. "<178> %d <278>match zero or more digits.\n"
  4144. "<178> %D <278>match zero or more non digits.\n"
  4145. "<178> %s <278>match zero or more spaces.\n"
  4146. "<178> %S <278>match zero or more non spaces.\n"
  4147. "<178> %w <278>match zero or more word characters.\n"
  4148. "<178> %W <278>match zero or more non word characters.\n"
  4149. "\n"
  4150. " Experimental (subject to change) matches are:\n"
  4151. "\n"
  4152. "<178> %p <278>match zero or more printable characters.\n"
  4153. "<178> %P <278>match zero or more non printable characters.\n"
  4154. "<178> %u <278>match zero or more unicode characters.\n"
  4155. "<178> %U <278>match zero or more non unicode characters.\n"
  4156. "\n"
  4157. " If you want to match 1 digit use %+1d, if you want to match between 3\n"
  4158. " and 5 spaces use %+3..5s, if you want to match 0 or more word\n"
  4159. " characters use %+0..w, etc.\n"
  4160. "\n"
  4161. "<178> %+ <278>match one or more characters.\n"
  4162. "<178> %? <278>match zero or one character.\n"
  4163. "<178> %. <278>match one character.\n"
  4164. "<178> %* <278>match zero or more characters.\n"
  4165. "\n"
  4166. "<178> %i <278>matching becomes case insensitive.\n"
  4167. "<178> %I <278>matching becomes case sensitive (default).\n"
  4168. "\n"
  4169. "<278> The match is automatically stored to a value between %1 and %99\n"
  4170. "<278> starting at %1 and incrementing by 1 for every regex. If you use\n"
  4171. "<278> %15 as a regular expression, the next unnumbered regular expression\n"
  4172. "<278> would be %16. To prevent a match from being stored use %!*, %!w, etc.\n"
  4173. "\n"
  4174. "<178>Example<278>: #regexp {bli bla blo} {bli {.*} blo} {#show &1}\n"
  4175. "\n"
  4176. "<178>Comment<278>: Like an alias or function #regex has its own scope.\n"
  4177. ,
  4178. "pcre replace"
  4179. },
  4180. {
  4181. "REPEAT",
  4182. TOKEN_TYPE_STRING,
  4183. "<178>Command<278>: #<178>[<078>number<178>] {<278>commands<178>}\n"
  4184. "\n"
  4185. "<278> Sometimes you want to repeat the same command multiple times. This is\n"
  4186. "<278> the easiest way to accomplish that.\n"
  4187. "\n"
  4188. "<178>Example<278>: #10 {buy bread}\n",
  4189. "mathematics statements"
  4190. },
  4191. {
  4192. "REPLACE",
  4193. TOKEN_TYPE_COMMAND,
  4194. "<178>Command<278>: #replace <178>{<278>variable<178>} {<278>oldtext<178>} {<278>newtext<178>}\n"
  4195. "\n"
  4196. "<278> Searches the given variable, replacing each occurrence of 'oldtext'\n"
  4197. "<278> with 'newtext'. The 'oldtext' argument is a regular expression.\n"
  4198. "\n"
  4199. "<278> Variables are stored in &1 to &99 with &0 holding the entire matched\n"
  4200. "<278> substring.\n"
  4201. "\n"
  4202. "<178>Example<278>: #function rnd #math result 1d9;#replace test {%.} {@rnd{}}\n"
  4203. ,
  4204. "cat format function local math script variable"
  4205. },
  4206. {
  4207. "RETURN",
  4208. TOKEN_TYPE_STATEMENT,
  4209. "<178>Command<278>: #return <178>{<278>text<178>}\n"
  4210. "\n"
  4211. "<278> This command can be used to break out of a command string being\n"
  4212. "<278> executed.\n"
  4213. "\n"
  4214. "<278> If used inside a #function you can use #return with an argument to both\n"
  4215. "<278> break out of the function and set the result variable.\n"
  4216. ,
  4217. "break continue foreach list loop parse repeat while"
  4218. },
  4219. {
  4220. "RUN",
  4221. TOKEN_TYPE_COMMAND,
  4222. "<178>Command<278>: #run <178>{<278>name<178>} {<278>shell command<178>} {<278>file<178>}\n"
  4223. "\n"
  4224. "<278> The run command works much like the system command except that it\n"
  4225. "<278> runs the command in a pseudo terminal. The run command also creates\n"
  4226. "<278> a session that treats the given shell command as a server. This\n"
  4227. "<278> allows you to run ssh, as well as any other shell application, with\n"
  4228. "<278> full tintin scripting capabilities. If a file name is given the file\n"
  4229. "<278> is loaded prior to execution.\n"
  4230. "\n"
  4231. "<178>Example<278>: #run {somewhere} {ssh someone@somewhere.com}\n"
  4232. "<178>Example<278>: #run {something} {tail -f chats.log}\n"
  4233. ,
  4234. "all port session sessionname snoop ssl zap"
  4235. },
  4236. {
  4237. "SCAN",
  4238. TOKEN_TYPE_COMMAND,
  4239. "<178>Command<278>: #scan <178>{<278>abort<178>|<278>csv<178><178>|<278>tsv<178><178>|<278>txt<178>} {<278>filename<178>}\n"
  4240. "\n"
  4241. "<278> The scan command is a file reading utility.\n"
  4242. "\n"
  4243. "<278> <178>#scan {abort}\n"
  4244. "<278> This command must be called from with a SCAN event and will\n"
  4245. "<278> abort the scan if one is in progress.\n"
  4246. "\n"
  4247. "<278> <178>#scan {csv} <filename>\n"
  4248. "<278> The scan csv command reads in a comma separated value file\n"
  4249. "<278> without printing the content to the screen. Instead it triggers one\n"
  4250. "<278> of two events.\n"
  4251. "\n"
  4252. "<278> The SCAN CSV HEADER event is triggered on the first line of the csv\n"
  4253. "<278> file. The SCAN CSV LINE event is triggered on the second and each\n"
  4254. "<278> subsequent line of the csv file. The %0 argument contains the entire\n"
  4255. "<278> line, with %1 containing the first value, %2 the second value, etc,\n"
  4256. "<278> all the way up to %99.\n"
  4257. "\n"
  4258. "<278> Values containing spaces must be surrounded with quotes, keep in mind\n"
  4259. "<278> newlines within quotes are not supported. Use two quotes to print one\n"
  4260. "<278> literal quote character.\n"
  4261. "\n"
  4262. "<178> #scan {dir} <filename> <variable>\n"
  4263. "\n"
  4264. "<278> The scan dir command will read the given filename or directory and\n"
  4265. "<278> store any gathered information into the provided variable.\n"
  4266. "\n"
  4267. "<278> <178>#scan {tsv} <filename>\n"
  4268. "\n"
  4269. "<278> The scan tsv <filename> command reads in a tab separated value file\n"
  4270. "<278> without printing the content to the screen. Instead it triggers the\n"
  4271. "<278> SCAN TSV HEADER event for the first line and SCAN TSV LINE for all\n"
  4272. "<278> subsequent lines.\n"
  4273. "\n"
  4274. "<278> <178>#scan {file} <filename> {commands}\n"
  4275. "\n"
  4276. "<278> The scan file command reads the given files and executes the\n"
  4277. "<278> commands argument. &0 contains the raw content of the file and\n"
  4278. "<278> &1 contains the plain content. &2 contains the raw byte size of the\n"
  4279. "<278> file and &3 the plain byte size. &5 contains the line count.\n"
  4280. "\n"
  4281. "<278> <178>#scan {txt} <filename>\n"
  4282. "\n"
  4283. "<278> The scan txt <filename> command reads in a file and sends its content\n"
  4284. "<278> to the screen as if it was sent by a server. After using scan you can\n"
  4285. "<278> use page-up and down to view the file.\n"
  4286. "\n"
  4287. "<278> This command is useful to convert ansi color files to html or viewing\n"
  4288. "<278> raw log files.\n"
  4289. "\n"
  4290. "<278> Actions, highlights, and substitutions will trigger as normal, and it\n"
  4291. "<278> is possible to create an action to execute #scan abort to prematurely\n"
  4292. "<278> stop the scan.\n"
  4293. ,
  4294. "read textin"
  4295. },
  4296. {
  4297. "SCREEN",
  4298. TOKEN_TYPE_COMMAND,
  4299. "<178>Command<278>: #screen <178>{<278>option<178>}<178> {<278>argument<178>}\n"
  4300. "\n"
  4301. "<278> The screen command offers a variety of screen manipulation\n"
  4302. "<278> commands and utilities.\n"
  4303. "\n"
  4304. "<278> <178>#screen blur\n"
  4305. "<278> Move the terminal to the back of the stack.\n"
  4306. "\n"
  4307. "<278> <178>#screen clear [all|scroll region|square] <args>\n"
  4308. "<278> Provide 4 arguments defining the top left and bottom right corner\n"
  4309. "<278> <888> when erasing a square.\n"
  4310. "\n"
  4311. "<278> <178>#screen focus\n"
  4312. "<278> Move the terminal to the front of the stack.\n"
  4313. "\n"
  4314. "<278> <178>#screen fullscreen [on|off]\n"
  4315. "<278> Toggles fullscreen mode when used without an argument.\n"
  4316. "\n"
  4317. "<278> <178>#screen get <option> <var>\n"
  4318. "<278> Get various screen options and save them to <var>. Use #screen\n"
  4319. "<278> get without an argument to see all available options.\n"
  4320. "\n"
  4321. "<278> <178>#screen info\n"
  4322. "<278> Debugging information.\n"
  4323. "\n"
  4324. "<278> <178>#screen inputregion <square> [name]\n"
  4325. "<278> Set the input region. The name argument is optional and can be\n"
  4326. "<278> used to create named RECEIVED INPUT [NAME] events.\n"
  4327. "\n"
  4328. "<278> <178>#screen load <both|label|title>\n"
  4329. "<278> Reload the saved title, label, or both.\n"
  4330. "\n"
  4331. "<278> <178>#screen minimize <on|off>\n"
  4332. "<278> Minimize with on, restore with off.\n"
  4333. "\n"
  4334. "<278> <178>#screen maximize [on|off]\n"
  4335. "<278> Maximize with on, restore with off.\n"
  4336. "\n"
  4337. "<278> <178>#screen move <height> <width>\n"
  4338. "<278> Move the upper left corner of the terminal to pixel coordinate.\n"
  4339. "\n"
  4340. "<278> <178>#screen raise <event>\n"
  4341. "<278> This will raise several screen events with %1 and %2 arguments.\n"
  4342. "\n"
  4343. "<278> <178>#screen refresh\n"
  4344. "<278> Terminal dependant, may do nothing.\n"
  4345. "\n"
  4346. "<278> <178>#screen rescale <height> <width>\n"
  4347. "<278> Resize the screen to the given height and width in pixels.\n"
  4348. "\n"
  4349. "<278> <178>#screen resize <rows> <cols>\n"
  4350. "<278> Resize the screen to the given height and width in characters.\n"
  4351. "\n"
  4352. "<278> <178>#screen save <both|label|title>\n"
  4353. "<278> Save the title, label, or both.\n"
  4354. "\n"
  4355. "<278> <178>#screen scroll <square>\n"
  4356. "<278> Set the scrolling region, changes the split setting.\n"
  4357. "\n"
  4358. "<278> <178>#screen set <both|label|title>\n"
  4359. "<278> Set the title, label, or both. Only title works on Windows.\n"
  4360. "\n"
  4361. "<278> <178>#screen swap\n"
  4362. "<278> Swap the input and scroll region.\n"
  4363. ,
  4364. "bell"
  4365. },
  4366. {
  4367. "SCREEN READER",
  4368. TOKEN_TYPE_STRING,
  4369. "<178>Command<278>: #config <178>{<278>SCREEN READER<178>} {<278>ON|OFF<178>}\n"
  4370. "\n"
  4371. "<278> Screen reader mode is enabled by using #config screen on. One purpose\n"
  4372. "<278> of the screen reader mode is to report to servers that a screen reader\n"
  4373. "<278> is being used by utilizing the MTTS standard. The MTTS specification\n"
  4374. "<278> is available at:\n"
  4375. "\n"
  4376. "<278> https://tintin.mudhalla.net/protocols/mtts\n"
  4377. "\n"
  4378. "<278> With the screen reader mode enabled TinTin++ will try to remove or\n"
  4379. "<278> alter visual elements where possible.\n"
  4380. ,
  4381. "config"
  4382. },
  4383. {
  4384. "SCRIPT",
  4385. TOKEN_TYPE_COMMAND,
  4386. "<178>Command<278>: #script <178>{<278>variable<178>}<178> {<278>shell command<178>}\n"
  4387. "\n"
  4388. "<278> The script command works much like the system command except that it\n"
  4389. "<278> treats the generated echos as commands if no variable is provided.\n"
  4390. "\n"
  4391. "<278> This is useful for running php, perl, ruby, and python scripts. You\n"
  4392. "<278> can run these scripts either from file or from within tintin if the\n"
  4393. "<278> scripting language allows this.\n"
  4394. "\n"
  4395. "<278> If you provide a variable the output of the script is stored as a list.\n"
  4396. "\n"
  4397. "<178>Example<278>: #script {ruby -e 'print \"#show hello world\"'}\n"
  4398. "<178>Example<278>: #script {python -c 'print \"#show hello world\"'}\n"
  4399. "<178>Example<278>: #script {php -r 'echo \"#show hello world\"'}\n"
  4400. "<178>Example<278>: #script {path} {pwd};#show The path is $path[1].\n"
  4401. ,
  4402. "format function local math replace variable"
  4403. },
  4404. {
  4405. "SEND",
  4406. TOKEN_TYPE_COMMAND,
  4407. "<178>Command<278>: #send <178>{<278>text<178>}\n"
  4408. "\n"
  4409. "<278> Sends the text directly to the server, useful if you want to start\n"
  4410. "<278> with an escape code.\n"
  4411. ,
  4412. "textin"
  4413. },
  4414. {
  4415. "SESSION",
  4416. TOKEN_TYPE_COMMAND,
  4417. "<178>Command<278>: #session <178>{<278>name<178>} {<278>host<178>} {<278>port<178>} {<278>file<178>}\n"
  4418. "\n"
  4419. "<278> Starts a telnet session with the given name, host, port, and optional\n"
  4420. "<278> file name. The name can be anything you want, except the name of an\n"
  4421. "<278> already existing session, a number, or the keywords '+' and '-'.\n"
  4422. "\n"
  4423. "<278> If a file name is given the file is only read if the session\n"
  4424. "<278> succesfully connects.\n"
  4425. "\n"
  4426. "<278> Without an argument #session shows the currently defined sessions.\n"
  4427. "\n"
  4428. "<278> If you have more than one session, you can use the following commands:\n"
  4429. "\n"
  4430. "<278> #session {-} Switch to the previous session.\n"
  4431. "<278> #session {+} Switch to the next session.\n"
  4432. "<278> #session {<number>} Switch to the given session. Session 0 is the\n"
  4433. "<278> startup session, +1 the first, +2 the second, and\n"
  4434. "<278> -1 is the last session. Sessions are (currently)\n"
  4435. "<278> sorted in order of creation.\n"
  4436. "<278> #gts Switch to the startup session. The name gts stands\n"
  4437. "<278> for global tintin session.\n"
  4438. "<278> #ats Switch to the active session. The name ats stands\n"
  4439. "<278> for active tintin session.\n"
  4440. "<278> not necessarily the calling session.\n"
  4441. "<278> #{name} Activates to the session with the given name.\n"
  4442. "<278> #{name} {command}: Executes a command with the given session without\n"
  4443. "<278> changing the active session.\n"
  4444. "<278> @<name>{text}: Parse text in the given session, substituting the\n"
  4445. "<278> variables and functions, and print the result in\n"
  4446. "<278> the current active session.\n"
  4447. "\n"
  4448. "<278> The startup session is named 'gts' and can be used for relog scripts.\n"
  4449. "<278> Do keep in mind that tickers do not work in the startup session.\n"
  4450. "\n"
  4451. "<178>Example<278>: #event {SESSION DISCONNECTED} {#gts #delay 10 #ses %0 tintin.net 4321}\n"
  4452. ,
  4453. "all port run sessionname snoop ssl zap"
  4454. },
  4455. {
  4456. "SESSIONNAME",
  4457. TOKEN_TYPE_STRING,
  4458. "<178>Syntax<278>: #[sessionname] <178>{<278>commands<178>}\n"
  4459. "\n"
  4460. "<278> You can create multiple sessions with the #session command. By default\n"
  4461. "<278> only one session is active, meaning commands you input are executed in\n"
  4462. "<278> the active session. While all sessions receive output, only output sent\n"
  4463. "<278> to the active session is displayed.\n"
  4464. "\n"
  4465. "<278> When you create a session with the #session command you must specify a\n"
  4466. "<278> session name, the session name, prepended with a hashtag, can be used\n"
  4467. "<278> to activate the session when used without an argument. If an argument\n"
  4468. "<278> is given it will be executed by that session as a command, the session\n"
  4469. "<278> will not be activated.\n"
  4470. "\n"
  4471. "<178>Example<278>: #ses one tintin.net 23;#ses two tintin.net 23;#one;#two grin\n"
  4472. "\n"
  4473. "<278> This will create two sessions, the session that was created last (two\n"
  4474. "<278> in this case) will be automatically activated upon creation. Using\n"
  4475. "<278> #one, session one is activated. Using #two grin, the grin social will\n"
  4476. "<278> be executed by session two, session one will remain the active session.\n"
  4477. "\n"
  4478. "<278> If you send a variable to another session it will be substituted before\n"
  4479. "<278> being passed. If you want the variable value of the receiving session\n"
  4480. "<278> to be used you need to use '$${variable}' to properly escape it.\n"
  4481. "\n"
  4482. "<178>Syntax<278>: @[sessionname]<178>{<278>substitution<178>}\n"
  4483. "\n"
  4484. "<278> If you want to pull the value of a variable from another session you\n"
  4485. "<278> can do so in a similar way as you would use a #function call. Using\n"
  4486. "<278> #showme {@two{$test}} in session one would print the value of $test,\n"
  4487. "<278> as defined by session two.\n"
  4488. ,
  4489. "suspend"
  4490. },
  4491. {
  4492. "SHOWME",
  4493. TOKEN_TYPE_COMMAND,
  4494. "<178>Command<278>: #show <178>{<278>string<178>} {<278>row<178>} <178>{<278>col<178>}\n"
  4495. "\n"
  4496. "<278> Display the string to the terminal, do not send to the server. Useful\n"
  4497. "<278> for status, warnings, etc. The {row} and col number are optional and\n"
  4498. "<278> work the same way as the row number of the #prompt trigger.\n"
  4499. "\n"
  4500. "<278> Actions can be triggered by the show command. If you want to avoid\n"
  4501. "<278> this from happening use: #line ignore #show {<string>}.\n"
  4502. "\n"
  4503. "<178>Example<278>: #tick {TICK} {#delay 50 #show 10 SECONDS TO TICK!!!} {60}\n"
  4504. "\n"
  4505. "<178>Comment<278>: The #prompt helpfile contains more information on using the\n"
  4506. "<278> option {row} and {col} arguments.\n"
  4507. ,
  4508. "buffer draw echo grep prompt"
  4509. },
  4510. {
  4511. "SNOOP",
  4512. TOKEN_TYPE_COMMAND,
  4513. "<178>Command<278>: #snoop <178>{<278>session name<178>} <178>{<278>on<178>|<278>off<178>|<278>scroll<178>}\n"
  4514. "\n"
  4515. "<278> If there are multiple sessions active, this command allows you to\n"
  4516. "<278> monitor what is going on in the sessions that are not currently active.\n"
  4517. "<278> The line of text from other sessions will be prefixed by the session's\n"
  4518. "<278> name.\n"
  4519. "\n"
  4520. "<278> You can toggle off snoop mode by executing #snoop a second time.\n"
  4521. "\n"
  4522. "<278> By using the scroll argument you will snoop the session's scroll\n"
  4523. "<278> region which will overwrite the display of whichever session is active.\n"
  4524. "<278> You can change the size and location of a session's scroll region by\n"
  4525. "<278> using the #split and #screen scrollregion commands.\n"
  4526. ,
  4527. "all port run session sessionname ssl zap"
  4528. },
  4529. {
  4530. "SPEEDWALK",
  4531. TOKEN_TYPE_STRING,
  4532. "<128> SPEEDWALK V1\n"
  4533. "\n"
  4534. "<278> Speedwalking allows you to enter multiple directions without using\n"
  4535. "<278> semicolons. Directions should be prefixed with a number and will be\n"
  4536. "<278> executed the given number of times.\n"
  4537. "\n"
  4538. "<278> You can enable speedwalking with #CONFIG {SPEEDWALK} {ON}.\n"
  4539. "\n"
  4540. "<178>Example<278>: Without speedwalk, you have to type:\n"
  4541. "<278> <178>s;s;w;w;w;w;w;s;s;s;w;w;w;n;n;w\n"
  4542. "<278> With speedwalk, you only have to type:\n"
  4543. "<278> <178>2s5w3s3w2nw\n"
  4544. "\n"
  4545. "<278> <128>SPEEDWALK V2\n"
  4546. "\n"
  4547. "<278> Modern MUDs have increasingly adopted the use of diagonal exits, like\n"
  4548. "<278> ne, nw, sw, and se. To make accomodations for this the #map and #path\n"
  4549. "<278> command no longer interpret nesw as a speedwalk and require this to\n"
  4550. "<278> be written as 1n1e1s1w, which then allows 2ne2e to execute ne;ne;e;e.\n"
  4551. "\n"
  4552. "<278> Speedwalks entered on the input line continue to use the v1 system.\n"
  4553. "\n"
  4554. "<278> The #path load command is backward compatible with v1 speedwalks and\n"
  4555. "<278> to load v2 speedwalks the #path unzip command needs to be used, unless\n"
  4556. "<278> the speedwalk was saved using #path save in which case a v2 compatible\n"
  4557. "<278> format is used that can also contain timing data.\n"
  4558. "\n"
  4559. "<178>Example<278>: #path unzip 3n1e2nw\n"
  4560. "<178>Example<278>: #map move 3ne1d\n",
  4561. "keypad mapping repeat"
  4562. },
  4563. {
  4564. "SPLIT",
  4565. TOKEN_TYPE_COMMAND,
  4566. "<178>Command<278>: #split <178>{<278>top bar<178>} {<278>bottom bar<178>} {<278>left bar<178>} {<278>right bar<178>} {<278>input bar<178>}\n"
  4567. "\n"
  4568. "<278> This option requires for your terminal to support VT100 emulation.\n"
  4569. "\n"
  4570. "<278> #split allows the creation of a top status bar, a left and right status\n"
  4571. "<278> bar, a scrolling region, a bottom status bar, and an input line.\n"
  4572. "\n"
  4573. "<278> <268>╭<268>──────<268>─<268>──────────────────<268>───────╮\n"
  4574. "<278> <268>│<178> <178> <178> top bar <268> │\n"
  4575. "<278> <268>├<268>──────<268>┬<268>──────────────────<268>┬──────┤\n"
  4576. "<278> <268>│<178> left <268>│<178> scrolling <268>│<178> right<268>│\n"
  4577. "<278> <268>│<178> bar <268>│<178> region <268>│<178> bar <268>│\n"
  4578. "<278> <268>├<268>──────<268>┴<268>──────────────────<268>┴──────┤\n"
  4579. "<278> <268>│<178> <178> <178> bottom bar <268> │\n"
  4580. "<278> <268>├<268>──────<268>─<268>──────────────────<268>───────┤\n"
  4581. "<278> <268>│<178> <178> <178> input bar <268> │\n"
  4582. "<278> <268>╰<268>──────<268>─<268>──────────────────<268>───────╯\n"
  4583. "\n"
  4584. "<278> By default the bottom status bar is filled with dashes --- and\n"
  4585. "<278> subsequently it is also known as the split line. The scrolling\n"
  4586. "<278> region is also known as the main screen and this is where all\n"
  4587. "<278> incoming text is displayed by default.\n"
  4588. "\n"
  4589. "<278> If you use #split without an argument it will set the height of the\n"
  4590. "<278> top status bar to 0 lines and the bottom status bar to 1 line.\n"
  4591. "\n"
  4592. "<278> If you use #split with one argument it will set the height of the top\n"
  4593. "<278> status bar to the given number of lines and the bottom status bar will\n"
  4594. "<278> be set to 1 line.\n"
  4595. "\n"
  4596. "<278> If you use two arguments the first argument is the height of the top\n"
  4597. "<278> status bar and the second argument the height of the bottom status bar.\n"
  4598. "\n"
  4599. "<278> The third and fourth argument are optional and default to 0.\n"
  4600. "\n"
  4601. "<278> The fifth argument is optional and sets the size of the input bar, it\n"
  4602. "<278> defaults to 1.\n"
  4603. "\n"
  4604. "<278> It is possible to use negative arguments in which case the bar width\n"
  4605. "<278> defines the minimum width of the scrolling region.\n"
  4606. "\n"
  4607. "<178>Example<278>: #split 0 0\n"
  4608. "<278> This will create a split screen with just a scrolling region and an\n"
  4609. "<278> input line. Great for the minimalist.\n"
  4610. "\n"
  4611. "<178>Example<278>: #split 1 1 0 -80\n"
  4612. "<278> This will create a split screen with a single line top and bottom\n"
  4613. "<278> bar. The left bar has a width of 0 while the right bar will be of\n"
  4614. "<278> variable width. If for example the screen is 100 columns wide, 80\n"
  4615. "<278> columns will be used for the scrolling region, leaving a right bar\n"
  4616. "<278> with a width of 20 columns.\n"
  4617. "\n"
  4618. "<278> To avoid displaying problems it's suggesed to use #prompt to capture\n"
  4619. "<278> the prompt sent by the MUD.\n"
  4620. "\n"
  4621. "<178>Comment<278>: You can display text on the split line(s) with the #prompt and\n"
  4622. "<278> #show {line} {row} commands.\n"
  4623. "\n"
  4624. "<178>Comment<278>: You can remove split mode with the #unsplit command.\n"
  4625. ,
  4626. "echo prompt showme"
  4627. },
  4628. {
  4629. "SSL",
  4630. TOKEN_TYPE_COMMAND,
  4631. "<178>Command<278>: #ssl <178>{<278>name<178>} {<278>host<178>} {<278>port<178>} {<278>file<178>}\n"
  4632. "\n"
  4633. "<278> Starts a secure socket telnet session with the given name, host, port,\n"
  4634. "<278> and optional file name.\n"
  4635. ,
  4636. "all port run sessionname snoop ssl zap"
  4637. },
  4638. {
  4639. "STATEMENTS",
  4640. TOKEN_TYPE_STRING,
  4641. "\n"
  4642. "<278> TinTin++ knows the following statements.\n"
  4643. "\n"
  4644. "<278> #break\n"
  4645. "<278> #case {value} {true}\n"
  4646. "<278> #continue\n"
  4647. "<278> #default {commands}\n"
  4648. "<278> #else {commands}\n"
  4649. "<278> #elseif {expression} {true}\n"
  4650. "<278> #foreach {list} {variable} {commands}\n"
  4651. "<278> #if {expression} {true}\n"
  4652. "<278> #loop {min} {max} {variable} {commands}\n"
  4653. "<278> #match {regex} {commands}\n"
  4654. "<278> #parse {string} {variable} {commands}\n"
  4655. "<278> #return {value}\n"
  4656. "<278> #switch {expression} {commands}\n"
  4657. "<278> #while {expression} {commands}\n"
  4658. ,
  4659. "mathematics pcre repeat"
  4660. },
  4661. {
  4662. "SUBSTITUTE",
  4663. TOKEN_TYPE_CONFIG,
  4664. "<178>Command<278>: #substitute <178>{<278>text<178>} {<278>new text<178>} {<278>priority<178>}\n"
  4665. "\n"
  4666. "<278> Allows you to replace text from the server with the new text.\n"
  4667. "\n"
  4668. "<278> The %1-%99 variables can be used to capture text and use it as part of\n"
  4669. "<278> the new output.\n"
  4670. "\n"
  4671. "<278> Color codes can be used to color the new text, to restore the color to\n"
  4672. "<278> that of the original line the <<888>900> color code can be used.\n"
  4673. "\n"
  4674. "<278> If only one argument is given, all active substitutions that match the\n"
  4675. "<278> argument are displayed. Wildcards can be used, see '#help regex' for\n"
  4676. "<278> additional information on that subject.\n"
  4677. "\n"
  4678. "<278> If no argument is given, all subs are displayed.\n"
  4679. "\n"
  4680. "<178>Example<278>: #sub {Zoe} {ZOE}\n"
  4681. "<278> Any instance of Zoe will be replaced with ZOE.\n"
  4682. "\n"
  4683. "<178>Example<278>: #sub {~\\e[0;34m} {\\e[1;34m}\n"
  4684. "<278> Replace generic dark blue color codes with bright blue ones.\n"
  4685. "\n"
  4686. "<178>Example<278>: #sub {%1massacres%2} {<<888>018>%1<<888>118>MASSACRES<<888>018>%2}\n"
  4687. "<278> Replace a line containing 'massacres' with 'MASSACRES' in red.\n"
  4688. "\n"
  4689. "<178>Comment<278>: See '#help action', for more information about triggers.\n"
  4690. "\n"
  4691. "<178>Comment<278>: See '#help colors', for more information.\n"
  4692. "\n"
  4693. "<178>Comment<278>: You can remove a substitution with the #unsubstitute command.\n"
  4694. ,
  4695. "action gag highlight prompt"
  4696. },
  4697. {
  4698. "SUBSTITUTIONS",
  4699. TOKEN_TYPE_STRING,
  4700. "<278> TinTin++ will perform various types of substitions as detailed below.\n"
  4701. "\n"
  4702. "<128> Variables\n"
  4703. "\n"
  4704. "<178>$ & * @<278> All variable and function names must begin with an alphabetic\n"
  4705. "<278> character, followed by any combination of alphanumeric characters and\n"
  4706. "<278> underscores.\n"
  4707. "\n"
  4708. "<178>$<278> The dollar sign is used to retrieve the value of a variable.\n"
  4709. "\n"
  4710. "<178>&<278> The ampersand sign is used to retrieve the index of a variable.\n"
  4711. "\n"
  4712. "<178>*<278> The astrix sign is used to retrieve the name of a variable.\n"
  4713. "\n"
  4714. "<178>@<278> The at sign is used for functions.\n"
  4715. "\n"
  4716. "<178>[ ]<278> Brackets are used for nested variables which function as an\n"
  4717. "<278> associative array. Associative arrays are also known as tables and\n"
  4718. "<278> maps. Regex can be used within brackets to match multiple variables.\n"
  4719. "\n"
  4720. "<178>+ -<278> The plus and minus signs are used to access variables by their index,\n"
  4721. "<278> with the first variable having index +1, and the last variable\n"
  4722. "<278> having index -1. Variables are ordered alphanumerically.\n"
  4723. "\n"
  4724. "<278> All variables and functions can be escaped by doubling the sign,\n"
  4725. "<278> like $$variable_name or @@function_name. To escape a variable\n"
  4726. "<278> twice use $$$var_name. One escape is removed each time tintin\n"
  4727. "<278> needs to substitute a variable or function.\n"
  4728. "\n"
  4729. "<128> Arguments\n"
  4730. "\n"
  4731. "<178>\%0 - \%99<278> The percent sign followed by a number is used for arguments by the\n"
  4732. "<278> following triggers:\n"
  4733. "\n"
  4734. "<278> alias, action, button, event, function, prompt, and substitute.\n"
  4735. "\n"
  4736. "<178>&0 - &99<278> The ampersand sign followed by a number is used for arguments in the\n"
  4737. "<278> regex and replace commands.\n"
  4738. "\n"
  4739. "<278> All trigger and command arguments can be escaped by doubling the\n"
  4740. "<278> sign like \%\%1 or &&1. One escape is removed each time tintin\n"
  4741. "<278> substitutes trigger or command arguments. To escape three times\n"
  4742. "<278> triple the sign like \%\%\%1, etc.\n"
  4743. "\n"
  4744. "<128> Colors\n"
  4745. "\n"
  4746. "<178><<888>000><278> Three alphanumeric characters encapsulated by the less- and greater-\n"
  4747. "<278> than signs are used for 4 and 8 bit color codes.\n"
  4748. "\n"
  4749. "<178><<888>0000><278> Either a B (background) or F (foreground) followed by three\n"
  4750. "<278> hexadecimal characters encapsulated by < > signs are used for 12\n"
  4751. "<278> bit color codes. Requires truecolor capable terminal.\n"
  4752. "\n"
  4753. "<178><<888>0000000><278> Either a B (background) or F (foreground) followed by six\n"
  4754. "<278> hexadecimal characters encapsulated by < > signs are used for 24\n"
  4755. "<278> bit color codes. Requires truecolor capable terminal.\n"
  4756. "\n"
  4757. "<278> More information is available at #help color.\n"
  4758. "\n"
  4759. "<128> Escapes\n"
  4760. "\n"
  4761. "<178>\\ <278> The back slash is used to escape a character. All available options\n"
  4762. "<278> are listed at #help escape. Escapes are typically escaped when text\n"
  4763. "<278> leaves the client, by being sent to a server, the shell, being\n"
  4764. "<278> displayed on the screen, or being processed as part of a regex.\n"
  4765. "<278> Escapes try to mimic escapes in PCRE when possible.\n"
  4766. ,
  4767. "characters colors escape_codes pcre",
  4768. },
  4769. {
  4770. "SUSPEND",
  4771. TOKEN_TYPE_STRING,
  4772. "<178>Command<278>: #cursor suspend\n"
  4773. "\n"
  4774. "<278> Temporarily suspends tintin and returns you to your shell. To\n"
  4775. "<278> return to tintin, type 'fg' at the shell prompt.\n"
  4776. "\n"
  4777. "<278> While suspended your tintin sessions will freeze. To keep a\n"
  4778. "<278> suspended session running use the #daemon command.\n"
  4779. ,
  4780. "sessionname"
  4781. },
  4782. {
  4783. "SWITCH",
  4784. TOKEN_TYPE_STATEMENT,
  4785. "<178>Command<278>: #switch <178>{<278>conditional<178>} {<278>arguments<178>}\n"
  4786. "\n"
  4787. "<278> The switch command works similar to the switch statement in other\n"
  4788. "<278> languages. When the 'switch' command is encountered its body is parsed\n"
  4789. "<278> and each 'case' command found will be compared to the conditional\n"
  4790. "<278> argument of the switch and executed if there is a match.\n"
  4791. "\n"
  4792. "<278> When comparing strings both the switch and case arguments must be\n"
  4793. "<278> enclosed in quote characters.\n"
  4794. "\n"
  4795. "<278> If the 'default' command is found and no 'case' statement has been\n"
  4796. "<278> matched the default command's argument is executed.\n"
  4797. "\n"
  4798. "<178>Example<278>: #switch {1d4} {#case 1 cackle;#case 2 smile;#default giggle}\n"
  4799. ,
  4800. "statements"
  4801. },
  4802. {
  4803. "SYSTEM",
  4804. TOKEN_TYPE_COMMAND,
  4805. "<178>Command<278>: #system <178>{<278>command<178>}\n"
  4806. "\n"
  4807. "<278> Executes the command specified as a shell command.\n"
  4808. ,
  4809. "detach script run"
  4810. },
  4811. {
  4812. "TAB",
  4813. TOKEN_TYPE_CONFIG,
  4814. "<178>Command<278>: #tab <178>{<278>word<178>}\n"
  4815. "\n"
  4816. "<278> Adds a word to the tab completion list, alphabetically sorted.\n"
  4817. "\n"
  4818. "<278> If no tabs are defined tintin will use the scrollback buffer for auto\n"
  4819. "<278> tab completion.\n"
  4820. "\n"
  4821. "<278> Tabbing behavior can be modified with the #cursor tab command which\n"
  4822. "<278> by default is bound to the tab key.\n"
  4823. "\n"
  4824. "<178>Example<278>: #macro \\t #cursor tab list scrollback caseless forward\n"
  4825. "\n"
  4826. "<178>Comment<278>: You can remove a tab with the #untab command.\n"
  4827. ,
  4828. "alias cursor history keypad macro speedwalk"
  4829. },
  4830. {
  4831. "TEXTIN",
  4832. TOKEN_TYPE_COMMAND,
  4833. "<178>Command<278>: #textin <178>{<278>filename<178>} {<278>delay<178>}\n"
  4834. "\n"
  4835. "<278> Textin allows the user to read in a file, and send its contents\n"
  4836. "<278> directly to the server. Useful for doing online creation, or message\n"
  4837. "<278> writing.\n"
  4838. "\n"
  4839. "<278> The delay is in seconds and takes a floating point number which is\n"
  4840. "<278> cumulatively applied to each outgoing line.\n"
  4841. ,
  4842. "scan send"
  4843. },
  4844. {
  4845. "TICKER",
  4846. TOKEN_TYPE_CONFIG,
  4847. "<178>Command<278>: #ticker <178>{<278>name<178>} {<278>commands<178>} {<278>interval in seconds<178>}\n"
  4848. "\n"
  4849. "<278> Executes given command every # of seconds. Floating point precision\n"
  4850. "<278> for the interval is allowed. A ticker cannot fire more often than\n"
  4851. "<278> 10 times per second.\n"
  4852. "\n"
  4853. "<178>Comment<278>: Tickers don't work in the startup session.\n"
  4854. "\n"
  4855. "<178>Comment<278>: You can remove a ticker with the #unticker command.\n"
  4856. ,
  4857. "delay event"
  4858. },
  4859. {
  4860. "TIME",
  4861. TOKEN_TYPE_STRING,
  4862. "<178>Command<278>: #format <178>{<278>variable<178>} {<278>%t<178>} {<278>argument<178>}\n"
  4863. "\n"
  4864. "<278> The %t format specifier of the #format command allows printing dates\n"
  4865. "<278> using the strftime() format specifiers. By default the time stamp used\n"
  4866. "<278> is the current time, if you want to print a past or future date use:\n"
  4867. "\n"
  4868. "<178>Command<278>: #format <178>{<278>variable<178>} {<278>%t<178>} {{<278>argument<178>} <178>{<278>epoch time<178>}}\n"
  4869. "\n"
  4870. "<278> The current epoch time value is obtained using #format {time} {%T}.\n"
  4871. "\n"
  4872. "<278> When using %t the argument should contain strftime format specifiers.\n"
  4873. "<278> Below are some common specifiers, see man strftime for the full list.\n"
  4874. "\n"
  4875. "<278> %a Abbreviated name of the day of the week (mon ... sun).\n"
  4876. "<278> %A Full name of the day of the week. (Monday ... Sunday)\n"
  4877. "<278> %b Abbreviated name of the month (Jan ... Dec)\n"
  4878. "<278> %B Full name of the month. (January ... December)\n"
  4879. "<278> %C 2 digit numeric century. (19 ... 20)\n"
  4880. "<278> %d 2 digit numeric day of the month (01 ... 31)\n"
  4881. "<278> %H 2 digit numeric 24-hour clock hour. (00 ... 23)\n"
  4882. "<278> %I 2 digit numeric 12-hour clock hour. (01 ... 12)\n"
  4883. "<278> %j 3 digit numeric day of the year (001 ... 366)\n"
  4884. "<278> %m 2 digit numeric month of the year (01 ... 12)\n"
  4885. "<278> %M 2 digit numeric minute of the hour (00 ... 59)\n"
  4886. "<278> %p Abbreviated 12 hour clock period (AM ... PM)\n"
  4887. "<278> %P Abbreviated 12 hour clock period (am ... pm)\n"
  4888. "<278> %S 2 digit numeric second of the minute (00 ...59\n"
  4889. "<278> %u 1 digit numeric day of the week (1 ... 7)\n"
  4890. "<278> %U 2 digit numeric Sunday week of the year (00 ... 53\n"
  4891. "<278> %w 1 digit numeric day of the week (0 ... 6)\n"
  4892. "<278> %W 2 digit numeric Monday week of the year (00 ... 53\n"
  4893. "<278> %y 2 digit numeric year. (70 ... 38)\n"
  4894. "<278> %Y 4 digit numeric year. (1970 ... 2038)\n"
  4895. "<278> %z 5 digit timezone offset. (-1200 ... +1400)\n"
  4896. "<278> %Z Abbreviated name of the time zone. (CET, GMT, etc)\n"
  4897. ,
  4898. "echo event format"
  4899. },
  4900. {
  4901. "TRIGGERS",
  4902. TOKEN_TYPE_STRING,
  4903. "<278> All available triggers in TinTin++ are displayed when you use the #info\n"
  4904. "<278> command without an argument. All of them are written to file when you\n"
  4905. "<278> use the #write command, except commands, histories, and paths.\n"
  4906. "\n"
  4907. "<278> Triggers can be disabled with the #ignore command. The #message\n"
  4908. "<278> command can be used to disable messages generated or related to the\n"
  4909. "<278> corresponding trigger, though this is generally not needed.\n"
  4910. "\n"
  4911. "<278> The #debug command will generate useful debugging information for the\n"
  4912. "<278> corresponding trigger when enabled. The #info command can be used on\n"
  4913. "<278> triggers to generate additional information that might be of use.\n"
  4914. "\n"
  4915. "<178>Example<278>: #info event on\n"
  4916. "\n"
  4917. "<278> When #info event is set to on you will see when most events are raised.\n"
  4918. "<278> Since this can get rather spammy some of the events won't generate\n"
  4919. "<278> messages, unless you have an event in the same category set already.\n"
  4920. "\n"
  4921. "<128> Text triggers\n"
  4922. "\n"
  4923. "<278> When a block of text arrives from the host it is split into individual\n"
  4924. "<278> lines, and all action, prompt, gag, substitute, and highlight triggers\n"
  4925. "<278> are checked for each line. Only one action can trigger per line, while\n"
  4926. "<278> the other triggers can trigger multiple times.\n"
  4927. "\n"
  4928. "<128> Packet fragmentation\n"
  4929. "\n"
  4930. "<278> MUDs that send long blurbs of text, don't have MCCP support, have a bad\n"
  4931. "<278> connection, or a combination of all three, will deliver broken packets.\n"
  4932. "<278> This can cause triggers to not fire, as well as displaying problems if\n"
  4933. "<278> #split is enabled.\n"
  4934. "\n"
  4935. "<278> To mitigate this you can use <178>#config packet_patch 0.5<278>.\n"
  4936. "\n"
  4937. "<278> TinTin++ will automatically enable packet patching if the IAC GA or IAC\n"
  4938. "<278> EOR telnet sequences are used to mark the end of the prompt. A MUD can\n"
  4939. "<278> negotiate the EOR option: https://tintin.mudhalla.net/protocols/eor\n"
  4940. "\n"
  4941. "<278> In addition #prompt can be used to make packet patching less noticable.\n"
  4942. "\n"
  4943. "<128> Color triggers\n"
  4944. "\n"
  4945. "<278> By default most color, control, and vt100 codes are stripped from\n"
  4946. "<278> incoming text before being ran through the trigger engine. To create\n"
  4947. "<278> a trigger that runs on the unstripped text, the regular expression in\n"
  4948. "<278> the trigger should start with a ~.\n"
  4949. "\n"
  4950. "<278> To view control codes you can use <178>#config convert_meta on<278> which will\n"
  4951. "<278> translate both input and output codes to PCRE escape sequences.\n"
  4952. "\n"
  4953. "<128> Multi-line triggers\n"
  4954. "\n"
  4955. "<278> If an action or substitution contains the \\n sequence it will be\n"
  4956. "<278> turned into a multi-line trigger. A multi-line trigger is executed on\n"
  4957. "<278> incoming blocks of text from the MUD, and they will not trigger if the\n"
  4958. "<278> regular expression spans more than one block. You can visualize\n"
  4959. "<278> incoming blocks by using the following event:\n"
  4960. "\n"
  4961. "<278> #event {RECEIVED OUTPUT} {#echo <<888>058>%+80h BLOCK}\n"
  4962. "\n"
  4963. "<278> Since the %* expression does not capture the \\n sequence it is required\n"
  4964. "<278> to use %a to capture multiple lines. To capture the start of the block\n"
  4965. "<278> use \\A and for the end use \\Z. You can use ^ and $ to capture the\n"
  4966. "<278> start and end of a line.\n"
  4967. "\n"
  4968. "<278> Multi-line triggers trigger before regular triggers. Multiple\n"
  4969. "<278> multi-line actions can trigger per block, and each multi-line action\n"
  4970. "<278> can trigger multiple times per block. Packet fragmentation is not\n"
  4971. "<278> currently handled.\n"
  4972. "\n"
  4973. "<278> Multi-line triggers are experimental and subject to change.\n"
  4974. "\n"
  4975. "<128> Input triggers\n"
  4976. "\n"
  4977. "<278> The alias, history and pathdir triggers are checked for each line of\n"
  4978. "<278> input. The macro and tab triggers are checked for key presses.\n"
  4979. "\n"
  4980. "<128> Time triggers\n"
  4981. "\n"
  4982. "<278> The delay, path, and ticker triggers will execute at a set timed\n"
  4983. "<278> interval.\n"
  4984. "\n"
  4985. "<128> Substitution triggers\n"
  4986. "\n"
  4987. "<278> The function and variable triggers will generally execute right\n"
  4988. "<278> before the final processing of a line of text.\n"
  4989. "\n"
  4990. "<128> Mouse triggers\n"
  4991. "\n"
  4992. "<278> The button trigger is checked for each mouse input. #config mouse\n"
  4993. "<278> must be set to on to enable mouse tracking.\n"
  4994. "\n"
  4995. "<128> Event triggers\n"
  4996. "\n"
  4997. "<278> Events can be used for a wide variety of pre-defined triggers.\n"
  4998. ,
  4999. "pcre substitutions escape_codes"
  5000. },
  5001. {
  5002. "VARIABLE",
  5003. TOKEN_TYPE_CONFIG,
  5004. "<178>Command<278>: #variable <178>{<278>variable name<178>} {<278>text to fill variable<178>}\n"
  5005. "\n"
  5006. "<278> Variables differ from the %0-99 arguments in the fact that you can\n"
  5007. "<278> specify a full word as a variable, and they stay in memory for the\n"
  5008. "<278> full session unless they are changed. They can be saved in the\n"
  5009. "<278> coms file, and can be set to different values if you have two or\n"
  5010. "<278> more sessions running at the same time. Variables are global for\n"
  5011. "<278> each session and can be accessed by adding a $ before the variable\n"
  5012. "<278> name.\n"
  5013. "\n"
  5014. "<178>Example<278>: #alias {target} {#var target %0}\n"
  5015. "<278> #alias {x} {kick $target}\n"
  5016. "\n"
  5017. "<278> The name of a variable must exist of only letters, numbers and\n"
  5018. "<278> underscores in order to be substituted. If you do not meet these\n"
  5019. "<278> requirements do not panic, simply encapsulate the variable in braces:\n"
  5020. "\n"
  5021. "<178>Example<278>: #variable {cool website} {https://tintin.mudhalla.net}\n"
  5022. "<278> #chat I was on ${cool website} yesterday!.\n"
  5023. "\n"
  5024. "<278> Variables can be escaped by adding additional $ signs.\n"
  5025. "\n"
  5026. "<178>Example<278>: #var test 42;#showme $$test\n"
  5027. "\n"
  5028. "<278> Variables can be nested using brackets:\n"
  5029. "\n"
  5030. "<178>Example<278>: #var hp[self] 34;#var hp[target] 46\n"
  5031. "\n"
  5032. "<278> You can see the first nest of a variable using $variable[+1] and the\n"
  5033. "<278> last nest using $variable[-1]. Using $variable[-2] will report the\n"
  5034. "<278> second last variable, and so on. To show all indices use *variable[].\n"
  5035. "<278> To show all values use $variable[]. To show all values from index 2\n"
  5036. "<278> through 4 use $variable[+2..4].\n"
  5037. "\n"
  5038. "<278> Nested variables are also known as tables, table generally being used\n"
  5039. "<278> to refer to several variables nested within one specific variable.\n"
  5040. "\n"
  5041. "<278> It's possible to use regular expressions.\n"
  5042. "\n"
  5043. "<178>Example<278>: #show {Targets starting with the letter A: $targets[A%*]\n"
  5044. "\n"
  5045. "<278> To disable using regular expressions start the match with '='.\n"
  5046. "\n"
  5047. "<178>Example<278>: #show {A target literally defined as A%*: $targets[=A%*]\n"
  5048. "\n"
  5049. "<278> To see the internal index of a variable use &<variable name>. To see\n"
  5050. "<278> the size of a table you would use: &targets[] or &targets[%*]. A non\n"
  5051. "<278> existent nested variable will report itself as 0.\n"
  5052. "\n"
  5053. "<178>Example<278>: #show {Number of targets starting with A: &targets[A%*]\n"
  5054. "\n"
  5055. "<278> In some scripts you need to know the name of a nested variable. This\n"
  5056. "<278> is also known as the key, and you can get it using *variable. For\n"
  5057. "<278> example *target[+1]. To get the first variable's name use *{+1}.\n"
  5058. "\n"
  5059. "<278> It's also possible to declare a table using brace notation. Using\n"
  5060. "<278> #var hp[self] 34 is the equivalent of #var {hp} {{self}{34}}. This\n"
  5061. "<278> also allows merging tables. #var hp[self] 34;#var hp[target] 46 is\n"
  5062. "<278> the equivalent of #var {hp} {{self}{34} {target}{46}} as well as\n"
  5063. "<278> #var {hp} {{self}{34}} {{target}{46}} or if you want to get creative\n"
  5064. "<278> the equivalent of #var hp[self] 34;#var {hp} {$hp} {{target}{46}}.\n"
  5065. "\n"
  5066. "<178>Comment<278>: You can remove a variable with the #unvariable command.\n"
  5067. ,
  5068. "cat format function local math replace script"
  5069. },
  5070. {
  5071. "WHILE",
  5072. TOKEN_TYPE_STATEMENT,
  5073. "<178>Command<278>: #while <178>{<278>conditional<178>} {<278>commands<178>}\n"
  5074. "\n"
  5075. "<278> This command works similar to a 'while' statement in other languages.\n"
  5076. "\n"
  5077. "<278> When a 'while' command is encourated, the conditional is evaluated,\n"
  5078. "<278> and if TRUE (any non-zero result) the commands are executed. The\n"
  5079. "<278> 'while' loop will be repeated indefinitely until the conditional is\n"
  5080. "<278> FALSE or the #BREAK or #RETURN commands are found.\n"
  5081. "\n"
  5082. "<278> The 'while' statement is only evaluated if it is read, so you must\n"
  5083. "<278> nest it inside a trigger, like an alias or action.\n"
  5084. "\n"
  5085. "<278> The conditional is evaluated exactly the same as in the 'math' command.\n"
  5086. "\n"
  5087. "<178>Example<278>: #math cnt 0;#while {$cnt < 20} {#math cnt $cnt + 1;say $cnt}\n"
  5088. "\n"
  5089. "<178>Comment<278>: See '#help math', for more information.\n"
  5090. ,
  5091. "statements"
  5092. },
  5093. {
  5094. "WRITE",
  5095. TOKEN_TYPE_COMMAND,
  5096. "<178>Command<278>: #write <178>{<278><filename><178>} {<278>[FORCE]<178>}\n"
  5097. "\n"
  5098. "<278> Writes all current actions, aliases, subs, highlights, and variables\n"
  5099. "<278> to a command file, specified by filename.\n"
  5100. "\n"
  5101. "<278> By default you cannot write to .map files to prevent accidentally\n"
  5102. "<278> overwriting a map file. Use the FORCE argument to ignore this\n"
  5103. "<278> protection.\n"
  5104. ,
  5105. "log read scan textin"
  5106. },
  5107. {
  5108. "ZAP",
  5109. TOKEN_TYPE_COMMAND,
  5110. "<178>Command<278>: #zap {[session]}\n"
  5111. "\n"
  5112. "<278> Kill your current session. If there is no current session, it will\n"
  5113. "<278> cause the program to terminate. If you provide an argument it'll zap\n"
  5114. "<278> the given session instead.\n"
  5115. ,
  5116. "all port run session sessionname snoop ssl"
  5117. },
  5118. {
  5119. "",
  5120. TOKEN_TYPE_COMMAND,
  5121. ""
  5122. ,
  5123. ""
  5124. }
  5125. };
  5126. size_t help_size()
  5127. {
  5128. return sizeof(help_table) / sizeof(help_table[0]) - 1;
  5129. }