Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #var MapOutputWindow 0
- #action {/^#Connection established\./}
- {
- #var MapperWorldName $HOSTNAME;
- #wclear $MapOutputWindow;
- #wname $MapOutputWindow {GMCP Automap - $MapperWorldName};
- #message mapper off;
- #var PrevVNum 0;
- #var CurrentVNum 0;
- #var AutoRun 0;
- #read maps/$MapperWorldName.gmcp.map
- }
- {automap}
- #action {/^#Connection lost\./} {#mapper write maps/$MapperWorldName.gmcp.map} {5} {automap}
- #action {/^#Connection closed by user\./} {#mapper write maps/$MapperWorldName.gmcp.map} {5} {automap}
- #mapper clear
- #mapper add direction {down,d} -1 -1 0 {up,u}
- #mapper add direction {east,e} 1 0 0 {west,w}
- #mapper add direction {north,n} 0 1 0 {south,s}
- #mapper add flag {store} {$} {light green}
- #mapper add flag {quest} {@} {yellow}
- #mapper add flag {repair} {%} {brown}
- #mapper add flag {danger} {!} {light red}
- #mapper add flag {master} {*} {green}
- #mapper add flag {hell} {H} {light red}
- #mapper add flag {unexplored} {?} {brown}
- #alias redrawMap
- {
- #wclear $MapOutputWindow;
- #mapper print normal header flags exits comment w$MapOutputWindow $MapVNum
- }
- {automap}
- #alias onRoom
- {
- #mapper add room $GmcpRoomInfoNum {$GmcpRoomInfoName} {} {$GmcpRoomInfoZone} {} {$GmcpRoomInfoTerrain};
- #mapper reset flag $GmcpRoomInfoNum unexplored;
- #if {$GmcpRoomInfoExitsLength > 0}
- {
- #loop {1, $GmcpRoomInfoExitsLength}
- {
- #mapper get id {$GmcpRoomInfoExitsValue%0} ExitVNum;
- #if {$ExitVNum == 0}
- {
- #mapper add room {$GmcpRoomInfoExitsValue%0} {?} {} {} {} {unexplored}
- };
- #mapper add exit $GmcpRoomInfoNum {$GmcpRoomInfoExitsKey%0} {$GmcpRoomInfoExitsValue%0}
- }
- };
- #var PrevVNum {$CurrentVNum};
- #var CurrentVNum {$GmcpRoomInfoNum};
- #var MapVNum {$CurrentVNum};
- redrawMap;
- #if {$AutoRun == 1} {stepAutoRun}
- }
- {automap}
- #unaction {/^#oob GMCP room/}
- #action TEXT {/^#oob GMCP room/} {onRoom; #drop}
- #alias saveexit {#mapper add exit $PrevVNum {$COMMAND} $CurrentVNum;redrawMap} {automap}
- #alias hereis
- {
- #mapper set flag $MapVNum %1;
- #strcmp %1 danger {#mapper set avoidance $MapVNum 100};
- #strcmp %1 hell {#mapper set avoidance $MapVNum 0};
- redrawMap
- }
- {automap}
- #alias hereisnot {#mapper reset flag $MapVNum %1;redrawMap} {automap}
- #alias comment {#mapper set comment $MapVNum {%%0};redrawMap} {automap}
- #alias {/^passto (\w+) (.*)/} {#mapper set pass $MapVNum {%%0} {%%1};redrawMap} {automap}
- #alias pathto {#mapper path $CurrentVNum $MapVNum} {automap}
- #alias tonearest
- {
- #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 runhere
- {
- #var TargetVNum $MapVNum;
- #var AutoRun 1;
- stepAutoRun
- }
- {automap}
- #alias stoprun {#var AutoRun 0} {automap}
- #alias bymap
- {
- #mapper get exit %1 $MapVNum NextMapVNum;
- #if {$NextMapVNum != 0}
- {
- #var MapVNum $NextMapVNum;
- redrawMap
- }
- }
- {automap}
- #hot {Alt+UP} {bymap north} {automap}
- #hot {Alt+LEFT} {bymap west} {automap}
- #hot {Alt+RIGHT} {bymap east} {automap}
- #hot {Alt+DOWN} {bymap south} {automap}
- #hot {Alt+0} {#var MapVNum $CurrentVNum;redrawMap} {automap}
- #telnet GMCP on
- #oob GMCP add room
- #message oob ON
- #group enable automap
Add Comment
Please, Sign In to add comment