Newbie scripts database

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Newbie scripts database

Post by Rhaegar » 19 Jan 2011 05:39

I've decided to create a database with basic scripts for different clients (just post them here if you like).
This way the community may check them out, comment on them and improve them if needed and they could be later put on the main page for people to download and use if they'd like to (if they're not happy with the online client for example).

I'll start with TF.

Usage:

You can get the latest TF here

1. Download and extract the script (duh).
2. Linux: rename to .tfrc and put it in your home directory (usually /home/username/)
Windows: copy & paste contents below the line in tfrc in client folder
3. Enjoy!

Features:

It automates some of the tedious tasks without ruining the game with spoilers, giving people advanced scripts that automate everything, allow them to idle forever or anything like that. Fairly simple to use too.

I'd like it very much if people could take it for a spin and leave feedback here so I could improve the scripts.
Attachments
genesis_tf.zip
genesis script
(4.49 KiB) Downloaded 501 times
Last edited by Rhaegar on 25 Jan 2011 18:55, edited 2 times in total.
I fear no evil for I am fear incarnate.

User avatar
Kitriana
Champion
Posts: 627
Joined: 04 Mar 2010 04:46
Location: United Kingdom

Re: Newbie scripts database

Post by Kitriana » 19 Jan 2011 13:43

This is a great idea... thanks for working on it!
If something I wrote sounds confusing ... assume you misunderstood it.

User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Re: Newbie scripts database

Post by Rhaegar » 19 Jan 2011 23:33

Updated the scripts. Added comments and documentation.

Here's the README file I included:

Code: Select all

;
; Manual for basic TinyFugue scripts
;

; Table of contents

1. Introduction
2. Scriptfiles overview
3. Troubleshooting

;
; 1. Introduction
;

This is a brief manual to get you started on the basic TF
scripts. It will cover the basic commands you can use as
well as describe what you can find in the script files.
It is highly advised that you browse the files themselves
(you can do this using any text editing software) to have
a look at what do they look like and what do they contain.
All more complex aliases and definitions are commented so
you can easily grasp how they work.

First thing to do is installing TinyFugue and placing file
called "tfrc" in its respective place (this varies on your
operating system, in case of Windows you will already have
"tfrc" file in the TF directory, just edit it and put the
lines from provided file there) and edit the paths in it
to correspond to the place where you put your script files.

;
; 2. Scriptfiles overview
;

All files follow the same structure. You have the file name
followed by its "dependencies" which are other files that
must be loaded for the script to work.
Then come the "variables" which are values the script stores
and uses in its triggers. Most common values are 1 (for true
or on), 0 (for false or off) and string (a word or a set of
words). Most variables change automatically thanks to the
script but some need to be changed manually.
The files also contain definitions (most of those are used
for controlling variables) and triggers (definitions which
are launched automatically when their trigger occurs).

You can see the current values of variables using the commands:
/cvar - for combat
/ivar - for items
/tvar - for teams

You can also reset the variables to default values at any time:
/creset
/ireset
/treset

aliases.tf - this is the file containing the basic aliases.
there are very few of them initially but feel free to add
your own.

combat.tf - this is the file containing the basic combat
aliases and triggers.
Here are some examples of how to use it:
k <target> - kills your <target>. <target> is semi-optional
				 as it will default to your previous entry.
				 Example: If you typed "k orc" and want to kill
				 another orc, all you need to do is type "k"
				 and the script will automatically send "kill
				 orc" to the world.

bc - this alias displays your current number of kills.

/atk - this switch turns auto-killing on and off. Whenever
		 you kill something and this is on, the script will
		 automatically use the command "k".

hilites.tf - this is a file with basic definitions for
				 color-coding world and client output.

items.tf - this is the file containing the basic commands
			  and triggers for item handling.
Usage examples:
/coins - switch for automatic coins looting when you kill.

/gems - switch for gems looting.

/pack - switch that turns automatic packing on and off,
		  it is largerly automated (it turns on when you
		  wear a pack and off when you remove it) but you
		  can always switch it manually with this command.

loot <n> - gets all from n corpses. n must be a number
			  in the 2-5 range. If no number is given or the
			  number is beyond 2-5 range only one corpse will
			  be looted.

/lootarmours - loots armours from 5 corpses.
/lootweapons - loots weapons from 5 corpses.
/lootcoins - loots coins from 5 corpses.
/lootgems - loots gems from 5 corpses

/light - switches automatic lamp handling on and off.
         If on it will re-fill your lamp with oil and
			drop empty oil-flasks.

teams.tf - this is the script for handling teams.

Usage:
/assist - switch automatic assisting on or off (off by
          default, need to be set manually).

/leader <name> - this sets your team leader (done automatically
                 by default, you can override it with this
					  command). If no name is given it will set leader
					  to "none" and reset team variables to default
					  values.

travel.tf - travel assistant script. Lets you board and disembark
	         ships automatically.

Usage:
/board - switches automatic boarding on and off.

;
; 3. Troubleshooting
;

The most common errors in TF usually have 2 sources:
1. Unsatisfied dependencies - when a definition needs a variable or
   another definition which are in a different file.
	This can be solved easily by loading the required file.

2. Line breaking and whitespaces - those can take some time to weed
   out. The problem here is that some file editing software uses
	different formatting and doesn't recognise linebreaks or spaces
	properly.
	To solve this you must go through the file and make sure that:
	a) in definitions and aliases that span more than one line, that
	   each line ends in \
		This sign tells TF that he should ignore the rest of the line
		and continue from the next one. Without it it will think that
		the next line is a separate definition. To avoid this you
		should turn auto-wrapping lines off in some cases.
	b) whitespace following trailing \. This is a very common error
	   and it simply means that you have a space (or more) after the
		line break "\" sign. Deleting the spaces solves the issue.

This concludes this brief guide. I hope you will enjoy using the
scripts.
Let me know what you think if you get to try it out.
I fear no evil for I am fear incarnate.

User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Re: Newbie scripts database

Post by Rhaegar » 24 Jan 2011 15:28

Update pending.
I've scrapped the entire documentation/comments idea (I suck at commenting my own files) and opted for something different instead.
The internal help file for the scripts.

Examples:

Image

Image

What do you think about it?
I fear no evil for I am fear incarnate.

User avatar
Cherek
Site Admin
Posts: 3612
Joined: 04 Mar 2010 04:36

Re: Newbie scripts database

Post by Cherek » 25 Jan 2011 15:15

Is there a way to make it automated? So you just have to download ONE file (self-executable, zip, rar, dmg, whatever you like) that includes the tinyfugue client with your scripts and aliases all included and automatically connecting to Genesis?

If so it might be a really good thing to have on the webpage?

I know Gorboth have asked for something like that. I have been thinking about making a Zmud Genesis profile that autoinstall with Zmud, but I am not the best at these things...

User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Re: Newbie scripts database

Post by Rhaegar » 25 Jan 2011 17:35

Hard to do, as TF comes with different builds for various platforms and has some slight differences, like the Windows version which comes with cygwin so that TF understands the paths but you still have to write them the Linux way and add additional stuff (/cygdrive/c/Program Files/myscript.tf for example). And the Linux version comes as a source you need to configure, make and install yourself.

I guess the best thing I can do is make it just one file. Technically I don't need to split the files and can put them all into the .tfrc so all the user would have to do is place it in his home folder or in case of Windows copy and paste the contents into the tfrc file it comes with (unless someone can provide me with Windows tfrc so I can put it right there and again you'd only need to replace it). I'm also working on breaking the lines better so linewrap wouldn't be an issue. Would that be better?
I fear no evil for I am fear incarnate.

User avatar
Cherek
Site Admin
Posts: 3612
Joined: 04 Mar 2010 04:36

Re: Newbie scripts database

Post by Cherek » 25 Jan 2011 18:55

Well if you run Linux I think you are the type of person that doesnt bother with placing scripts in folders and compiling your client. But a generic Windows user would probably like to doubleclick an install file (or self-extracting exe) and just click "Ok" to have it installed. Then run the program and have it automatically connect to Genesis with all the settings included.

For it to work as a webpage downloadable I think it has to be that simple.

I think it could be doable with an old version of Zmud and basic triggers and aliases. I have never used tinyfuge so I have no idea how it works. You're the expert.

Oh and yes, visually an automatic linewrap would look better I think.

User avatar
Rhaegar
Legend
Posts: 960
Joined: 13 May 2010 06:22

Re: Newbie scripts database

Post by Rhaegar » 25 Jan 2011 18:59

Update!

Made it just one file and easier to use. Would greatly appreciate it if someone could check it out and provide some feedback (also, if someone could grab me this windows tfrc file it would be awesome). I have no idea how does it look like on OS X, if someone could comment on this I'd be grateful.
Helper not included yet, still working on it.
Changed README to just list available commands for now.

@Cherek: Windows TF installer does just that, you double-click the exe, click OK and it installs it (you might have to select the directory). I'm not competent enough to write a self-extracting file which would search for TF install and replace files as needed...
And with linewrap I meant the code so it wouldn't get butchered on some machines.
I fear no evil for I am fear incarnate.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/