view example-tfrc.txt @ 1686:db1a3e72c1d1 default tip

Update to match in-game changes ('help item conditions').
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 18 May 2024 21:25:57 +0300
parents 3a089138b01c
children
line wrap: on
line source

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Personal settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Turn logging off, while we set things up
/log off

;; Add some worlds
/test addworld("bat", "lp.*", "bat.org", 23, "myname", "password")


;; Set player character name before loading scripts.
;; You need to set this to your character name, for example "Ggr"
/eval /set set_plrname=Mycharname

;; Savefiles should be stored under to this directory.
;; The example here uses $HOME/.ggrtf/ which works for *NIX style systems.
/eval /set set_datapath=%{HOME}/.ggrtf/

;; We want savefiles to use filename prefix "bat-"
/eval /set set_saveprefix=bat-


;; Define a helper macro to load modules from under user home directory
;; $HOME/ggrtf/ -- adjust this as necessary
/def -i gloadmod = /eval /load %{HOME}/tf/%{*}


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Character set / locale
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; You MAY need to set your character set encoding/locale to have
;; non-ASCII characters work properly in BatMUD. This is outside of
;; the scope of GgrTF, but it is discussed in more depth in the
;; user manual.

;; This setting needs to match an installed locale for *NIX style systems.
;/setenv LANG=en_US.iso88591

;; You may also try following settings if ISO-8859-1 does not work:
; /setenv LANG=en_US.iso885915
; /setenv LANG=en_US.latin1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load GgrTF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; The preloader module MUST be loaded first
/gloadmod ggrtf-pre.tf

;; And the main module after that ...
/gloadmod ggrtf.tf

;; Some useful modules: mangler, placer, spellname translator
/gloadmod gm-pssmangle.tf
/gloadmod gm-magical.tf
/gloadmod gm-tgtcast.tf
/gloadmod gm-pplacer.tf
/gloadmod gm-spellnames.tf
/gloadmod gm-tf5.tf

;; Load additional modules now
/gloadmod gm-rais.tf
/gloadmod gm-tarma.tf
/gloadmod gm-nun.tf


;; Load previously saved settings after all modules are initialized
/gload


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load keyboard support files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Bind some keys
/gloadmod kbd-xterm.tf
/gloadmod kbd-tf5def.tf

;; Some personal keybinds here ...
;/def -i -b'^[Om' = @smode
;/def -i -b'^[Ok' = @cmode


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (Re-)start logging
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function that returns log filename without directory path
;; Example returns: "YYYY-MM-DD-worldname-charname.log"
/def -i prget_log_filename =\
	/return strcat(ftime("%Y-%m-%d"), "-", fg_world, "-", tolower(set_plrname), ".log")


;; Start logging to a file
/def -i prlogfile_start =\
	/set logfile_enabled=1%;\
	/set logfile_prevtime=$[time()]%;\
	/set set_logfile=$[strcat(set_logdir, prget_log_filename())]%;\
	/eval /log %{set_logfile}


;; On world connection establish, begin logging
/def -i -F -p9999 -hCONNECT ghook_log_start =\
	/log OFF%;\
	/prlogfile_start

;; On world disconnect, stop logging
/def -i -F -p9999 -hDISCONNECT ghook_log_stop =\
	/set logfile_enabled=0%;\
	/log OFF

;; On date change, restart logging
/def -i glogfile_check_date =\
	/if (logfile_enabled & ftime("%Y-%m-%d", logfile_prevtime) !~ ftime("%Y-%m-%d"))\
		/msq Day changed, switching logfile ...%;\
		/log OFF%;\
		/prlogfile_start%;\
	/endif%;\
	/set logfile_prevtime=$[time()]

/eval /if (!logfile_timer) /repeat -1 i /glogfile_check_date%;/endif
/set logfile_timer=1