tutorial.html 124 KB

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