Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #var MapOutputWindow 0
- #alias initQueue
- {
- #unvar Queue%1*;
- #var Queue%1Begin {0};
- #var Queue%1End {0}
- }
- #alias putQueue
- {
- #var Queue%1Value$Queue%1End {%%2};
- #math Queue%1End {$Queue%%1End + 1}
- }
- #alias getQueue
- {
- #if {$Queue%%1Begin != $Queue%%1End}
- {
- #var %%2 {$Queue%%%1Value$$Queue%%%1Begin};
- #unvar Queue%%1Value$Queue%%1Begin;
- #math Queue%1Begin {$Queue%%1Begin + 1}
- }
- {
- #var %%2 {0}
- }
- }
- #action {/^#Connection established\./}
- {
- #var MapperWorldName $HOSTNAME;
- #wclear $MapOutputWindow;
- #wname $MapOutputWindow {Automap - $MapperWorldName};
- #message mapper off;
- #message var off;
- #var CreatingMap 0;
- #var LabyrinthMode 0;
- #var PrevVNum 0;
- #var CurrentVNum 0;
- #var MapVNum 0;
- #var AutoRun 0;
- initQueue CommandsQ;
- #read maps/$MapperWorldName.auto.map
- }
- {automap}
- #action {/^#Connection lost\./} {#mapper write maps/$MapperWorldName.auto.map} {5} {automap}
- #action {/^#Connection closed by user\./} {#mapper write maps/$MapperWorldName.auto.map} {5} {automap}
- #mapper clear
- #mapper add direction {север,с,north,n} 0 1 0 {юг,ю,south,s}
- #mapper add direction {восток,в,east,e} 1 0 0 {запад,з,west,w}
- #mapper add direction {вниз,вн,down,d} 0 0 -1 {вверх,вв,up,u}
- #mapper add direction {северо-запад,сз,northwest,nw} -1 1 0 {юго-восток,юв,southeast,se}
- #mapper add direction {северо-восток,св,northeast,ne} 1 1 0 {юго-запад,юз,southwest,sw}
- #mapper add direction {возврат,recall} 0 0 0 {} {@}
- #mapper add direction {кол возврат,ca word} 0 0 0 {} {@}
- #mapper add direction {войти,enter} 0 0 0 {выйти} {0}
- #mapper add flag {продавец} {$} {light green}
- #mapper add flag {квестер} {@} {yellow}
- #mapper add flag {кузнец} {%} {brown}
- #mapper add flag {опасно} {!} {light red}
- #mapper add flag {жопа} {Ж} {light red}
- #mapper add flag {учитель} {*} {green}
- #mapper add flag {неисследовано} {?} {brown}
- #alias redrawMap
- {
- #wclear $MapOutputWindow;
- #mapper print normal header flags exits comment w$MapOutputWindow {$MapVNum}
- }
- {automap}
- #alias onRoom
- {
- getQueue CommandsQ LastCommand;
- #strcmp {$LastCommand} {0}
- {
- #var LastCommand {$COMMAND};
- #var KnownLastCommand 0
- }
- {
- #var KnownLastCommand 1
- };
- #if {$CreatingMap == 1}
- {
- #mapper get exit {$LastCommand} $CurrentVNum NextVNum;
- #strcmp {$NextVNum} {0}
- {
- #if {$KnownLastCommand == 1}
- {
- #mapper add room auto {%%%%%1} {%%%%%2} {} {} {} NextVNum
- }
- {
- #mapper autoid {%%%%%1} {%%%%%2} {} NextVNum;
- #mapper get id {$NextVNum} NextVNum;
- #strcmp {$NextVNum} {0}
- {
- #mapper add room auto {%%%%%%1} {%%%%%%2} {} {} {} NextVNum
- }
- }
- };
- #if {$KnownLastCommand == 1}
- {
- #strcmp {$CurrentVNum} {0}
- {}
- {
- #if {$LabyrinthMode == 1}
- {#mapper add exit $CurrentVNum {$LastCommand} $NextVNum CurrentVNum NextVNum}
- {#mapper add exit $CurrentVNum {$LastCommand} $NextVNum bidir CurrentVNum NextVNum}
- }
- }
- }
- {
- #mapper autoid {%%%1} {%%%2} {} NextVNum;
- #mapper track add {$LastCommand} {$NextVNum};
- #mapper track position NextVNum
- };
- #var PrevVNum {$CurrentVNum};
- #var CurrentVNum {$NextVNum};
- #var MapVNum {$CurrentVNum};
- redrawMap;
- #if {$AutoRun == 1} {stepAutoRun}
- }
- {automap}
- #action COLOR {/^&W(.*?)\n(.*?)\n?&?W?Выходы: (.*?)\.\n/mg} {onRoom {%%0} {} {%%2}} {5} {automap}
- #alias {/^(север|юг|восток|запад|сз|св|юз|юв|вверх|вниз|войти|выйти|возврат)/} {putQueue CommandsQ {%%0}; %0}
- #action TEXT {/^(Вы не можете идти в этом направлении\.|Во сне\?|Выход .* закрыт\.|Вы слишком устали\.)/} {getQueue CommandsQ LastCommand}
- #alias {/^см/} {initQueue CommandsQ;look}
- #alias запвых {#mapper add exit $PrevVNum {$COMMAND} $CurrentVNum {};redrawMap} {automap}
- #alias здесь
- {
- #mapper set flag $MapVNum %1;
- #strcmp %1 опасно {#mapper set avoidance $MapVNum 100};
- #strcmp %1 жопа {#mapper set avoidance $MapVNum 0};
- redrawMap
- }
- {automap}
- #alias здесьне {#mapper reset flag $MapVNum %1;redrawMap} {automap}
- #alias коммент {#mapper set comment $MapVNum {%%0};redrawMap} {automap}
- #alias {/^проход (\w+) (.*)/} {#mapper set pass $MapVNum {%%0} {%%1};redrawMap} {automap}
- #alias ятут {#mapper merge $CurrentVNum $MapVNum CurrentVNum;#var MapVNum {$CurrentVNum};redrawMap} {automap}
- #alias путьсюда {#mapper path $CurrentVNum $MapVNum} {automap}
- #alias кближнему
- {
- #mapper search near $MapVNum flag %1 TargetVNum;
- #strcmp {$TargetVNum} {0} {}
- {
- #var AutoRun 1;
- stepAutoRun
- }
- }
- {automap}
- #alias stepAutoRun
- {
- #strcmp $CurrentVNum $TargetVNum {#var AutoRun 0};
- #if {$AutoRun == 1}
- {
- #mapper path $CurrentVNum $TargetVNum AutoRunStep;
- #strcmp {$AutoRunStep} {}
- {
- #var AutoRun {0}
- }
- {$AutoRunStep}
- }
- }
- {automap}
- #alias бежсюда
- {
- #var TargetVNum $MapVNum;
- #var AutoRun 1;
- stepAutoRun
- }
- {automap}
- #alias стопбеж {#var AutoRun 0} {automap}
- #alias режкарт
- {
- #math CreatingMap {1 - $CreatingMap};
- #if {$CreatingMap == 0}
- { #showme {Картирование отключено.} }
- {
- #mapper set maxdifflen 2;
- #mapper set maxidentlen 5;
- #showme {Картирование включено.}
- }
- }
- {automap}
- #alias лабиринт
- {
- #math LabyrinthMode {1 - $LabyrinthMode};
- #if {$LabyrinthMode == 0}
- {
- #mapper set maxdifflen 2;
- #mapper set maxidentlen 5;
- #showme {Режим лабиринта отключен.}
- }
- {
- #mapper set maxdifflen 2;
- #mapper set maxidentlen 7;
- #showme {Режим лабиринта включен.}
- }
- }
- {automap}
- #alias покарте
- {
- #mapper get exit {%%0} $MapVNum NextMapVNum;
- #strcmp {$NextMapVNum} {0}
- {}
- {
- #var MapVNum $NextMapVNum;
- redrawMap
- }
- }
- {automap}
- #hot {Alt+UP} {покарте север} {automap}
- #hot {Alt+LEFT} {покарте запад} {automap}
- #hot {Alt+RIGHT} {покарте восток} {automap}
- #hot {Alt+DOWN} {покарте юг} {automap}
- #hot {Alt+0} {#var MapVNum $CurrentVNum;redrawMap} {automap}
- #group enable automap
Add Comment
Please, Sign In to add comment