tutorial.html 124 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv='content-type' content='text/html; charset=utf-8'>
  5. <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  6. <style type='text/css'>
  7. body {font-family:Consolas;font-size:12pt}
  8. a {text-decoration:none}
  9. a:link {color:#06b}
  10. a:visited {color:#6b0}
  11. a:hover {text-decoration:underline}
  12. a:active {color:#b06}
  13. </style>
  14. <body bgcolor='#000000'>
  15. </head>
  16. <pre>
  17. <span style='background-color:#000'><span style='color:#FFF'>
  18. </span><span style='color:#FF5'> ╭──────────────────────────────────────────────────────────────────────╮
  19. │ <a href='index.html'>Home</a> │
  20. ╰──────────────────────────────────────────────────────────────────────╯
  21. <a href='#INDEX'>INDEX </a> <a href='#GREETING'>GREETING </a> <a href='#MSDP'>MSDP </a> <a href='#STATEMENTS'>STATEMENTS </a>
  22. <a href='#INTRODUCTION'>INTRODUCTION </a> <a href='#KEYPAD'>KEYPAD </a> <a href='#MSLP'>MSLP </a> <a href='#SUBSTITUTIONS'>SUBSTITUTIONS </a>
  23. <a href='#CHARACTERS'>CHARACTERS </a> <a href='#LISTS'>LISTS </a> <a href='#PCRE'>PCRE </a> <a href='#SUSPEND'>SUSPEND </a>
  24. <a href='#COLORS'>COLORS </a> <a href='#MAPPING'>MAPPING </a> <a href='#REPEAT'>REPEAT </a> <a href='#TIME'>TIME </a>
  25. <a href='#COORDINATES'>COORDINATES </a> <a href='#MATHEMATICS'>MATHEMATICS </a> <a href='#SCREEN_READER'>SCREEN READER </a> <a href='#TRIGGERS'>TRIGGERS </a>
  26. <a href='#EDITING'>EDITING </a> <a href='#METRIC_SYSTEM'>METRIC SYSTEM </a> <a href='#SESSIONNAME'>SESSIONNAME </a>
  27. <a href='#ESCAPE_CODES'>ESCAPE CODES </a> <a href='#MOUSE'>MOUSE </a> <a href='#SPEEDWALK'>SPEEDWALK </a>
  28. <a name='INDEX'></a>
  29. INDEX
  30. </span><span style='color:#08F'> ████████┐██████┐███┐ ██┐████████┐██████┐███┐ ██┐
  31. └──██┌──┘└─██┌─┘████┐ ██│└──██┌──┘└─██┌─┘████┐ ██│
  32. ██│ ██│ ██┌██┐ ██│ ██│ ██│ ██┌██┐ ██│
  33. ██│ ██│ ██│└██┐██│ ██│ ██│ ██│└██┐██│
  34. ██│ ██████┐██│ └████│ ██│ ██████┐██│ └████│
  35. └─┘ └─────┘└─┘ └───┘ └─┘ └─────┘└─┘ └───┘
  36. ██┐ ██┐
  37. ██│ ██│
  38. ████████┐████████┐
  39. └──██┌──┘└──██┌──┘
  40. ██│ ██│
  41. └─┘ └─┘
  42. </span><span style='color:#AAA'> </span><span style='color:#08F'>(</span><span style='color:#06B'>T</span><span style='color:#08F'>)</span><span style='color:#06B'>he K</span><span style='color:#08F'>(</span><span style='color:#06B'>I</span><span style='color:#08F'>)</span><span style='color:#06B'>cki</span><span style='color:#08F'>(</span><span style='color:#06B'>N</span><span style='color:#08F'>)</span><span style='color:#06B'> </span><span style='color:#08F'>(</span><span style='color:#06B'>T)ickin D</span><span style='color:#08F'>(</span><span style='color:#06B'>I</span><span style='color:#08F'>)</span><span style='color:#06B'>kumud Clie</span><span style='color:#08F'>(</span><span style='color:#06B'>N</span><span style='color:#08F'>)</span><span style='color:#06B'>t
  43. </span><span style='color:#AAA'> </span><span style='color:#5F5'>What is TinTin++?
  44. </span><span style='color:#AAA'> TinTin++ is a client program specialized to help playing muds. This is
  45. a souped up version of TINTIN III with many new features.
  46. </span><span style='color:#5F5'>Giving Credit Where Credit is Due
  47. </span><span style='color:#AAA'> None of this work would be possible, without the work done by Peter
  48. Unold. He was the author of TINTIN III, the base of TinTin++. Hats off
  49. to ya Peter. You started the ball rolling.
  50. </span><span style='color:#5F5'>Introduction
  51. </span><span style='color:#AAA'> If you're new to TinTin++ a good place to start is the introduction,
  52. which should be linked below.
  53. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#INTRODUCTION'>introduction</a>
  54. <a name='INTRODUCTION'></a>
  55. </span><span style='color:#FF5'> INTRODUCTION
  56. </span><span style='color:#AAA'> On this page you'll find an introduction to using TinTin++. Additional
  57. information can be found in the individual help sections.
  58. </span><span style='color:#5F5'>Starting and Ending
  59. </span><span style='color:#AAA'> The syntax for starting TinTin++ is: ./tt++ [command file]
  60. Read more about the command file in the files section below. Remember
  61. one thing though. All actions, aliases, substitutions, etc, defined
  62. when starting up TinTin++ are inherited by all sessions.
  63. If you want to exit TinTin++ type '#end' or press ctrl-d on an empty
  64. line.
  65. For the WinTin++ users, if you want to paste text use shift-insert,
  66. text is automatically copied upon selection. This is typical Linux
  67. behavior, but it can take some getting used to.
  68. </span><span style='color:#5F5'>Basic features
  69. </span><span style='color:#AAA'> I'll start by explaining some of the very basic and important features:
  70. All TinTin++ commands starts with a '#'.
  71. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #help -- #help is a client command, and isn't send to the server.
  72. All TinTin++ commands can be abbreviated when typed.
  73. #he -- Typing #he is the same as typing #help though it's suggested to
  74. use at least 3 letter abbreviations just in case another command is
  75. added that starts with 'he'.
  76. All commands can be separated with a ';'.
  77. n;l dragon;s;say Dan Dare is back! -- do these 4 commands
  78. There are 3 ways ';'s can be overruled.
  79. &bsol;say Hello ;) -- Lines starting with a '&bsol;' aren't parsed by TinTin++.
  80. say Hello &bsol;;) -- The escape character can escape 1 letter.
  81. #config verbatim on -- Everything is sent as is except '#' commands.
  82. </span><span style='color:#5F5'>Connecting to a server
  83. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #session </span><span style='color:#FFF'>{</span><span style='color:#AAA'>session name</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>server address</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>port</span><span style='color:#FFF'>}
  84. Example</span><span style='color:#AAA'>: #session someone tintin.sourceforge.net 4321
  85. You can have more than one session, in which case you can switch
  86. between sessions typing #&lt;session name&gt;.
  87. You can get a list of all sessions by typing: #session. The current
  88. active session is marked with (active). Snooped sessions with
  89. (snooped). MCCP sessions (compression) with (mccp 2) and (mccp 3).
  90. </span><span style='color:#5F5'>Split
  91. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #split
  92. The split command will create a separated input and output area.
  93. Using the #prompt command you can capture the prompt and place it on
  94. the split line. To get rid of the split interface you can use #unsplit
  95. which will restore the terminal settings to default.
  96. </span><span style='color:#5F5'>Alias
  97. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #alias </span><span style='color:#FFF'>{</span><span style='color:#AAA'>name</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>commands</span><span style='color:#FFF'>}
  98. </span><span style='color:#AAA'> The syntax of the #alias command is almost like alias in csh.
  99. Use this command to define aliases. The variables %0, %1.. %9 contain
  100. the arguments to the aliased command as follows:
  101. the %0 variable contains all the arguments.
  102. the %1 variable contains the 1st argument
  103. ....
  104. the %9 variable contains the 9th argument
  105. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #alias greet say Greetings, most honorable %1
  106. If you want an alias to execute more commands, you must use braces.
  107. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #alias ws </span><span style='color:#FFF'>{</span><span style='color:#AAA'>wake;stand</span><span style='color:#FFF'>}
  108. </span><span style='color:#AAA'> To delete an alias use the #unalias command.
  109. WARNING! TinTin++ doesn't baby sit, and hence does not check for
  110. recursive aliases! You can avoid recursion by escaping the entire
  111. line.
  112. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #alias put &bsol;put %1 in %2
  113. Or by using the send command.
  114. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #alias put #send put %1 in %2
  115. </span><span style='color:#5F5'> Action
  116. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #action </span><span style='color:#FFF'>{</span><span style='color:#AAA'>action-text</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>commands</span><span style='color:#FFF'>}
  117. </span><span style='color:#AAA'> Use this command to define an action to take place when a particular
  118. text appears on your screen. There are 99 variables you can use as
  119. wildcards in the action-text.
  120. These variables are %1, %2, %3 .... %9, %10, %11 ... %97, %98, %99.
  121. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #action </span><span style='color:#FFF'>{</span><span style='color:#AAA'>You are hungry</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>get bread bag;eat bread</span><span style='color:#FFF'>}
  122. Example</span><span style='color:#AAA'>: #action </span><span style='color:#FFF'>{</span><span style='color:#AAA'>%1 has arrived.</span><span style='color:#FFF'>}</span><span style='color:#AAA'> shake %1 -- shake hands with people arriving.
  123. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #action </span><span style='color:#FFF'>{</span><span style='color:#AAA'>%1 tells you '%2'</span><span style='color:#FFF'>}
  124. </span><span style='color:#AAA'> </span><span style='color:#FFF'>{</span><span style='color:#AAA'>tell bob %1 told me '%2'</span><span style='color:#FFF'>}</span><span style='color:#AAA'> -- forward tells.
  125. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #action </span><span style='color:#FFF'>{</span><span style='color:#AAA'>tells you</span><span style='color:#FFF'>}</span><span style='color:#AAA'> #bell -- beep on tell.
  126. You can have TinTin++ ignore actions if you type '#ignore actions on'.
  127. You can see what commands TinTin++ executes when an action triggers
  128. by typing '#debug actions on'.
  129. You can remove actions with the #unaction command.
  130. </span><span style='color:#5F5'>Command files
  131. </span><span style='color:#AAA'> When you order TinTin++ to read a command file, it parses all the text
  132. in the file. You can use command files to keep aliases/actions in,
  133. login to a server (name, password etc..) and basically all kinds of
  134. commands.
  135. You can make the command files with either a text editor (suggested),
  136. or use the #write command to write out a file.
  137. Commands for files:
  138. #read filename -- read and execute the file.
  139. #write filename -- write all actions/aliases/substitutes/etc known for
  140. the current session to a file.
  141. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>:
  142. #session x mymud.com 1234
  143. myname
  144. mypassword
  145. #split
  146. #action {^You are hungry.} {eat bread}
  147. If you save the above five lines to a file named 'mymud.tin' you can
  148. use 'tt++ mymud.tin' to start tintin and execute the file, connecting
  149. you to your mud, logging in, enabling split mode, and setting an action
  150. to eat a bread whenever you go hungry.
  151. </span><span style='color:#5F5'>Highlight
  152. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #highlight </span><span style='color:#FFF'>{</span><span style='color:#AAA'>text</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>color</span><span style='color:#FFF'>}
  153. </span><span style='color:#AAA'> This command works a bit like #action. The purpose of this command is
  154. to substitute text from the server with color you provide. This command
  155. is a simplified version of the #substitute command.
  156. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #high </span><span style='color:#FFF'>{</span><span style='color:#AAA'>Snowy</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>light yellow</span><span style='color:#FFF'>}
  157. Example</span><span style='color:#AAA'>: #high </span><span style='color:#FFF'>{</span><span style='color:#AAA'>%*Snowy%*</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>light yellow</span><span style='color:#FFF'>}
  158. </span><span style='color:#AAA'> Use #unhigh to delete highlights.
  159. </span><span style='color:#5F5'> Speedwalk
  160. </span><span style='color:#AAA'> If you type a command consisting ONLY of letters and numbers n, e, s,
  161. w, u, d - then this command can be interpreted as a serie of movement
  162. commands.
  163. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: ssw2n -- go south, south, west, north, north
  164. If you have problems with typing some commands that actually ONLY
  165. consists of these letters, then type them in CAPS. For example when
  166. checking the NEWS or when asked to enter NEW as your name.
  167. You must enable speedwalking with: #config speedwalk on.
  168. </span><span style='color:#5F5'>Ticker
  169. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #ticker </span><span style='color:#FFF'>{</span><span style='color:#AAA'>name</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>commands</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>seconds</span><span style='color:#FFF'>}
  170. </span><span style='color:#AAA'> The name can be whatever you want it to be, and is only required for
  171. the unticker command. The commands will be executed every x amount of
  172. seconds, which is specified in the interval part.
  173. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #tick </span><span style='color:#FFF'>{</span><span style='color:#AAA'>tick</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>#delay 50 #show 10 SECONDS TO TICK!;#show TICK!!!</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>60</span><span style='color:#FFF'>}
  174. </span><span style='color:#AAA'> This creates a ticker with the name </span><span style='color:#FFF'>{</span><span style='color:#AAA'>tick</span><span style='color:#FFF'>}</span><span style='color:#AAA'> which will print TICK!!!,
  175. as well as print a warning when the next tick will occure.
  176. You can remove tickers with #untick
  177. </span><span style='color:#5F5'>Repeating Commands
  178. </span><span style='color:#AAA'> You can repeat a command, the syntax is: #number command
  179. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #5 cackle -- if you just killed bob the wizard.
  180. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #10 </span><span style='color:#FFF'>{</span><span style='color:#AAA'>buy bread;put bread bag</span><span style='color:#FFF'>}</span><span style='color:#AAA'> -- repeat these 2 commands 10 times.
  181. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #100 ooc w00t w00t!!!!! -- nochannel yourself.
  182. </span><span style='color:#5F5'>History
  183. </span><span style='color:#AAA'> TinTin++ has a limited subset of the csh history features.
  184. ! -- repeat the last command
  185. !cast -- repeat the last command starting with cast
  186. ctrl-r -- enter the reverse history search mode.
  187. </span><span style='color:#5F5'>Map commands
  188. </span><span style='color:#AAA'> TinTin++ has a powerful highly configurable automapper. Whenever
  189. you type n/ne/e/se/s/sw/w/nw/n/u/d tt++ tries to keep track of your
  190. movement.
  191. Commands for map:
  192. #map create -- create a map.
  193. #map goto 1 -- go to the first room in the map, created by default.
  194. #map map -- display the map.
  195. #map undo -- undo your last map alteration.
  196. #map write &lt;filename&gt; -- save the map to file.
  197. #map read &lt;filename&gt; -- load a map from file.
  198. There are many other map options and it's beyond the scope of this
  199. help section to explain everything there is to know, but I'll give
  200. a set of commands that will get most people started.
  201. #map create
  202. #split 12 1
  203. #map flag unicode on
  204. #map flag vt on
  205. #map goto 1
  206. These commands will create a 12 row vt100 split section at the top of
  207. your screen where a map drawn using unicode characters is displayed.
  208. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #action </span><span style='color:#FFF'>{</span><span style='color:#AAA'>There is no exit in that direction.</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>#map undo</span><span style='color:#FFF'>}
  209. </span><span style='color:#AAA'> The map will be automatically created as you move around.
  210. </span><span style='color:#5F5'>Help
  211. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #help </span><span style='color:#FFF'>{</span><span style='color:#AAA'>subject</span><span style='color:#FFF'>}
  212. </span><span style='color:#AAA'> The help command is your friend and contains the same helpfiles
  213. inside TinTin++ as are available on the website. If you type #help
  214. without an argument you will see the various available help subjects
  215. which try to explain the TinTin++ commands and features in greater
  216. detail. Entries in cyan describe commands, while entries in white
  217. describe various features, often in greater detail.
  218. </span><span style='color:#5F5'>That's all for the introduction, enjoy
  219. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#CHARACTERS'>characters</a>, <a href='#COLORS'>colors</a>, <a href='#COORDINATES'>coordinates</a>, <a href='#EDITING'>editing</a>, <a href='#ESCAPE_CODES'>escape_codes</a>, <a href='#GREETING'>greeting</a>, <a href='#KEYPAD'>keypad</a>, <a href='#LISTS'>lists</a>, <a href='#MAPPING'>mapping</a>, <a href='#MATHEMATICS'>mathematics</a>, <a href='#SCREEN_READER'>screen_reader</a>, <a href='#SESSIONNAME'>sessionname</a>, <a href='#SPEEDWALK'>speedwalk</a>, <a href='#STATEMENTS'>statements</a>, <a href='#SUSPEND'>suspend</a> and <a href='#TIME'>time</a>.
  220. <a name='CHARACTERS'></a>
  221. </span><span style='color:#FF5'> CHARACTERS
  222. </span><span style='color:#AAA'> The following special characters are defined:
  223. </span><span style='color:#FFF'># </span><span style='color:#AAA'>The hashtag is the default character for starting a command and is
  224. subsequently known as the command character or tintin character.
  225. When loading a command file the command character is set to the
  226. first character in the file. The character can also be redefined
  227. using #config.
  228. </span><span style='color:#FFF'>; </span><span style='color:#AAA'>The semi-colon is used as the command separator and can be used to
  229. separate two commands. Multiple commands can be strung together as
  230. well. Trailing semi-colons are ignored when reading a script file
  231. as this is a common error.
  232. </span><span style='color:#FFF'>{ } </span><span style='color:#AAA'>Curly brackets aka braces are used for separating multi word command
  233. arguments, nesting commands, and nesting variables. Braces cannot
  234. easily be escaped and must always be used in pairs.
  235. </span><span style='color:#FFF'>&quot; &quot; </span><span style='color:#AAA'>Quote characters are used for strings in the #math, #if, #switch,
  236. and #case commands. It is however suggested to use a set of braces
  237. { } to define strings instead, particularly when checking strings
  238. that may contain quotes.
  239. </span><span style='color:#FFF'>! </span><span style='color:#AAA'>The exclamation sign is used to repeat commands, see #help history.
  240. The character can be redefined using #config.
  241. </span><span style='color:#FFF'>&bsol; </span><span style='color:#AAA'>An input line starting with a backslash is sent verbatim if you are
  242. connected to a server. This character can be configured with
  243. #config, and is itself sent verbatim when the verbatim config mode
  244. is enabled.
  245. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#COLORS'>colors</a>, <a href='#ESCAPE_CODES'>escape_codes</a>, <a href='help.html#FUNCTION'>function</a>, <a href='#MATHEMATICS'>mathematics</a>, <a href='#PCRE'>pcre</a> and <a href='help.html#VARIABLE'>variable</a>.
  246. <a name='COLORS'></a>
  247. </span><span style='color:#FF5'> COLORS
  248. </span><span style='color:#FFF'>Syntax</span><span style='color:#AAA'>: &lt;xyz&gt; with x, y, z being parameters
  249. Parameter 'x': VT100 code
  250. 0 - Reset all colors and codes to default
  251. 1 - Bold
  252. 2 - Dim
  253. 3 - Italic
  254. 4 - Underscore
  255. 5 - Blink
  256. 7 - Reverse
  257. 8 - Skip (use previous code)
  258. Parameter 'y': Foreground color
  259. Parameter 'z': Background color
  260. 0 - Black 5 - Magenta
  261. 1 - Red 6 - Cyan
  262. 2 - Green 7 - White
  263. 3 - Yellow 8 - Skip
  264. 4 - Blue 9 - Default
  265. For xterm 256 colors support use &lt;aaa&gt; to &lt;fff&gt; for RGB foreground
  266. colors and &lt;AAA&gt; to &lt;FFF&gt; for RGB background colors. For the grayscale
  267. foreground colors use &lt;g00&gt; to &lt;g23&gt;, for grayscale background colors
  268. use &lt;G00&gt; to &lt;G23&gt;.
  269. The tertiary colors are as follows:
  270. &lt;acf&gt; - Azure &lt;afc&gt; - Jade
  271. &lt;caf&gt; - Violet &lt;cfa&gt; - Lime
  272. &lt;fac&gt; - Pink &lt;fca&gt; - Orange
  273. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #show &lt;acf&gt;Azure &lt;afc&gt;Jade &lt;caf&gt;Violet
  274. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #show &lt;cfa&gt;Lime &lt;fac&gt;Pink &lt;fca&gt;Orange
  275. For 12 bit truecolor use &lt;F000&gt; to &lt;FFFF&gt; for foreground colors and
  276. &lt;B000&gt; to &lt;BFFF&gt; for background colors.
  277. For 24 bit truecolor use &lt;F000000&gt; to &lt;FFFFFFF&gt; for foreground
  278. colors and &lt;B000000&gt; to &lt;BFFFFFF&gt; for background colors.
  279. If the color code exceeds your configured color mode it will be
  280. downgraded to the closest match.
  281. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#CHARACTERS'>characters</a>, <a href='#COORDINATES'>coordinates</a>, <a href='#ESCAPE_CODES'>escape_codes</a>, <a href='#MATHEMATICS'>mathematics</a> and <a href='#PCRE'>pcre</a>.
  282. <a name='COORDINATES'></a>
  283. </span><span style='color:#FF5'> COORDINATES
  284. </span><span style='color:#AAA'> When the 0,0 coordinate is in the upper left corner TinTin++ uses
  285. a y,x / row,col notation, starting at 1,1. Subsequently -1,-1
  286. will indicate the bottom right corner. This type of argument is
  287. used by the #showme command.
  288. When the 0,0 coordinate is in the bottom left corner tintin uses
  289. a standard x,y notation. This type of argument is used by the
  290. #map jump command.
  291. The vast majority of tintin commands use y,x / row,col notation,
  292. primarily because that is the notation used by the VT100 standard
  293. used for terminal emulation.
  294. </span><span style='color:#5F5'>Squares
  295. </span><span style='color:#AAA'> A square argument takes 2 coordinates. The first coordinate defines
  296. the upper left corner, the last coordinate defines the bottom
  297. right corner. The upper left corner of the terminal is defined as
  298. 1,1 and the bottom right corner as -1,-1. This type of argument is
  299. used by #draw, #button and #map offset.
  300. </span><span style='color:#5F5'>Panes
  301. </span><span style='color:#AAA'> A pane argument takes 4 size values, which are: top pane, bottom
  302. pane, left pane, right pane. When a negative value is provided the
  303. size is the maximum size, minus the value. This type of argument
  304. is used by the #split command.
  305. </span><span style='color:#5F5'>Ranges
  306. </span><span style='color:#AAA'> A range argument takes 2 values known as the upper bound and lower
  307. bound. The upper bound (first value) defines the start of the
  308. range, the lower bound (second value) the end. The first index of
  309. a range is defined as 1. When a negative value is provides the last
  310. index is defined as -1. This type of argument is used by #buffer
  311. and #variable.
  312. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#CHARACTERS'>characters</a>, <a href='#COLORS'>colors</a>, <a href='#ESCAPE_CODES'>escape_codes</a>, <a href='#MATHEMATICS'>mathematics</a> and <a href='#PCRE'>pcre</a>.
  313. <a name='EDITING'></a>
  314. </span><span style='color:#FF5'> EDITING
  315. </span><span style='color:#0AA'>┌─────────────────────────┐┌────────────────────────────────────────────┐
  316. │</span><span style='color:#FFF'>alt b </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor backward word </span><span style='color:#0AA'>│
  317. ├─────────────────────────┤├────────────────────────────────────────────┤
  318. │</span><span style='color:#FFF'>alt f </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor forward word </span><span style='color:#0AA'>│
  319. └─────────────────────────┘└────────────────────────────────────────────┘
  320. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  321. │</span><span style='color:#FFF'>ctrl a </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor home </span><span style='color:#0AA'>│
  322. ├─────────────────────────┤├────────────────────────────────────────────┤
  323. │</span><span style='color:#FFF'>ctrl b </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor backward </span><span style='color:#0AA'>│
  324. ├─────────────────────────┤├────────────────────────────────────────────┤
  325. │</span><span style='color:#FFF'>ctrl c </span><span style='color:#0AA'>││</span><span style='color:#FFF'>clear line </span><span style='color:#0AA'>│
  326. ├─────────────────────────┤├────────────────────────────────────────────┤
  327. │</span><span style='color:#FFF'>ctrl d </span><span style='color:#0AA'>││</span><span style='color:#FFF'>delete or exit </span><span style='color:#0AA'>│
  328. ├─────────────────────────┤├────────────────────────────────────────────┤
  329. │</span><span style='color:#FFF'>ctrl e </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor end </span><span style='color:#0AA'>│
  330. ├─────────────────────────┤├────────────────────────────────────────────┤
  331. │</span><span style='color:#FFF'>ctrl f </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor forward </span><span style='color:#0AA'>│
  332. ├─────────────────────────┤├────────────────────────────────────────────┤
  333. │</span><span style='color:#FFF'>ctrl g </span><span style='color:#0AA'>││</span><span style='color:#FFF'> </span><span style='color:#0AA'>│
  334. ├─────────────────────────┤├────────────────────────────────────────────┤
  335. │</span><span style='color:#FFF'>ctrl h </span><span style='color:#0AA'>││</span><span style='color:#FFF'>backspace </span><span style='color:#0AA'>│
  336. ├─────────────────────────┤├────────────────────────────────────────────┤
  337. │</span><span style='color:#FFF'>ctrl i </span><span style='color:#0AA'>││</span><span style='color:#FFF'>tab </span><span style='color:#0AA'>│
  338. ├─────────────────────────┤├────────────────────────────────────────────┤
  339. │</span><span style='color:#FFF'>ctrl j </span><span style='color:#0AA'>││</span><span style='color:#FFF'>enter </span><span style='color:#0AA'>│
  340. ├─────────────────────────┤├────────────────────────────────────────────┤
  341. │</span><span style='color:#FFF'>ctrl k </span><span style='color:#0AA'>││</span><span style='color:#FFF'>clear line right </span><span style='color:#0AA'>│
  342. ├─────────────────────────┤├────────────────────────────────────────────┤
  343. │</span><span style='color:#FFF'>ctrl l </span><span style='color:#0AA'>││</span><span style='color:#FFF'>redraw input </span><span style='color:#0AA'>│
  344. ├─────────────────────────┤├────────────────────────────────────────────┤
  345. │</span><span style='color:#FFF'>ctrl m </span><span style='color:#0AA'>││</span><span style='color:#FFF'>enter </span><span style='color:#0AA'>│
  346. ├─────────────────────────┤├────────────────────────────────────────────┤
  347. │</span><span style='color:#FFF'>ctrl n </span><span style='color:#0AA'>││</span><span style='color:#FFF'>input history next </span><span style='color:#0AA'>│
  348. ├─────────────────────────┤├────────────────────────────────────────────┤
  349. │</span><span style='color:#FFF'>ctrl o </span><span style='color:#0AA'>││</span><span style='color:#FFF'> </span><span style='color:#0AA'>│
  350. ├─────────────────────────┤├────────────────────────────────────────────┤
  351. │</span><span style='color:#FFF'>ctrl p </span><span style='color:#0AA'>││</span><span style='color:#FFF'>input history prev </span><span style='color:#0AA'>│
  352. ├─────────────────────────┤├────────────────────────────────────────────┤
  353. │</span><span style='color:#FFF'>ctrl q </span><span style='color:#0AA'>││</span><span style='color:#FFF'> </span><span style='color:#0AA'>│
  354. ├─────────────────────────┤├────────────────────────────────────────────┤
  355. │</span><span style='color:#FFF'>ctrl r </span><span style='color:#0AA'>││</span><span style='color:#FFF'>input history search </span><span style='color:#0AA'>│
  356. ├─────────────────────────┤├────────────────────────────────────────────┤
  357. │</span><span style='color:#FFF'>ctrl s </span><span style='color:#0AA'>││</span><span style='color:#FFF'> </span><span style='color:#0AA'>│
  358. ├─────────────────────────┤├────────────────────────────────────────────┤
  359. │</span><span style='color:#FFF'>ctrl t </span><span style='color:#0AA'>││</span><span style='color:#FFF'>scroll buffer lock </span><span style='color:#0AA'>│
  360. ├─────────────────────────┤├────────────────────────────────────────────┤
  361. │</span><span style='color:#FFF'>ctrl u </span><span style='color:#0AA'>││</span><span style='color:#FFF'>clear line left </span><span style='color:#0AA'>│
  362. ├─────────────────────────┤├────────────────────────────────────────────┤
  363. │</span><span style='color:#FFF'>ctrl v </span><span style='color:#0AA'>││</span><span style='color:#FFF'>convert meta characters </span><span style='color:#0AA'>│
  364. ├─────────────────────────┤├────────────────────────────────────────────┤
  365. │</span><span style='color:#FFF'>ctrl w </span><span style='color:#0AA'>││</span><span style='color:#FFF'>delete word left </span><span style='color:#0AA'>│
  366. ├─────────────────────────┤├────────────────────────────────────────────┤
  367. │</span><span style='color:#FFF'>ctrl x </span><span style='color:#0AA'>││</span><span style='color:#FFF'> </span><span style='color:#0AA'>│
  368. ├─────────────────────────┤├────────────────────────────────────────────┤
  369. │</span><span style='color:#FFF'>ctrl y </span><span style='color:#0AA'>││</span><span style='color:#FFF'>paste </span><span style='color:#0AA'>│
  370. ├─────────────────────────┤├────────────────────────────────────────────┤
  371. │</span><span style='color:#FFF'>ctrl z </span><span style='color:#0AA'>││</span><span style='color:#FFF'>suspend </span><span style='color:#0AA'>│
  372. └─────────────────────────┘└────────────────────────────────────────────┘
  373. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  374. │</span><span style='color:#FFF'>arrow left </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor left </span><span style='color:#0AA'>│
  375. ├─────────────────────────┤├────────────────────────────────────────────┤
  376. │</span><span style='color:#FFF'>arrow right </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor right </span><span style='color:#0AA'>│
  377. ├─────────────────────────┤├────────────────────────────────────────────┤
  378. │</span><span style='color:#FFF'>arrow up </span><span style='color:#0AA'>││</span><span style='color:#FFF'>previous input line </span><span style='color:#0AA'>│
  379. ├─────────────────────────┤├────────────────────────────────────────────┤
  380. │</span><span style='color:#FFF'>arrow down </span><span style='color:#0AA'>││</span><span style='color:#FFF'>next input line </span><span style='color:#0AA'>│
  381. └─────────────────────────┘└────────────────────────────────────────────┘
  382. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  383. │</span><span style='color:#FFF'>ctrl arrow left </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor left word </span><span style='color:#0AA'>│
  384. ├─────────────────────────┤├────────────────────────────────────────────┤
  385. │</span><span style='color:#FFF'>ctrl arrow right </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor right word </span><span style='color:#0AA'>│
  386. └─────────────────────────┘└────────────────────────────────────────────┘
  387. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  388. │</span><span style='color:#FFF'>backspace </span><span style='color:#0AA'>││</span><span style='color:#FFF'>backspace </span><span style='color:#0AA'>│
  389. ├─────────────────────────┤├────────────────────────────────────────────┤
  390. │</span><span style='color:#FFF'>alt backspace </span><span style='color:#0AA'>││</span><span style='color:#FFF'>clear line left </span><span style='color:#0AA'>│
  391. ├─────────────────────────┤├────────────────────────────────────────────┤
  392. │</span><span style='color:#FFF'>ctrl backspace </span><span style='color:#0AA'>││</span><span style='color:#FFF'>clear line </span><span style='color:#0AA'>│
  393. └─────────────────────────┘└────────────────────────────────────────────┘
  394. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  395. │</span><span style='color:#FFF'>delete </span><span style='color:#0AA'>││</span><span style='color:#FFF'>delete </span><span style='color:#0AA'>│
  396. ├─────────────────────────┤├────────────────────────────────────────────┤
  397. │</span><span style='color:#FFF'>ctrl delete </span><span style='color:#0AA'>││</span><span style='color:#FFF'>delete word right </span><span style='color:#0AA'>│
  398. └─────────────────────────┘└────────────────────────────────────────────┘
  399. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  400. │</span><span style='color:#FFF'>end </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor end </span><span style='color:#0AA'>│
  401. ├─────────────────────────┤├────────────────────────────────────────────┤
  402. │</span><span style='color:#FFF'>ctrl end </span><span style='color:#0AA'>││</span><span style='color:#FFF'>scroll buffer end </span><span style='color:#0AA'>│
  403. └─────────────────────────┘└────────────────────────────────────────────┘
  404. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  405. │</span><span style='color:#FFF'>enter </span><span style='color:#0AA'>││</span><span style='color:#FFF'>enter </span><span style='color:#0AA'>│
  406. ├─────────────────────────┤├────────────────────────────────────────────┤
  407. │</span><span style='color:#FFF'>shift-enter </span><span style='color:#0AA'>││</span><span style='color:#FFF'>soft enter </span><span style='color:#0AA'>│
  408. └─────────────────────────┘└────────────────────────────────────────────┘
  409. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  410. │</span><span style='color:#FFF'>home </span><span style='color:#0AA'>││</span><span style='color:#FFF'>cursor home </span><span style='color:#0AA'>│
  411. ├─────────────────────────┤├────────────────────────────────────────────┤
  412. │</span><span style='color:#FFF'>ctrl home </span><span style='color:#0AA'>││</span><span style='color:#FFF'>scroll buffer home </span><span style='color:#0AA'>│
  413. └─────────────────────────┘└────────────────────────────────────────────┘
  414. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  415. │</span><span style='color:#FFF'>page up </span><span style='color:#0AA'>││</span><span style='color:#FFF'>scroll buffer up </span><span style='color:#0AA'>│
  416. ├─────────────────────────┤├────────────────────────────────────────────┤
  417. │</span><span style='color:#FFF'>page down </span><span style='color:#0AA'>││</span><span style='color:#FFF'>scroll buffer down </span><span style='color:#0AA'>│
  418. └─────────────────────────┘└────────────────────────────────────────────┘
  419. ┌─────────────────────────┐┌────────────────────────────────────────────┐
  420. │</span><span style='color:#FFF'>tab </span><span style='color:#0AA'>││</span><span style='color:#FFF'>complete word forward </span><span style='color:#0AA'>│
  421. ├─────────────────────────┤├────────────────────────────────────────────┤
  422. │</span><span style='color:#FFF'>shift-tab </span><span style='color:#0AA'>││</span><span style='color:#FFF'>complete word backward </span><span style='color:#0AA'>│
  423. └─────────────────────────┘└────────────────────────────────────────────┘
  424. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#CURSOR'>cursor</a>, <a href='help.html#EDIT'>edit</a> and <a href='help.html#MACRO'>macro</a>.
  425. <a name='ESCAPE_CODES'></a>
  426. </span><span style='color:#FF5'> ESCAPE CODES
  427. </span><span style='color:#AAA'> You may use the escape character &bsol; for various special characters.
  428. &bsol;a beep the terminal.
  429. &bsol;c send a control character, &bsol;ca for ctrl-a.
  430. &bsol;e start an escape sequence.
  431. &bsol;f send a form feed.
  432. &bsol;n send a line feed.
  433. &bsol;r send a carriage return.
  434. &bsol;t send a horizontal tab.
  435. &bsol;x print an 8 bit character using hexadecimal, &bsol;xFF for example.
  436. &bsol;x7B send the '{' character.
  437. &bsol;x7D send the '}' character.
  438. &bsol;u print a 16 bit unicode character, &bsol;uFFFD for example.
  439. &bsol;u{} print a 8-21 bit unicode character, &bsol;u{2AF21} for example.
  440. &bsol;U print a 21 bit unicode character, &bsol;U02AF21 for example.
  441. &bsol;v send a vertical tab
  442. Ending a line with &bsol; will stop tintin from appending a line feed.
  443. To escape arguments in an alias or action use %%0 %%1 %%2 etc.
  444. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#CHARACTERS'>characters</a>, <a href='#COLORS'>colors</a>, <a href='#COORDINATES'>coordinates</a>, <a href='#MATHEMATICS'>mathematics</a> and <a href='#PCRE'>pcre</a>.
  445. <a name='GREETING'></a>
  446. </span><span style='color:#FF5'> GREETING
  447. </span><span style='color:#0AA'> ####################################################################
  448. #</span><span style='color:#AAA'> </span><span style='color:#0AA'>#
  449. #</span><span style='color:#AAA'> T I N T I N + + 2.02.40 </span><span style='color:#0AA'>#
  450. #</span><span style='color:#AAA'> </span><span style='color:#0AA'>#
  451. #</span><span style='color:#AAA'> Code by Peter Unold, Bill Reis, and Igor van den Hoven </span><span style='color:#0AA'>#
  452. #</span><span style='color:#AAA'> </span><span style='color:#0AA'>#
  453. ####################################################################
  454. <a name='KEYPAD'></a>
  455. </span><span style='color:#FF5'> KEYPAD
  456. </span><span style='color:#AAA'> When TinTin++ starts up it sends &bsol;e= to the terminal to enable the
  457. terminal's application keypad mode, which can be disabled using #show {&bsol;e&gt;}
  458. </span><span style='color:#FFF'> Configuration A Configuration B Configuration C
  459. </span><span style='color:#0AA'> ╭─────┬─────┬─────┬─────╮ ╭─────┬─────┬─────┬─────╮ ╭─────┬─────┬─────┬─────╮
  460. │</span><span style='color:#FFF'>num</span><span style='color:#0AA'> │</span><span style='color:#FFF'>/</span><span style='color:#0AA'> │</span><span style='color:#FFF'>*</span><span style='color:#0AA'> │</span><span style='color:#FFF'>-</span><span style='color:#0AA'> │ │</span><span style='color:#FFF'>num</span><span style='color:#0AA'> │</span><span style='color:#FFF'>/</span><span style='color:#0AA'> │</span><span style='color:#FFF'>*</span><span style='color:#0AA'> │</span><span style='color:#FFF'>-</span><span style='color:#0AA'> │ │</span><span style='color:#FFF'>Num</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp/</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp*</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp-</span><span style='color:#0AA'> │
  461. ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤
  462. │</span><span style='color:#FFF'>7</span><span style='color:#0AA'> │</span><span style='color:#FFF'>8</span><span style='color:#0AA'> │</span><span style='color:#FFF'>9</span><span style='color:#0AA'> │</span><span style='color:#FFF'>+</span><span style='color:#0AA'> │ │</span><span style='color:#FFF'>Home</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Up</span><span style='color:#0AA'> │</span><span style='color:#FFF'>PgUp</span><span style='color:#0AA'> │</span><span style='color:#FFF'>+</span><span style='color:#0AA'> │ │</span><span style='color:#FFF'>nkp7</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp8</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp9</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp+</span><span style='color:#0AA'> │
  463. ├─────┼─────┼─────┤ │ ├─────┼─────┼─────┤ │ ├─────┼─────┼─────┤ │
  464. │</span><span style='color:#FFF'>4</span><span style='color:#0AA'> │</span><span style='color:#FFF'>5</span><span style='color:#0AA'> │</span><span style='color:#FFF'>6</span><span style='color:#0AA'> │ │ │</span><span style='color:#FFF'>Left</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Cntr</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Right</span><span style='color:#0AA'>│ │ │</span><span style='color:#FFF'>nkp4</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp5</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp6</span><span style='color:#0AA'> │ │
  465. ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤
  466. │</span><span style='color:#FFF'>1</span><span style='color:#0AA'> │</span><span style='color:#FFF'>2</span><span style='color:#0AA'> │</span><span style='color:#FFF'>3</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Enter</span><span style='color:#0AA'>│ │</span><span style='color:#FFF'>End</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Down</span><span style='color:#0AA'> │</span><span style='color:#FFF'>PgDn</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Enter</span><span style='color:#0AA'>│ │</span><span style='color:#FFF'>nkp1</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp2</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp3</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkpEn</span><span style='color:#0AA'>│
  467. ├─────┴─────┼─────┤ │ ├─────┴─────┼─────┤ │ ├─────┴─────┼─────┤ │
  468. │</span><span style='color:#FFF'>0</span><span style='color:#0AA'> │</span><span style='color:#FFF'>.</span><span style='color:#0AA'> │ │ │</span><span style='color:#FFF'>Ins</span><span style='color:#0AA'> │</span><span style='color:#FFF'>Del</span><span style='color:#0AA'> │ │ │</span><span style='color:#FFF'>nkp0</span><span style='color:#0AA'> │</span><span style='color:#FFF'>nkp.</span><span style='color:#0AA'> │ │
  469. ╰───────────┴─────┴─────╯ ╰───────────┴─────┴─────╯ ╰───────────┴─────┴─────╯
  470. </span><span style='color:#AAA'> With keypad mode disabled numlock on will give you configuration A,
  471. and numlock off will give you configuration B. With keypad mode
  472. enabled you'll get configuration C.
  473. </span><span style='color:#FFF'> Terminals that support keypad mode
  474. </span><span style='color:#AAA'> Linux Console, PuTTY, MinTTY, Eterm, aterm.
  475. </span><span style='color:#FFF'> Terminals that do not support keypad mode
  476. </span><span style='color:#AAA'> RXVT on Cygwin, Windows Console, Gnome Terminal, Konsole.
  477. </span><span style='color:#FFF'> Peculiar Terminals
  478. </span><span style='color:#AAA'> RXVT requires turning off numlock to enable configuration C.
  479. Xterm may require disabling Alt/NumLock Modifiers (num-lock) in the
  480. ctrl left-click menu. Or edit ~/.Xresources and add
  481. XTerm*VT100.numLock:false
  482. Mac OS X Terminal requires enabling 'strict vt100 keypad behavior' in
  483. Terminal -&gt; Window Settings -&gt; Emulation.
  484. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#COLORS'>colors</a>, <a href='#COORDINATES'>coordinates</a>, <a href='#ESCAPE_CODES'>escape_codes</a>, <a href='#MATHEMATICS'>mathematics</a> and <a href='#PCRE'>pcre</a>.
  485. <a name='LISTS'></a>
  486. </span><span style='color:#FF5'> LISTS
  487. </span><span style='color:#AAA'> There are several different types of lists in tintin which behave in a
  488. fairly universal manner. To properly explain lists it's easiest to
  489. explain the most basic variable type first before discussing more
  490. complex types.
  491. - Basic variable: The standard key = value variable.
  492. - Simple list: A string that contains semicolon delimited fields.
  493. {a;b;c}. Can be saved as a variable.
  494. - Brace list: A string in which fields are delimited with braces.
  495. {a}{b}{c}. Brace lists cannot be stored as a variable because tables
  496. use braces as well, they must be stored as a simple list instead.
  497. - Table: Think of this as variables nested within another variable. Or
  498. as variables contained within another variable.
  499. - List: A table that uses integers for its indexes. Also known as an
  500. array. The #list command is a utility command for using tables as
  501. arrays.
  502. </span><span style='color:#5F5'> Simple Variables
  503. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>:
  504. #variable {simple} {Hello World!}
  505. #show &dollar;simple
  506. To see if the 'simple' variable exists you can use &amp;{simple} which
  507. will display 0 if the variable does not exist, or the variable's index
  508. if it exists.
  509. If you have multiple variables they are sorted alphabetically and
  510. numerically. While it's not all that relevant for simple variables,
  511. the first variable has index 1, the second variable index 2, and so
  512. on.
  513. Variable names need to start with a letter and only exist of letters,
  514. numbers, and underscores. If you need to use a non standard variable
  515. name this is possible using braces.
  516. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #variable {:)} {Happy Happy!};#show &dollar;{:)}
  517. Variables can be accessed using their index. While primarily useful
  518. for tables it is possible to do this for simple variables. Use +1 for
  519. the first variable, +2 for the second variable, etc. Use -1 for the
  520. last variable, -2 for the second last variable, etc.
  521. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #show The first variable is: *{+1} with value: &dollar;{+1}
  522. </span><span style='color:#5F5'> Removing Variables
  523. </span><span style='color:#AAA'> To remove a variable, use #unvariable or #unvar (every command can be
  524. abbreviated). It's possible to remove multiple variables at once
  525. using #unvar {var 1} {var 2} {etc}
  526. Variables are unique to each session, so if you have multiple
  527. sessions, removing a variable from one session won't remove it from
  528. other sessions.
  529. If you remove a table variable, all variables contained within that
  530. table variable are removed as well.
  531. </span><span style='color:#5F5'> Simple Lists
  532. </span><span style='color:#AAA'> A simple list is a string that contains semicolon delimited fields.
  533. Commands can be entered as simple lists, for example:
  534. #show {a};#show {b} will execute a single line as two commands.
  535. Several commands take a simple list as their input, these are:
  536. #foreach, #line substitute, #path load, #list create, and #highlight.
  537. </span><span style='color:#5F5'> Brace Lists
  538. </span><span style='color:#AAA'> A brace list is a string in which fields are delimited with braces.
  539. Most commands take a brace list for their arguments, for example:
  540. #session {x} {mud.com} {1234} {mud.tin}. The session command takes
  541. 4 arguments, the 4th argument (command file) is optional.
  542. Commands that take a simple list as their input will also accept a
  543. brace list, keep in mind you'll have to embed the brace list in an
  544. extra set of braces, for example: #path load {{n}{s}{w}{w}}, which is
  545. identical to: #path load {n;s;w;w}.
  546. Brace lists cannot be stored as variables because TinTin++ will
  547. confuse them with tables. You can convert a brace list to a table
  548. variable using: #list {bracelist} {create} {{a}{b}{c}} this will look
  549. internally as: {{1}{a}{2}{b}{3}{c}}. You can then convert this table
  550. back to a simple list using: #list {bracelist} {simplify} which will
  551. change it to {a;b;c}.
  552. Braces cannot easily be escaped in TinTin++. Using &bsol;{ or &bsol;} will not
  553. work. The reason for this is due to several factors, but primarily
  554. backward compatibility. To escape braces you must define them using
  555. hexadecimal notation using &bsol;x7B and &bsol;x7D. See #help escape for a list
  556. of escape options, and the help file will also remind you of how to
  557. escape braces.
  558. </span><span style='color:#5F5'> Tables
  559. </span><span style='color:#AAA'> Tables are key/value pairs stored within a variable. Tables are also
  560. known as associative arrays, dictionaries, maps, nested variables,
  561. structures, and probably a couple of other names. There are several
  562. ways to create and access tables.
  563. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #variable {friendlist} {{bob}{bob@mail.com} {bubba}{sunset@gmail.com}}
  564. This will create a friendlist with two entries, the key is the name of
  565. the friend, the value is the email address of the friend. You can see
  566. the email address of bob using: #show {&dollar;friendlist[bob]}. You can
  567. also define this table as following:
  568. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>:
  569. #variable {friendlist[bob]} {bob@mail.com}
  570. #variable {friendlist[bubba]} {sunset@gmail.com}
  571. This would create the exact same table as the single line declaration
  572. used previously. To see the first key in the table use:
  573. *friendlist[+1], to see the first value in the table use:
  574. &dollar;friendlist[+1]. To see the size of the table use &amp;friendlist[]. To
  575. print a bracelist of all friends use *friendlist[], to print a
  576. bracelist of all friends whose name starts with the letter 'a' you
  577. would use: *friendlist[a%*]. Similarly to see the number of friends
  578. you have whose name ends with the letter 'b' you would use:
  579. &amp;friendlist[%*b].
  580. See #help regexp for a brief overview of regular expression options.
  581. While TinTin++ supports PCRE (perl-compatible regular expressions), it
  582. embeds them within its own regular expression syntax that is simpler
  583. and less invasive, while still allowing the full power of PCRE for
  584. those who need it.
  585. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #unvariable {friendlist[bubba]}
  586. This would remove {bubba} from the friendlist. To remove the entire
  587. friendlist you would use: #unvariable {friendlist}.
  588. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #variable {friendlist} {{bob} {{email}{bob@ma.il} {phone}{123456789}}}
  589. There is no limit to the number of nests, simply add more braces. To
  590. see Bob's email in this example you would use:
  591. #show {&dollar;friendlist[bob][email]}.
  592. To merge two tables the #cat command can be used.
  593. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>:
  594. #variable {bli} {{a}{1}{b}{2}}
  595. #variable {blo} {{c}{3}{d}{4}}
  596. #cat {blo} {&dollar;bli}
  597. </span><span style='color:#5F5'> Lists
  598. </span><span style='color:#AAA'> Tables are sorted alphabetically with the exception of numbers which
  599. are sorted numerically. If you want to determine the sorting order
  600. yourself you can use use the #list command which helps you to use
  601. tables as arrays.
  602. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #action {%1 chats %2} {#list chats add {%0}}
  603. Each time a chat is received it's added to the end of the 'chats' list
  604. variable. If you type #variable chats this might look like:
  605. </span><span style='color:#FF5'>#</span><span style='color:#5FF'>VARIABLE </span><span style='color:#A0A'>{</span><span style='color:#FFF'>chats</span><span style='color:#A0A'>}
  606. </span><span style='color:#AAA'> </span><span style='color:#A0A'>{
  607. </span><span style='color:#AAA'> </span><span style='color:#A0A'>{</span><span style='color:#FFF'>1</span><span style='color:#A0A'>} {</span><span style='color:#FFF'>Bubba chats Hi</span><span style='color:#A0A'>}
  608. </span><span style='color:#AAA'> </span><span style='color:#A0A'>{</span><span style='color:#FFF'>2</span><span style='color:#A0A'>} {</span><span style='color:#FFF'>Bob chats Hi bub</span><span style='color:#A0A'>}
  609. </span><span style='color:#AAA'> </span><span style='color:#A0A'>{</span><span style='color:#FFF'>3</span><span style='color:#A0A'>} {</span><span style='color:#FFF'>Bubba chats Bye</span><span style='color:#A0A'>}
  610. </span><span style='color:#AAA'> </span><span style='color:#A0A'>{</span><span style='color:#FFF'>4</span><span style='color:#A0A'>} {</span><span style='color:#FFF'>Bob chats bub bye</span><span style='color:#A0A'>}
  611. </span><span style='color:#AAA'> </span><span style='color:#A0A'>}
  612. </span><span style='color:#5F5'> Parsing
  613. </span><span style='color:#AAA'> There are various ways to parse lists and tables, using either #loop,
  614. #foreach, #while, or #&lt;number&gt;.
  615. #loop takes two numeric arguments, incrementing or decrementing the
  616. first number until it matches the second number. The value of the loop
  617. counter is stored in the provided variable.
  618. #foreach takes either a simple list or a brace list as its first
  619. argument. Foreach will go through each item in the list and store the
  620. value in the provided variable.
  621. #while will perform an if check on the first argument, if the result
  622. is true it will execute the commands in the second argument. Then it
  623. performs an if check on the first argument again. It will continue to
  624. repeat until the if check returns 0 or the loop is interrupted with a
  625. control flow command. It takes special care to avoid infinite loops.
  626. #&lt;number&gt; will execute the provided argument 'number' times. For
  627. example: #4 {#show beep! &bsol;a}
  628. Here are some examples.
  629. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #list friends create {bob;bubba;zorro}
  630. Internally this looks like {{1}{bob}{2}{bubba}{3}{zorro}} and the
  631. list can be parsed in various ways.
  632. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #foreach {&dollar;friends[%*]} {name} {#show &dollar;name}
  633. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #foreach {*friends[%*]} {i} {#show &dollar;friends[&dollar;i]}
  634. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #loop {1} {&amp;friends[]} {i} {#show &dollar;friends[+&dollar;i]}
  635. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #math i 1;#while {&amp;friends[+&dollar;i]} {#show &dollar;friends[+&dollar;i];
  636. #math i &dollar;i + 1}
  637. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #math i 1;#&amp;friends[] {#show &dollar;friends[+&dollar;i];#math i &dollar;i + 1}
  638. Each of the five examples above performs the same task; printing the
  639. three names in the friends list.
  640. If you want to get a better look at what goes on behind the scenes
  641. while executing scripts you can use '#debug all on'. To stop seeing
  642. debug information use '#debug all off'.
  643. </span><span style='color:#5F5'> List Tables
  644. </span><span style='color:#AAA'> List tables are also known as databases and the #list command has
  645. several options to manipulate them.
  646. For these options to work properly all tables need to have identical
  647. keys. Here is an example list table.
  648. #var {friendlist}
  649. {
  650. {1}{{name}{bob} {age}{54}}
  651. {2}{{name}{bubba} {age}{21}}
  652. {3}{{name}{pamela} {age}{36}}
  653. }
  654. To sort the list table by age you would use:
  655. #list friendlist indexate age
  656. #list friendlist order
  657. To remove everyone whose name starts with a 'b' you would use:
  658. #list friendlist indexate name
  659. #list friendlist filter {} {b%*}
  660. The filter option only supports regular expressions. To filter
  661. using mathematics you would loop through the list backwards:
  662. #loop &amp;friendlist[] 1 index
  663. {
  664. #if {&dollar;friendlist[+&dollar;index][age] &lt; 30}
  665. {
  666. #list friendlist delete &dollar;index
  667. }
  668. }
  669. Alternatively you can use the refine option.
  670. #list friendlist indexate age
  671. #list friendlist refine {&amp;0 &gt;= 30}
  672. To add an item to a list table there are two options:
  673. #list friendlist add {{{name}{hobo} {age}{42}}}
  674. #list friendlist insert -1 {{name}{hobo} {age}{42}}
  675. </span><span style='color:#5F5'> Optimization
  676. </span><span style='color:#AAA'> TinTin++ tables are exceptionally fast while they remain under 100
  677. items. Once a table grows beyond 10000 items there can be performance
  678. issues when inserting and removing items in the beginning or middle of
  679. the table.
  680. The plan is to eventually implement an indexable and flexible data
  681. structure for large tables.
  682. If you load a large table from file it's important to make sure it's
  683. sorted, when using #write to save a table it's automatically sorted.
  684. If you notice performance issues on large tables it's relatively easy
  685. to create a hash table.
  686. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>:
  687. #alias {sethash}
  688. {
  689. #format hash %H %1;
  690. #math hash1 &dollar;hash % 100;
  691. #math hash2 &dollar;hash / 100 % 100;
  692. #var hashtable[&dollar;hash1][&dollar;hash2][%1] %2
  693. }
  694. #function {gethash}
  695. {
  696. #format hash %H %1;
  697. #math hash1 &dollar;hash % 100;
  698. #math hash2 &dollar;hash / 100 % 100;
  699. #return &dollar;hashtable[&dollar;hash1][&dollar;hash2][%1]
  700. }
  701. #alias {test}
  702. {
  703. sethash bli hey;
  704. sethash bla hi;
  705. sethash blo hello;
  706. #show The value of bla is: @gethash{bla}
  707. }
  708. The above script will rapidly store and retrieve over 1 million items.
  709. Looping through a hash table is relatively easy as well.
  710. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>:
  711. #alias {showhash}
  712. {
  713. #foreach {*hashtable[%*]} {hash1}
  714. {
  715. #foreach {*hashtable[&dollar;hash1][%*]} {hash2}
  716. {
  717. #echo {%-20s = %s}
  718. {hashtable[&dollar;hash1][&dollar;hash2]}
  719. {&dollar;hashtable[&dollar;hash1][&dollar;hash2]}
  720. }
  721. }
  722. }
  723. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#BREAK'>break</a>, <a href='help.html#CONTINUE'>continue</a>, <a href='help.html#FOREACH'>foreach</a>, <a href='help.html#LOOP'>loop</a>, <a href='help.html#PARSE'>parse</a>, <a href='#REPEAT'>repeat</a>, <a href='help.html#RETURN'>return</a> and <a href='help.html#WHILE'>while</a>.
  724. <a name='MAPPING'></a>
  725. </span><span style='color:#FF5'> MAPPING
  726. </span><span style='color:#AAA'> TinTin++ has a powerful automapper that uses a room system similar to
  727. Diku MUDs which means that odd map layouts and weird exit
  728. configurations aren't a problem. The mapper provides tools to improve
  729. the visual map display. For basic path tracking see #help PATH.
  730. </span><span style='color:#FFF'> #map create [size]
  731. </span><span style='color:#AAA'> This command creates the initial map. The size is 50,000 by default
  732. and can be changed at any time with the #map resize command. If you
  733. play a MUD that uses MSDP or GMCP to provide room numbers you'll have
  734. to increase it to the highest reported room number. Increasing the
  735. size of the map doesn't decrease performance.
  736. </span><span style='color:#FFF'> #map goto &lt;location&gt;
  737. </span><span style='color:#AAA'> When you create the map you are not automatically inside the map. By
  738. default room number (vnum) 1 is created, so you can go to it using
  739. #map goto 1. Once you are inside the map new rooms are automatically
  740. created as you move around. Movement commands are defined with the
  741. pathdir command. By default n, ne, e, se, s, sw, w, nw, u, d are
  742. defined.
  743. </span><span style='color:#FFF'>#map map &lt;rows&gt; &lt;cols&gt; &lt;append|overwrite|list|variable&gt; &lt;name&gt;
  744. </span><span style='color:#AAA'> To see the map you can use #map map. It's annoying to have to
  745. constantly type #map map however. Instead it's possible to use #split
  746. to display a vt100 map. To do so execute:
  747. </span><span style='color:#FFF'>#split 16 1
  748. </span><span style='color:#AAA'> #map flag vtmap on
  749. The first command sets the top split lines to 16 and the bottom split
  750. line to 1. If you want a smaller or larger map display you can use a
  751. different value than 16.
  752. If you don't need to display diagonal exits and prefer a more compact
  753. look you can use #map flag AsciiGraphics off. This will enable the
  754. standard display which uses UTF-8 box drawing characters, results may
  755. vary depending on the font used.
  756. If your terminal supports UTF-8 you can also give #map flag unicode on
  757. a try.
  758. If you want to display the map in a different location of the screen
  759. use something like:
  760. </span><span style='color:#FFF'>#split 0 1 0 -80
  761. </span><span style='color:#AAA'> #map offset 1 81 -4 -1
  762. This will display the map on the right side of the screen, if the
  763. width of the screen is wide enough.
  764. </span><span style='color:#FFF'>#map undo
  765. </span><span style='color:#AAA'> If you accidentally walk into the wall on your MUD the mapper will
  766. still create a new room. You can easily fix this mistake by using
  767. #map undo. If you want to move around on the map without moving around
  768. on the MUD you can use: #map move {direction}. To delete a room
  769. manually you can use: #map delete {direction}. To create a room
  770. manually you can use: #map dig {direction}.
  771. </span><span style='color:#FFF'>#map write &lt;filename&gt;
  772. </span><span style='color:#AAA'> You can save your map using #map write, to load a map you can use
  773. #map read &lt;filename&gt;.
  774. </span><span style='color:#FFF'>#map set &lt;option&gt; &lt;value&gt;
  775. </span><span style='color:#AAA'> You can set the room name using #map set roomname &lt;name&gt;. You either
  776. have to do this manually or create triggers to set the room name
  777. automatically. Once the room name is set you can use #map goto with
  778. the room name to visit it. If there are two rooms with the same name
  779. #map goto will go to the most nearby room. If you want to always go
  780. to the same room you should memorize the room number or create a
  781. landmark.
  782. </span><span style='color:#FFF'>#map landmark firstroom 1
  783. </span><span style='color:#AAA'> You can further narrow down the matches by providing additional
  784. arguments, for example:
  785. </span><span style='color:#FFF'>#map goto {dark alley} {roomexits} {n;e} {roomarea} {Haddock Ville}
  786. </span><span style='color:#AAA'> You can set the room weight using #map set roomweight {value}. The
  787. weight by default is set to 1.0 and it represents the difficulty of
  788. traversing the room. If you have a lake as an alternative route, and
  789. traversing water rooms is 4 times slower than regular rooms, then you
  790. could set the weight of the lake rooms to 4.0. If the lake is 3 rooms
  791. wide the total weight is 12. If walking around the lake has a weight
  792. less than 12 the mapper will go around the lake, if the weight is
  793. greater than 12 the mapper will take a route through the lake.
  794. You can set the room symbol using #map set roomsymbol {value}. The
  795. symbol should be one, two, or three characters, which can be
  796. colorized. You can for example mark shops with an 'S' and colorize the
  797. 'S' depending on what type of shop it is.
  798. </span><span style='color:#FFF'>#map run &lt;location&gt; &lt;delay&gt;
  799. </span><span style='color:#AAA'> The run command will have tintin find the shortest path to the given
  800. location and execute the movement commands to get there. You can
  801. provide a delay in seconds with floating point precision, for example:
  802. </span><span style='color:#FFF'>#map run {dark alley} {0.5}
  803. </span><span style='color:#AAA'> This will make you walk towards the nearest dark alley with 0.5 second
  804. intervals. Typical MUDs accept commands at 0.25 second intervals.
  805. </span><span style='color:#FFF'>#map insert {direction} {flag}
  806. </span><span style='color:#AAA'> The insert command is useful for adding spacer rooms called void rooms.
  807. Often rooms overlap, and by adding void rooms you can stretch out
  808. exits. For example: #map insert north void. You cannot enter void rooms
  809. once they've been created, so you'll have to use #map info in an
  810. adjacent room to find the room vnum, then use #map goto {vnum} to
  811. visit.
  812. It's also possible to align rooms using void rooms. This is easily
  813. done using #map insert north void.
  814. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#MAP'>map</a>, <a href='help.html#PATH'>path</a> and <a href='help.html#PATHDIR'>pathdir</a>.
  815. <a name='MATHEMATICS'></a>
  816. </span><span style='color:#FF5'> MATHEMATICS
  817. </span><span style='color:#AAA'> </span><span style='color:#FFF'>Number operations
  818. </span><span style='color:#AAA'> Operators Priority Function
  819. ------------------------------------------------
  820. ! 0 logical not
  821. ~ 0 bitwise not
  822. * 1 integer multiply
  823. ** 1 integer power
  824. / 1 integer divide
  825. // 1 integer sqrt // 2 or cbrt // 3
  826. % 1 integer modulo
  827. d 1 integer random dice roll
  828. + 2 integer addition
  829. - 2 integer subtraction
  830. &lt;&lt; 3 bitwise shift
  831. &gt;&gt; 3 bitwise shift
  832. &gt; 4 logical greater than
  833. &gt;= 4 logical greater than or equal
  834. &lt; 4 logical less than
  835. &lt;= 4 logical less than or equal
  836. == 5 logical equal
  837. != 5 logical not equal
  838. &amp; 6 bitwise and
  839. ^ 7 bitwise xor
  840. | 8 bitwise or
  841. &amp;&amp; 9 logical and
  842. ^^ 10 logical xor
  843. || 11 logical or
  844. Operator priority can be ignored by using parentheses, for example
  845. (1 + 1) * 2 equals 4, while 1 + 1 * 2 equals 3.
  846. </span><span style='color:#FFF'>String operations
  847. </span><span style='color:#AAA'> Operators Priority Function
  848. ------------------------------------------------
  849. &gt; 4 alphabetical greater than
  850. &gt;= 4 alphabetical greater than or equal
  851. &lt; 4 alphabetical less than
  852. &lt;= 4 alphabetical less than or equal
  853. == 5 alphabetical equal using regex
  854. != 5 alphabetical not equal using regex
  855. === 5 alphabetical equal
  856. !== 5 alphabetical not equal
  857. Strings must be encased in double quotes or braces. The &gt; &gt;= &lt; &lt;=
  858. operators perform basic string comparisons. The == != operators perform
  859. regular expressions, with the argument on the left being the string,
  860. and the argument on the right being the regex. For example
  861. {bla} == {%*a} would evaluate as 1.
  862. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#MATH'>math</a> and <a href='help.html#REGEXP'>regexp</a>.
  863. <a name='METRIC_SYSTEM'></a>
  864. </span><span style='color:#FF5'> METRIC SYSTEM
  865. </span><span style='color:#AAA'> The #math command supports using 1K, 1M, 1m, and 1u to make large and
  866. small number handling a little easier. These are case sensitive. Only
  867. four symbols are supported to keep false positives to a minimum.
  868. </span><span style='color:#0AA'> ╭─────────┬────────┬─────────────────────────────────╮
  869. │</span><span style='color:#FFF'> Name </span><span style='color:#0AA'>│</span><span style='color:#FFF'> Symbol </span><span style='color:#0AA'>│</span><span style='color:#FFF'> Factor</span><span style='color:#0AA'>│
  870. ├─────────┼────────┼─────────────────────────────────┤
  871. │</span><span style='color:#FFF'> Mega </span><span style='color:#0AA'>│</span><span style='color:#FFF'> M </span><span style='color:#0AA'>│</span><span style='color:#FFF'> 1 000 000</span><span style='color:#0AA'>│
  872. │</span><span style='color:#FFF'> Kilo </span><span style='color:#0AA'>│</span><span style='color:#FFF'> K </span><span style='color:#0AA'>│</span><span style='color:#FFF'> 1 000</span><span style='color:#0AA'>│
  873. │</span><span style='color:#FFF'> </span><span style='color:#0AA'>│</span><span style='color:#FFF'> </span><span style='color:#0AA'>│</span><span style='color:#FFF'> </span><span style='color:#0AA'>│
  874. │</span><span style='color:#FFF'> milli </span><span style='color:#0AA'>│</span><span style='color:#FFF'> m </span><span style='color:#0AA'>│</span><span style='color:#FFF'> 0.001</span><span style='color:#0AA'>│
  875. │</span><span style='color:#FFF'> micro </span><span style='color:#0AA'>│</span><span style='color:#FFF'> u </span><span style='color:#0AA'>│</span><span style='color:#FFF'> 0.000 001</span><span style='color:#0AA'>│
  876. ╰─────────┴────────┴─────────────────────────────────╯
  877. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#ECHO'>echo</a>, <a href='help.html#FORMAT'>format</a> and <a href='help.html#MATH'>math</a>.
  878. <a name='MOUSE'></a>
  879. </span><span style='color:#FF5'> MOUSE
  880. </span><span style='color:#AAA'> To enable xterm mouse tracking use #CONFIG MOUSE ON.
  881. To see mouse events as they happen use #CONFIG MOUSE INFO. This
  882. information can then be used to create mouse events with the #event
  883. command and buttons with the #button command.
  884. Visual buttons and pop-ups can be drawn on the screen with the #draw
  885. command.
  886. The input field can be changed and renamed using #screen inputregion,
  887. which allows creating named events for enter handling.
  888. Links can be created using the MSLP protocol which will generate link
  889. specific events when clicked.
  890. In order to copy/paste, most terminals require that you press the shift
  891. key during selection.
  892. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#BUTTON'>button</a>, <a href='help.html#DRAW'>draw</a>, <a href='help.html#EVENT'>event</a> and <a href='#MSLP'>MSLP</a>.
  893. <a name='MSDP'></a>
  894. </span><span style='color:#FF5'> MSDP
  895. </span><span style='color:#AAA'> MSDP (Mud Server Data Protocol) is part of the #port functionality.
  896. See #help event for additional documentation as all MSDP events are
  897. available as regular events.
  898. Available MSDP events can be queried using the MSDP protocol
  899. as described in the specification.
  900. </span><span style='color:#5FF'>https://tintin.sourceforge.io/protocols/msdp
  901. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#EVENT'>event</a> and <a href='help.html#PORT'>port</a>.
  902. <a name='MSLP'></a>
  903. </span><span style='color:#FF5'> MSLP
  904. </span><span style='color:#AAA'> MSLP (Mud Server Link Protocol) requires enabling #config mouse on,
  905. and creating the appropriate LINK events.
  906. The simplest link can be created by surrounding a keyword with the
  907. &bsol;e[4m and &bsol;e[24m tags.
  908. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #substitute {&bsol;b{n|e|s|w|u|d}&bsol;b} {&bsol;e[4m%1&bsol;e[24m}
  909. This would display 'Exits: n, e, w.' as 'Exits: n, e, w.'.
  910. When clicked this would trigger the PRESSED LINK MOUSE BUTTON ONE
  911. event of which %4 will hold the link command and %6 holds the
  912. link name, which in the case of a simple link will be empty.
  913. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #event {PRESSED LINK MOUSE BUTTON ONE} {#send {%4}}
  914. Keep in mind that if you change PRESSED to DOUBLE-CLICKED the link
  915. will only work if the text does not scroll in between clicks.
  916. If you want to create a complex link use an OSC code.
  917. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #sub {&bsol;bsmurf&bsol;b} {&bsol;e]68;1;;say I hate smurfs!&bsol;a&bsol;e[4m%0&bsol;e[24m}
  918. If you have the LINK event of the previous example set, the %4
  919. argument will contain 'say I hate smurfs!'.
  920. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #sub {&bsol;bgoblin&bsol;b} {&bsol;e]68;1;SEND;kill goblin&bsol;a&bsol;e[4m%0&bsol;e[24m}
  921. Notice the previous instance of ;; has been replaced with ;SEND;
  922. which will name the link. This will generate a named event.
  923. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #event {PRESSED LINK SEND MOUSE BUTTON ONE} {#send {%4}}
  924. By naming links you can organize things a little bit better instead
  925. of tunneling everything through the same event.
  926. Keep in mind that the server is allowed to use &bsol;e]68;1;&bsol;a as well,
  927. subsequently various security measures are in place.
  928. To create secure links, which are filtered out when send by a server,
  929. you need to use &bsol;e]68;2;&bsol;a, and they instead trigger the SECURE LINK
  930. event.
  931. To creae a link that is not undelined, use &bsol;e]4;24m text &bsol;e]24m.
  932. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #sub {%* tells %*} {&bsol;e]68;2;EXEC;#cursor set tell %1 &bsol;a&bsol;e[4;24m%0&bsol;e[24m}
  933. </span><span style='color:#FFF'> </span><span style='color:#AAA'> #event {PRESSED SECURE LINK EXEC MOUSE BUTTON ONE} {%4}
  934. This would make you start a reply when clicking on a tell.
  935. </span><span style='color:#FFF'>Website</span><span style='color:#AAA'>: https://tintin.mudhalla.net/protocols/mslp
  936. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#EVENT'>event</a> and <a href='help.html#PORT'>port</a>.
  937. <a name='PCRE'></a>
  938. </span><span style='color:#FF5'> PCRE
  939. </span><span style='color:#AAA'> A regular expression, regex or regexp is a sequence of characters that
  940. defines a search pattern. Since the 1980s, different syntaxes for
  941. writing regular expressions exist, the two most widely used ones being
  942. the POSIX syntax and the similar but more advanced Perl standard.
  943. TinTin++ supports the Perl standard known as PCRE (Perl Compatible
  944. Regular Expressions).
  945. Regular expressions are an integral part of TinTin++, but keep in mind
  946. that tintin doesn't allow you to use regular expressions directly,
  947. instead it uses a simpler intermediate syntax that still allows more
  948. complex expressions when needed.
  949. Commands that utilize regular expressions are: action, alias, elseif,
  950. gag, grep, highlight, if, kill, local, math, prompt, regexp, replace,
  951. substitute, switch, variable and while. Several other commands use
  952. regular expressions in minor ways. Fortunately the basics are very
  953. easy to learn.
  954. </span><span style='color:#5F5'> TinTin++ Regular Expression
  955. </span><span style='color:#AAA'> The following support is available for regular expressions.
  956. </span><span style='color:#FFF'> ^ </span><span style='color:#AAA'>match start of line.
  957. </span><span style='color:#FFF'> &dollar; </span><span style='color:#AAA'>match of end of line.
  958. </span><span style='color:#FFF'> &bsol; </span><span style='color:#AAA'>escape one character.
  959. </span><span style='color:#FFF'> %1-%99 </span><span style='color:#AAA'>match of any text, stored in the corresponding index.
  960. </span><span style='color:#FFF'> %0 </span><span style='color:#AAA'>should be avoided in the regex, contains all matched text.
  961. </span><span style='color:#FFF'> { } </span><span style='color:#AAA'>embed a perl compatible regular expression, matches are stored.
  962. </span><span style='color:#FFF'> %!{ } </span><span style='color:#AAA'>embed a perl compatible regular expression, matches are not stored.
  963. [ ] . + | ( ) ? * are treated as normal text unless used within braces.
  964. Keep in mind that { } is replaced with ( ) automatically unless %!{ }
  965. is used.
  966. </span><span style='color:#FFF'>TinTin++ Description POSIX
  967. %a </span><span style='color:#AAA'>Match zero or more characters including newlines ([^&bsol;0]*?)
  968. </span><span style='color:#FFF'> %A </span><span style='color:#AAA'>Match zero or more newlines ([&bsol;n]*?)
  969. </span><span style='color:#FFF'> %c </span><span style='color:#AAA'>Match zero or more ansi color codes ((?:&bsol;e&bsol;[[0-9;]*m)*?)
  970. </span><span style='color:#FFF'> %d </span><span style='color:#AAA'>Match zero or more digits ([0-9]*?)
  971. </span><span style='color:#FFF'> %D </span><span style='color:#AAA'>Match zero or more non-digits ([^0-9]*?)
  972. </span><span style='color:#FFF'> %i </span><span style='color:#AAA'>Matches become case insensitive (?i)
  973. </span><span style='color:#FFF'> %I </span><span style='color:#AAA'>Matches become case sensitive (default) (?-i)
  974. </span><span style='color:#FFF'> %s </span><span style='color:#AAA'>Match zero or more spaces ([&bsol;r&bsol;n&bsol;t ]*?)
  975. </span><span style='color:#FFF'> %S </span><span style='color:#AAA'>Match zero or more non-spaces ([^&bsol;r&bsol;n&bsol;t ]*?)
  976. </span><span style='color:#FFF'> %w </span><span style='color:#AAA'>Match zero or more word characters ([A-Za-z0-9_]*?)
  977. </span><span style='color:#FFF'> %W </span><span style='color:#AAA'>Match zero or more non-word characters ([^A-Za-z0-9_]*?)
  978. </span><span style='color:#FFF'> %? </span><span style='color:#AAA'>Match zero or one character (.??)
  979. </span><span style='color:#FFF'> %. </span><span style='color:#AAA'>Match one character (.)
  980. </span><span style='color:#FFF'> %+ </span><span style='color:#AAA'>Match one or more characters (.+?)
  981. </span><span style='color:#FFF'> %* </span><span style='color:#AAA'>Match zero or more characters excluding newlines (.*?)
  982. </span><span style='color:#5F5'>Ranges
  983. </span><span style='color:#AAA'> If you want to match 1 digit use %+1d, if you want to match between 3
  984. and 5 spaces use %+3..5s, if you want to match 1 or more word
  985. characters use %+1..w, etc.
  986. </span><span style='color:#5F5'>Variables
  987. </span><span style='color:#AAA'> If you use %1 in an action to perform a match the matched string is
  988. stored in the %1 variable which can be used in the action body.
  989. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%1 says 'Tickle me'} {tickle %1}
  990. If you use %2 the match is stored in %2, etc. If you use an unnumbered
  991. match like %* or %S the match is stored at the last used index
  992. incremented by one.
  993. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%3 says '%*'} {#if {&quot;%4&quot; == &quot;Tickle me&quot;} {tickle %3}}
  994. The maximum variable index is 99. If you begin an action with %* the
  995. match is stored in %1. You should never use %0 in the trigger part of
  996. an action, when used in the body of an action %0 contains all the parts
  997. of the string that were matched.
  998. To prevent a match from being stored use %!*, %!w, etc.
  999. </span><span style='color:#5F5'>Perl Compatible Regular Expressions
  1000. </span><span style='color:#AAA'> You can embed a PCRE (Perl Compatible Regular Expression) using curley
  1001. braces { }, these braces are replaced with parentheses ( ) unless you
  1002. use %!{ }.
  1003. </span><span style='color:#5F5'>Or
  1004. </span><span style='color:#AAA'> You can separate alternatives within a PCRE using the | character.
  1005. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%* raises {his|her|its} eyebrows.} {say 42..}
  1006. </span><span style='color:#5F5'>Brackets
  1007. </span><span style='color:#AAA'> You can group alternatives and ranges within a PCRE using brackets.
  1008. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%* says 'Who is number {[1-9]}?} {say &dollar;number[%2] is number %2}
  1009. The example only triggers if someone provides a number between 1 and
  1010. 9. Any other character will cause the action to not trigger.
  1011. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%* says 'Set password to {[^0-9]*}&dollar;} {say The password must
  1012. contain at least one number, not for security reasons, but just to
  1013. annoy you.} {4}
  1014. When the ^ character is used within brackets it creates an inverse
  1015. search, [^0-9] matches every character except for a number between 0
  1016. and 9.
  1017. </span><span style='color:#5F5'>Quantification
  1018. </span><span style='color:#AAA'> A quantifier placed after a match specifies how often the match is
  1019. allowed to occur.
  1020. </span><span style='color:#FFF'> ? </span><span style='color:#AAA'>repeat zero or one time.
  1021. </span><span style='color:#FFF'> * </span><span style='color:#AAA'>repeat zero or multiple times.
  1022. </span><span style='color:#FFF'> + </span><span style='color:#AAA'>repeat once or multiple times.
  1023. </span><span style='color:#FFF'> {n} </span><span style='color:#AAA'>repeat exactly n times, n must be a number.
  1024. </span><span style='color:#FFF'> {n,} </span><span style='color:#AAA'>repeat at least n times, n must be a number.
  1025. </span><span style='color:#FFF'> {n,o} </span><span style='color:#AAA'>repeat between n and o times, n and o must be a number.
  1026. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%* says 'Who is number {[1-9][0-9]{0,2}}?} {Say &dollar;number[%2] is
  1027. number %2}
  1028. The example only triggers if someone provides a number between 1 and
  1029. 999.
  1030. </span><span style='color:#5F5'>Parantheses
  1031. </span><span style='color:#AAA'> TinTin Regular Expressions automatically add parenthesis, for example
  1032. %* translates to (.*?) in PCRE unless the %* is found at the start or
  1033. end of the line, in which cases it translates to (.*). Paranthesis in
  1034. PCRE causes a change in execution priority similar to mathematical
  1035. expressions, but parentheses also causes the match to be stored to a
  1036. variable.
  1037. When nesting multiple sets of parentheses each nest is assigned its
  1038. numerical variable in order of appearance.
  1039. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #act {%* chats '{Mu(ha)+}'} {chat %2ha!}
  1040. If someone chats Muha you will chat Muhaha! If someone chats Muhaha
  1041. you will chat Muhahaha!
  1042. </span><span style='color:#5F5'>Lazy vs Greedy
  1043. </span><span style='color:#AAA'> By default regex matches are greedy, meaning {.*} will capture as much
  1044. text as possible.
  1045. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #regex {bli bla blo} {^{.*} {.*}&dollar;} {#show Arg1=(&amp;1) Arg2=(&amp;2)}
  1046. This will display: Arg1=(bli bla) Arg2=(blo)
  1047. By appending a ? behind a regex it becomes lazy, meaning {.*?} will
  1048. capture as little text as possible.
  1049. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #regex {bli bla blo} {^{.*?} {.*?}&dollar;} {#show Arg1=(&amp;1) Arg2=(&amp;2)}
  1050. This will display: Arg1=(bli) Arg2=(bla blo).
  1051. </span><span style='color:#5F5'>Escape Codes
  1052. </span><span style='color:#AAA'> PCRE support the following escape codes.
  1053. </span><span style='color:#FFF'> PCRE Description POSIX
  1054. &bsol;A </span><span style='color:#AAA'>Match start of string ^
  1055. </span><span style='color:#FFF'> &bsol;b </span><span style='color:#AAA'>Match word boundaries (^|&bsol;r|&bsol;n|&bsol;t| |&dollar;)
  1056. </span><span style='color:#FFF'> &bsol;B </span><span style='color:#AAA'>Match non-word boundaries [^&bsol;r&bsol;n&bsol;t ]
  1057. </span><span style='color:#FFF'> &bsol;c </span><span style='color:#AAA'>Insert control character &bsol;c
  1058. </span><span style='color:#FFF'> &bsol;d </span><span style='color:#AAA'>Match digits [0-9]
  1059. </span><span style='color:#FFF'> &bsol;D </span><span style='color:#AAA'>Match non-digits [^0-9]
  1060. </span><span style='color:#FFF'> &bsol;e </span><span style='color:#AAA'>Insert escape character &bsol;e
  1061. </span><span style='color:#FFF'> &bsol;f </span><span style='color:#AAA'>Insert form feed character &bsol;f
  1062. </span><span style='color:#FFF'> &bsol;n </span><span style='color:#AAA'>Insert line feed character &bsol;n
  1063. </span><span style='color:#FFF'> &bsol;r </span><span style='color:#AAA'>Insert carriage return character &bsol;r
  1064. </span><span style='color:#FFF'> &bsol;s </span><span style='color:#AAA'>Match spaces [&bsol;r&bsol;n&bsol;t ]
  1065. </span><span style='color:#FFF'> &bsol;S </span><span style='color:#AAA'>Match non-spaces [^&bsol;r&bsol;n&bsol;t ]
  1066. </span><span style='color:#FFF'> &bsol;t </span><span style='color:#AAA'>Insert tab character &bsol;t
  1067. </span><span style='color:#FFF'> &bsol;w </span><span style='color:#AAA'>Match letters, numbers, and underscores [A-Za-z0-9_]
  1068. </span><span style='color:#FFF'> &bsol;W </span><span style='color:#AAA'>Match non-letters, numbers, and underscores [^A-Za-z0-9_]
  1069. </span><span style='color:#FFF'> &bsol;x </span><span style='color:#AAA'>Insert hex character &bsol;x
  1070. </span><span style='color:#FFF'> &bsol;Z </span><span style='color:#AAA'>Match end of string &dollar;
  1071. &bsol;s matches one space, &bsol;s+ matches one or multiple spaces, the use
  1072. of {&bsol;s+} is required for this sequence to work in tintin, &bsol;s by itself will work outside of a set of braces.
  1073. </span><span style='color:#5F5'>Color triggers
  1074. </span><span style='color:#AAA'> To make matching easier text triggers (Actions, Gags, Highlights,
  1075. Prompts, and Substitutes) have their color codes stripped. If you
  1076. want to create a color trigger you must start the triggers with a ~
  1077. (tilde). To make escape codes visible use #config {convert meta} on.
  1078. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #action {~&bsol;e[1;37m%1} {#var roomname %1}
  1079. If the room name is the only line on the server in bright white
  1080. white color trigger will save the roomname.
  1081. This covers the basics. PCRE has more options, most of which are
  1082. somewhat obscure, so you'll have to read a PCRE manual for additional
  1083. information.
  1084. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#MAP'>map</a> and <a href='help.html#PATH'>path</a>.
  1085. <a name='REPEAT'></a>
  1086. </span><span style='color:#FF5'> REPEAT
  1087. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #</span><span style='color:#FFF'>[</span><span style='color:#AAA'>number</span><span style='color:#FFF'>] {</span><span style='color:#AAA'>commands</span><span style='color:#FFF'>}
  1088. </span><span style='color:#AAA'> Sometimes you want to repeat the same command multiple times. This is
  1089. the easiest way to accomplish that.
  1090. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #10 {buy bread}
  1091. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#MATHEMATICS'>mathematics</a> and <a href='#STATEMENTS'>statements</a>.
  1092. <a name='SCREEN_READER'></a>
  1093. </span><span style='color:#FF5'> SCREEN READER
  1094. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #config </span><span style='color:#FFF'>{</span><span style='color:#AAA'>SCREEN READER</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>ON|OFF</span><span style='color:#FFF'>}
  1095. </span><span style='color:#AAA'> Screen reader mode is enabled by using #config screen on. One purpose
  1096. of the screen reader mode is to report to servers that a screen reader
  1097. is being used by utilizing the MTTS standard. The MTTS specification
  1098. is available at:
  1099. http://tintin.sourceforge.net/protocols/mtts
  1100. With the screen reader mode enabled TinTin++ will try to remove or
  1101. alter visual elements where possible.
  1102. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#CONFIG'>config</a>
  1103. <a name='SESSIONNAME'></a>
  1104. </span><span style='color:#FF5'> SESSIONNAME
  1105. </span><span style='color:#FFF'>Syntax</span><span style='color:#AAA'>: #[sessionname] </span><span style='color:#FFF'>{</span><span style='color:#AAA'>commands</span><span style='color:#FFF'>}
  1106. </span><span style='color:#AAA'> You can create multiple sessions with the #session command. By default
  1107. only one session is active, meaning commands you input are executed in
  1108. the active session. While all sessions receive output, only output sent
  1109. to the active session is displayed.
  1110. When you create a session with the #session command you must specify a
  1111. session name, the session name, prepended with a hashtag, can be used
  1112. to activate the session when used without an argument. If an argument
  1113. is given it will be executed by that session as a command, the session
  1114. will not be activated.
  1115. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #ses one tintin.net 23;#ses two tintin.net 23;#one;#two grin
  1116. This will create two sessions, the session that was created last (two
  1117. in this case) will be automatically activated upon creation. Using
  1118. #one, session one is activated. Using #two grin, the grin social will
  1119. be executed by session two, session one will remain the active session.
  1120. If you send a variable to another session it will be substituted before
  1121. being passed. If you want the variable value of the receiving session
  1122. to be used you need to use '&dollar;&dollar;{variable}' to properly escape it.
  1123. </span><span style='color:#FFF'>Syntax</span><span style='color:#AAA'>: @[sessionname]</span><span style='color:#FFF'>{</span><span style='color:#AAA'>substitution</span><span style='color:#FFF'>}
  1124. </span><span style='color:#AAA'> If you want to pull the value of a variable from another session you
  1125. can do so in a similar way as you would use a #function call. Using
  1126. #showme {@two{&dollar;test}} in session one would print the value of &dollar;test,
  1127. as defined by session two.
  1128. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#SUSPEND'>suspend</a>
  1129. <a name='SPEEDWALK'></a>
  1130. </span><span style='color:#FF5'> SPEEDWALK
  1131. </span><span style='color:#5F5'> SPEEDWALK V1
  1132. </span><span style='color:#AAA'> Speedwalking allows you to enter multiple directions without using
  1133. semicolons. Directions should be prefixed with a number and will be
  1134. executed the given number of times.
  1135. You can enable speedwalking with #CONFIG {SPEEDWALK} {ON}.
  1136. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: Without speedwalk, you have to type:
  1137. </span><span style='color:#FFF'>s;s;w;w;w;w;w;s;s;s;w;w;w;n;n;w
  1138. </span><span style='color:#AAA'> With speedwalk, you only have to type:
  1139. </span><span style='color:#FFF'>2s5w3s3w2nw
  1140. </span><span style='color:#AAA'> </span><span style='color:#5F5'>SPEEDWALK V2
  1141. </span><span style='color:#AAA'> Modern MUDs have increasingly adopted the use of diagonal exits, like
  1142. ne, nw, sw, and se. To make accomodations for this the #map and #path
  1143. command no longer interpret nesw as a speedwalk and require this to
  1144. be written as 1n1e1s1w, which then allows 2ne2e to execute ne;ne;e;e.
  1145. Speedwalks entered on the input line continue to use the v1 system.
  1146. The #path load command is backward compatible with v1 speedwalks and
  1147. to load v2 speedwalks the #path unzip command needs to be used, unless
  1148. the speedwalk was saved using #path save in which case a v2 compatible
  1149. format is used that can also contain timing data.
  1150. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #path unzip 3n1e2nw
  1151. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #map move 3ne1d
  1152. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#KEYPAD'>keypad</a>, <a href='#MAPPING'>mapping</a> and <a href='#REPEAT'>repeat</a>.
  1153. <a name='STATEMENTS'></a>
  1154. </span><span style='color:#FF5'> STATEMENTS
  1155. </span><span style='color:#AAA'> TinTin++ knows the following statements.
  1156. #break
  1157. #case {value} {true}
  1158. #continue
  1159. #default {commands}
  1160. #else {commands}
  1161. #elseif {expression} {true}
  1162. #foreach {list} {variable} {commands}
  1163. #if {expression} {true}
  1164. #loop {min} {max} {variable} {commands}
  1165. #parse {string} {variable} {commands}
  1166. #return {value}
  1167. #switch {expression} {commands}
  1168. #while {expression} {commands}
  1169. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#MATHEMATICS'>mathematics</a>, <a href='#PCRE'>pcre</a> and <a href='#REPEAT'>repeat</a>.
  1170. <a name='SUBSTITUTIONS'></a>
  1171. </span><span style='color:#FF5'> SUBSTITUTIONS
  1172. </span><span style='color:#AAA'> TinTin++ will perform various types of substitions as detailed below.
  1173. </span><span style='color:#5F5'> Variables
  1174. </span><span style='color:#FFF'>&dollar; &amp; * @</span><span style='color:#AAA'> All variable and function names must begin with an alphabetic
  1175. character, followed by any combination of alphanumeric characters and
  1176. underscores.
  1177. </span><span style='color:#FFF'>&dollar;</span><span style='color:#AAA'> The dollar sign is used to retrieve the value of a variable.
  1178. </span><span style='color:#FFF'>&amp;</span><span style='color:#AAA'> The ampersand sign is used to retrieve the index of a variable.
  1179. </span><span style='color:#FFF'>*</span><span style='color:#AAA'> The astrix sign is used to retrieve the name of a variable.
  1180. </span><span style='color:#FFF'>@</span><span style='color:#AAA'> The at sign is used for functions.
  1181. </span><span style='color:#FFF'>[ ]</span><span style='color:#AAA'> Brackets are used for nested variables which function as an
  1182. associative array. Associative arrays are also known as tables and
  1183. maps. Regex can be used within brackets to match multiple variables.
  1184. </span><span style='color:#FFF'>+ -</span><span style='color:#AAA'> The plus and minus signs are used to access variables by their index,
  1185. with the first variable having index +1, and the last variable
  1186. having index -1. Variables are ordered alphanumerically.
  1187. All variables and functions can be escaped by doubling the sign,
  1188. like &dollar;&dollar;variable_name or @@function_name. To escape a variable
  1189. twice use &dollar;&dollar;&dollar;var_name. One escape is removed each time tintin
  1190. needs to substitute a variable or function.
  1191. </span><span style='color:#5F5'> Arguments
  1192. </span><span style='color:#FFF'>%0 - %99</span><span style='color:#AAA'> The percent sign followed by a number is used for arguments by the
  1193. following triggers:
  1194. alias, action, button, event, function, prompt, and substitute.
  1195. </span><span style='color:#FFF'>&amp;0 - &amp;99</span><span style='color:#AAA'> The ampersand sign followed by a number is used for arguments in the
  1196. regex and replace commands.
  1197. All trigger and command arguments can be escaped by doubling the
  1198. sign like %%1 or &amp;&amp;1. One escape is removed each time tintin
  1199. substitutes trigger or command arguments. To escape three times
  1200. triple the sign like %%%1, etc.
  1201. </span><span style='color:#5F5'> Colors
  1202. </span><span style='color:#FFF'>&lt;000&gt;</span><span style='color:#AAA'> Three alphanumeric characters encapsulated by the less- and greater-
  1203. than signs are used for 4 and 8 bit color codes.
  1204. </span><span style='color:#FFF'>&lt;0000&gt;</span><span style='color:#AAA'> Either a B (background) or F (foreground) followed by three
  1205. hexadecimal characters encapsulated by &lt; &gt; signs are used for 12
  1206. bit color codes. Requires truecolor capable terminal.
  1207. </span><span style='color:#FFF'>&lt;0000000&gt;</span><span style='color:#AAA'> Either a B (background) or F (foreground) followed by six
  1208. hexadecimal characters encapsulated by &lt; &gt; signs are used for 24
  1209. bit color codes. Requires truecolor capable terminal.
  1210. More information is available at #help color.
  1211. </span><span style='color:#5F5'> Escapes
  1212. </span><span style='color:#FFF'>&bsol; </span><span style='color:#AAA'> The back slash is used to escape a character. All available options
  1213. are listed at #help escape. Escapes are typically escaped when text
  1214. leaves the client, by being send to a server, the shell, being
  1215. displayed on the screen, or being processed as part of a regex.
  1216. Escapes try to mimic escapes in PCRE when possible.
  1217. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#CHARACTERS'>characters</a>, <a href='#COLORS'>colors</a>, <a href='#ESCAPE_CODES'>escape_codes</a> and <a href='#PCRE'>pcre</a>.
  1218. <a name='SUSPEND'></a>
  1219. </span><span style='color:#FF5'> SUSPEND
  1220. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #cursor suspend
  1221. Temporarily suspends tintin and returns you to your shell. To
  1222. return to tintin, type 'fg' at the shell prompt.
  1223. While suspended your tintin sessions will freeze. To keep a
  1224. suspended session running use the #daemon command.
  1225. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#SESSIONNAME'>sessionname</a>
  1226. <a name='TIME'></a>
  1227. </span><span style='color:#FF5'> TIME
  1228. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #format </span><span style='color:#FFF'>{</span><span style='color:#AAA'>variable</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>%t</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>argument</span><span style='color:#FFF'>}
  1229. </span><span style='color:#AAA'> The %t format specifier of the #format command allows printing dates
  1230. using the strftime() format specifiers. By default the time stamp used
  1231. is the current time, if you want to print a past or future date use:
  1232. </span><span style='color:#FFF'>Command</span><span style='color:#AAA'>: #format </span><span style='color:#FFF'>{</span><span style='color:#AAA'>variable</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>%t</span><span style='color:#FFF'>} {{</span><span style='color:#AAA'>argument</span><span style='color:#FFF'>} {</span><span style='color:#AAA'>epoch time</span><span style='color:#FFF'>}}
  1233. </span><span style='color:#AAA'> The current epoch time value is obtained using #format {time} {%T}.
  1234. When using %t the argument should contain strftime format specifiers.
  1235. Below are some common specifiers, see man strftime for the full list.
  1236. %a Abbreviated name of the day of the week (mon ... sun).
  1237. %A Full name of the day of the week. (Monday ... Sunday)
  1238. %b Abbreviated name of the month (Jan ... Dec)
  1239. %B Full name of the month. (January ... December)
  1240. %C 2 digit numeric century. (19 ... 20)
  1241. %d 2 digit numeric day of the month (01 ... 31)
  1242. %H 2 digit numeric 24-hour clock hour. (00 ... 23)
  1243. %I 2 digit numeric 12-hour clock hour. (01 ... 12)
  1244. %j 3 digit numeric day of the year (001 ... 366)
  1245. %m 2 digit numeric month of the year (01 ... 12)
  1246. %M 2 digit numeric minute of the hour (00 ... 59)
  1247. %p Abbreviated 12 hour clock period (AM ... PM)
  1248. %P Abbreviated 12 hour clock period (am ... pm)
  1249. %S 2 digit numeric second of the minute (00 ...59
  1250. %u 1 digit numeric day of the week (1 ... 7)
  1251. %U 2 digit numeric Sunday week of the year (00 ... 53
  1252. %w 1 digit numeric day of the week (0 ... 6)
  1253. %W 2 digit numeric Monday week of the year (00 ... 53
  1254. %y 2 digit numeric year. (70 ... 38)
  1255. %Y 4 digit numeric year. (1970 ... 2038)
  1256. %z 5 digit timezone offset. (-1200 ... +1400)
  1257. %Z Abbreviated name of the time zone. (CET, GMT, etc)
  1258. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='help.html#ECHO'>echo</a>, <a href='help.html#EVENT'>event</a> and <a href='help.html#FORMAT'>format</a>.
  1259. <a name='TRIGGERS'></a>
  1260. </span><span style='color:#FF5'> TRIGGERS
  1261. </span><span style='color:#AAA'> All available triggers in TinTin++ are displayed when you use the #info
  1262. command without an argument. All of them are written to file when you
  1263. use the #write command, except commands, histories, and paths.
  1264. Triggers can be disabled with the #ignore command. The #message
  1265. command can be used to disable messages generated or related to the
  1266. corresponding trigger, though this is generally not needed.
  1267. The #debug command will generate useful debugging information for the
  1268. corresponding trigger when enabled. The #info command can be used on
  1269. triggers to generate additional information that might be of use.
  1270. </span><span style='color:#FFF'>Example</span><span style='color:#AAA'>: #info event on
  1271. When #info event is set to on you will see when most events are raised.
  1272. Since this can get rather spammy some of the events won't generate
  1273. messages, unless you have an event in the same category set already.
  1274. </span><span style='color:#5F5'> Text triggers
  1275. </span><span style='color:#AAA'> When a block of text arrives from the host it is split into individual
  1276. lines, and all action, prompt, gag, substitute, and highlight triggers
  1277. are checked for each line. Only one action can trigger per line, while
  1278. the other triggers can trigger multiple times.
  1279. </span><span style='color:#5F5'> Packet fragmentation
  1280. </span><span style='color:#AAA'> MUDs that send long blurbs of text, don't have MCCP support, have a bad
  1281. connection, or a combination of all three, will deliver broken packets.
  1282. This can cause triggers to not fire, as well as displaying problems if
  1283. #split is enabled.
  1284. To mitigate this you can use </span><span style='color:#FFF'>#config packet_patch 0.5</span><span style='color:#AAA'>.
  1285. TinTin++ will automatically enable packet patching if the IAC GA or IAC
  1286. EOR telnet sequences are used to mark the end of the prompt. A MUD can
  1287. negotiate the EOR option: https://tintin.mudhalla.net/protocols/eor
  1288. In addition #prompt can be used to make packet patching less noticable.
  1289. </span><span style='color:#5F5'> Color triggers
  1290. </span><span style='color:#AAA'> By default most color, control, and vt100 codes are stripped from
  1291. incoming text before being ran through the trigger engine. To create
  1292. a trigger that runs on the unstripped text, the regular expression in
  1293. the trigger should start with a ~.
  1294. To view control codes you can use </span><span style='color:#FFF'>#config convert_meta on</span><span style='color:#AAA'> which will
  1295. translate both input and output codes to PCRE escape sequences.
  1296. </span><span style='color:#5F5'> Multi-line triggers
  1297. </span><span style='color:#AAA'> If an action or substitution contains the &bsol;n sequence it will be
  1298. turned into a multi-line trigger. A multi-line trigger is executed on
  1299. incoming blocks of text from the MUD, and they will not trigger if the
  1300. regular expression spans more than one block. You can visualize
  1301. incoming blocks by using the following event:
  1302. #event {RECEIVED OUTPUT} {#echo &lt;058&gt;%+80h BLOCK}
  1303. Since the %* expression does not capture the &bsol;n sequence it is required
  1304. to use %a to capture multiple lines. To capture the start of the block
  1305. use &bsol;A and for the end use &bsol;Z. You can use ^ and &dollar; to capture the
  1306. start and end of a line.
  1307. Multi-line triggers trigger before regular triggers. Multiple
  1308. multi-line actions can trigger per block, and each multi-line action
  1309. can trigger multiple times per block. Packet fragmentation is not
  1310. currently handled.
  1311. Multi-line triggers are experimental and subject to change.
  1312. </span><span style='color:#5F5'> Input triggers
  1313. </span><span style='color:#AAA'> The alias, history and pathdir triggers are checked for each line of
  1314. input. The macro and tab triggers are checked for key presses.
  1315. </span><span style='color:#5F5'> Time triggers
  1316. </span><span style='color:#AAA'> The delay, path, and ticker triggers will execute at a set timed
  1317. interval.
  1318. </span><span style='color:#5F5'> Substitution triggers
  1319. </span><span style='color:#AAA'> The function and variable triggers will generally execute right
  1320. before the final processing of a line of text.
  1321. </span><span style='color:#5F5'> Mouse triggers
  1322. </span><span style='color:#AAA'> The button trigger is checked for each mouse input. #config mouse
  1323. must be set to on to enable mouse tracking.
  1324. </span><span style='color:#5F5'> Event triggers
  1325. </span><span style='color:#AAA'> Events can be used for a wide variety of pre-defined triggers.
  1326. </span><span style='color:#FFF'>Related</span><span style='color:#AAA'>: <a href='#PCRE'>pcre</a>, <a href='#SUBSTITUTIONS'>substitutions</a> and <a href='#ESCAPE_CODES'>escape_codes</a>.