view ship_maps.tf @ 374:10d030b85117 misc tip

Switch Convent map to SVG version, add link to PNG render to the caption.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 01 Mar 2024 10:02:38 +0200
parents e8a24520d8d8
children
line wrap: on
line source

;; TinyFugure script for semi-automatically copying and sending waypoint
;; maps to another ship. Requires TF 5.0 beta 7 or later.
;; (C) Copyright 2009-2010 Matti 'ccr' Hämäläinen <ccr@tnsp.org>
;;
;; Usage: Start with "/setship destination_ship_name"
;; to set name of the destination ship where copied maps will be sent.
;;
;; Then "/cmap mapname" to make a copy of given map and send it.
;;
;; NOTICE! If map copying fails, the script will automatically retry!
;; Make sure you have enough empty map scrolls available.
;;

/def -i -aBCred -mregexp -t"tells you 'ARGH! I can't believe" copymap_fail =\
	/repeat -1 1 /copymap_copy

/def -i -aBCgreen -mregexp -t"tells you 'Easy as pie, Captain.'" copymap_ok =\
	/repeat -1 1 /copymap_finish

/def -i -aBCred -mregexp -t"advises you 'That ship already has a map by that name, Captain.'" sendmap_has =\
	/echo -p @{BCyellow}Destination had that map, destroying copy.@{n}%;\
	/test send(strcat("@@bookcase remove ",tmpmap))

/def -i copymap_copy =\
	/echo -p @{BCyellow}Trying to copy map '%{tmpmap}' to '%{copymap}' ...@{n}%;\
	/test send(strcat("@@bookcase copy ",tmpmap," ",copymap))

/def -i copymap_finish =\
	/echo -p @{BCyellow}Sending '%{copymap}' to '%{targetship}'.@{n}%;\
	/test send(strcat("@@bookcase give ",copymap," ",targetship))%;\
	/test send(strcat("@@bookcase rename ",tmpmap," ",copymap))

/def -i cmap =\
	/set copymap=%{1}%;\
	/set tmpmap=tmpmap%;\
	/echo -p @{BCwhite}Copying@{n} '@{BCgreen}%{copymap}@{n}' ...%;\
	/echo -p @{BCyellow}Temporarily renaming '%{copymap}' to '%{tmpmap}'.@{n}%;\
	/test send(strcat("@@bookcase rename ",copymap," ",tmpmap))%;\
	/copymap_copy

/def -i setship =\
	/if ({#} > 0)\
		/set targetship=%{1}%;\
		/echo -p @{BCwhite}Setting target ship to@{n} '@{BCgreen}%{targetship}@{n}' ...%;\
		/echo -p Now use @{BCwhite}/cmap mapname@{n}%;\
	/else \
		/echo -p @{BCred}No ship name given!@{n} Use '/setship targetshipfoobar'.%;\
	/endif