TinTin++ Configs for DiscworldMUD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

372 lines
15 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #CLASS {database} {kill};
  2. #CLASS {database} {open};
  3. #VARIABLE {map_id_names} {
  4. {1}{Ankh-Morpork}
  5. {2}{AM Assassins}
  6. {3}{AM Buildings}
  7. {4}{AM Cruets}
  8. {5}{AM Docks}
  9. {6}{AM Guilds}
  10. {7}{AM Isle of Gods}
  11. {8}{Shades Maze}
  12. {9}{Temple of Small Gods}
  13. {10}{AM Temples}
  14. {11}{AM Thieves}
  15. {12}{Unseen University}
  16. {13}{AM Warriors}
  17. {14}{Pseudopolis Watch House}
  18. {15}{Magpyr's Castle}
  19. {16}{Bois}
  20. {17}{Bes Pelargic}
  21. {18}{BP Buildings}
  22. {19}{BP Estates}
  23. {20}{BP Wizards}
  24. {21}{Brown Islands}
  25. {22}{Death's Domain}
  26. {23}{Djelibeybi}
  27. {24}{IIL - DJB Wizards}
  28. {25}{Ephebe}
  29. {26}{Ephebe Underdocks}
  30. {27}{Genua}
  31. {28}{Genua Sewers}
  32. {29}{GRFLX Caves}
  33. {30}{Hashishim Caves}
  34. {31}{Klatch Region}
  35. {32}{Lancre Region}
  36. {33}{Mano Rossa}
  37. {34}{Monks of Cool}
  38. {35}{Netherworld}
  39. {37}{Pumpkin Town}
  40. {38}{Ramtops Regions}
  41. {39}{Sto-Lat}
  42. {40}{Academy of Artificers}
  43. {41}{Cabbage Warehouse}
  44. {42}{AoA Library}
  45. {43}{Sto-Lat Sewers}
  46. {44}{Sprite Caves}
  47. {45}{Sto Plains Region}
  48. {46}{Uberwald Region}
  49. {47}{UU Library}
  50. {48}{Klatchian Farmsteads}
  51. {49}{CTF Arena}
  52. {50}{PK Arena}
  53. {51}{AM Post Office}
  54. {52}{Ninja Guild}
  55. {53}{The Travelling Shop}
  56. {54}{Slippery Hollow}
  57. {55}{House of Magic - Creel}
  58. {56}{Special Areas}
  59. {57}{Skund Wolf Trail}
  60. }
  61. #FUNCTION {map_parse} {
  62. #unvar {map_term} {search_map};
  63. #format {search_map} {%l} {%1};
  64. #regex {$search_map} {^am} { #var {map_term} {1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 51} };
  65. #regex {$search_map} {^ankh-morpork$} { #var {map_term} {1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 51} };
  66. #regex {$search_map} {^bp$} { #var {map_term} {17, 18, 19, 20, 21} };
  67. #regex {$search_map} {^bes pelargic$} { #var {map_term} {17, 18, 19, 20, 21} };
  68. #regex {$search_map} {^djb$} { #var {map_term} {23, 24} };
  69. #regex {$search_map} {^djelibeybi} { #var {map_term} {23, 24} };
  70. #regex {$search_map} {^ephebe$} { #var {map_term} {25, 26} };
  71. #regex {$search_map} {^genua$} { #var {map_term} {27, 28, 16} };
  72. #regex {$search_map} {^ramtops$} { #var {map_term} {38, 32, 54, 55} };
  73. #regex {$search_map} {^sto$} { #var {map_term} {29, 45} };
  74. #regex {$search_map} {^sto plains$} { #var {map_term} {29, 45} };
  75. #regex {$search_map} {^sto-lat$} { #var {map_term} {39, 40, 41, 42, 43} };
  76. #return {$search_map};
  77. };
  78. #LIST {last_query_list} {create};
  79. #ALIAS {db gatherable %1} {
  80. #unvariable {gatherable_display};
  81. #variable {search_term} {%1};
  82. #replace {search_term} {'} {''};
  83. #format {query} {SELECT item_name, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price = 'gather' LIMIT 10;} {$search_term};
  84. #format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
  85. #script {gatherable_query_result} {$db_command};
  86. #list {gatherable_query_result} {size} {gatherable_result_size};
  87. #list {last_query_list} {clear};
  88. #if {$gatherable_result_size > 0} {
  89. #format {gatherable_display} {%cResults for gatherables matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
  90. #echo {$gatherable_display};
  91. #var {gather_count} {0};
  92. #foreach {$gatherable_query_result[%*]} {inner_query_result} {
  93. #replace {inner_query_result} {\\} {};
  94. #list gatherable_results create {${inner_query_result}};
  95. #variable {gatherable_info} {
  96. {item_name}{$gatherable_results[1]}
  97. {room_short}{$gatherable_results[2]}
  98. {room_id}{$gatherable_results[3]}
  99. {map_name}{$map_id_names[$gatherable_results[4]]}
  100. };
  101. #format {gatherable_display} {%c [%c%d%c]: %c%s%c found in %c%s%c,%c %s%c} {bold blue}{cyan}{$gather_count}{bold blue}{green}{$gatherable_info[item_name]}{bold blue}{orange}{$gatherable_info[room_short]}{bold blue}{orange}{$gatherable_info[map_name]}{bold blue};
  102. #echo {$gatherable_display};
  103. #variable {last_query_list[$gather_count]} {$gatherable_info};
  104. #math {gather_count} {$gather_count + 1};
  105. }
  106. } {
  107. #format {gatherable_display} {%cQuery Result: %c%s%c was not found.} {bold blue}{green}{%1}{bold blue};
  108. #echo {$gatherable_display};
  109. }
  110. }
  111. #ALIAS {db npc {[^{}\n]+}{( \{([\w\s-]+)\})?}$} {
  112. #unvariable {npc_display} {search_term} {query};
  113. #variable {search_term} {%1};
  114. #replace {search_term} {'} {''};
  115. #nop If we found an area name in curly braces, try to match a map-set;
  116. #var {search_map} {@map_parse{%4}};
  117. #if {&map_term} {
  118. #format {query} {SELECT npc_name, rooms.map_id, rooms.room_id, rooms.room_short, INSTR(npc_name, '%s') pos FROM npc_info INNER JOIN rooms on rooms.room_id = npc_info.room_id WHERE pos > 0 AND rooms.map_id IN (%s) LIMIT 10} {$search_term} {$map_term};
  119. };
  120. #else {
  121. #format {query} {SELECT npc_name, rooms.map_id, rooms.room_id, rooms.room_short, INSTR(npc_name, '%s') pos FROM npc_info INNER JOIN rooms on rooms.room_id = npc_info.room_id WHERE pos > 0 LIMIT 10} {$search_term};
  122. }
  123. #format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
  124. #script {npc_query_result} {$db_command};
  125. #list {npc_query_result} {size} {npc_result_size};
  126. #list {last_query_list} {clear};
  127. #if {$npc_result_size > 0} {
  128. #format {npc_display} {%cResults for NPCs matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
  129. #echo {$npc_display};
  130. #var {npc_count} {0};
  131. #foreach {$npc_query_result[%*]} {inner_query_result} {
  132. #replace {inner_query_result} {\\} {};
  133. #list npc_results create {${inner_query_result}};
  134. #variable {npc_info} {
  135. {npc_name}{$npc_results[1]}
  136. {map_name}{$map_id_names[$npc_results[2]]}
  137. {room_id}{$npc_results[3]}
  138. {room_short}{$npc_results[4]}
  139. };
  140. #format {npc_display} {%c [%c%d%c]: %c%s%c found in %c%s%c,%c %s%c} {bold blue}{cyan}{$npc_count}{bold blue}{green}{$npc_info[npc_name]}{bold blue}{orange}{$npc_info[room_short]}{bold blue}{orange}{$npc_info[map_name]}{bold blue};
  141. #echo {$npc_display};
  142. #variable {last_query_list[$npc_count]} {$npc_info};
  143. #math {npc_count} {$npc_count + 1};
  144. }
  145. } {
  146. #format {npc_display} {%cQuery Result: %c%s%c was not found.} {bold blue}{green}{%1}{bold blue};
  147. #echo {$npc_display};
  148. }
  149. };
  150. #ALIAS {db npcitem {[^{}\n]+}{( \{([\w\s-]+)\})?}$} {
  151. #unvariable {npcitem_display} {search_term} {query};
  152. #variable {search_term} {%1};
  153. #replace {search_term} {'} {''};
  154. #nop If we found an area name in curly braces, try to match a map-set;
  155. #var {search_map} {@map_parse{%4}};
  156. #if {&map_term} {
  157. #format {query} {SELECT npc_info.map_id, npc_name, npc_info.room_id, item_name, room_short, INSTR(item_name, '%s') pos FROM 'npc_info' INNER JOIN npc_items ON npc_items.npc_id = npc_info.npc_id INNER JOIN rooms on npc_info.room_id = rooms.room_id WHERE pos > 0 AND rooms.map_id IN (%s) LIMIT 10} {$search_term} {$map_term};
  158. };
  159. #else {
  160. #format {query} {SELECT npc_info.map_id, npc_name, npc_info.room_id, item_name, room_short, INSTR(item_name, '%s') pos FROM 'npc_info' INNER JOIN npc_items ON npc_items.npc_id = npc_info.npc_id INNER JOIN rooms on npc_info.room_id = rooms.room_id WHERE pos > 0 LIMIT 10} {$search_term};
  161. }
  162. #format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
  163. #script {npcitem_query_result} {$db_command};
  164. #list {npcitem_query_result} {size} {npcitem_result_size};
  165. #list {last_query_list} {clear};
  166. #if {$npcitem_result_size > 0} {
  167. #format {npcitem_display} {%cResults for NPC items matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
  168. #echo {$npcitem_display};
  169. #var {npcitem_count} {0};
  170. #foreach {$npcitem_query_result[%*]} {inner_query_result} {
  171. #replace {inner_query_result} {\\} {};
  172. #list npcitem_results create {${inner_query_result}};
  173. #variable {npcitem_info} {
  174. {map_name}{$map_id_names[$npcitem_results[1]]}
  175. {npc_name}{$npcitem_results[2]}
  176. {room_id}{$npcitem_results[3]}
  177. {item_name}{$npcitem_results[4]}
  178. {room_short}{$npcitem_results[5]}
  179. };
  180. #format {npcitem_display} {%c [%c%d%c]: %c%s%c found on %c%s%c in %c%s%c,%c %s%c} {bold blue}{cyan}{$npcitem_count}{bold blue}{green}{$npcitem_info[item_name]}{bold blue}{white}{$npcitem_info[npc_name]}{bold blue}{orange}{$npcitem_info[room_short]}{bold blue}{orange}{$npcitem_info[map_name]}{bold blue};
  181. #echo {$npcitem_display};
  182. #variable {last_query_list[$npcitem_count]} {$npcitem_info};
  183. #math {npcitem_count} {$npcitem_count + 1};
  184. }
  185. } {
  186. #format {npcitem_display} {%cQuery Result: %c%s%c was not found.} {bold blue}{green}{%1}{bold blue};
  187. #echo {$npcitem_display};
  188. }
  189. };
  190. #ALIAS {^db item {[^{}\n]+}{( \{([\w\s-]+)\})?}$} {
  191. #unvariable {item_display} {search_term} {query};
  192. #variable {search_term} {%1};
  193. #replace {search_term} {'} {''};
  194. #nop If we found an area name in curly braces, try to match a map-set;
  195. #var {search_map} {@map_parse{%4}};
  196. #if {&map_term} {
  197. #format {query} {SELECT item_name, sale_price, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price != 'gather' AND map_id IN (%s) LIMIT 10;} {$search_term} {$map_term};
  198. };
  199. #else {
  200. #format {query} {SELECT item_name, sale_price, room_short, shop_items.room_id, map_id, INSTR(item_name, '%s') pos FROM shop_items INNER JOIN rooms on rooms.room_id = shop_items.room_id WHERE pos > 0 AND sale_price != 'gather' LIMIT 10;} {$search_term};
  201. }
  202. #format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
  203. #script {item_query_result} {$db_command};
  204. #list {item_query_result} {size} {item_result_size};
  205. #list {last_query_list} {clear};
  206. #if {$item_result_size > 0} {
  207. #format {item_display} {%cResults for items matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
  208. #echo {$item_display};
  209. #var {item_count} {0};
  210. #foreach {$item_query_result[%*]} {inner_query_result} {
  211. #replace {inner_query_result} {\\} {};
  212. #list item_results create {${inner_query_result}};
  213. #variable {item_info} {
  214. {item_name}{$item_results[1]}
  215. {sale_price}{$item_results[2]}
  216. {room_short}{$item_results[3]}
  217. {room_id}{$item_results[4]}
  218. {map_name}{$map_id_names[$item_results[5]]}
  219. };
  220. #format {item_display} {%c [%c%d%c]: %c%s%c (%c%s%c) found in %c%s%c,%c %s%c} {bold blue}{cyan}{$item_count}{bold blue}{green}{$item_info[item_name]}{bold blue}{yellow}{$item_info[sale_price]}{bold blue}{orange}{$item_info[room_short]}{bold blue}{orange}{$item_info[map_name]}{bold blue};
  221. #echo {$item_display};
  222. #variable {last_query_list[$item_count]} {$item_info};
  223. #math {item_count} {$item_count + 1};
  224. };
  225. } {
  226. #format {item_display} {%cQuery Result: %c%s%c was not found.} {bold blue}{green}{%1}{bold blue};
  227. #echo {$item_display};
  228. };
  229. };
  230. #ALIAS {^db room {[^{}\n]+}{( \{([\w\s-]+)\})?}$} {
  231. #unvariable {room_display} {search_term} {query};
  232. #variable {search_term} {%1};
  233. #replace {search_term} {'} {''};
  234. #nop If we found an area name in curly braces, try to match a map-set;
  235. #var {search_map} {@map_parse{%4}};
  236. #if {&map_term} {
  237. #format {query} {SELECT room_id, map_id, room_short, room_type, INSTR(room_short, '%s') pos FROM rooms WHERE pos > 0 AND map_id IN (%s) LIMIT 10;} {$search_term} {$map_term};
  238. };
  239. #else {
  240. #format {query} {SELECT room_id, map_id, room_short, room_type, INSTR(room_short, '%s') pos FROM rooms WHERE pos > 0 LIMIT 10;} {$search_term};
  241. }
  242. #format {db_command} {sqlite3 -separator ";" src/quow.db "%s"} {$query};
  243. #script {room_query_result} {$db_command};
  244. #list {room_query_result} {size} {room_result_size};
  245. #list {last_query_list} {clear};
  246. #if {$room_result_size > 0} {
  247. #format {room_display} {%cResults for items items matching "%c%s%c":} {bold blue}{yellow}{%1}{bold blue};
  248. #echo {$room_display};
  249. #var {room_count} {0};
  250. #foreach {$room_query_result[%*]} {inner_query_result} {
  251. #replace {inner_query_result} {\\} {};
  252. #list room_results create {${inner_query_result}};
  253. #variable {room_info} {
  254. {room_id}{$room_results[1]}
  255. {map_name}{$map_id_names[$room_results[2]]}
  256. {room_short}{$room_results[3]}
  257. {room_type}{$room_results[4]}
  258. };
  259. #format {room_display} {%c [%c%d%c]: %c%s%c (%c%s%c) found in %c%s%c} {bold blue}{cyan}{$room_count}{bold blue}{green}{$room_info[room_short]}{bold blue}{yellow}{$room_info[room_type]}{bold blue}{orange}{$room_info[map_name]}{bold blue};
  260. #echo {$room_display};
  261. #variable {last_query_list[$room_count]} {$room_info};
  262. #math {room_count} {$room_count + 1};
  263. }
  264. } {
  265. #format {room_display} {%cQuery Result: %c%s%c was not found.} {bold blue}{green}{%1}{bold blue};
  266. #echo {$room_display};
  267. };
  268. };
  269. #ALIAS {db route %1} {
  270. #if {&last_query_list[%1]} {
  271. #var {target_room} {$last_query_list[%1]};
  272. #format {route_display} {%c[speedwalk] Generating speedwalk from current location to %c%s%c, %c%s%c...} {bold blue}{green}{$target_room[room_short]}{bold blue}{orange}{$target_room[map_name]}{bold blue};
  273. #echo {$route_display};
  274. #var {route_current_room_id} {$GMCP[room][info][identifier]};
  275. #var {route_target_room_id} {$target_room[room_id]};
  276. #format {route_command} {python src/maproute.py %s %s} {$route_current_room_id} {$route_target_room_id};
  277. #script {speedwalk_result} {$route_command};
  278. #if {"$speedwalk_result[1]" == "0"} {
  279. #format {route_error} {%c[speedwalk] Unable to find route to %c%s%c or unknown current room.} {bold blue}{green}{$target_room[room_short]}{bold blue};
  280. #echo {$route_error};
  281. #return;
  282. }
  283. #send {$speedwalk_result[1]};
  284. #variable {route_length} {$speedwalk_result[1]};
  285. #replace {route_length} {\\\;} {;};
  286. #replace {route_length} { } {};
  287. #list {route_length} {create} {$route_length};
  288. #list {route_length} {size} {route_length};
  289. #format {route_confirm} {%c[speedwalk] A route was found, type "%cspeedwalk%c" to fast travel. [%g steps]} {bold blue}{green}{bold blue}{$route_length};
  290. #echo {$route_confirm};
  291. } {
  292. #format {route_display} {%c[speedwalk] No previous query data found, try searching first.} {bold blue};
  293. #echo {$route_display};
  294. }
  295. };
  296. #ALIAS {speedwalk} {
  297. #send {RuhsSpeedRun};
  298. }
  299. #CLASS {database} {close};