Guest User

mapper.auto.arda.set

a guest
Oct 10th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.04 KB | None | 0 0
  1. #var MapOutputWindow 0
  2.  
  3. #alias initQueue
  4. {
  5. #unvar Queue%1*;
  6. #var Queue%1Begin {0};
  7. #var Queue%1End {0}
  8. }
  9. #alias putQueue
  10. {
  11. #var Queue%1Value$Queue%1End {%%2};
  12. #math Queue%1End {$Queue%%1End + 1}
  13. }
  14. #alias getQueue
  15. {
  16. #if {$Queue%%1Begin != $Queue%%1End}
  17. {
  18. #var %%2 {$Queue%%%1Value$$Queue%%%1Begin};
  19. #unvar Queue%%1Value$Queue%%1Begin;
  20. #math Queue%1Begin {$Queue%%1Begin + 1}
  21. }
  22. {
  23. #var %%2 {0}
  24. }
  25. }
  26.  
  27. #action {/^#Connection established\./}
  28. {
  29. #var MapperWorldName $HOSTNAME;
  30. #wclear $MapOutputWindow;
  31. #wname $MapOutputWindow {Automap - $MapperWorldName};
  32. #message mapper off;
  33. #message var off;
  34. #var CreatingMap 0;
  35. #var LabyrinthMode 0;
  36. #var PrevVNum 0;
  37. #var CurrentVNum 0;
  38. #var MapVNum 0;
  39. #var AutoRun 0;
  40. initQueue CommandsQ;
  41. #read maps/$MapperWorldName.auto.map
  42. }
  43. {automap}
  44. #action {/^#Connection lost\./} {#mapper write maps/$MapperWorldName.auto.map} {5} {automap}
  45. #action {/^#Connection closed by user\./} {#mapper write maps/$MapperWorldName.auto.map} {5} {automap}
  46.  
  47. #mapper clear
  48.  
  49. #mapper add direction {север,с,north,n} 0 1 0 {юг,ю,south,s}
  50. #mapper add direction {восток,в,east,e} 1 0 0 {запад,з,west,w}
  51. #mapper add direction {вниз,вн,down,d} 0 0 -1 {вверх,вв,up,u}
  52.  
  53. #mapper add direction {северо-запад,сз,northwest,nw} -1 1 0 {юго-восток,юв,southeast,se}
  54. #mapper add direction {северо-восток,св,northeast,ne} 1 1 0 {юго-запад,юз,southwest,sw}
  55.  
  56. #mapper add direction {возврат,recall} 0 0 0 {} {@}
  57. #mapper add direction {кол возврат,ca word} 0 0 0 {} {@}
  58. #mapper add direction {войти,enter} 0 0 0 {выйти} {0}
  59.  
  60. #mapper add flag {продавец} {$} {light green}
  61. #mapper add flag {квестер} {@} {yellow}
  62. #mapper add flag {кузнец} {%} {brown}
  63. #mapper add flag {опасно} {!} {light red}
  64. #mapper add flag {жопа} {Ж} {light red}
  65. #mapper add flag {учитель} {*} {green}
  66. #mapper add flag {неисследовано} {?} {brown}
  67.  
  68. #alias redrawMap
  69. {
  70. #wclear $MapOutputWindow;
  71. #mapper print normal header flags exits comment w$MapOutputWindow {$MapVNum}
  72. }
  73. {automap}
  74. #alias onRoom
  75. {
  76. getQueue CommandsQ LastCommand;
  77. #strcmp {$LastCommand} {0}
  78. {
  79. #var LastCommand {$COMMAND};
  80. #var KnownLastCommand 0
  81. }
  82. {
  83. #var KnownLastCommand 1
  84. };
  85. #if {$CreatingMap == 1}
  86. {
  87. #mapper get exit {$LastCommand} $CurrentVNum NextVNum;
  88. #strcmp {$NextVNum} {0}
  89. {
  90. #if {$KnownLastCommand == 1}
  91. {
  92. #mapper add room auto {%%%%%1} {%%%%%2} {} {} {} NextVNum
  93. }
  94. {
  95. #mapper autoid {%%%%%1} {%%%%%2} {} NextVNum;
  96. #mapper get id {$NextVNum} NextVNum;
  97. #strcmp {$NextVNum} {0}
  98. {
  99. #mapper add room auto {%%%%%%1} {%%%%%%2} {} {} {} NextVNum
  100. }
  101. }
  102. };
  103. #if {$KnownLastCommand == 1}
  104. {
  105. #strcmp {$CurrentVNum} {0}
  106. {}
  107. {
  108. #if {$LabyrinthMode == 1}
  109. {#mapper add exit $CurrentVNum {$LastCommand} $NextVNum CurrentVNum NextVNum}
  110. {#mapper add exit $CurrentVNum {$LastCommand} $NextVNum bidir CurrentVNum NextVNum}
  111. }
  112. }
  113. }
  114. {
  115. #mapper autoid {%%%1} {%%%2} {} NextVNum;
  116. #mapper track add {$LastCommand} {$NextVNum};
  117. #mapper track position NextVNum
  118. };
  119. #var PrevVNum {$CurrentVNum};
  120. #var CurrentVNum {$NextVNum};
  121. #var MapVNum {$CurrentVNum};
  122. redrawMap;
  123. #if {$AutoRun == 1} {stepAutoRun}
  124. }
  125. {automap}
  126.  
  127. #action COLOR {/^&W(.*?)\n(.*?)\n?&?W?Выходы: (.*?)\.\n/mg} {onRoom {%%0} {} {%%2}} {5} {automap}
  128. #alias {/^(север|юг|восток|запад|сз|св|юз|юв|вверх|вниз|войти|выйти|возврат)/} {putQueue CommandsQ {%%0}; %0}
  129. #action TEXT {/^(Вы не можете идти в этом направлении\.|Во сне\?|Выход .* закрыт\.|Вы слишком устали\.)/} {getQueue CommandsQ LastCommand}
  130. #alias {/^см/} {initQueue CommandsQ;look}
  131.  
  132. #alias запвых {#mapper add exit $PrevVNum {$COMMAND} $CurrentVNum {};redrawMap} {automap}
  133. #alias здесь
  134. {
  135. #mapper set flag $MapVNum %1;
  136. #strcmp %1 опасно {#mapper set avoidance $MapVNum 100};
  137. #strcmp %1 жопа {#mapper set avoidance $MapVNum 0};
  138. redrawMap
  139. }
  140. {automap}
  141. #alias здесьне {#mapper reset flag $MapVNum %1;redrawMap} {automap}
  142. #alias коммент {#mapper set comment $MapVNum {%%0};redrawMap} {automap}
  143. #alias {/^проход (\w+) (.*)/} {#mapper set pass $MapVNum {%%0} {%%1};redrawMap} {automap}
  144. #alias ятут {#mapper merge $CurrentVNum $MapVNum CurrentVNum;#var MapVNum {$CurrentVNum};redrawMap} {automap}
  145. #alias путьсюда {#mapper path $CurrentVNum $MapVNum} {automap}
  146.  
  147. #alias кближнему
  148. {
  149. #mapper search near $MapVNum flag %1 TargetVNum;
  150. #strcmp {$TargetVNum} {0} {}
  151. {
  152. #var AutoRun 1;
  153. stepAutoRun
  154. }
  155. }
  156. {automap}
  157.  
  158. #alias stepAutoRun
  159. {
  160. #strcmp $CurrentVNum $TargetVNum {#var AutoRun 0};
  161. #if {$AutoRun == 1}
  162. {
  163. #mapper path $CurrentVNum $TargetVNum AutoRunStep;
  164. #strcmp {$AutoRunStep} {}
  165. {
  166. #var AutoRun {0}
  167. }
  168. {$AutoRunStep}
  169. }
  170. }
  171. {automap}
  172. #alias бежсюда
  173. {
  174. #var TargetVNum $MapVNum;
  175. #var AutoRun 1;
  176. stepAutoRun
  177. }
  178. {automap}
  179. #alias стопбеж {#var AutoRun 0} {automap}
  180.  
  181. #alias режкарт
  182. {
  183. #math CreatingMap {1 - $CreatingMap};
  184. #if {$CreatingMap == 0}
  185. { #showme {Картирование отключено.} }
  186. {
  187. #mapper set maxdifflen 2;
  188. #mapper set maxidentlen 5;
  189. #showme {Картирование включено.}
  190. }
  191. }
  192. {automap}
  193.  
  194. #alias лабиринт
  195. {
  196. #math LabyrinthMode {1 - $LabyrinthMode};
  197. #if {$LabyrinthMode == 0}
  198. {
  199. #mapper set maxdifflen 2;
  200. #mapper set maxidentlen 5;
  201. #showme {Режим лабиринта отключен.}
  202. }
  203. {
  204. #mapper set maxdifflen 2;
  205. #mapper set maxidentlen 7;
  206. #showme {Режим лабиринта включен.}
  207. }
  208. }
  209. {automap}
  210.  
  211. #alias покарте
  212. {
  213. #mapper get exit {%%0} $MapVNum NextMapVNum;
  214. #strcmp {$NextMapVNum} {0}
  215. {}
  216. {
  217. #var MapVNum $NextMapVNum;
  218. redrawMap
  219. }
  220. }
  221. {automap}
  222.  
  223. #hot {Alt+UP} {покарте север} {automap}
  224. #hot {Alt+LEFT} {покарте запад} {automap}
  225. #hot {Alt+RIGHT} {покарте восток} {automap}
  226. #hot {Alt+DOWN} {покарте юг} {automap}
  227. #hot {Alt+0} {#var MapVNum $CurrentVNum;redrawMap} {automap}
  228.  
  229. #group enable automap
Add Comment
Please, Sign In to add comment