Beginner's Guide to Tinyfugue

From Gwen Morse's Wiki
Jump to: navigation, search
The Beginners Guide to Tinyfugue v3.11
--------------------------------------------------------

OK, I'm assuming that you've installed a version of tf in your UNIX account. 
If you haven't, you need to refer to the tf.README file, which will be with 
the compressed version of tf.

Contents
-------------

[1] The very beginning

[2] /bind - defining hotkeys / Fkeys / boundkeys

[3] /hook send - defining macros

[4] /list, /save, /load, /undefn and /purge - basic file handling commands

[5] /trig - autoresponses

[6] /hilite - highlighting important text

[7] /visual - split screen view

[8] /set - using variables to set up targets.

[9] %{n} - specifying places in a triggering command line.

[10] extra list commands


[1] I've installed tf - what now?
--------------------------------------------

Tf can be run from anywhere in your UNIX account, but it may be an idea to
run from an empty directory, as it will save out files to where you start
from. Just type 'tf' to start.

You should get a screen something like this:

Tinyfugue version 3.4 alpha 16, Copyright (C) 1993, 1994, 1995 Ken Keys
Regexp package is Copyright (C) 1986 by University of Toronto.
Type '/help', '/help topics', or '/help intro' for help

%loading commands from /ee/ee94/u1/jadg/tf.lib/stdlib.tf
---- No World ----

In order to send commands to tf, you must preface them with a / 
Anything else will be sent to the MUD - but since you are not yet connected 
to anywhere, these commands will simply be ignored.
So, to connect to Avalon, type the following:
/telnet avalon-rpg.com

This should connect you to Avalon, with the login prompt as normal.
After you login, you can play Avalon as normal...

Two quick ground rules - anything I put inside brackets in a tf command is my 
comment to you, don't type it. Also, anything in square brackets is a 
variable, you need to put in something like a filename.

Basic tf commands
---------------------------

[2] /bind

This is one of the most useful commands in tf. Basically, it allows you to 
define hotkeys.
It works by replacing a particular combination of  characters with the 
defined macro.
Example:
On my system, when I press the F1 key at the UNIX prompt, I get [12~
Some other systems get things like ^q or oq. 
To bind these, use the following command:
/bind (press the F1 key, or type what it normally prints out) = drink blue 
potion
i.e. I would type

/bind [12~ = drink blue potion

Then, whenever I press the F1 key, it will take a drink out of my blue potion. 
N.B., you don't need to press anything else, specifically <CR>

Care should be taken with this command, especially if your Fkeys use things 
like op. This is because it will replace any incidence of op in any command 
with drink blue potion, or whatever. So instead of typing 'get opals' it will 
give you 'drink blue potion' followed by 'get als'. To solve this, you can 
change your UNIX keymaps. I recommend you beg, borrow or steal a UNIX 
handbook.

More that one avalon command can be placed in the hotkey list, using the 
%; command separator. e.g.

/bind [13~ = drink blue potion%;outp lestagii%;eat lestagii
As many commands as you like can be put into the response line - however, 
Avalon will unlog you if you enter more than 30 commands in one second. The 
separator %; is global, and can be used in any tf command.
It's not a good idea to bind an Fkey more than once - you can't be sure which 
command it will do. Look below at /list etc. for how to delete multiple 
bindings.




[3] /hook send

Now, you have a limited number of hotkeys. They are best reserved for your 
most urgent fighting commands, such as attacks and defences. Also, it is 
hard to keep track of what F7 does etc. - it's not very descriptive. For 
less urgent commands, and a virtually infinite range of user defined macros, 
you need the command /hook send.

This is best demonstrated by a couple of examples.

(1)
/hook send heal = chant healhand %; cast me

This tells tf, that whenever I type :
 
heal <CR>

I will heal myself up, using charming.

(2)
/hook send n = north %; exits

this one looks at the exits every time I go north.



[4] /list, /save, /load, /purge and /undefn

So, you have defined a couple of hotkeys and macros. How do you mess about 
with your handiwork?
Well /list will show all your currently defined macros, complete with macro 
numbers. e.g.

%223: /def -p1 -mglob -b'[12~' = drink blue potion
%224: /def -p1 -mglob -b'[13~' = drink blue potion %; outp lestagii %; 
eat lestagii
%225: /def -p1 -mglob hook send heal = healhand
%226: hook send n = n%;routes

(N.B. ignore -p1 and -mglob options. Tf uses /def to define all of it's 
macros, hotkeys, triggers etc. It uses options such as -t and -b to specify 
how a /def will work precisely.  -p1 and -mglob are just two more options, 
that have little/no effect.)



In order to have these macros next time you use tf, you need to save them out 
to a file - tf will not keep them in memory
Example:

/save [filename]
e.g.
/save macros

Then to load them back in when tf is running, use

/load macros

(this is dead easy, Huh)

How do you delete a macro that's on your list?
Simple:
/undefn [macro number]
i.e. in the list above you would use

/undefn 223

to delete the first macro.
Personally, I find it easier to use a UNIX texteditor to modify my saved 
macros file.

Lastly, if you want to erase your list of macros (e.g. you screwed up, and you 
want to reload your backup copy of your saved macros) there is no need to quit 
out of tf, and restart; just type
/purge
You need to do this as tf will not allow current macros to be overwritten by 
loaded files.

Complex tf commands
--------------------------------

The following commands are more complex, but also VERY useful.

[5] /trig

Next up - Autoresponses.
Let's say you want the equivalent of autowake.
What you need is the /trig command.
The text line is 'You are asleep and incapable of acting; type WAKE to wake 
yourself up.'
So, we use

/trig You are asleep and incapable of acting; type WAKE to wake yourself up. = 
wake

The trigger text must always start on the left - so what happens if you want 
to trigger on something that happens in the middle of the sentence?
Well, we use wildcards
example:

/trig * stands within a pentacle.* = chant nullify

It's a good idea to use about half dozen words from the middle of a line of 
trigger text, and put wildcards both ends. This way, if a word at either end 
is lost, or the prompt goes slightly over, then the trigger will still 
activate - it makes it less sensitive to minor variations in your combat text. 
Note triggers are not case sensitive. 

Triggers have a lot of uses: here's another:

/trig *A pestilence demon gives you anorexia* = light pipe%;smoke pipe

This assumes I have a hotkey that fills the pipe with megillos before I go 
into a fight.



[6] /hilite

This command works just like /trig - you have trigger text, and a response. 
The difference is that /hilite highlights the trigger text as well as acting 
on it.
example:

/hilite *A demonic pestilence gives you * = light pipe%;smoke pipe

You can use this feature without any response to the trigger:

/hilite *shaitan* 
will highlight all signs of shaitan - on the who list, for example.



[7] /visual on

This command is quite nice. Basically, it splits the screen. 
In the bottom half (3 lines)  it puts the prompt, and your entered commands. 
The top (main half) is used to display all the normal output from Avalon. 
It is handy for keeping track of what you're typing in the middle of a fight.



[8] /set

This is the command you've all been waiting for - targets!!!
Once you start getting this deep into tf commands, it's more like using a 
computer language than a user friendly mud interface (not that tf is 
particularly user friendly, or I wouldn't need to be writing this)
We set up targets by defining a variable - I use t - and referring to this 
variable in our macros.
Let us go back to the Fkey commands - this is where targets are most useful.
Example:

/bind [12~ = cast %{t}

Then we want our target to be Shaitan (for example)

/set t=shaitan

Now, every time we press F1, it does cast Shaitan instead.
If you want to change target, just redo the set command, with a different 
name. You can even use this on ccc's.
 
If you want to know what t is currently set to, just type:
/set t

(one point about variables - the full designation of a variable substitution 
is %{t}, but this can often be abbreviated, as shown above)





[9] {n}
Here's an interesting way to combine targets, and macros. Note,
all tf commands can be nested
example:

/hook send en * = /set t={2} %; enemy %{t} 25

Well, what does this weird command do? Basically, when I type

en shaitan <CR>

it defines Shaitan as my target, and sticks him on my enemy list. Very useful 
when you're a Mage! (On some versions of tf, it might prefer {1} instead 
of {2}) The {n} refers to the nth word in the command line. In the above 
example, {1} is en, {2} is shaitan, {3} is undefined. This can be used quite 
easily to simplify bulk commands, that require multiple entries. Let's say 
you are an aide to state, stocking the food stall. Instead of having to use
city stalls add mfood meat 6
followed by
city stalls add mfood bread 10
etc.
you define :

/hook send af * = city stalls add mfood {2} {3}
and type:

af bread 10 <CR>
etc.



[10] Extra /list commands

With all the different types of macros you can now define, /list gets a little
long and complicated.
/listbind
/listhook
/listtrig
and /listhilite
enable you to look at specific types of macro in your list.
This can also be used for /save
i.e. /savehook



That's all folks
--------------------

Well, that's more or less it for most of the useful tf commands. Tf can 
handle a LOT more than I have introduced here - you might want to start 
putting Boolean algebra into your aliases, or strange variable collections 
on your hotkeys. You can even put in time delay commands for magic, so you're 
not always waiting for equilibrium!
Something worth trying is putting your /load and /require statements into the 
tfrc file in the tf.lib directory - this will load them up whenever you run 
Tinyfugue. See /help .tfrc for more details.

If you have any problems, the /help files are very thorough, if a little 
cryptic. If you're STILL puzzled after reading through the appropriate 
literature, I'm online in avalon a lot of the time, as Archmage Hero. You can 
also contact me through Email - ee95jjg@brunel.ac.uk, or my webpage
http://www.brunel.ac.uk/~ee95jjg
(I'll do my best to help you with installation problems, but I'm a user, not 
an admin. However, if it tells you that you have a processor problem when you 
try to install, basically, you're screwed. Get an already installed copy off 
a friend, and change the user permissions so you can use their copy. Also, 
change the variable TFLIBDIR=where/you/are/keeping/tf.lib in your .cshrc 
file). Good luck, and may your macros never fail!

James Gater, the tfmeister (well, I do my best!)



By the way - if you hunger for more, then the 'Advanced Guide to tf' is now 
available.