; nannymud.tf - tinyfugue macros for NannyMUD ; ; This file was written for the TF version 4.0stable1. ; If it works for other versions, it's pure luck. ; ; + Colouring of guild/club/party/chat-lines prefix. ; Messages, tells, replies. ; ; Last change: 2002-01-22 ; ;----------------------------------------------------------------- ; --- Language section. --- ; Language: swedish. /set LANG sv_SE /set istrip off ; --- Split screen, 3 lines in input window. --- /set isize=3 /set visual on ; --- Don't check for mail /set maildelay=0 ; --- Load some standard packages. --- ; Load some packages, set some defaults. /load -q complete.tf /set alias=new ; Get 'new' style alias expansions. /load -q alias.tf /load -q tools.tf ; Makes %; mean etc. /sub on ; Uncomment this if you want the window to get the title ; '@NannyMUD' when you start TF. ;/xtitle @NannyMUD ; Set title of window. ; 24h clock. /set status_int_clock=ftime("%H:%M", time()) ; --- The world --- ; /addworld -T"lp" NannyMUD mud.lysator.liu.se 2000 ; --- Key section --- ; Get arrow keys to work, as well as ^K and ^Y. /unbind OA /unbind OB /bind OA = /dokey RECALLB /bind OB = /dokey RECALLF ; Num-pad for walking. Unfortunately, the keys 7913 doesn't ; give unique key-codes to TF in many common terminal emulators ; (notably some RXVT)... remap using xmodmap? /bind Ox = /send north /bind Ow = /send south /bind Ot = /send west /bind Ov = /send east /def -i kb_cut_region = \ /test _kb_region := kbtail() %;\ /test kbdel(kblen())%;\ /def -i kb_paste_buffer = \ /test input(_kb_region) /unbind ^K /def -ib'^Y' = /kb_paste_buffer /def -ib'^K' = /kb_cut_region ; ----- ; Word wrap etc. is best handled in the client. The game line-breaks ; too may things, really. Do 'toggle raw' inside the game for slightly ; better wraps. ; /set wrap=on /set wrapsize=77 /set wrapspace=2 ; ------------------------------------------------------------------ ; a = attribute ; C = color (-aCred) ; r = reverse ; b = bell ; u = underline ; B = bold ; -P implies regexps. ; ; valid values for colour in RXVT are: ; black, red, green, yellow, blue, magenta, cyan, white, ; 8, 9, 10, 11, 12, 13, 14, 15, ; bgblack, bgred, bggreen, bgyellow, bgblue, bgmagenta, bgcyan, bgwhite ; ; Tells and replies. ; Partial highlights (using 'P') implies regexp matching. ; /set hiliteattr=B ; Highlight using 'bold'. /def -p1 -PhCyellow,Cbgred -t'^[a-zA-Z]+ tells you:' /def -p1 -PhCyellow,Cbgred -t'^[a-zA-Z]+ replies to you:' ; Various guild lines. ; knights, khornes, druids, simyarin, monks, adv-guild, ; dark, vamps, lepers, cthulhu, dua, chefs, masters /def -PhCyellow,Cbgblack -t'^\\[-Assembly-\\]' /def -PhCyellow,Cbgblack -t'^\\[Khorne\\]' /def -PhCyellow,Cbgblack -t'^\\[-Druids-\\]' /def -PhCyellow,Cbgblack -t'^\\[Simyarin\\]' /def -PhCyellow,Cbgblack -t'^\\[Monks\\]' /def -PhCyellow,Cbgblack -t'^\\[Adv\\]' /def -PhCyellow,Cbgblack -t'^\\[Dark\\]' /def -PhCyellow,Cbgblack -t'^\\[Bloodline\\]' /def -PhCyellow,Cbgblack -t'^\\[=Leper=\\]' /def -PhCyellow,Cbgblack -t'^\\( Cthulhu \\)' /def -PhCyellow,Cbgblack -t'^\\[U\\]' /def -PhCyellow,Cbgblack -t'^\\[S=:-\\)\\]' /def -PhCyellow,Cbgblack -t'^\\[Masters\\]' ; Various clubs and their lines. /def -PhCyellow,Cbgred -t'^\\[\\$\\]' /def -PhCyellow,Cbgred -t'^\\[Flatworlders\\]' /def -PhCyellow,Cbgred -t'^-BirdLine-' /def -PhCyellow,Cbgred -t'^\\[Voter\\]' /def -PhCyellow,Cbgred -t'^\\[Followers\\]' /def -PhCyellow,Cbgred -t'^\\[socks\\]' /def -PhCyellow,Cbgred -t'^\\[Chat\\]' /def -PhCyellow,Cbgred -t'^\\[Trade\\]' ; A list of tells. Really reaquires you to have toggled 'raw tells' on ; NannyMUD, or multi-line tells will degenerate to the first line only. ; Then one need a bit of line-formatting, too. ; /alias tellhistory /recall -q -t -mregexp #/100 tells you: ; Example of gag. Default matching is 'glob'. ; /gag ; /gag [Gg]uest says: ; A few aliases. ; /alias gc get all from corpse /alias g get all /alias sc score ; Example of automatic response. ; /def -p1 -c99 -F -t'Guest tells you:' = reply Sorry, I am busy. ;----------------------------------------------------------------- ; The status line and what's in it. ; The code here will bump some things up into the status line from ; two places: ; 1/ the output from hpinfo ; 2/ the prompt ; ; Silently ensure we get the hp/sp info. ; /def -ag -mglob -t'*HP/SP info turned on.*' /def -ag -mglob -t'*HP/SP info turned off.*' check_hpinfo = \ /send hpinfo on ; Some defaults /if ( _xp < 1 ) /set _xp=_ %; /endif /if ( _qp < 1 ) /set _qp=_ %; /endif /if ( _np < 1 ) /set _np=_ %; /endif /if ( _gc < 1 ) /set _gc=_ %; /endif /if ( !hp ) /set hp=___/___ %; /endif /if ( !sp ) /set sp=___/___ %; /endif ; Set the look of the status line. /set status_fields=@more:8:Br :1 \ hp:10:BCred :1 \ sp:10:BCmagenta :1 \ _xp:7:BCwhite :1 \ _qp:7:BCblue :1 \ _np:7:BCcyan :1 \ _gc:7:BCyellow :1 \ insert:6 :1 \ @clock:-5 ; Read the HP/SP info into the variables for the status line /def -i -F -ag -mregexp -t'HP: ([0-9]+)/([0-9]+).*SP: ([0-9]+)/([0-9]+)' hpst_ = \ /set hp0=%P1 %;\ /set hp1=%P2 %;\ /set sp0=%P3 %;\ /set sp1=%P4 %;\ /set hp=$[pad("HP:",2, hp0,strlen(hp0), "/",1, hp1,strlen(hp1))] %;\ /set sp=$[pad("SP:",2, sp0,strlen(sp0), "/",1, sp1,strlen(sp1))] %;\ /test status_fields := status_fields ; The prompt hook. /def -F -mregexp -h"PROMPT \ :([0-9]+):([0-9]+):([0-9]+):([0-9]+):>.*$" \ prompt_hook = \ /prompt > %;\ /set _xp0=%P1 %;\ /set _qp0=%P2 %;\ /set _np0=%P3 %;\ /set _gc0=%P4 %;\ ; /if (_xp0 > 1000000) \ /eval /set tmp=$[_xp0/1000000] %;\ /set _xp=$[pad("XP:",3, tmp,strlen(tmp), "M",1)]%;\ /elseif (_xp0 > 1000) \ /eval /set tmp=$[_xp0/1000] %;\ /set _xp=$[pad("XP:",3, tmp,strlen(tmp), "k",1)]%;\ /else \ /set _xp=$[pad("XP:",3, _xp0,strlen(_xp0))]%;\ /endif %;\ ; /if (_qp0 > 1000000) \ /eval /set tmp=$[_qp0/1000000] %;\ /set _qp=$[pad("QP:",3, tmp,strlen(tmp), "M",1)]%;\ /elseif (_qp0 > 1000) \ /eval /set tmp=$[_qp0/1000] %;\ /set _qp=$[pad("QP:",3, tmp,strlen(tmp), "k",1)]%;\ /else \ /set _qp=$[pad("QP:",3, _qp0,strlen(_qp0))]%;\ /endif %;\ ; /if (_np0 > 1000000) \ /eval /set tmp=$[_np0/1000000] %;\ /set _np=$[pad("NP:",3, tmp,strlen(tmp), "M",1)]%;\ /elseif (_np0 > 1000) \ /eval /set tmp=$[_np0/1000] %;\ /set _np=$[pad("NP:",3, tmp,strlen(tmp), "k",1)]%;\ /else \ /set _np=$[pad("NP:",3, _np0,strlen(_np0))]%;\ /endif %;\ ; /if (_gc0 > 1000000) \ /eval /set tmp=$[_gc0/1000000] %;\ /set _gc=$[pad("GC:",3, tmp,strlen(tmp), "M",1)]%;\ /elseif (_gc0 > 1000) \ /eval /set tmp=$[_gc0/1000] %;\ /set _gc=$[pad("GC:",3, tmp,strlen(tmp), "k",1)]%;\ /else \ /set _gc=$[pad("GC:",3, _gc0,strlen(_gc0))]%;\ /endif %;\ ; /test status_fields := status_fields ; Those sends must come after you have connected... ; ; Toggle the hpinfo and set the prompt. /def initialize_tf = /if /test 1 %; /then \ /send set_prompt :\$exp:\$qp:\$np:\$gold:> %;\ /send toggle hpinfo on%;\ /undef initialize_tf %;\ /endif ;/echo *** ;/echo *** To set things up, you need to type '/initialise_tf' ;/echo *** after you have logged in. You also need to change ;/echo *** your SP or HP to get it into the status line. ;/echo *** ; When we have logged on, we make TF respond to the 'GENERAL INFO' ; banner. We set things up, but we have to gag away the ugly prompt ; which is shown first. ; /gag :[-0-9]*:[-0-9]*:[0-9]*:[0-9]*>* /set motdh=--XXX-- /echo $motdh /def -ag -F -mglob -t'*GENERAL INFO*' = \ /_echo ------------------------------ GENERAL INFO -------------------------------%; \ /initialize_tf%; \ /echo%; \ /echo%; \ ; -- End of script