help.txt 190 KB

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