<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://govbanned.info/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sulfar</id>
	<title>AvatarWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://govbanned.info/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sulfar"/>
	<link rel="alternate" type="text/html" href="http://govbanned.info/index.php/Special:Contributions/Sulfar"/>
	<updated>2026-04-06T08:41:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33895</id>
		<title>Enchantbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33895"/>
		<updated>2008-11-25T09:07:49Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: adds link to http directory with the scripts, and wget line to get them all&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h4&amp;gt;Features&amp;lt;/h4&amp;gt;&lt;br /&gt;
So you have a pile of armor to enchant.  And a couple of weapons and bows to go with that.  Well you toss it all in fodderbag, run this script, and collect the results from upgradebag, sparebag or wastebag.  Or if you don't configure it with your current gear, you can collect the items from brillbag, shimmerbag, wastebag.  It accepts some options:&lt;br /&gt;
&lt;br /&gt;
* -l enchanting with an unshadowed lord&lt;br /&gt;
* -w&amp;lt;level&amp;gt; level we want to wear the item at&lt;br /&gt;
* -x&amp;lt;command&amp;gt; execute &amp;lt;command&amp;gt; when done&lt;br /&gt;
&lt;br /&gt;
The script will use &amp;quot;get 1. fodderbag&amp;quot;, identifies 1., and from then on it'll use the keywords it got from identify.  It will check the names of&lt;br /&gt;
* the item you got from the fodderbag&lt;br /&gt;
* the first item in your inventory&lt;br /&gt;
* the name it gets by looking at the keywords it got from identify&lt;br /&gt;
If they're not all the same it won't enchant the item.&lt;br /&gt;
&lt;br /&gt;
It sets config +blind, +combine, -condition, +nosummon, +notake, +nodisturb and filter +spellother to decrease the chance of anything/anyone messing up the script.  That should make sure the triggers don't respond on people cutting/pasting brills to channels, the triggers work on you inventory, your regen is not interrupted and the triggers won't respond to other players enchants.  Config +blind doesn't affect grtz channel but that is still covered by safechannel.tf.  The script uses config.tf to store/restore your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Example config file&amp;lt;/h4&amp;gt;&lt;br /&gt;
The script will try to load an enchantbag.gear.tf file with a configuration of gear.  It's simply a list of variables, like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/set enchantbag_hero_essence_amorphous_orb                  11dr 10dr&lt;br /&gt;
/set enchantbag_hero_hero_heroes_shield                     b12    b12&lt;br /&gt;
/set enchantbag_hero_bow_sliver_glowing_moonlight_arc       21hr&lt;br /&gt;
/set enchantbag_hero_lemans_family_seal_talisman            b12 -9 b12 -6&lt;br /&gt;
&lt;br /&gt;
;To reuse a value for an equivalent item, you could&lt;br /&gt;
/eval /set enchantbag_hero_mother_pearl %{enchantbag_hero_lemans_family_seal_talisman}&lt;br /&gt;
&lt;br /&gt;
;Lord stuff&lt;br /&gt;
/set enchantbag_lord_essence_amorphous_orb                  15dr 13dr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the variable name, you'd append &amp;quot;enchantbag_&amp;quot; with either &amp;quot;hero_&amp;quot;, &amp;quot;lord_&amp;quot;, or &amp;quot;lowmort_&amp;quot;, then append that with the keywords you get from identify, remove &amp;quot;weird&amp;quot; characters (anything not in [a-zA-Z0-9 ]) and turn spaces into underscores.&lt;br /&gt;
&lt;br /&gt;
The first value is the current gear, anything above that will go into upgradebag.  The second value is the lowest spare that should go into sparebag.  The script currently treats spares kinda aggressively, it'll try to enchant a 12 -3 spare to a 12 -6 spare if the level permits, even if you have 12 -3 as lowest spare to keep.  Perhaps I should switch that around, I don't know yet.  You can omit the second value, it'll then use the default ranges for spares.&lt;br /&gt;
&lt;br /&gt;
If you're enchanting armor and want to use the configuration, you'll also need to add the item to [[identify.tf]] to know the multiplier for the armor class.  A bunch of them are already there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Stuff you need&amp;lt;/h4&amp;gt;&lt;br /&gt;
This script uses [[config.tf]], [[verbose.tf]], [[enchant.tf]] and [[identify.tf]] so you'll want those if you want to use this script.  Config.tf and identify.tf use [[prompt.tf]], and enchant.tf uses [[regen.tf]] and [[safechannel.tf]] so get those while you're at it.  &amp;lt;b&amp;gt;If you update this script from an older version, please update these scripts as well,&amp;lt;/b&amp;gt; or strange things might happen, or it might not work at all.  You don't need to cut and paste them all, you can download them from [http://drieman.dyndns.org/avatar-tf/ here].  People with wget (mostly linux users) can just open a terminal window, cd to their tf scripts directory and cut'n'past this all at once:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wget http://drieman.dyndns.org/avatar-tf/enchantbag.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/enchant.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/config.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/verbose.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/identify.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/prompt.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/regen.tf \&lt;br /&gt;
  http://drieman.dyndns.org/avatar-tf/safechannel.tf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll also need some bags, look at the comments in the script for a list of etches and christens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Examples&amp;lt;/h4&amp;gt;&lt;br /&gt;
Enchant a pile of stuff with a hero for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of mother pearls with an unshadowed lord but for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of amorphous orbs or doom shards for lord and sleep afterwards:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l -w125 -xsleep&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you'd want to see all debug spam it produces, try&lt;br /&gt;
&amp;lt;pre&amp;gt;/verbose -s3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Disclaimer&amp;lt;/h4&amp;gt;&lt;br /&gt;
I didn't test enchanting piles of lord eq.  If you know any such piles please let me know where I can pick them up ;)&lt;br /&gt;
&lt;br /&gt;
I'm guessing a hero level bow would raise 5 levels if you'd enchant it with a lord.  I'm not sure.  Also don't know why anybody would want to do that so I can't be bothered to check it.  I did check all the other level increments.&lt;br /&gt;
&lt;br /&gt;
I've used this script quite a number of times now and debugged it extensively.  It works fine for me.  However, if you were to vape your b12 -9 shield or heros, or blow your 13/13 hero level doom shard, I'll be more than happy to accept your bug report but will not accept any responsibility for the items.  I guess keeping your inventory clean is the way to be 100% sure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;The script&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}enchant.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}config.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /enchantbag           Enchant all items in fodderbag and distribute results&lt;br /&gt;
/echo -aCyellow %%      [-l]                 you're an unshadowed lord.  Default: you're a hero&lt;br /&gt;
/echo -aCyellow %%      [-w&amp;lt;level&amp;gt;]          you wear the item at level &amp;lt;level&amp;gt;.  Default 51.&lt;br /&gt;
/echo -aCyellow %%      [-x&amp;lt;command&amp;gt;]        execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
;etch           christen&lt;br /&gt;
;fodderbag      Fodderbag&lt;br /&gt;
;upgradebag     Upgradebag&lt;br /&gt;
;sparebag       Sparebag&lt;br /&gt;
;wastebag       Wastebag&lt;br /&gt;
;brillbag       Brillbag&lt;br /&gt;
;shimmerbag     Shimmerbag&lt;br /&gt;
;&lt;br /&gt;
;Only the rename of the fodderbag matters, enchantbag_got_item triggers on it&lt;br /&gt;
;Use the same name or change the trigger to match your bag&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var enchantbag_exit to&lt;br /&gt;
;ok             enchantbag finished correctly with an empty fodderbag&lt;br /&gt;
;enchant_err    we got an error code from enchant.tf&lt;br /&gt;
;no_fodderbag   couldnt find the fodderbag&lt;br /&gt;
;wrong_name     names didn't check out&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchantbag&lt;br /&gt;
&lt;br /&gt;
;Range to use if we didn't set the lowest spare to keep in the config file&lt;br /&gt;
;Range includes the item in the gear, so if the armor spare range is 4 and the&lt;br /&gt;
;item in our gear is a 12 -9 lemans seal, the lowest upgrade would be b12 -10,&lt;br /&gt;
;and the spares could be b12 -7, b12 -8, b12 -9.  If the level permits&lt;br /&gt;
;enchanting tho, the script *will* try to make a b12 -9 spare out of a b12 -6,&lt;br /&gt;
;or enchant a 12-9 spare to a 12-12 upgrade.&lt;br /&gt;
/set enchantbag_armor_spare_range=3&lt;br /&gt;
/set enchantbag_weapon_spare_range=2&lt;br /&gt;
/set enchantbag_bow_spare_range=3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Load file with current gear&lt;br /&gt;
/set enchantbag_gear_file=enchantbag.gear.tf&lt;br /&gt;
/eval /set enchantbag_path=%{TINYPREFIX}&lt;br /&gt;
/eval /load -q %{enchantbag_path}%{enchantbag_gear_file}&lt;br /&gt;
&lt;br /&gt;
;should NOT set enchantbag_post here&lt;br /&gt;
/def -i enchantbag_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set enchantbag=0%;\&lt;br /&gt;
        /set enchantbag_name=%;\&lt;br /&gt;
        /set enchantbag_name_check=0%;\&lt;br /&gt;
        /set enchantbag_inv=0%;\&lt;br /&gt;
        /set enchantbag_inv_name=%;\&lt;br /&gt;
        /set enchantbag_level_increment=0%;\&lt;br /&gt;
        /set enchantbag_enchant_count=0%;\&lt;br /&gt;
        /set enchantbag_max_level=0%;\&lt;br /&gt;
        /set enchantbag_fade=0%;\&lt;br /&gt;
        /set enchantbag_shimmer=0%;\&lt;br /&gt;
        /set enchantbag_brill=0%;\&lt;br /&gt;
        /set enchantbag_vape=0%;\&lt;br /&gt;
        /set enchantbag_item_known=0%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_exit=&lt;br /&gt;
&lt;br /&gt;
/enchantbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /set enchantbag_enchanter_level=51%;\&lt;br /&gt;
        /set enchantbag_wear_level=51%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0: Start processing bag.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Loading %{enchantbag_path}%{enchantbag_gear_file}.%;\&lt;br /&gt;
        /load -q %{enchantbag_path}%{enchantbag_gear_file}%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;lx:w#&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_l) /set enchantbag_enchanter_level 125%;/endif%;\&lt;br /&gt;
        /if (opt_w) /set enchantbag_wear_level %{opt_w}%;/endif%;\&lt;br /&gt;
        /set enchantbag_post %{opt_x}%;\&lt;br /&gt;
        /config_store -senchantbag -x/enchantbag_config_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_config_done = \&lt;br /&gt;
        /filter_store -senchantbag -x/enchantbag_filter_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_filter_done = \&lt;br /&gt;
        config +blind%;\&lt;br /&gt;
        config +combine%;\&lt;br /&gt;
        config -condition%;\&lt;br /&gt;
        config +nosummon%;\&lt;br /&gt;
        config +notake%;\&lt;br /&gt;
        config +nodisturb%;\&lt;br /&gt;
        filter +spellother%;\&lt;br /&gt;
        /enchantbag_next_item&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_next_item = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Getting next item from the fodderbag.%;\&lt;br /&gt;
        get 1. fodderbag&lt;br /&gt;
&lt;br /&gt;
;Bag empty.  We're finished.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;You see nothing like that in Fodderbag.&amp;quot; enchantbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Your fodderbag is empty.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit ok&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Fodderbag in a bag?&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;I see no fodderbag here.&amp;quot; enchantbag_no_fodderbag = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% You are not carrying the fodderbag.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit no_fodderbag&lt;br /&gt;
&lt;br /&gt;
;New item.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from Fodderbag.$&amp;quot; enchantbag_got_item = \&lt;br /&gt;
        /set enchantbag_name %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% Got %{enchantbag_name}.  Going to identify it.%;\&lt;br /&gt;
        /identify -x/enchantbag_identify_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Done identifying.  Doing cross reference on name.%;\&lt;br /&gt;
        /set enchantbag_name_check 1%;\&lt;br /&gt;
        inv%;\&lt;br /&gt;
        look &amp;quot;%{identify_object}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -p799 -t&amp;quot;You are carrying:&amp;quot; enchantbag_inv = \&lt;br /&gt;
        /def -1 -mregexp -p900 -t&amp;quot;^(\\( ?[0-9]+\\)|    ) (\\([a-zA-Z]+\\) )\*([^\\[]+)( \\[.+)\*\$&amp;quot; _enchantbag_inv = \&lt;br /&gt;
                /set enchantbag_inv_name=%%{P3}%%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%%% /%%0: First item in inventory is %%enchantbag_inv_name&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -mregexp -t&amp;quot;^You look at (.+) in your inventory...$&amp;quot; enchantbag_name_check = \&lt;br /&gt;
        /let identify_name %{P1}%;\&lt;br /&gt;
        /set enchantbag_name_check 0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Looking at %identify_object, we got: %identify_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: First item in inventory is %enchantbag_inv_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We got %enchantbag_name from the fodderbag.%;\&lt;br /&gt;
        /if ((identify_name =~ enchantbag_name) &amp;amp; (identify_name =~ enchantbag_inv_name)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Names ok.%;\&lt;br /&gt;
                /repeat -0.3 1 /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Names mismatch.  Exit.  Messy inventory?%;\&lt;br /&gt;
                /enchantbag_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_processor = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Processing identify information.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: brill is %enchantbag_brill, shimmer is %enchantbag_shimmer, level is %identify_level.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: fade is %enchantbag_fade, vape is %enchantbag_vape, enchant_count is %enchantbag_enchant_count%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_armor%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_weapon%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_bow%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (enchantbag_item_known) \&lt;br /&gt;
                /if (enchantbag_upgrade) \&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; upgradebag%;\&lt;br /&gt;
                        save%;\&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: An upgrade!  Stashing... Next!%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_possible_upgrade) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible upgrade!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done &amp;quot;%{identify_object}&amp;quot;%;\&lt;br /&gt;
                /elseif (enchantbag_possible_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible spare!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done &amp;quot;%{identify_object}&amp;quot;%;\&lt;br /&gt;
                /elseif (enchantbag_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A spare!  Stashing... Next!%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; sparebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: This item goes to waste... Next!%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: Item unknown.  Using simple distribution method.%;\&lt;br /&gt;
                /if (enchantbag_brill) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into brillbag.%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; brillbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_shimmer) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into shimmerbag.%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; shimmerbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (identify_level &amp;lt; enchantbag_max_level) \&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done &amp;quot;%{identify_object}&amp;quot;%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into wastebag.%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_enchant_done = \&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_type|no_item|wrong_type&amp;quot;, enchant_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Exit enchantbag, enchant_err.%;\&lt;br /&gt;
                /enchantbag_exit enchant_err%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;wrong_name&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Rechecking names.%;\&lt;br /&gt;
                /identify -x/enchantbag_identify_done 1.%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;vape&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCred %%% /%0: Our item vaped...  Next!%;\&lt;br /&gt;
                /enchantbag_next_item%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;fade&amp;quot;) \&lt;br /&gt;
                /send get idontwanttoLID%;\&lt;br /&gt;
                /test ++identify_level%;\&lt;br /&gt;
                /set identify_enchant_armor 0%;\&lt;br /&gt;
                /set identify_enchant_weapon 0%;\&lt;br /&gt;
                /set identify_enchant_bow 0%;\&lt;br /&gt;
                /set enchantbag_fade 1%;\&lt;br /&gt;
                /set enchantbag_brill 0%;\&lt;br /&gt;
                /set enchantbag_shimmer 0%;\&lt;br /&gt;
                /set enchantbag_enchant_count 0%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_fade 0%;\&lt;br /&gt;
                /test identify_level += %enchantbag_level_increment%;\&lt;br /&gt;
                /test ++enchantbag_enchant_count%;\&lt;br /&gt;
                /if (enchant_exit =~ &amp;quot;shimmer&amp;quot;) \&lt;br /&gt;
                        /test ++enchantbag_shimmer%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test ++identify_enchant_weapon%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 2%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (regmatch(&amp;quot;presence|brill&amp;quot;, enchant_exit)) \&lt;br /&gt;
                        /test ++enchantbag_brill%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 3%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_weapon += 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 3%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_armor = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this piece of armor?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /if (!identify_armor_multiplier) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know the armor multiplier for %identify_object.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let id_total_armor=0%;\&lt;br /&gt;
        /let id_max_armor=0%;\&lt;br /&gt;
        /let acgear_stats=%;\&lt;br /&gt;
        /let acgear_base=0%;\&lt;br /&gt;
        /let acgear_enchant=0%;\&lt;br /&gt;
        /let acgear_total_armor=0%;\&lt;br /&gt;
        /let acgear_spare_base=0%;\&lt;br /&gt;
        /let acgear_spare_enchant=0%;\&lt;br /&gt;
        /let acgear_spare_armor=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_armor $[(identify_armor_class * identify_armor_multiplier) - identify_enchant_armor]%;\&lt;br /&gt;
        /test acgear_stats:=enchantbag_get_stats(identify_object)%;\&lt;br /&gt;
        /if (acgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our acgear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;b([0-9]+) \*(-?\\+?[0-9]\*) \*b?([0-9]\*) \*(-?\\+?[0-9]\*)$$&amp;quot;, acgear_stats)%;\&lt;br /&gt;
        /let acgear_base %{P1}%;\&lt;br /&gt;
        /let acgear_enchant %{P2}%;\&lt;br /&gt;
        /let acgear_spare_base %{P3}%;\&lt;br /&gt;
        /let acgear_spare_enchant %{P4}%;\&lt;br /&gt;
        /let acgear_total_armor $[acgear_base * identify_armor_multiplier - acgear_enchant]%;\&lt;br /&gt;
        /let acgear_spare_armor $[acgear_spare_base * identify_armor_multiplier - acgear_spare_enchant]%;\&lt;br /&gt;
        /if (!acgear_spare_armor) \&lt;br /&gt;
                /let acgear_spare_armor $[acgear_total_armor - enchantbag_armor_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_armor $[id_total_armor - (possible_enchants * -3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_armor &amp;gt; acgear_total_armor]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_armor &amp;gt; acgear_total_armor)]%;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_armor &amp;gt;= acgear_spare_armor)]%;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_armor &amp;gt;= acgear_spare_armor]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our acgear, we have base %acgear_base, enchant %acgear_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Lowest spare we want to keep is base %acgear_spare_base, enchant %acgear_spare_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Armor class multiplier of this item is %identify_armor_multiplier%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCred %%% /%0: Acgear item has a total armor of %acgear_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Spare item has min armor of %acgear_spare_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has a total armor of %id_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: We could make the total armor %id_max_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_weapon = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this weapon?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;essence amorphous orb|shard black doom marble&amp;quot;, identify_object)) \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 5]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_dr=0%;\&lt;br /&gt;
        /let id_max_dr=0%;\&lt;br /&gt;
        /let damgear_stats=%;\&lt;br /&gt;
        /let damgear_total_dr=0%;\&lt;br /&gt;
        /let damgear_spare_dr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_dr $[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let damgear_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (damgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)dr \*([0-9]+)?(dr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let damgear_total_dr %{P1}%;\&lt;br /&gt;
        /let damgear_spare_dr %{P2}%;\&lt;br /&gt;
        /if (!damgear_spare_dr) \&lt;br /&gt;
                /let damgear_spare_dr $[damgear_total_dr - enchantbag_weapon_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_dr $[id_total_dr + (possible_enchants * 2)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_dr &amp;gt; damgear_total_dr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_dr &amp;gt; damgear_total_dr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_dr &amp;gt;= damgear_spare_dr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_dr &amp;gt;= damgear_spare_dr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our damgear, we have a %{damgear_total_dr}dr weapon%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %id_total_dr dr.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total dr %id_max_dr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_bow = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: The item is a bow.  Preprocessing.%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this bow?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
;DEBUG don't actually know what the level would do if a lord enchanted a hero&lt;br /&gt;
;DEBUG bow, this is a guess.  Also wouldn't know why you'd want to do a thing&lt;br /&gt;
;DEBUG like that&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_hr=0%;\&lt;br /&gt;
        /let id_max_hr=0%;\&lt;br /&gt;
        /let bow_cur_stats=%;\&lt;br /&gt;
        /let bow_cur_hr=0%;\&lt;br /&gt;
        /let bow_spare_hr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_hr $[identify_hr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let bow_cur_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (bow_cur_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)hr \*([0-9]+)?(hr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let bow_cur_hr %{P1}%;\&lt;br /&gt;
        /let bow_spare_hr %{P2}%;\&lt;br /&gt;
        /if (!bow_spare_hr) \&lt;br /&gt;
                /let bow_spare_hr $[bow_cur_hr - enchantbag_bow_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_hr $[id_total_hr + (possible_enchants * 3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_hr &amp;gt; bow_cur_hr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_hr &amp;gt; bow_cur_hr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_hr &amp;gt;= bow_spare_hr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_hr &amp;gt;= bow_spare_hr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: We have a %{bow_cur_hr}hr bow in our gear%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %{id_total_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total hr %{id_max_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_get_stats = \&lt;br /&gt;
        /if (enchantbag_wear_level == 51) \&lt;br /&gt;
                /let var_mid hero%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level == 125) \&lt;br /&gt;
                /let var_mid lord%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level &amp;lt;= 50) \&lt;br /&gt;
                /let var_mid lowmort%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let var_right=%*%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
        /test var_right:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_right)%;\&lt;br /&gt;
        /test var_right:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_right)%;\&lt;br /&gt;
        /let varname enchantbag_%{var_mid}_%{var_right}%;\&lt;br /&gt;
        /eval /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%%% /%0: Stats we have on file for %identify_object is %%{%{varname}}%;\&lt;br /&gt;
        /eval /return &amp;quot;%%{%{varname}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_possible_enchants = \&lt;br /&gt;
        /let pos_ench=0%;\&lt;br /&gt;
        /let counter %{identify_level}%;\&lt;br /&gt;
        /while (counter &amp;lt; enchantbag_wear_level - 1) \&lt;br /&gt;
                /if (counter + enchantbag_level_increment &amp;lt;= enchantbag_max_level) \&lt;br /&gt;
                        /test ++pos_ench%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /test counter+=enchantbag_level_increment%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /if (enchantbag_enchanter_level == enchantbag_wear_level) \&lt;br /&gt;
                /test pos_ench+=$[enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment))]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test pos_ench+=$[(enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment)))/enchantbag_level_increment]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (pos_ench &amp;lt; 0) /let pos_ench 0%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: We could enchant %pos_ench more times%;\&lt;br /&gt;
        /return %{pos_ench}&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_exit = \&lt;br /&gt;
        /let _post %enchantbag_post%;\&lt;br /&gt;
        /config_restore -senchantbag blind%;\&lt;br /&gt;
        /config_restore -senchantbag combine%;\&lt;br /&gt;
        /config_restore -senchantbag condition%;\&lt;br /&gt;
        /config_restore -senchantbag nosummon%;\&lt;br /&gt;
        /config_restore -senchantbag notake%;\&lt;br /&gt;
        /config_restore -senchantbag nodisturb%;\&lt;br /&gt;
        /config_rmset enchantbag%;\&lt;br /&gt;
        /filter_restore -senchantbag spellother%;\&lt;br /&gt;
        /filter_rmset enchantbag%;\&lt;br /&gt;
        /unset enchantbag%;\&lt;br /&gt;
        /unset enchantbag_name%;\&lt;br /&gt;
        /unset enchantbag_name_check%;\&lt;br /&gt;
        /unset enchantbag_inv%;\&lt;br /&gt;
        /unset enchantbag_inv_name%;\&lt;br /&gt;
        /unset enchantbag_level_increment%;\&lt;br /&gt;
        /unset enchantbag_enchant_count%;\&lt;br /&gt;
        /unset enchantbag_max_level%;\&lt;br /&gt;
        /unset enchantbag_fade%;\&lt;br /&gt;
        /unset enchantbag_shimmer%;\&lt;br /&gt;
        /unset enchantbag_brill%;\&lt;br /&gt;
        /unset enchantbag_vape%;\&lt;br /&gt;
        /unset enchantbag_item_known%;\&lt;br /&gt;
        /unset enchantbag_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_spare%;\&lt;br /&gt;
        /unset enchantbag_spare%;\&lt;br /&gt;
        /unset enchantbag_post%;\&lt;br /&gt;
        /unset enchantbag_enchanter_level%;\&lt;br /&gt;
        /unset enchantbag_wear_level%;\&lt;br /&gt;
        /set enchantbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0 reports: We're finished.  Post command is: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.3 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33894</id>
		<title>Enchantbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33894"/>
		<updated>2008-11-25T07:45:44Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: now uses the keywords it got from identify when it can, instead of 1. all the time&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h4&amp;gt;Features&amp;lt;/h4&amp;gt;&lt;br /&gt;
So you have a pile of armor to enchant.  And a couple of weapons and bows to go with that.  Well you toss it all in fodderbag, run this script, and collect the results from upgradebag, sparebag or wastebag.  Or if you don't configure it with your current gear, you can collect the items from brillbag, shimmerbag, wastebag.  It accepts some options:&lt;br /&gt;
&lt;br /&gt;
* -l enchanting with an unshadowed lord&lt;br /&gt;
* -w&amp;lt;level&amp;gt; level we want to wear the item at&lt;br /&gt;
* -x&amp;lt;command&amp;gt; execute &amp;lt;command&amp;gt; when done&lt;br /&gt;
&lt;br /&gt;
The script will use &amp;quot;get 1. fodderbag&amp;quot;, identifies 1., and from then on it'll use the keywords it got from identify.  It will check the names of&lt;br /&gt;
* the item you got from the fodderbag&lt;br /&gt;
* the first item in your inventory&lt;br /&gt;
* the name it gets by looking at the keywords it got from identify&lt;br /&gt;
If they're not all the same it won't enchant the item.&lt;br /&gt;
&lt;br /&gt;
It sets config +blind, +combine, -condition, +nosummon, +notake, +nodisturb and filter +spellother to decrease the chance of anything/anyone messing up the script.  That should make sure the triggers don't respond on people cutting/pasting brills to channels, the triggers work on you inventory, your regen is not interrupted and the triggers won't respond to other players enchants.  Config +blind doesn't affect grtz channel but that is still covered by safechannel.tf.  The script uses config.tf to store/restore your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Example config file&amp;lt;/h4&amp;gt;&lt;br /&gt;
The script will try to load an enchantbag.gear.tf file with a configuration of gear.  It's simply a list of variables, like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/set enchantbag_hero_essence_amorphous_orb                  11dr 10dr&lt;br /&gt;
/set enchantbag_hero_hero_heroes_shield                     b12    b12&lt;br /&gt;
/set enchantbag_hero_bow_sliver_glowing_moonlight_arc       21hr&lt;br /&gt;
/set enchantbag_hero_lemans_family_seal_talisman            b12 -9 b12 -6&lt;br /&gt;
&lt;br /&gt;
;To reuse a value for an equivalent item, you could&lt;br /&gt;
/eval /set enchantbag_hero_mother_pearl %{enchantbag_hero_lemans_family_seal_talisman}&lt;br /&gt;
&lt;br /&gt;
;Lord stuff&lt;br /&gt;
/set enchantbag_lord_essence_amorphous_orb                  15dr 13dr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the variable name, you'd append &amp;quot;enchantbag_&amp;quot; with either &amp;quot;hero_&amp;quot;, &amp;quot;lord_&amp;quot;, or &amp;quot;lowmort_&amp;quot;, then append that with the keywords you get from identify, remove &amp;quot;weird&amp;quot; characters (anything not in [a-zA-Z0-9 ]) and turn spaces into underscores.&lt;br /&gt;
&lt;br /&gt;
The first value is the current gear, anything above that will go into upgradebag.  The second value is the lowest spare that should go into sparebag.  The script currently treats spares kinda aggressively, it'll try to enchant a 12 -3 spare to a 12 -6 spare if the level permits, even if you have 12 -3 as lowest spare to keep.  Perhaps I should switch that around, I don't know yet.  You can omit the second value, it'll then use the default ranges for spares.&lt;br /&gt;
&lt;br /&gt;
If you're enchanting armor and want to use the configuration, you'll also need to add the item to [[identify.tf]] to know the multiplier for the armor class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Stuff you need&amp;lt;/h4&amp;gt;&lt;br /&gt;
This script uses [[config.tf]], [[verbose.tf]], [[enchant.tf]] and [[identify.tf]] so you'll want those if you want to use this script.  Config.tf and identify.tf use [[prompt.tf]], and enchant.tf uses [[regen.tf]] and [[safechannel.tf]] so get those while you're at it.  &amp;lt;b&amp;gt;If you update this script from an older version, please update these scripts as well,&amp;lt;/b&amp;gt; or strange things might happen, or it might not work at all.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll also need some bags, look at the comments in the script for a list of etches and christens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Examples&amp;lt;/h4&amp;gt;&lt;br /&gt;
Enchant a pile of stuff with a hero for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of mother pearls with an unshadowed lord but for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of amorphous orbs or doom shards for lord and sleep afterwards:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l -w125 -xsleep&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you'd want to see all debug spam it produces, try&lt;br /&gt;
&amp;lt;pre&amp;gt;/verbose -s3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Disclaimer&amp;lt;/h4&amp;gt;&lt;br /&gt;
I didn't test enchanting piles of lord eq.  If you know any such piles please let me know where I can pick them up ;)&lt;br /&gt;
&lt;br /&gt;
I'm guessing a hero level bow would raise 5 levels if you'd enchant it with a lord.  I'm not sure.  Also don't know why anybody would want to do that so I can't be bothered to check it.  I did check all the other level increments.&lt;br /&gt;
&lt;br /&gt;
I've used this script quite a number of times now and debugged it extensively.  It works fine for me.  However, if you were to vape your b12 -9 shield or heros, or blow your 13/13 hero level doom shard, I'll be more than happy to accept your bug report but will not accept any responsibility for the items.  I guess keeping your inventory clean is the way to be 100% sure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;The script&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}enchant.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}config.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /enchantbag           Enchant all items in fodderbag and distribute results&lt;br /&gt;
/echo -aCyellow %%      [-l]                 you're an unshadowed lord.  Default: you're a hero&lt;br /&gt;
/echo -aCyellow %%      [-w&amp;lt;level&amp;gt;]          you wear the item at level &amp;lt;level&amp;gt;.  Default 51.&lt;br /&gt;
/echo -aCyellow %%      [-x&amp;lt;command&amp;gt;]        execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
;etch           christen&lt;br /&gt;
;fodderbag      Fodderbag&lt;br /&gt;
;upgradebag     Upgradebag&lt;br /&gt;
;sparebag       Sparebag&lt;br /&gt;
;wastebag       Wastebag&lt;br /&gt;
;brillbag       Brillbag&lt;br /&gt;
;shimmerbag     Shimmerbag&lt;br /&gt;
;&lt;br /&gt;
;Only the rename of the fodderbag matters, enchantbag_got_item triggers on it&lt;br /&gt;
;Use the same name or change the trigger to match your bag&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var enchantbag_exit to&lt;br /&gt;
;ok             enchantbag finished correctly with an empty fodderbag&lt;br /&gt;
;enchant_err    we got an error code from enchant.tf&lt;br /&gt;
;no_fodderbag   couldnt find the fodderbag&lt;br /&gt;
;wrong_name     names didn't check out&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchantbag&lt;br /&gt;
&lt;br /&gt;
;Range to use if we didn't set the lowest spare to keep in the config file&lt;br /&gt;
;Range includes the item in the gear, so if the armor spare range is 4 and the&lt;br /&gt;
;item in our gear is a 12 -9 lemans seal, the lowest upgrade would be b12 -10,&lt;br /&gt;
;and the spares could be b12 -7, b12 -8, b12 -9.  If the level permits&lt;br /&gt;
;enchanting tho, the script *will* try to make a b12 -9 spare out of a b12 -6,&lt;br /&gt;
;or enchant a 12-9 spare to a 12-12 upgrade.&lt;br /&gt;
/set enchantbag_armor_spare_range=3&lt;br /&gt;
/set enchantbag_weapon_spare_range=2&lt;br /&gt;
/set enchantbag_bow_spare_range=3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Load file with current gear&lt;br /&gt;
/set enchantbag_gear_file=enchantbag.gear.tf&lt;br /&gt;
/eval /set enchantbag_path=%{TINYPREFIX}&lt;br /&gt;
/eval /load -q %{enchantbag_path}%{enchantbag_gear_file}&lt;br /&gt;
&lt;br /&gt;
;should NOT set enchantbag_post here&lt;br /&gt;
/def -i enchantbag_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set enchantbag=0%;\&lt;br /&gt;
        /set enchantbag_name=%;\&lt;br /&gt;
        /set enchantbag_name_check=0%;\&lt;br /&gt;
        /set enchantbag_inv=0%;\&lt;br /&gt;
        /set enchantbag_inv_name=%;\&lt;br /&gt;
        /set enchantbag_level_increment=0%;\&lt;br /&gt;
        /set enchantbag_enchant_count=0%;\&lt;br /&gt;
        /set enchantbag_max_level=0%;\&lt;br /&gt;
        /set enchantbag_fade=0%;\&lt;br /&gt;
        /set enchantbag_shimmer=0%;\&lt;br /&gt;
        /set enchantbag_brill=0%;\&lt;br /&gt;
        /set enchantbag_vape=0%;\&lt;br /&gt;
        /set enchantbag_item_known=0%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_exit=&lt;br /&gt;
&lt;br /&gt;
/enchantbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /set enchantbag_enchanter_level=51%;\&lt;br /&gt;
        /set enchantbag_wear_level=51%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0: Start processing bag.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Loading %{enchantbag_path}%{enchantbag_gear_file}.%;\&lt;br /&gt;
        /load -q %{enchantbag_path}%{enchantbag_gear_file}%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;lx:w#&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_l) /set enchantbag_enchanter_level 125%;/endif%;\&lt;br /&gt;
        /if (opt_w) /set enchantbag_wear_level %{opt_w}%;/endif%;\&lt;br /&gt;
        /set enchantbag_post %{opt_x}%;\&lt;br /&gt;
        /config_store -senchantbag -x/enchantbag_config_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_config_done = \&lt;br /&gt;
        /filter_store -senchantbag -x/enchantbag_filter_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_filter_done = \&lt;br /&gt;
        config +blind%;\&lt;br /&gt;
        config +combine%;\&lt;br /&gt;
        config -condition%;\&lt;br /&gt;
        config +nosummon%;\&lt;br /&gt;
        config +notake%;\&lt;br /&gt;
        config +nodisturb%;\&lt;br /&gt;
        filter +spellother%;\&lt;br /&gt;
        /enchantbag_next_item&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_next_item = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Getting next item from the fodderbag.%;\&lt;br /&gt;
        get 1. fodderbag&lt;br /&gt;
&lt;br /&gt;
;Bag empty.  We're finished.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;You see nothing like that in Fodderbag.&amp;quot; enchantbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Your fodderbag is empty.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit ok&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Fodderbag in a bag?&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;I see no fodderbag here.&amp;quot; enchantbag_no_fodderbag = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% You are not carrying the fodderbag.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit no_fodderbag&lt;br /&gt;
&lt;br /&gt;
;New item.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from Fodderbag.$&amp;quot; enchantbag_got_item = \&lt;br /&gt;
        /set enchantbag_name %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% Got %{enchantbag_name}.  Going to identify it.%;\&lt;br /&gt;
        /identify -x/enchantbag_identify_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Done identifying.  Doing cross reference on name.%;\&lt;br /&gt;
        /set enchantbag_name_check 1%;\&lt;br /&gt;
        inv%;\&lt;br /&gt;
        look &amp;quot;%{identify_object}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -p799 -t&amp;quot;You are carrying:&amp;quot; enchantbag_inv = \&lt;br /&gt;
        /def -1 -mregexp -p900 -t&amp;quot;^(\\( ?[0-9]+\\)|    ) (\\([a-zA-Z]+\\) )\*([^\\[]+)( \\[.+)\*\$&amp;quot; _enchantbag_inv = \&lt;br /&gt;
                /set enchantbag_inv_name=%%{P3}%%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%%% /%%0: First item in inventory is %%enchantbag_inv_name&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -mregexp -t&amp;quot;^You look at (.+) in your inventory...$&amp;quot; enchantbag_name_check = \&lt;br /&gt;
        /let identify_name %{P1}%;\&lt;br /&gt;
        /set enchantbag_name_check 0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Looking at %identify_object, we got: %identify_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: First item in inventory is %enchantbag_inv_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We got %enchantbag_name from the fodderbag.%;\&lt;br /&gt;
        /if ((identify_name =~ enchantbag_name) &amp;amp; (identify_name =~ enchantbag_inv_name)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Names ok.%;\&lt;br /&gt;
                /repeat -0.3 1 /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Names mismatch.  Exit.  Messy inventory?%;\&lt;br /&gt;
                /enchantbag_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_processor = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Processing identify information.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: brill is %enchantbag_brill, shimmer is %enchantbag_shimmer, level is %identify_level.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: fade is %enchantbag_fade, vape is %enchantbag_vape, enchant_count is %enchantbag_enchant_count%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_armor%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_weapon%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_bow%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (enchantbag_item_known) \&lt;br /&gt;
                /if (enchantbag_upgrade) \&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; upgradebag%;\&lt;br /&gt;
                        save%;\&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: An upgrade!  Stashing... Next!%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_possible_upgrade) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible upgrade!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done &amp;quot;%{identify_object}&amp;quot;%;\&lt;br /&gt;
                /elseif (enchantbag_possible_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible spare!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done &amp;quot;%{identify_object}&amp;quot;%;\&lt;br /&gt;
                /elseif (enchantbag_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A spare!  Stashing... Next!%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; sparebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: This item goes to waste... Next!%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: Item unknown.  Using simple distribution method.%;\&lt;br /&gt;
                /if (enchantbag_brill) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into brillbag.%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; brillbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_shimmer) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into shimmerbag.%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; shimmerbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (identify_level &amp;lt; enchantbag_max_level) \&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done &amp;quot;%{identify_object}&amp;quot;%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into wastebag.%;\&lt;br /&gt;
                        put &amp;quot;%{identify_object}&amp;quot; wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_enchant_done = \&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_type|no_item|wrong_type&amp;quot;, enchant_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Exit enchantbag, enchant_err.%;\&lt;br /&gt;
                /enchantbag_exit enchant_err%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;wrong_name&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Rechecking names.%;\&lt;br /&gt;
                /identify -x/enchantbag_identify_done 1.%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;vape&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCred %%% /%0: Our item vaped...  Next!%;\&lt;br /&gt;
                /enchantbag_next_item%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;fade&amp;quot;) \&lt;br /&gt;
                /send get idontwanttoLID%;\&lt;br /&gt;
                /test ++identify_level%;\&lt;br /&gt;
                /set identify_enchant_armor 0%;\&lt;br /&gt;
                /set identify_enchant_weapon 0%;\&lt;br /&gt;
                /set identify_enchant_bow 0%;\&lt;br /&gt;
                /set enchantbag_fade 1%;\&lt;br /&gt;
                /set enchantbag_brill 0%;\&lt;br /&gt;
                /set enchantbag_shimmer 0%;\&lt;br /&gt;
                /set enchantbag_enchant_count 0%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_fade 0%;\&lt;br /&gt;
                /test identify_level += %enchantbag_level_increment%;\&lt;br /&gt;
                /test ++enchantbag_enchant_count%;\&lt;br /&gt;
                /if (enchant_exit =~ &amp;quot;shimmer&amp;quot;) \&lt;br /&gt;
                        /test ++enchantbag_shimmer%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test ++identify_enchant_weapon%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 2%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (regmatch(&amp;quot;presence|brill&amp;quot;, enchant_exit)) \&lt;br /&gt;
                        /test ++enchantbag_brill%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 3%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_weapon += 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 3%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_armor = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this piece of armor?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /if (!identify_armor_multiplier) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know the armor multiplier for %identify_object.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let id_total_armor=0%;\&lt;br /&gt;
        /let id_max_armor=0%;\&lt;br /&gt;
        /let acgear_stats=%;\&lt;br /&gt;
        /let acgear_base=0%;\&lt;br /&gt;
        /let acgear_enchant=0%;\&lt;br /&gt;
        /let acgear_total_armor=0%;\&lt;br /&gt;
        /let acgear_spare_base=0%;\&lt;br /&gt;
        /let acgear_spare_enchant=0%;\&lt;br /&gt;
        /let acgear_spare_armor=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_armor $[(identify_armor_class * identify_armor_multiplier) - identify_enchant_armor]%;\&lt;br /&gt;
        /test acgear_stats:=enchantbag_get_stats(identify_object)%;\&lt;br /&gt;
        /if (acgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our acgear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;b([0-9]+) \*(-?\\+?[0-9]\*) \*b?([0-9]\*) \*(-?\\+?[0-9]\*)$$&amp;quot;, acgear_stats)%;\&lt;br /&gt;
        /let acgear_base %{P1}%;\&lt;br /&gt;
        /let acgear_enchant %{P2}%;\&lt;br /&gt;
        /let acgear_spare_base %{P3}%;\&lt;br /&gt;
        /let acgear_spare_enchant %{P4}%;\&lt;br /&gt;
        /let acgear_total_armor $[acgear_base * identify_armor_multiplier - acgear_enchant]%;\&lt;br /&gt;
        /let acgear_spare_armor $[acgear_spare_base * identify_armor_multiplier - acgear_spare_enchant]%;\&lt;br /&gt;
        /if (!acgear_spare_armor) \&lt;br /&gt;
                /let acgear_spare_armor $[acgear_total_armor - enchantbag_armor_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_armor $[id_total_armor - (possible_enchants * -3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_armor &amp;gt; acgear_total_armor]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_armor &amp;gt; acgear_total_armor)]%;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_armor &amp;gt;= acgear_spare_armor)]%;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_armor &amp;gt;= acgear_spare_armor]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our acgear, we have base %acgear_base, enchant %acgear_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Lowest spare we want to keep is base %acgear_spare_base, enchant %acgear_spare_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Armor class multiplier of this item is %identify_armor_multiplier%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCred %%% /%0: Acgear item has a total armor of %acgear_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Spare item has min armor of %acgear_spare_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has a total armor of %id_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: We could make the total armor %id_max_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_weapon = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this weapon?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;essence amorphous orb|shard black doom marble&amp;quot;, identify_object)) \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 5]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_dr=0%;\&lt;br /&gt;
        /let id_max_dr=0%;\&lt;br /&gt;
        /let damgear_stats=%;\&lt;br /&gt;
        /let damgear_total_dr=0%;\&lt;br /&gt;
        /let damgear_spare_dr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_dr $[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let damgear_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (damgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)dr \*([0-9]+)?(dr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let damgear_total_dr %{P1}%;\&lt;br /&gt;
        /let damgear_spare_dr %{P2}%;\&lt;br /&gt;
        /if (!damgear_spare_dr) \&lt;br /&gt;
                /let damgear_spare_dr $[damgear_total_dr - enchantbag_weapon_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_dr $[id_total_dr + (possible_enchants * 2)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_dr &amp;gt; damgear_total_dr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_dr &amp;gt; damgear_total_dr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_dr &amp;gt;= damgear_spare_dr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_dr &amp;gt;= damgear_spare_dr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our damgear, we have a %{damgear_total_dr}dr weapon%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %id_total_dr dr.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total dr %id_max_dr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_bow = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: The item is a bow.  Preprocessing.%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this bow?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
;DEBUG don't actually know what the level would do if a lord enchanted a hero&lt;br /&gt;
;DEBUG bow, this is a guess.  Also wouldn't know why you'd want to do a thing&lt;br /&gt;
;DEBUG like that&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_hr=0%;\&lt;br /&gt;
        /let id_max_hr=0%;\&lt;br /&gt;
        /let bow_cur_stats=%;\&lt;br /&gt;
        /let bow_cur_hr=0%;\&lt;br /&gt;
        /let bow_spare_hr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_hr $[identify_hr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let bow_cur_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (bow_cur_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)hr \*([0-9]+)?(hr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let bow_cur_hr %{P1}%;\&lt;br /&gt;
        /let bow_spare_hr %{P2}%;\&lt;br /&gt;
        /if (!bow_spare_hr) \&lt;br /&gt;
                /let bow_spare_hr $[bow_cur_hr - enchantbag_bow_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_hr $[id_total_hr + (possible_enchants * 3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_hr &amp;gt; bow_cur_hr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_hr &amp;gt; bow_cur_hr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_hr &amp;gt;= bow_spare_hr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_hr &amp;gt;= bow_spare_hr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: We have a %{bow_cur_hr}hr bow in our gear%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %{id_total_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total hr %{id_max_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_get_stats = \&lt;br /&gt;
        /if (enchantbag_wear_level == 51) \&lt;br /&gt;
                /let var_mid hero%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level == 125) \&lt;br /&gt;
                /let var_mid lord%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level &amp;lt;= 50) \&lt;br /&gt;
                /let var_mid lowmort%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let var_right=%*%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
        /test var_right:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_right)%;\&lt;br /&gt;
        /test var_right:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_right)%;\&lt;br /&gt;
        /let varname enchantbag_%{var_mid}_%{var_right}%;\&lt;br /&gt;
        /eval /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%%% /%0: Stats we have on file for %identify_object is %%{%{varname}}%;\&lt;br /&gt;
        /eval /return &amp;quot;%%{%{varname}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_possible_enchants = \&lt;br /&gt;
        /let pos_ench=0%;\&lt;br /&gt;
        /let counter %{identify_level}%;\&lt;br /&gt;
        /while (counter &amp;lt; enchantbag_wear_level - 1) \&lt;br /&gt;
                /if (counter + enchantbag_level_increment &amp;lt;= enchantbag_max_level) \&lt;br /&gt;
                        /test ++pos_ench%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /test counter+=enchantbag_level_increment%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /if (enchantbag_enchanter_level == enchantbag_wear_level) \&lt;br /&gt;
                /test pos_ench+=$[enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment))]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test pos_ench+=$[(enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment)))/enchantbag_level_increment]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (pos_ench &amp;lt; 0) /let pos_ench 0%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: We could enchant %pos_ench more times%;\&lt;br /&gt;
        /return %{pos_ench}&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_exit = \&lt;br /&gt;
        /let _post %enchantbag_post%;\&lt;br /&gt;
        /config_restore -senchantbag blind%;\&lt;br /&gt;
        /config_restore -senchantbag combine%;\&lt;br /&gt;
        /config_restore -senchantbag condition%;\&lt;br /&gt;
        /config_restore -senchantbag nosummon%;\&lt;br /&gt;
        /config_restore -senchantbag notake%;\&lt;br /&gt;
        /config_restore -senchantbag nodisturb%;\&lt;br /&gt;
        /config_rmset enchantbag%;\&lt;br /&gt;
        /filter_restore -senchantbag spellother%;\&lt;br /&gt;
        /filter_rmset enchantbag%;\&lt;br /&gt;
        /unset enchantbag%;\&lt;br /&gt;
        /unset enchantbag_name%;\&lt;br /&gt;
        /unset enchantbag_name_check%;\&lt;br /&gt;
        /unset enchantbag_inv%;\&lt;br /&gt;
        /unset enchantbag_inv_name%;\&lt;br /&gt;
        /unset enchantbag_level_increment%;\&lt;br /&gt;
        /unset enchantbag_enchant_count%;\&lt;br /&gt;
        /unset enchantbag_max_level%;\&lt;br /&gt;
        /unset enchantbag_fade%;\&lt;br /&gt;
        /unset enchantbag_shimmer%;\&lt;br /&gt;
        /unset enchantbag_brill%;\&lt;br /&gt;
        /unset enchantbag_vape%;\&lt;br /&gt;
        /unset enchantbag_item_known%;\&lt;br /&gt;
        /unset enchantbag_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_spare%;\&lt;br /&gt;
        /unset enchantbag_spare%;\&lt;br /&gt;
        /unset enchantbag_post%;\&lt;br /&gt;
        /unset enchantbag_enchanter_level%;\&lt;br /&gt;
        /unset enchantbag_wear_level%;\&lt;br /&gt;
        /set enchantbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0 reports: We're finished.  Post command is: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.3 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Lens_Of_Experience&amp;diff=33838</id>
		<title>Lens Of Experience</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Lens_Of_Experience&amp;diff=33838"/>
		<updated>2008-11-17T04:58:57Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Changed directions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; '[[Detect Invis|detect invis]]   ' continuous.&lt;br /&gt;
 '[[Detect Hidden|detect hidden]]  ' continuous.&lt;br /&gt;
 Modifies [[Intelligence|intelligence]] by 4 continuous.&lt;br /&gt;
&lt;br /&gt;
Slot: head&amp;lt;br&amp;gt;&lt;br /&gt;
Level: 32&amp;lt;br&amp;gt;&lt;br /&gt;
Base: 7&amp;lt;br&amp;gt;&lt;br /&gt;
Weight: 2&amp;lt;br&amp;gt;&lt;br /&gt;
Flags: none&amp;lt;br&amp;gt;&lt;br /&gt;
Area: [[:Category: Paradise Point |Paradise Point]] ([[Paradise Point Map |Map]])&amp;lt;br&amp;gt;&lt;br /&gt;
Mob: [[Older Half-Elven Ranger]]&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Port to [[Chief Hunter]] and go wss.&lt;br /&gt;
See also [[Suggested Spellcasting Gear#Suggested Buffing Gear|Suggested Buffing Gear]]&lt;br /&gt;
[[Category: Gear In Paradise Point]]&lt;br /&gt;
[[Category: Armor]]&lt;br /&gt;
[[Category: Lowmort 21-30 Gear]]&lt;br /&gt;
[[Category: Int Gear]]&lt;br /&gt;
[[Category: Gear That Applies Detect Hidden]]&lt;br /&gt;
[[Category: Gear That Applies Detect Invis]]&lt;br /&gt;
[[Category: Utility Gear]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Alt.tf&amp;diff=33834</id>
		<title>Alt.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Alt.tf&amp;diff=33834"/>
		<updated>2008-11-17T04:25:16Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Made executing of commands work for lowmorts too...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P&amp;gt;This script provides&lt;br /&gt;
* easy alt switching, one command will log out the current char and login the other&lt;br /&gt;
* triggers to log in quickly scrolling by the motd and what not&lt;br /&gt;
* a modified /world (stdlib.tf) which will not connect if tf has an active connection&lt;br /&gt;
* a modification to /world to set secho off during the /@connect, this prevends the password from being displayed if you have secho on.&lt;br /&gt;
* you can use /alt -x&amp;lt;command&amp;gt; &amp;lt;alt&amp;gt;  to log in &amp;lt;alt&amp;gt; and have &amp;lt;command&amp;gt; executed when the alt logged in, so you could easily make a spellup macro that'd use 2 alts :)&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&lt;br /&gt;
You'll probably want to change the value of &amp;quot;main_alt&amp;quot; at the beginning of this script.&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;B&amp;gt;An older version had a bug&amp;lt;/B&amp;gt; that creeped in when I changed the trigger to a disconnect hook.  It didn't turn it off after an alt switch.  If you'd use it to log in (create) a denied character, &amp;lt;B&amp;gt;the script would loop trying to log in that character.&amp;lt;/B&amp;gt;  I suspect it'd do the same if you'd have a wrong password in your config file.  Big oops!  If you're using this script, plz make sure and update.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/alt.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /alt                  (Logout and) login %{main_alt}&lt;br /&gt;
/echo -aCyellow %% /alt &amp;lt;world&amp;gt;          (Logout and) login &amp;lt;world&amp;gt;&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; after alt switch&lt;br /&gt;
/echo -aCyellow %% /relog                (Logout and) login current world&lt;br /&gt;
&lt;br /&gt;
;Set this variable to your main alt&lt;br /&gt;
/set main_alt sulfar&lt;br /&gt;
&lt;br /&gt;
/def alt_init = \&lt;br /&gt;
        /set alt_get=0%;\&lt;br /&gt;
        /set alt=%;\&lt;br /&gt;
        /set alt_post=%;\&lt;br /&gt;
        /set alt_execute_post=0&lt;br /&gt;
&lt;br /&gt;
;;Quick, easy and safe alt switching&lt;br /&gt;
/def -i alt = \&lt;br /&gt;
        /alt_init%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /if (opt_x !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set alt_post %{opt_x}%;\&lt;br /&gt;
                /set alt_execute_post 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /set alt %*%;\&lt;br /&gt;
        /if (alt =~ &amp;quot;&amp;quot;) /set alt %{main_alt}%;/endif%;\&lt;br /&gt;
        /if (is_open())\&lt;br /&gt;
                /set alt_get 1%;\&lt;br /&gt;
                quit%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /world %{alt}%;\&lt;br /&gt;
                /set alt=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i relog = /alt ${world_name}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(alt_get) -p999 -F -h'disconnect' alt_disconnect = \&lt;br /&gt;
        /set alt_get 0%;\&lt;br /&gt;
        /world %{alt}%;\&lt;br /&gt;
        /set alt=&lt;br /&gt;
&lt;br /&gt;
/def -i -E(alt_execute_post) -p999 -F -t&amp;quot;Welcome back to the AVATAR System*&amp;quot; alt_welcome_back = \&lt;br /&gt;
        /let post %alt_post%;\&lt;br /&gt;
        /alt_init%;\&lt;br /&gt;
        /echo -aCcyan %%% /%0: Alt switch ready!  Executing command: %post%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&lt;br /&gt;
;Some triggers to scroll by the motd and what not&lt;br /&gt;
/def -i -mregexp -t&amp;quot;AVATAR (PLAYER|MORTAL) INFORMATION CENTER&amp;quot; login_enter_1 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %;/echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;Please press &amp;lt;enter&amp;gt; to continue&amp;quot; login_enter_2 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;Please ensure that you've read and understood the Rules.&amp;quot; login_enter_3 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;please press *RETURN* to continue&amp;quot; login_enter_4 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;Press &amp;lt;ENTER&amp;gt; to continue&amp;quot; login_enter_5 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Modified /world (stdlib.tf)&lt;br /&gt;
; will not connect if tf has an active connection to avoid multiplay accidents&lt;br /&gt;
; will turn secho off before connecting to prevend echoing the password to the&lt;br /&gt;
;   screen in case it was on.  The value of secho is restored after connecting.&lt;br /&gt;
/def -i world = \&lt;br /&gt;
        /if (!getopts(&amp;quot;nlqxfb&amp;quot;, 0)) /return 0%; \&lt;br /&gt;
        /endif%; \&lt;br /&gt;
        /let _args=%*%; \&lt;br /&gt;
        /if (_args =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /let _args=$(/nth 1 $(/@listworlds -s))%; \&lt;br /&gt;
                /if (_args =/ &amp;quot;default&amp;quot;) \&lt;br /&gt;
                        /let _args=$(/nth 2 $(/@listworlds -s))%; \&lt;br /&gt;
                /endif%; \&lt;br /&gt;
        /endif%; \&lt;br /&gt;
        /let _opts=%; \&lt;br /&gt;
        /if (is_open(_args)) \&lt;br /&gt;
                /if (opt_n) /let _opts=%_opts -n%; /endif%; \&lt;br /&gt;
                /if (opt_q) /let _opts=%_opts -q%; /endif%; \&lt;br /&gt;
                /@fg %_opts %_args%; \&lt;br /&gt;
        /elseif (is_open())\&lt;br /&gt;
                /echo %% But you *are* connected!%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /if (opt_l) /let _opts=%_opts -l%; /endif%; \&lt;br /&gt;
                /if (opt_q) /let _opts=%_opts -q%; /endif%; \&lt;br /&gt;
                /if (opt_x) /let _opts=%_opts -x%; /endif%; \&lt;br /&gt;
                /if (opt_f) /let _opts=%_opts -f%; /endif%; \&lt;br /&gt;
                /if (opt_b) /let _opts=%_opts -b%; /endif%; \&lt;br /&gt;
                /let _secho %{secho}%;\&lt;br /&gt;
                /set secho off%;\&lt;br /&gt;
                /@connect %_opts %_args%; \&lt;br /&gt;
                /set secho %{_secho}%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Affects.tf&amp;diff=33833</id>
		<title>Affects.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Affects.tf&amp;diff=33833"/>
		<updated>2008-11-17T00:44:22Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: small fix for /aff and got_sanc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Provides&lt;br /&gt;
* custom colors of affects list&lt;br /&gt;
* /aff &amp;lt;spell&amp;gt; shows affects list just for &amp;lt;spell&amp;gt;&lt;br /&gt;
* /sick shows how sick you are&lt;br /&gt;
* /chkaff shows which spells you are *not* affected by&lt;br /&gt;
* Sanctuary ticker on the satus line&lt;br /&gt;
* Spellup ticker on the status line&lt;br /&gt;
&lt;br /&gt;
The tickers grab the duration of sanctuary and holy aura from the affects list, colors them and puts them in a status variable.  It then uses [[tick.tf]] to make the tickers count down on the tick.  That also means that if the tick counter isn't running yet it won't count down ;)&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[tick.tf]] so you'll need those too.  Also, you should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}tick.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /aff &amp;lt;spell&amp;gt;          Shows affects list for &amp;lt;spell&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /sick                 Shows how sick you are&lt;br /&gt;
/echo -aCyellow %% /chkaff               Shows which spells you are *not* affected by&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script:&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_sanctuary:3 :1 status_spellup:3 :1 status_position insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Custom color the affects list..&lt;br /&gt;
;Paint all of the affects list green&lt;br /&gt;
/def -i -p999 -F -PCgreen -mregexp -t&amp;quot;^Spell: '.*&amp;quot; affects_green&lt;br /&gt;
&lt;br /&gt;
;yellow for some spells i might want to check more than others&lt;br /&gt;
/def -i -p998 -F -PCyellow -mregexp -t&amp;quot;^Spell: '(steel|iron|bark|pass|fly|water|heigh|conc).*&amp;quot; affects_yellow&lt;br /&gt;
&lt;br /&gt;
;white for spells i most probably want to find quickly&lt;br /&gt;
/def -i -p998 -F -PCwhite -mregexp -t&amp;quot;^Spell: '(sanc|regen|scramble|hand).*&amp;quot; affects_white&lt;br /&gt;
&lt;br /&gt;
;You can &amp;quot;/aff sanc&amp;quot; and it'll only show the sanctuary line&lt;br /&gt;
;or use a regexp, &amp;quot;/aff sanc|fren&amp;quot;&lt;br /&gt;
/def -i aff = \&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _aff_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '%{*}.*&amp;quot; _aff_spell%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _aff_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 /undef _aff_affected _aff_spell _aff_gag_other_affects%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;Just a /sick macro.&lt;br /&gt;
/def -i sick = \&lt;br /&gt;
        /set sick_poison 0%;\&lt;br /&gt;
        /set sick_disease 0%;\&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _sick_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(poison|toxin|biotoxin|venom)'.*&amp;quot; _sick_poison = /test $$$[++sick_poison] %%;\&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(virus|plague)'.*&amp;quot; _sick_disease = /test $$$[++sick_disease]%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _sick_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 \&lt;br /&gt;
                        /undef _sick_affected _sick_poison _sick_disease _sick_gag_other_affects%%%;\&lt;br /&gt;
                gtell %%%%% I am affected by: %%%sick_poison poisons and %%%sick_disease diseases%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;/chkaff will show you the spells from the chkaff_list by which&lt;br /&gt;
;you're *not* affected.&lt;br /&gt;
/def -i chkaff = \&lt;br /&gt;
        /set chkaff_list= |BR| sanctuary |R| awen foci fortitudes \&lt;br /&gt;
                invincibility barkskin steel_skeleton iron_skin |W| protection_evil bless holy_aura \&lt;br /&gt;
                holy_armor armor water_breathing energy_shield displacement body_brace \&lt;br /&gt;
                mental_barrier calcify_flesh biofeedback anticipate adrenaline_pump concentrate \&lt;br /&gt;
                pass_door fly shield stone_skin giant_strength |G| frenzy |B| heighten_senses%;\&lt;br /&gt;
        /set chkaff 1%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -t&amp;quot;You are affected by:&amp;quot; chkaff_affected = \&lt;br /&gt;
        /set prompt_exe chkaff&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -mregexp -t&amp;quot;^Spell: '(.+)' .+&amp;quot; chkaff_spell = \&lt;br /&gt;
        /let affect=$[replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, {P1})]%;\&lt;br /&gt;
        /set chkaff_list=$(/remove %affect %chkaff_list)&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p991 -mglob -h'send PROMPT_EXE chkaff' chkaff_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /set chkaff 0%;\&lt;br /&gt;
        gtell %%% I am *not* affected by %chkaff_list&lt;br /&gt;
&lt;br /&gt;
;Sanc and spellup tickers on the status line&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;You are affected by:&amp;quot; tickers_init = \&lt;br /&gt;
        /set sanctuary_duration=%;\&lt;br /&gt;
        /set spellup_duration=%;\&lt;br /&gt;
        /sanctuary_status%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/tickers_init&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'sanctuary'  for ([0-9]+) hours.$&amp;quot; aff_sanc = \&lt;br /&gt;
        /test sanctuary_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;The protective aura fades from around your body.&amp;quot; sanctuary_fades = \&lt;br /&gt;
        /set sanctuary_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' sanctuary_tick = \&lt;br /&gt;
        /if (sanctuary_duration &amp;gt; 0) /test --sanctuary_duration%;\&lt;br /&gt;
        /else /set sanctuary_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i sanctuary_status = \&lt;br /&gt;
        /set status_sanctuary \$%{sanctuary_duration}%;\&lt;br /&gt;
        /if (sanctuary_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /elseif (sanctuary_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary BCred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 5) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -t&amp;quot;You are surrounded by a white aura.&amp;quot; got_sanc = /aff sanc|holy aura&lt;br /&gt;
&lt;br /&gt;
;Do the same for holy aura to have a spellup ticker&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'holy aura'  modifies armor class by -[0-9]+ for ([0-9]+) hours.$&amp;quot; aff_spellup = \&lt;br /&gt;
        /test spellup_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;Your Aura of Holiness fades...&amp;quot; spellup_fades = \&lt;br /&gt;
        /set spellup_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' spellup_tick = \&lt;br /&gt;
        /if (spellup_duration &amp;gt; 0) /test --spellup_duration%;\&lt;br /&gt;
        /else /set spellup_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i spellup_status = \&lt;br /&gt;
        /set status_spellup s%{spellup_duration}%;\&lt;br /&gt;
        /if (spellup_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /elseif (spellup_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_spellup BCred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 3) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Affects.tf&amp;diff=33796</id>
		<title>Affects.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Affects.tf&amp;diff=33796"/>
		<updated>2008-11-13T17:44:10Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: adds info to summary&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Provides&lt;br /&gt;
* custom colors of affects list&lt;br /&gt;
* /aff &amp;lt;spell&amp;gt; shows affects list just for &amp;lt;spell&amp;gt;&lt;br /&gt;
* /sick shows how sick you are&lt;br /&gt;
* /chkaff shows which spells you are *not* affected by&lt;br /&gt;
* Sanctuary ticker on the satus line&lt;br /&gt;
* Spellup ticker on the status line&lt;br /&gt;
&lt;br /&gt;
The tickers grab the duration of sanctuary and holy aura from the affects list, colors them and puts them in a status variable.  It then uses [[tick.tf]] to make the tickers count down on the tick.  That also means that if the tick counter isn't running yet it won't count down ;)&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[tick.tf]] so you'll need those too.  Also, you should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}tick.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /aff &amp;lt;spell&amp;gt;          Shows affects list for &amp;lt;spell&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /sick                 Shows how sick you are&lt;br /&gt;
/echo -aCyellow %% /chkaff               Shows which spells you are *not* affected by&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script:&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_sanctuary:3 :1 status_spellup:3 :1 status_position insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Custom color the affects list..&lt;br /&gt;
;Paint all of the affects list green&lt;br /&gt;
/def -i -p999 -F -PCgreen -mregexp -t&amp;quot;^Spell: '.*&amp;quot; affects_green&lt;br /&gt;
&lt;br /&gt;
;yellow for some spells i might want to check more than others&lt;br /&gt;
/def -i -p998 -F -PCyellow -mregexp -t&amp;quot;^Spell: '(steel|iron|bark|pass|fly|water|heigh|conc).*&amp;quot; affects_yellow&lt;br /&gt;
&lt;br /&gt;
;white for spells i most probably want to find quickly&lt;br /&gt;
/def -i -p998 -F -PCwhite -mregexp -t&amp;quot;^Spell: '(sanc|regen|scramble|hand).*&amp;quot; affects_white&lt;br /&gt;
&lt;br /&gt;
;You can &amp;quot;/aff sanc&amp;quot; and it'll only show the sanctuary line&lt;br /&gt;
;or use a regexp, &amp;quot;/aff sanc|fren&amp;quot;&lt;br /&gt;
/def -i aff = \&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _aff_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '%{1}.*&amp;quot; _aff_spell%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _aff_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 /undef _aff_affected _aff_spell _aff_gag_other_affects%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;Just a /sick macro.&lt;br /&gt;
/def -i sick = \&lt;br /&gt;
        /set sick_poison 0%;\&lt;br /&gt;
        /set sick_disease 0%;\&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _sick_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(poison|toxin|biotoxin|venom)'.*&amp;quot; _sick_poison = /test $$$[++sick_poison] %%;\&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(virus|plague)'.*&amp;quot; _sick_disease = /test $$$[++sick_disease]%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _sick_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 \&lt;br /&gt;
                        /undef _sick_affected _sick_poison _sick_disease _sick_gag_other_affects%%%;\&lt;br /&gt;
                gtell %%%%% I am affected by: %%%sick_poison poisons and %%%sick_disease diseases%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;/chkaff will show you the spells from the chkaff_list by which&lt;br /&gt;
;you're *not* affected.&lt;br /&gt;
/def -i chkaff = \&lt;br /&gt;
        /set chkaff_list= |BR| sanctuary |R| awen foci fortitudes \&lt;br /&gt;
                invincibility barkskin steel_skeleton iron_skin |W| protection_evil bless holy_aura \&lt;br /&gt;
                holy_armor armor water_breathing energy_shield displacement body_brace \&lt;br /&gt;
                mental_barrier calcify_flesh biofeedback anticipate adrenaline_pump concentrate \&lt;br /&gt;
                pass_door fly shield stone_skin giant_strength |G| frenzy |B| heighten_senses%;\&lt;br /&gt;
        /set chkaff 1%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -t&amp;quot;You are affected by:&amp;quot; chkaff_affected = \&lt;br /&gt;
        /set prompt_exe chkaff&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -mregexp -t&amp;quot;^Spell: '(.+)' .+&amp;quot; chkaff_spell = \&lt;br /&gt;
        /let affect=$[replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, {P1})]%;\&lt;br /&gt;
        /set chkaff_list=$(/remove %affect %chkaff_list)&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p991 -mglob -h'send PROMPT_EXE chkaff' chkaff_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /set chkaff 0%;\&lt;br /&gt;
        gtell %%% I am *not* affected by %chkaff_list&lt;br /&gt;
&lt;br /&gt;
;Sanc and spellup tickers on the status line&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;You are affected by:&amp;quot; tickers_init = \&lt;br /&gt;
        /set sanctuary_duration=%;\&lt;br /&gt;
        /set spellup_duration=%;\&lt;br /&gt;
        /sanctuary_status%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/tickers_init&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'sanctuary'  for ([0-9]+) hours.$&amp;quot; aff_sanc = \&lt;br /&gt;
        /test sanctuary_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;The protective aura fades from around your body.&amp;quot; sanctuary_fades = \&lt;br /&gt;
        /set sanctuary_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' sanctuary_tick = \&lt;br /&gt;
        /if (sanctuary_duration &amp;gt; 0) /test --sanctuary_duration%;\&lt;br /&gt;
        /else /set sanctuary_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i sanctuary_status = \&lt;br /&gt;
        /set status_sanctuary \$%{sanctuary_duration}%;\&lt;br /&gt;
        /if (sanctuary_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /elseif (sanctuary_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary BCred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 5) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -t&amp;quot;You are surrounded by a white aura.&amp;quot; got_sanc = affects&lt;br /&gt;
&lt;br /&gt;
;Do the same for holy aura to have a spellup ticker&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'holy aura'  modifies armor class by -[0-9]+ for ([0-9]+) hours.$&amp;quot; aff_spellup = \&lt;br /&gt;
        /test spellup_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;Your Aura of Holiness fades...&amp;quot; spellup_fades = \&lt;br /&gt;
        /set spellup_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' spellup_tick = \&lt;br /&gt;
        /if (spellup_duration &amp;gt; 0) /test --spellup_duration%;\&lt;br /&gt;
        /else /set spellup_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i spellup_status = \&lt;br /&gt;
        /set status_spellup s%{spellup_duration}%;\&lt;br /&gt;
        /if (spellup_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /elseif (spellup_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_spellup BCred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 3) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33794</id>
		<title>Prompt.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33794"/>
		<updated>2008-11-11T07:11:05Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A prompt script:&lt;br /&gt;
* Values are grabbed&lt;br /&gt;
* prompt1 is substituted, hp/mana/monitor are colored to reflect their status&lt;br /&gt;
* prompt2 containing surge/augment/quicken levels is gagged, the levels go into the status line and are colored&lt;br /&gt;
* Provides an easy way for other scripts to trigger on a prompt&lt;br /&gt;
* If you log in with a prompt that's incompatible with prompt.tf, it'll set the prompt to be compatible&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
* prompt_exe: instead of setting prompt_exe to 1, you can now set it to a string and it'll send &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot;.  Makes it easier to have multiple scripts use prompt_exe.  See the chkaff macro in [[affects.tf]] for an example.&lt;br /&gt;
&lt;br /&gt;
Read the comments in the script for more information.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/prompt.tf&lt;br /&gt;
&lt;br /&gt;
;These are the prompts I set on the mud.&lt;br /&gt;
;prompt &amp;lt;%h/%H(%p) %m/%M(%o) %v/%V [%T] %w/%W(%P) t%s&amp;gt;%n&lt;br /&gt;
;prompt2 &amp;lt;s%S a%A q%Q&amp;gt;%n&lt;br /&gt;
;also type &amp;quot;prompt2&amp;quot; once or twice and make sure it's on since the trigger below&lt;br /&gt;
;  gags it&lt;br /&gt;
&lt;br /&gt;
;Prompt1 is substituted by substitute_prompt1.  It adds values to see the loss&lt;br /&gt;
;  in hp, mana and monitor's hp.  It also changes the color of hp/mana/monitor.&lt;br /&gt;
;  If hp is higher than 70% it's colored green, if it's between 30% and 70% it's&lt;br /&gt;
;  colored yellow, if it's lower than 30% it's colored red.  Moves are just&lt;br /&gt;
;  green currently.&lt;br /&gt;
;&lt;br /&gt;
;The substitute currently looks like:&lt;br /&gt;
;$&amp;amp;&amp;lt;D&amp;gt;[S]!@#&amp;lt;10/30(20|33%) 20/80(60|25%) 90mv 100/700(600|14%) t3&amp;gt;&lt;br /&gt;
;first the prompt symbols as usual,&lt;br /&gt;
;then hp: you're at 10 hp out of 30, that's 33%, you lost 20,&lt;br /&gt;
;then mana:  you're at 20 mana out of 80, that's 25% used 60,&lt;br /&gt;
;then moves: you're at 90 mv,&lt;br /&gt;
;then monitor: is at 100 out of 700, that's 14%, lost 600&lt;br /&gt;
;then the lag timer, 3 seconds.&lt;br /&gt;
&lt;br /&gt;
;To save space on the prompt line, I put tnl in tf's statusline as [320] for&lt;br /&gt;
;  example.  Tnl also shifts color, green if it's above 300, yellow for 300 or&lt;br /&gt;
;  lower, bright yellow for 130 or lower.&lt;br /&gt;
;The AFK part of the prompt is captured but not displayed anywhere.&lt;br /&gt;
&lt;br /&gt;
;prompt2 has values for surge, augment, quicken, is gagged and its values are&lt;br /&gt;
;  captured to status_ variables to use in the tf status line.  &amp;quot;Off&amp;quot; values&lt;br /&gt;
;  are changed to &amp;quot;0&amp;quot; to save some space on the satusline.  Surge, augment&lt;br /&gt;
;  and quicken levels are colored.  Surge and augment are green if they're off,&lt;br /&gt;
;  yellow if 2 or 3, bright yellow if 4 or higher.  Quicken is green if it's&lt;br /&gt;
;  off, bright yellow if it's on.&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_surge:2 :1 status_augment:2 :1 status_quicken:2 :1 status_tnl :1  insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
;If you'd like to use the script and the prompt setting above contains all the&lt;br /&gt;
;  information you want but just doesn't look the way you want, I'd recommend&lt;br /&gt;
;  setting it to the format above anyways and then change the substitute below&lt;br /&gt;
;  to make it appear the way you want.&lt;br /&gt;
&lt;br /&gt;
;If prompt_exe is set to a string tf will send a &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot; to Avatar&lt;br /&gt;
;  when it receives a prompt.  However, it intercepts the &amp;quot;PROMPT_EXE*&amp;quot; string&lt;br /&gt;
;  with a send hook of priority 990.  This allowes you to make a higher priority&lt;br /&gt;
;  send hook in a script to do something when you get a prompt in.  Please don't&lt;br /&gt;
;  change the value here, it's just here to initialize when the script loads.&lt;br /&gt;
/set prompt_exe=&lt;br /&gt;
&lt;br /&gt;
;set mud side prompt to be compatible with prompt.tf&lt;br /&gt;
/def -i prompt_set = \&lt;br /&gt;
        prompt &amp;lt;%%h/%%H(%%p) %%m/%%M(%%o) %%v/%%V [%%T] %%w/%%W(%%P) t%%s&amp;gt;%%n%;\&lt;br /&gt;
        prompt2 &amp;lt;s%%S a%%A q%%Q&amp;gt;%%n%;\&lt;br /&gt;
        config +prompt%;\&lt;br /&gt;
        config +prompt2&lt;br /&gt;
&lt;br /&gt;
;Hooray for regexps!&lt;br /&gt;
/def -i -F -p400 -mregexp -t&amp;quot;^(\$|)(\&amp;amp;|)(\&amp;lt;D\&amp;gt;|)(\[S\]|)(\!|)(\@|)(\#|)(\*Deaf\* |)(\(AFK\) |)&amp;lt;(-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*) \[(-?[0-9]*)\] (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%?\) t([0-9]+)&amp;gt;&amp;quot; substitute_prompt1 =\&lt;br /&gt;
;set prompt vars&lt;br /&gt;
        /set prompt_sanctuary %{P1}%;\&lt;br /&gt;
        /set prompt_werrebocler %{P2}%;\&lt;br /&gt;
        /set prompt_demonfire %{P3}%;\&lt;br /&gt;
        /set prompt_stance %{P4}%;\&lt;br /&gt;
        /set prompt_invis %{P5}%;\&lt;br /&gt;
        /set prompt_move_hidden %{P6}%;\&lt;br /&gt;
        /set prompt_sneak %{P7}%;\&lt;br /&gt;
        /set prompt_deaf %{P8}%;\&lt;br /&gt;
        /set prompt_afk %{P9}%;\&lt;br /&gt;
        /test prompt_hp:=strip_attr({P10})%;\&lt;br /&gt;
        /test prompt_hp_max:=strip_attr({P11})%;\&lt;br /&gt;
        /test prompt_hp_relative:=strip_attr({P12})%;\&lt;br /&gt;
        /test prompt_mana:=strip_attr({P13})%;\&lt;br /&gt;
        /test prompt_mana_max:=strip_attr({P14})%;\&lt;br /&gt;
        /test prompt_mana_relative:=strip_attr({P15})%;\&lt;br /&gt;
        /test prompt_move:=strip_attr({P16})%;\&lt;br /&gt;
        /test prompt_move_max:=strip_attr({P17})%;\&lt;br /&gt;
        /test prompt_tnl:=strip_attr({P18})%;\&lt;br /&gt;
        /test prompt_monitor:=strip_attr({P19})%;\&lt;br /&gt;
        /test prompt_monitor_max:=strip_attr({P20})%;\&lt;br /&gt;
        /test prompt_monitor_relative:=strip_attr({P21})%;\&lt;br /&gt;
        /test prompt_lagtimer:=strip_attr({P22})%;\&lt;br /&gt;
        /set prompt_hp_diff $[prompt_hp_max - prompt_hp]%;\&lt;br /&gt;
        /set prompt_mana_diff $[prompt_mana_max - prompt_mana]%;\&lt;br /&gt;
        /set prompt_monitor_diff -%;\&lt;br /&gt;
        /test (prompt_monitor_max !~ &amp;quot;-&amp;quot;) &amp;amp; (prompt_monitor_diff:=prompt_monitor_max - prompt_monitor)%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (prompt_hp_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_hp_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (prompt_mana_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_mana_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color monitor&lt;br /&gt;
        /if (prompt_monitor_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_monitor_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mv green&lt;br /&gt;
        /test (prompt_move:=decode_attr(prompt_move, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                prompt_move_max:=decode_attr(prompt_move_max, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (prompt_tnl &amp;gt; 500) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 300) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 150) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cyellow&amp;quot;)]%;\&lt;br /&gt;
        /else /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCyellow&amp;quot;)]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;for the status line&lt;br /&gt;
        /set status_tnl [%{prompt_tnl}]%;\&lt;br /&gt;
;color lagtimer&lt;br /&gt;
        /test prompt_lagtimer:=decode_attr(prompt_lagtimer, &amp;quot;Cgreen&amp;quot;)%;\&lt;br /&gt;
;finally, the substitute&lt;br /&gt;
        /substitute -aCgreen \&lt;br /&gt;
;prompt symbols&lt;br /&gt;
        %{prompt_sanctuary}%{prompt_werrebocler}%{prompt_demonfire}\&lt;br /&gt;
        %{prompt_stance}%{prompt_invis}%{prompt_move_hidden}%{prompt_sneak}\&lt;br /&gt;
        %{prompt_deaf}\&lt;br /&gt;
;hp&lt;br /&gt;
        &amp;lt;%{prompt_hp}/%{prompt_hp_max}(%{prompt_hp_diff}|%{prompt_hp_relative}%%) \&lt;br /&gt;
;mana&lt;br /&gt;
        %{prompt_mana}/%{prompt_mana_max}(%{prompt_mana_diff}|%{prompt_mana_relative}%%) \&lt;br /&gt;
;mv&lt;br /&gt;
        %{prompt_move}mv \&lt;br /&gt;
;&lt;br /&gt;
;[tnl] -- uncomment the next line to restore tnl to the prompt you see&lt;br /&gt;
;       [%{prompt_tnl}] \&lt;br /&gt;
;&lt;br /&gt;
;monitor&lt;br /&gt;
        %{prompt_monitor}/%{prompt_monitor_max}(%{prompt_monitor_diff}|%{prompt_monitor_relative}%%) \&lt;br /&gt;
;lag timer&lt;br /&gt;
        t%{prompt_lagtimer}\&lt;br /&gt;
        &amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Grab prompt2 and set the status line variables&lt;br /&gt;
;Also, pretend to send PROMPT_EXE to the server if prompt_exe is set...&lt;br /&gt;
/def -i -ag -F -p400 -mregexp -t&amp;quot;^&amp;lt;s([^ ]+) a([^ ]+) q([^ ]+)&amp;gt;$&amp;quot; substitute_prompt2 =\&lt;br /&gt;
        /test prompt_surge:=strip_attr({P1})%;\&lt;br /&gt;
        /test prompt_augment:=strip_attr({P2})%;\&lt;br /&gt;
        /test prompt_quicken:=strip_attr({P3})%;\&lt;br /&gt;
        /set status_surge s%{prompt_surge}%;\&lt;br /&gt;
        /set status_augment a%{prompt_augment}%;\&lt;br /&gt;
        /set status_quicken q%{prompt_quicken}%;\&lt;br /&gt;
        /test (status_surge =~ &amp;quot;soff&amp;quot;) &amp;amp; (status_surge:=&amp;quot;s0&amp;quot;)%;\&lt;br /&gt;
        /test (status_augment =~ &amp;quot;aoff&amp;quot;) &amp;amp; (status_augment:=&amp;quot;a0&amp;quot;)%;\&lt;br /&gt;
        /test (status_quicken =~ &amp;quot;qoff&amp;quot;) &amp;amp; (status_quicken:=&amp;quot;q0&amp;quot;)%;\&lt;br /&gt;
;color surge&lt;br /&gt;
        /if (prompt_surge &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_surge BCyellow%;\&lt;br /&gt;
        /elseif (prompt_surge &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_surge Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_surge=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color augment&lt;br /&gt;
        /if (prompt_augment &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_augment BCyellow%;\&lt;br /&gt;
        /elseif (prompt_augment &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_augment Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_augment=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color quicken&lt;br /&gt;
        /if (prompt_quicken &amp;gt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_quicken BCyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_quicken=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (prompt_exe !~ &amp;quot;&amp;quot;) /send -h PROMPT_EXE %{prompt_exe}%;/endif&lt;br /&gt;
&lt;br /&gt;
;... except that we intercept the PROMPT_EXE with this send hook.  Other scripts&lt;br /&gt;
;  can now use a send hook with priority &amp;gt;990 to know when we got a prompt in.&lt;br /&gt;
;If you'd change the hook please be aware that unlike triggers, hooks apparently&lt;br /&gt;
;  need a body to do anything at all!&lt;br /&gt;
/def -i -p990 -mglob -h'send PROMPT_EXE*' send_hook_PROMPT_EXE = /test&lt;br /&gt;
&lt;br /&gt;
;Set the prompts right automagically at login&lt;br /&gt;
/def -i -p900 -F -i -t&amp;quot;Welcome back to the AVATAR System*&amp;quot; prompt_wb = \&lt;br /&gt;
        /set prompt_lagtimer err%;\&lt;br /&gt;
        /set prompt_mana_diff err%;\&lt;br /&gt;
        /set prompt_surge err%;\&lt;br /&gt;
        /set prompt_quicken err%;\&lt;br /&gt;
        /repeat -0.5 1 /prompt_check&lt;br /&gt;
&lt;br /&gt;
/def -i prompt_check = \&lt;br /&gt;
        /if ((prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_lagtimer =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_quicken =~ &amp;quot;err&amp;quot;)) \&lt;br /&gt;
                /echo -aCcyan %%% Setting prompt compatible to prompt.tf%;\&lt;br /&gt;
                /prompt_set%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33793</id>
		<title>Enchantbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33793"/>
		<updated>2008-11-11T06:38:00Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: yanked some info, wiki complained page got to long ;)  also changed a value in the example config&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h4&amp;gt;Features&amp;lt;/h4&amp;gt;&lt;br /&gt;
So you have a pile of armor to enchant.  And a couple of weapons and bows to go with that.  Well you toss it all in fodderbag, run this script, and collect the results from upgradebag, sparebag or wastebag.  Or if you don't configure it with your current gear, you can collect the items from brillbag, shimmerbag, wastebag.  It accepts some options:&lt;br /&gt;
&lt;br /&gt;
* -l enchanting with an unshadowed lord&lt;br /&gt;
* -w&amp;lt;level&amp;gt; level we want to wear the item at&lt;br /&gt;
* -x&amp;lt;command&amp;gt; execute &amp;lt;command&amp;gt; when done&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;get 1. fodderbag&amp;quot;, identifies 1., and enchants 1. .  It will check the names of&lt;br /&gt;
* the item you got from the fodderbag&lt;br /&gt;
* the first item in your inventory&lt;br /&gt;
* the name of the item it's identifying&lt;br /&gt;
If they're not all the same it won't enchant the item.&lt;br /&gt;
&lt;br /&gt;
It sets config +blind, +combine, -condition, +nosummon, +notake, +nodisturb and filter +spellother to decrease the chance of anything/anyone messing up the script.  That should make sure the triggers don't respond on people cutting/pasting brills to channels, the triggers work on you inventory, your regen is not interrupted and the triggers won't respond to other players enchants.  Config +blind doesn't affect grtz channel but that is still covered by safechannel.tf.  The script uses config.tf to store/restore your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Example config file&amp;lt;/h4&amp;gt;&lt;br /&gt;
The script will try to load an enchantbag.gear.tf file with a configuration of gear.  It's simply a list of variables, like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/set enchantbag_hero_essence_amorphous_orb                  11dr 10dr&lt;br /&gt;
/set enchantbag_hero_hero_heroes_shield                     b12    b12&lt;br /&gt;
/set enchantbag_hero_bow_sliver_glowing_moonlight_arc       21hr&lt;br /&gt;
/set enchantbag_hero_lemans_family_seal_talisman            b12 -9 b12 -6&lt;br /&gt;
&lt;br /&gt;
;To reuse a value for an equivalent item, you could&lt;br /&gt;
/eval /set enchantbag_hero_mother_pearl %{enchantbag_hero_lemans_family_seal_talisman}&lt;br /&gt;
&lt;br /&gt;
;Lord stuff&lt;br /&gt;
/set enchantbag_lord_essence_amorphous_orb                  15dr 13dr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the variable name, you'd append &amp;quot;enchantbag_&amp;quot; with either &amp;quot;hero_&amp;quot;, &amp;quot;lord_&amp;quot;, or &amp;quot;lowmort_&amp;quot;, then append that with the keywords you get from identify, remove &amp;quot;weird&amp;quot; characters (anything not in [a-zA-Z0-9 ]) and turn spaces into underscores.&lt;br /&gt;
&lt;br /&gt;
The first value is the current gear, anything above that will go into upgradebag.  The second value is the lowest spare that should go into sparebag.  The script currently treats spares kinda aggressively, it'll try to enchant a 12 -3 spare to a 12 -6 spare if the level permits, even if you have 12 -3 as lowest spare to keep.  Perhaps I should switch that around, I don't know yet.  You can omit the second value, it'll then use the default ranges for spares.&lt;br /&gt;
&lt;br /&gt;
If you're enchanting armor and want to use the configuration, you'll also need to add the item to [[identify.tf]] to know the multiplier for the armor class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Stuff you need&amp;lt;/h4&amp;gt;&lt;br /&gt;
This script uses [[config.tf]], [[verbose.tf]], [[enchant.tf]] and [[identify.tf]] so you'll want those if you want to use this script.  Config.tf and identify.tf use [[prompt.tf]], and enchant.tf uses [[regen.tf]] and [[safechannel.tf]] so get those while you're at it.  &amp;lt;b&amp;gt;If you update this script from an older version, please update these scripts as well,&amp;lt;/b&amp;gt; or strange things might happen, or it might not work at all.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll also need some bags, look at the comments in the script for a list of etches and christens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Examples&amp;lt;/h4&amp;gt;&lt;br /&gt;
Enchant a pile of stuff with a hero for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of mother pearls with an unshadowed lord but for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of amorphous orbs or doom shards for lord and sleep afterwards:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l -w125 -xsleep&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you'd want to see all debug spam it produces, try&lt;br /&gt;
&amp;lt;pre&amp;gt;/verbose -s3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Disclaimer&amp;lt;/h4&amp;gt;&lt;br /&gt;
I didn't test enchanting piles of lord eq.  If you know any such piles please let me know where I can pick them up ;)&lt;br /&gt;
&lt;br /&gt;
I'm guessing a hero level bow would raise 5 levels if you'd enchant it with a lord.  I'm not sure.  Also don't know why anybody would want to do that so I can't be bothered to check it.  I did check all the other level increments.&lt;br /&gt;
&lt;br /&gt;
I've used this script quite a number of times now and debugged it extensively.  It works fine for me.  However, if you were to vape your b12 -9 shield or heros, or blow your 13/13 hero level doom shard, I'll be more than happy to accept your bug report but will not accept any responsibility for the items.  I guess keeping your inventory clean is the way to be 100% sure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;The script&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}enchant.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}config.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /enchantbag           Enchant all items in fodderbag and distribute results&lt;br /&gt;
/echo -aCyellow %%      [-l]                 you're an unshadowed lord.  Default: you're a hero&lt;br /&gt;
/echo -aCyellow %%      [-w&amp;lt;level&amp;gt;]          you wear the item at level &amp;lt;level&amp;gt;.  Default 51.&lt;br /&gt;
/echo -aCyellow %%      [-x&amp;lt;command&amp;gt;]        execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
;etch           christen&lt;br /&gt;
;fodderbag      Fodderbag&lt;br /&gt;
;upgradebag     Upgradebag&lt;br /&gt;
;sparebag       Sparebag&lt;br /&gt;
;wastebag       Wastebag&lt;br /&gt;
;brillbag       Brillbag&lt;br /&gt;
;shimmerbag     Shimmerbag&lt;br /&gt;
;&lt;br /&gt;
;Only the rename of the fodderbag matters, enchantbag_got_item triggers on it&lt;br /&gt;
;Use the same name or change the trigger to match your bag&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var enchantbag_exit to&lt;br /&gt;
;0              enchantbag finished correctly with an empty fodderbag&lt;br /&gt;
;enchant_err    we got an error code from enchant.tf&lt;br /&gt;
;no_fodderbag   couldnt find the fodderbag&lt;br /&gt;
;wrong_name     names didn't check out&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchantbag&lt;br /&gt;
&lt;br /&gt;
;Range to use if we didn't set the lowest spare to keep in the config file&lt;br /&gt;
;Range includes the item in the gear, so if the armor spare range is 4 and the&lt;br /&gt;
;item in our gear is a 12 -9 lemans seal, the lowest upgrade would be b12 -10,&lt;br /&gt;
;and the spares could be b12 -7, b12 -8, b12 -9.  If the level permits&lt;br /&gt;
;enchanting tho, the script *will* try to make a b12 -9 spare out of a b12 -6,&lt;br /&gt;
;or enchant a 12-9 spare to a 12-12 upgrade.&lt;br /&gt;
/set enchantbag_armor_spare_range=3&lt;br /&gt;
/set enchantbag_weapon_spare_range=2&lt;br /&gt;
/set enchantbag_bow_spare_range=3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Load file with current gear&lt;br /&gt;
/set enchantbag_gear_file=enchantbag.gear.tf&lt;br /&gt;
/eval /set enchantbag_path=%{TINYPREFIX}&lt;br /&gt;
/eval /load -q %{enchantbag_path}%{enchantbag_gear_file}&lt;br /&gt;
&lt;br /&gt;
;should NOT set enchantbag_post here&lt;br /&gt;
/def -i enchantbag_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set enchantbag=0%;\&lt;br /&gt;
        /set enchantbag_name=%;\&lt;br /&gt;
        /set enchantbag_name_check=0%;\&lt;br /&gt;
        /set enchantbag_inv=0%;\&lt;br /&gt;
        /set enchantbag_inv_name=%;\&lt;br /&gt;
        /set enchantbag_level_increment=0%;\&lt;br /&gt;
        /set enchantbag_enchant_count=0%;\&lt;br /&gt;
        /set enchantbag_max_level=0%;\&lt;br /&gt;
        /set enchantbag_fade=0%;\&lt;br /&gt;
        /set enchantbag_shimmer=0%;\&lt;br /&gt;
        /set enchantbag_brill=0%;\&lt;br /&gt;
        /set enchantbag_vape=0%;\&lt;br /&gt;
        /set enchantbag_item_known=0%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_exit=&lt;br /&gt;
&lt;br /&gt;
/enchantbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /set enchantbag_enchanter_level=51%;\&lt;br /&gt;
        /set enchantbag_wear_level=51%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0: Start processing bag.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Loading %{enchantbag_path}%{enchantbag_gear_file}.%;\&lt;br /&gt;
        /load -q %{enchantbag_path}%{enchantbag_gear_file}%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;lx:w#&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_l) /set enchantbag_enchanter_level 125%;/endif%;\&lt;br /&gt;
        /if (opt_w) /set enchantbag_wear_level %{opt_w}%;/endif%;\&lt;br /&gt;
        /set enchantbag_post %{opt_x}%;\&lt;br /&gt;
        /config_store -senchantbag -x/enchantbag_config_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_config_done = \&lt;br /&gt;
        /filter_store -senchantbag -x/enchantbag_filter_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_filter_done = \&lt;br /&gt;
        config +blind%;\&lt;br /&gt;
        config +combine%;\&lt;br /&gt;
        config -condition%;\&lt;br /&gt;
        config +nosummon%;\&lt;br /&gt;
        config +notake%;\&lt;br /&gt;
        config +nodisturb%;\&lt;br /&gt;
        filter +spellother%;\&lt;br /&gt;
        /enchantbag_next_item&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_next_item = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Getting next item from the fodderbag.%;\&lt;br /&gt;
        get 1. fodderbag&lt;br /&gt;
&lt;br /&gt;
;Bag empty.  We're finished.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;You see nothing like that in Fodderbag.&amp;quot; enchantbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Your fodderbag is empty.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit 0&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Fodderbag in a bag?&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;I see no fodderbag here.&amp;quot; enchantbag_no_fodderbag = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% You are not carrying the fodderbag.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit no_fodderbag&lt;br /&gt;
&lt;br /&gt;
;New item.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from Fodderbag.$&amp;quot; enchantbag_got_item = \&lt;br /&gt;
        /set enchantbag_name %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% Got %{enchantbag_name}.  Going to identify it.%;\&lt;br /&gt;
        /identify -x/enchantbag_identify_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Done identifying.  Doing cross reference on name.%;\&lt;br /&gt;
        /set enchantbag_name_check 1%;\&lt;br /&gt;
        inv%;\&lt;br /&gt;
        look &amp;quot;%{identify_object}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -p799 -t&amp;quot;You are carrying:&amp;quot; enchantbag_inv = \&lt;br /&gt;
        /def -1 -mregexp -t&amp;quot;^(\\( ?[0-9]+\\)|    ) (\\([a-zA-Z]+\\) )\*([^\\[]+)( \\[.+)\*\$&amp;quot; _enchantbag_inv = \&lt;br /&gt;
                /set enchantbag_inv_name=%%{P3}%%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%%% /%%0: First item in inventory is %%enchantbag_inv_name&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -mregexp -t&amp;quot;^You look at (.+) in your inventory...$&amp;quot; enchantbag_name_check = \&lt;br /&gt;
        /let identify_name %{P1}%;\&lt;br /&gt;
        /set enchantbag_name_check 0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Looking at %identify_object, we got: %identify_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: First item in inventory is %enchantbag_inv_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We got %enchantbag_name from the fodderbag.%;\&lt;br /&gt;
        /if ((identify_name =~ enchantbag_name) &amp;amp; (identify_name =~ enchantbag_inv_name)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Names ok.%;\&lt;br /&gt;
                /echo%;\&lt;br /&gt;
                /repeat -0.3 1 /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Names mismatch.  Exit.  Messy inventory?%;\&lt;br /&gt;
                /enchantbag_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_processor = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Processing identify information.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: brill is %enchantbag_brill, shimmer is %enchantbag_shimmer, level is %identify_level.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: fade is %enchantbag_fade, vape is %enchantbag_vape, enchant_count is %enchantbag_enchant_count%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_armor%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_weapon%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_bow%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (enchantbag_item_known) \&lt;br /&gt;
                /if (enchantbag_upgrade) \&lt;br /&gt;
                        put 1. upgradebag%;\&lt;br /&gt;
                        save%;\&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: An upgrade!  Stashing... Next!%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_possible_upgrade) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible upgrade!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_possible_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible spare!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A spare!  Stashing... Next!%;\&lt;br /&gt;
                        put 1. sparebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: This item goes to waste... Next!%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: Item unknown.  Using simple distribution method.%;\&lt;br /&gt;
                /if (enchantbag_brill) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into brillbag.%;\&lt;br /&gt;
                        put 1. brillbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_shimmer) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into shimmerbag.%;\&lt;br /&gt;
                        put 1. shimmerbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (identify_level &amp;lt; enchantbag_max_level) \&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into wastebag.%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_enchant_done = \&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_type|no_item|wrong_type&amp;quot;, enchant_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Exit enchantbag, enchant_err.%;\&lt;br /&gt;
                /enchantbag_exit enchant_err%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;wrong_name&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Rechecking names.%;\&lt;br /&gt;
                /identify -x/enchantbag_identify_done 1.%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;vape&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCred %%% /%0: Our item vaped...  Next!%;\&lt;br /&gt;
                /enchantbag_next_item%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;fade&amp;quot;) \&lt;br /&gt;
                /send get idontwanttoLID%;\&lt;br /&gt;
                /test ++identify_level%;\&lt;br /&gt;
                /set identify_enchant_armor 0%;\&lt;br /&gt;
                /set identify_enchant_weapon 0%;\&lt;br /&gt;
                /set identify_enchant_bow 0%;\&lt;br /&gt;
                /set enchantbag_fade 1%;\&lt;br /&gt;
                /set enchantbag_brill 0%;\&lt;br /&gt;
                /set enchantbag_shimmer 0%;\&lt;br /&gt;
                /set enchantbag_enchant_count 0%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_fade 0%;\&lt;br /&gt;
                /test identify_level += %enchantbag_level_increment%;\&lt;br /&gt;
                /test ++enchantbag_enchant_count%;\&lt;br /&gt;
                /if (enchant_exit =~ &amp;quot;shimmer&amp;quot;) \&lt;br /&gt;
                        /test ++enchantbag_shimmer%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test ++identify_enchant_weapon%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 2%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (regmatch(&amp;quot;presence|brill&amp;quot;, enchant_exit)) \&lt;br /&gt;
                        /test ++enchantbag_brill%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 3%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_weapon += 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 3%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_armor = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this piece of armor?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /if (!identify_armor_multiplier) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know the armor multiplier for %identify_object.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let id_total_armor=0%;\&lt;br /&gt;
        /let id_max_armor=0%;\&lt;br /&gt;
        /let acgear_stats=%;\&lt;br /&gt;
        /let acgear_base=0%;\&lt;br /&gt;
        /let acgear_enchant=0%;\&lt;br /&gt;
        /let acgear_total_armor=0%;\&lt;br /&gt;
        /let acgear_spare_base=0%;\&lt;br /&gt;
        /let acgear_spare_enchant=0%;\&lt;br /&gt;
        /let acgear_spare_armor=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_armor $[(identify_armor_class * identify_armor_multiplier) - identify_enchant_armor]%;\&lt;br /&gt;
        /test acgear_stats:=enchantbag_get_stats(identify_object)%;\&lt;br /&gt;
        /if (acgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our acgear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;b([0-9]+) \*(-?\\+?[0-9]\*) \*b?([0-9]\*) \*(-?\\+?[0-9]\*)$$&amp;quot;, acgear_stats)%;\&lt;br /&gt;
        /let acgear_base %{P1}%;\&lt;br /&gt;
        /let acgear_enchant %{P2}%;\&lt;br /&gt;
        /let acgear_spare_base %{P3}%;\&lt;br /&gt;
        /let acgear_spare_enchant %{P4}%;\&lt;br /&gt;
        /let acgear_total_armor $[acgear_base * identify_armor_multiplier - acgear_enchant]%;\&lt;br /&gt;
        /let acgear_spare_armor $[acgear_spare_base * identify_armor_multiplier - acgear_spare_enchant]%;\&lt;br /&gt;
        /if (!acgear_spare_armor) \&lt;br /&gt;
                /let acgear_spare_armor $[acgear_total_armor - enchantbag_armor_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_armor $[id_total_armor - (possible_enchants * -3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_armor &amp;gt; acgear_total_armor]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_armor &amp;gt; acgear_total_armor)]%;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_armor &amp;gt;= acgear_spare_armor)]%;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_armor &amp;gt;= acgear_spare_armor]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our acgear, we have base %acgear_base, enchant %acgear_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Lowest spare we want to keep is base %acgear_spare_base, enchant %acgear_spare_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Armor class multiplier of this item is %identify_armor_multiplier%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCred %%% /%0: Acgear item has a total armor of %acgear_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Spare item has min armor of %acgear_spare_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has a total armor of %id_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: We could make the total armor %id_max_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_weapon = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this weapon?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;essence amorphous orb|shard black doom marble&amp;quot;, identify_object)) \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 5]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_dr=0%;\&lt;br /&gt;
        /let id_max_dr=0%;\&lt;br /&gt;
        /let damgear_stats=%;\&lt;br /&gt;
        /let damgear_total_dr=0%;\&lt;br /&gt;
        /let damgear_spare_dr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_dr $[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let damgear_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (damgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)dr \*([0-9]+)?(dr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let damgear_total_dr %{P1}%;\&lt;br /&gt;
        /let damgear_spare_dr %{P2}%;\&lt;br /&gt;
        /if (!damgear_spare_dr) \&lt;br /&gt;
                /let damgear_spare_dr $[damgear_total_dr - enchantbag_weapon_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_dr $[id_total_dr + (possible_enchants * 2)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_dr &amp;gt; damgear_total_dr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_dr &amp;gt; damgear_total_dr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_dr &amp;gt;= damgear_spare_dr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_dr &amp;gt;= damgear_spare_dr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our damgear, we have a %{damgear_total_dr}dr weapon%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %id_total_dr dr.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total dr %id_max_dr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_bow = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: The item is a bow.  Preprocessing.%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this bow?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
;DEBUG don't actually know what the level would do if a lord enchanted a hero&lt;br /&gt;
;DEBUG bow, this is a guess.  Also wouldn't know why you'd want to do a thing&lt;br /&gt;
;DEBUG like that&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_hr=0%;\&lt;br /&gt;
        /let id_max_hr=0%;\&lt;br /&gt;
        /let bow_cur_stats=%;\&lt;br /&gt;
        /let bow_cur_hr=0%;\&lt;br /&gt;
        /let bow_spare_hr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_hr $[identify_hr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let bow_cur_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (bow_cur_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)hr \*([0-9]+)?(hr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let bow_cur_hr %{P1}%;\&lt;br /&gt;
        /let bow_spare_hr %{P2}%;\&lt;br /&gt;
        /if (!bow_spare_hr) \&lt;br /&gt;
                /let bow_spare_hr $[bow_cur_hr - enchantbag_bow_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_hr $[id_total_hr + (possible_enchants * 3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_hr &amp;gt; bow_cur_hr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_hr &amp;gt; bow_cur_hr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_hr &amp;gt;= bow_spare_hr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_hr &amp;gt;= bow_spare_hr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: We have a %{bow_cur_hr}hr bow in our gear%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %{id_total_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total hr %{id_max_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_get_stats = \&lt;br /&gt;
        /if (enchantbag_wear_level == 51) \&lt;br /&gt;
                /let var_mid hero%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level == 125) \&lt;br /&gt;
                /let var_mid lord%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level &amp;lt;= 50) \&lt;br /&gt;
                /let var_mid lowmort%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let var_right=%*%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
        /test var_right:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_right)%;\&lt;br /&gt;
        /test var_right:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_right)%;\&lt;br /&gt;
        /let varname enchantbag_%{var_mid}_%{var_right}%;\&lt;br /&gt;
        /eval /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%%% /%0: Stats we have on file for %identify_object is %%{%{varname}}%;\&lt;br /&gt;
        /eval /return &amp;quot;%%{%{varname}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_possible_enchants = \&lt;br /&gt;
        /let pos_ench=0%;\&lt;br /&gt;
        /let counter %{identify_level}%;\&lt;br /&gt;
        /while (counter &amp;lt; enchantbag_wear_level - 1) \&lt;br /&gt;
                /if (counter + enchantbag_level_increment &amp;lt;= enchantbag_max_level) \&lt;br /&gt;
                        /test ++pos_ench%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /test counter+=enchantbag_level_increment%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /if (enchantbag_enchanter_level == enchantbag_wear_level) \&lt;br /&gt;
                /test pos_ench+=$[enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment))]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test pos_ench+=$[(enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment)))/enchantbag_level_increment]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (pos_ench &amp;lt; 0) /let pos_ench 0%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: We could enchant %pos_ench more times%;\&lt;br /&gt;
        /return %{pos_ench}&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_exit = \&lt;br /&gt;
        /let _post %enchantbag_post%;\&lt;br /&gt;
        /config_restore -senchantbag blind%;\&lt;br /&gt;
        /config_restore -senchantbag combine%;\&lt;br /&gt;
        /config_restore -senchantbag condition%;\&lt;br /&gt;
        /config_restore -senchantbag nosummon%;\&lt;br /&gt;
        /config_restore -senchantbag notake%;\&lt;br /&gt;
        /config_restore -senchantbag nodisturb%;\&lt;br /&gt;
        /config_rmset enchantbag%;\&lt;br /&gt;
        /filter_restore -senchantbag spellother%;\&lt;br /&gt;
        /filter_rmset enchantbag%;\&lt;br /&gt;
        /unset enchantbag%;\&lt;br /&gt;
        /unset enchantbag_name%;\&lt;br /&gt;
        /unset enchantbag_name_check%;\&lt;br /&gt;
        /unset enchantbag_inv%;\&lt;br /&gt;
        /unset enchantbag_inv_name%;\&lt;br /&gt;
        /unset enchantbag_level_increment%;\&lt;br /&gt;
        /unset enchantbag_enchant_count%;\&lt;br /&gt;
        /unset enchantbag_max_level%;\&lt;br /&gt;
        /unset enchantbag_fade%;\&lt;br /&gt;
        /unset enchantbag_shimmer%;\&lt;br /&gt;
        /unset enchantbag_brill%;\&lt;br /&gt;
        /unset enchantbag_vape%;\&lt;br /&gt;
        /unset enchantbag_item_known%;\&lt;br /&gt;
        /unset enchantbag_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_spare%;\&lt;br /&gt;
        /unset enchantbag_spare%;\&lt;br /&gt;
        /unset enchantbag_post%;\&lt;br /&gt;
        /unset enchantbag_enchanter_level%;\&lt;br /&gt;
        /unset enchantbag_wear_level%;\&lt;br /&gt;
        /set enchantbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0 reports: We're finished.  Post command is: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.3 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33791</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33791"/>
		<updated>2008-11-11T02:52:11Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: changed ma to mana&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
Also included is a substitute for &amp;quot;groupstat&amp;quot; to include percentages for hp and mana.  It strips mv.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're below 50%, red if they're below 20%.&lt;br /&gt;
;  tnl is yellow if it's below 250, red if it it's below 100.&lt;br /&gt;
;  align is yellow if it's between -450 and 450, red if it's between -200 and&lt;br /&gt;
;    200.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *([0-9]+) *(-?[0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color move if there's a default&lt;br /&gt;
        /if (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mv:=decode_attr(strip_attr(_mv), &amp;quot;C%{gls_default_color}&amp;quot;), _mv_max:=decode_attr(strip_attr(_mv_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color align&lt;br /&gt;
        /if ((_align &amp;gt;= -200) &amp;amp; (_align &amp;lt;= 200)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif ((_align &amp;gt;= -450) &amp;amp; (_align &amp;lt;= 450)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do some padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -6, _align, 5)].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^([a-zA-Z]+) is leading ([0-9]+) player(s?) with ([0-9]+)/([0-9]+) hp, ([0-9]+)/([0-9]+) ma, and [0-9]+/[0-9]+ mv.$&amp;quot; groupstat_substitute = \&lt;br /&gt;
        /let _name %{P1}%;\&lt;br /&gt;
        /let _players %{P2}%;\&lt;br /&gt;
        /let _hp %{P4}%;\&lt;br /&gt;
        /let _hp_max %{P5}%;\&lt;br /&gt;
        /let _hp_rel=-%;\&lt;br /&gt;
        /test _hp_max &amp;amp; (_hp_rel:=_hp*100/_hp_max)%;\&lt;br /&gt;
        /let _mana %{P6}%;\&lt;br /&gt;
        /let _mana_max %{P7}%;\&lt;br /&gt;
        /let _mana_rel=-%;\&lt;br /&gt;
        /test _mana_max &amp;amp; (_mana_rel:=_mana*100/_mana_max)%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _hp_rel:=decode_attr(strip_attr(_hp_rel), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _hp_rel:=decode_attr(strip_attr(_hp_rel), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _mana_rel:=decode_attr(strip_attr(_mana_rel), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _mana_rel:=decode_attr(strip_attr(_mana_rel), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /substitute -aCgreen %_name is leading %_players player%{P3} with %_hp/%_hp_max(%_hp_rel%%) hp, and %_mana/%_mana_max(%_mana_rel%%) mana.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33790</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33790"/>
		<updated>2008-11-11T02:20:42Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Adds groupstat substitute&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
Also included is a substitute for &amp;quot;groupstat&amp;quot; to include percentages for hp and mana.  It strips mv.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're below 50%, red if they're below 20%.&lt;br /&gt;
;  tnl is yellow if it's below 250, red if it it's below 100.&lt;br /&gt;
;  align is yellow if it's between -450 and 450, red if it's between -200 and&lt;br /&gt;
;    200.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *([0-9]+) *(-?[0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color move if there's a default&lt;br /&gt;
        /if (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mv:=decode_attr(strip_attr(_mv), &amp;quot;C%{gls_default_color}&amp;quot;), _mv_max:=decode_attr(strip_attr(_mv_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color align&lt;br /&gt;
        /if ((_align &amp;gt;= -200) &amp;amp; (_align &amp;lt;= 200)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif ((_align &amp;gt;= -450) &amp;amp; (_align &amp;lt;= 450)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do some padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -6, _align, 5)].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^([a-zA-Z]+) is leading ([0-9]+) player(s?) with ([0-9]+)/([0-9]+) hp, ([0-9]+)/([0-9]+) ma, and [0-9]+/[0-9]+ mv.$&amp;quot; groupstat_substitute = \&lt;br /&gt;
        /let _name %{P1}%;\&lt;br /&gt;
        /let _players %{P2}%;\&lt;br /&gt;
        /let _hp %{P4}%;\&lt;br /&gt;
        /let _hp_max %{P5}%;\&lt;br /&gt;
        /let _hp_rel=-%;\&lt;br /&gt;
        /test _hp_max &amp;amp; (_hp_rel:=_hp*100/_hp_max)%;\&lt;br /&gt;
        /let _mana %{P6}%;\&lt;br /&gt;
        /let _mana_max %{P7}%;\&lt;br /&gt;
        /let _mana_rel=-%;\&lt;br /&gt;
        /test _mana_max &amp;amp; (_mana_rel:=_mana*100/_mana_max)%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _hp_rel:=decode_attr(strip_attr(_hp_rel), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _hp_rel:=decode_attr(strip_attr(_hp_rel), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        _mana_rel:=decode_attr(strip_attr(_mana_rel), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        _mana_rel:=decode_attr(strip_attr(_mana_rel), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /substitute -aCgreen %_name is leading %_players player%{P3} with %_hp/%_hp_max(%_hp_rel%%) hp, and %_mana/%_mana_max(%_mana_rel%%) ma.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33789</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33789"/>
		<updated>2008-11-11T01:46:46Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Fixes padding for evil alignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're below 50%, red if they're below 20%.&lt;br /&gt;
;  tnl is yellow if it's below 250, red if it it's below 100.&lt;br /&gt;
;  align is yellow if it's between -450 and 450, red if it's between -200 and&lt;br /&gt;
;    200.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *([0-9]+) *(-?[0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color move if there's a default&lt;br /&gt;
        /if (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mv:=decode_attr(strip_attr(_mv), &amp;quot;C%{gls_default_color}&amp;quot;), _mv_max:=decode_attr(strip_attr(_mv_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color align&lt;br /&gt;
        /if ((_align &amp;gt;= -200) &amp;amp; (_align &amp;lt;= 200)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif ((_align &amp;gt;= -450) &amp;amp; (_align &amp;lt;= 450)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do some padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -6, _align, 5)].&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33788</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33788"/>
		<updated>2008-11-11T01:28:27Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: fixed possible division by zero (zerk mana)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're below 50%, red if they're below 20%.&lt;br /&gt;
;  tnl is yellow if it's below 250, red if it it's below 100.&lt;br /&gt;
;  align is yellow if it's between -450 and 450, red if it's between -200 and&lt;br /&gt;
;    200.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *([0-9]+) *(-?[0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_hp_max &amp;amp; _hp*100/_hp_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (_mana_max &amp;amp; _mana*100/_mana_max &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color move if there's a default&lt;br /&gt;
        /if (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mv:=decode_attr(strip_attr(_mv), &amp;quot;C%{gls_default_color}&amp;quot;), _mv_max:=decode_attr(strip_attr(_mv_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color align&lt;br /&gt;
        /if ((_align &amp;gt;= -200) &amp;amp; (_align &amp;lt;= 200)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif ((_align &amp;gt;= -450) &amp;amp; (_align &amp;lt;= 450)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do some padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -7, _align, 4)].&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33784</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33784"/>
		<updated>2008-11-10T07:59:31Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Colors mv to the default color as well&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're below 50%, red if they're below 20%.&lt;br /&gt;
;  tnl is yellow if it's below 250, red if it it's below 100.&lt;br /&gt;
;  align is yellow if it's between -450 and 450, red if it's between -200 and&lt;br /&gt;
;    200.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *([0-9]+) *(-?[0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if ((_hp*100/_hp_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_hp*100/_hp_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if ((_mana*100/_mana_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_mana*100/_mana_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color move if there's a default&lt;br /&gt;
        /if (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mv:=decode_attr(strip_attr(_mv), &amp;quot;C%{gls_default_color}&amp;quot;), _mv_max:=decode_attr(strip_attr(_mv_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color align&lt;br /&gt;
        /if ((_align &amp;gt;= -200) &amp;amp; (_align &amp;lt;= 200)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif ((_align &amp;gt;= -450) &amp;amp; (_align &amp;lt;= 450)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do some padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -7, _align, 4)].&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33783</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33783"/>
		<updated>2008-11-10T07:29:08Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Now colors alignment as well&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're below 50%, red if they're below 20%.&lt;br /&gt;
;  tnl is yellow if it's below 250, red if it it's below 100.&lt;br /&gt;
;  align is yellow if it's between -450 and 450, red if it's between -200 and&lt;br /&gt;
;    200.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *(-?[0-9]+)/([0-9]+) *([0-9]+) *(-?[0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if ((_hp*100/_hp_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_hp*100/_hp_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if ((_mana*100/_mana_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_mana*100/_mana_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color align&lt;br /&gt;
        /if ((_align &amp;gt;= -200) &amp;amp; (_align &amp;lt;= 200)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif ((_align &amp;gt;= -450) &amp;amp; (_align &amp;lt;= 450)) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _align:=decode_attr(strip_attr(_align), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do some padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -7, _align, 4)].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33782</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33782"/>
		<updated>2008-11-10T07:24:20Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: forgot align, hp and perhaps mana/moves could be negative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're &amp;lt;= 50%, red if they're &amp;lt;= 20%.&lt;br /&gt;
;  tnl is yellow if it's &amp;lt;= 250, red if it it's &amp;lt;= 100.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *-?([0-9]+)/([0-9]+) *-?([0-9]+)/([0-9]+) *-?([0-9]+)/([0-9]+) *([0-9]+) *-?([0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if ((_hp*100/_hp_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_hp*100/_hp_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if ((_mana*100/_mana_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_mana*100/_mana_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do the padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -7, _align, 4)].&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33781</id>
		<title>Group list:colors and format</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Group_list:colors_and_format&amp;diff=33781"/>
		<updated>2008-11-10T07:02:16Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Colors hp/mana/tnl in the output of 'group' and reformats it a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This script changes the format and color of the list you see when you type &amp;quot;group&amp;quot;.  See the comments in the script for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
;Colors&lt;br /&gt;
;  hp and mana are yellow if they're &amp;lt;= 50%, red if they're &amp;lt;= 20%.&lt;br /&gt;
;  tnl is yellow if it's &amp;lt;= 250, red if it it's &amp;lt;= 100.&lt;br /&gt;
&lt;br /&gt;
;The original group list has this green, cyan, etc pattern.  With no default&lt;br /&gt;
;  color set it'll keep as much from that pattern as it can, which is nice by&lt;br /&gt;
;  itself, but might be confusing if the group is hurt and you get red, cyan,&lt;br /&gt;
;  green, yellow, green, cyan.  Setting a default would change that to red,&lt;br /&gt;
;  &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;, yellow, &amp;lt;default&amp;gt;, &amp;lt;default&amp;gt;.&lt;br /&gt;
;So if gls_default_color is an empty string it will keep the colors it got from&lt;br /&gt;
;  avatar.  If it's set to a value that value will be used as default color.&lt;br /&gt;
;&lt;br /&gt;
;/set gls_default_color=&lt;br /&gt;
/set gls_default_color=cyan&lt;br /&gt;
&lt;br /&gt;
;I also made the columns align differently, so the hp/hp_max and mana/mana_max&lt;br /&gt;
;  aren't just left-aligned, but the '/' is at a fixed position.  I like that&lt;br /&gt;
;  much better.&lt;br /&gt;
;&lt;br /&gt;
;Original:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand 213/213     538/538     268/268     1296   1000&lt;br /&gt;
; 2|973 Hero Enchantress  Stand 1765/1765   6039/6110   4114/5216   819    1000&lt;br /&gt;
; 3|  6 Lord Kimla        Stand 2086/2086   1095/4686   4283/4283   14458  1000&lt;br /&gt;
;&lt;br /&gt;
;With this substitute:&lt;br /&gt;
; 1| 24 Mag  Darkfader    Stand   213/213     538/538     268/268   1296   1000.&lt;br /&gt;
; 2|973 Hero Enchantress  Stand  1765/1765   6037/6110   4114/5216  819    1000.&lt;br /&gt;
; 3|  6 Lord Kimla        Stand  2086/2086   1020/4686   4283/4283  14458  1000.&lt;br /&gt;
&lt;br /&gt;
;It appends a dot to each line so you can easily see the trigger is working.&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -t&amp;quot;^ *([0-9]+)[^ ] *([0-9]+) *([a-zA-Z]+) *([a-zA-Z]+) *([a-zA-Z]+) *([0-9]+)/([0-9]+) *([0-9]+)/([0-9]+) *([0-9]+)/([0-9]+) *([0-9]+) *([0-9]+)$&amp;quot; group_list_substitute = \&lt;br /&gt;
        /let _id %{P1}%;\&lt;br /&gt;
        /let _level %{P2}%;\&lt;br /&gt;
        /let _tier %{P3}%;\&lt;br /&gt;
        /let _name %{P4}%;\&lt;br /&gt;
        /let _pos %{P5}%;\&lt;br /&gt;
        /let _hp %{P6}%;\&lt;br /&gt;
        /let _hp_max %{P7}%;\&lt;br /&gt;
        /let _mana %{P8}%;\&lt;br /&gt;
        /let _mana_max %{P9}%;\&lt;br /&gt;
        /let _mv %{P10}%;\&lt;br /&gt;
        /let _mv_max %{P11}%;\&lt;br /&gt;
        /let _tnl %{P12}%;\&lt;br /&gt;
        /let _align %{P13}%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if ((_hp*100/_hp_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cred&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_hp*100/_hp_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;Cyellow&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_hp:=decode_attr(strip_attr(_hp), &amp;quot;C%{gls_default_color}&amp;quot;), _hp_max:=decode_attr(strip_attr(_hp_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if ((_mana*100/_mana_max) &amp;lt;= 20) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cred&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif ((_mana*100/_mana_max) &amp;lt;= 50) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;Cyellow&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test (_mana:=decode_attr(strip_attr(_mana), &amp;quot;C%{gls_default_color}&amp;quot;), _mana_max:=decode_attr(strip_attr(_mana_max), &amp;quot;C%{gls_default_color}&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (_tnl &amp;lt;= 100) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cred&amp;quot;)%;\&lt;br /&gt;
        /elseif (_tnl &amp;lt;= 250) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;Cyellow&amp;quot;)%;\&lt;br /&gt;
        /elseif (gls_default_color !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /test _tnl:=decode_attr(strip_attr(_tnl), &amp;quot;C%{gls_default_color}&amp;quot;)%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;substitute the mud output and do the padding&lt;br /&gt;
        /substitute -aCcyan -p @{n}$[pad(_id, 2, &amp;quot;|&amp;quot;, 1, _level, 3, &amp;quot; &amp;quot;, 1, _tier, -5, \&lt;br /&gt;
                _name, -13, _pos, -6, _hp, 5, &amp;quot;/&amp;quot;, 1, _hp_max, -6, _mana, 5, &amp;quot;/&amp;quot;, 1, \&lt;br /&gt;
                _mana_max, -6, _mv, 5, &amp;quot;/&amp;quot;, 1, _mv_max, -6, _tnl, -7, _align, 4)].&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33780</id>
		<title>Prompt.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33780"/>
		<updated>2008-11-10T01:03:08Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: rgb010 doesnt seem to play nice with some terminal emulators&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A prompt script:&lt;br /&gt;
* Values are grabbed&lt;br /&gt;
* prompt1 is substituted, hp/mana/monitor are colored to reflect their status&lt;br /&gt;
* prompt2 containing surge/augment/quicken levels is gagged, the levels go into the status line and are colored&lt;br /&gt;
* Provides an easy way for other scripts to trigger on a prompt&lt;br /&gt;
* If you log in with a prompt that's incompatible with prompt.tf, it'll set the prompt to be compatible&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
* prompt_exe: instead of setting prompt_exe to 1, you can now set it to a string and it'll send &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot;.  Makes it easier to have multiple scripts use prompt_exe.  See the chkaff macro in [[affects.tf]] for an example.&lt;br /&gt;
&lt;br /&gt;
Read the comments in the script for more information.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/prompt.tf&lt;br /&gt;
&lt;br /&gt;
;These are the prompts I set on the mud.&lt;br /&gt;
;prompt &amp;lt;%h/%H(%p) %m/%M(%o) %v/%V [%T] %w/%W(%P) t%s&amp;gt;%n&lt;br /&gt;
;prompt2 &amp;lt;s%S a%A q%Q&amp;gt;%n&lt;br /&gt;
;also type &amp;quot;prompt2&amp;quot; once or twice and make sure it's on since the trigger below&lt;br /&gt;
;  gags it&lt;br /&gt;
&lt;br /&gt;
;Prompt1 is substituted by substitute_prompt1.  It adds values to see the loss&lt;br /&gt;
;  in hp, mana and monitor's hp.  It also changes the color of hp/mana/monitor.&lt;br /&gt;
;  If hp is higher than 70% it's colored green, if it's between 30% and 70% it's&lt;br /&gt;
;  colored yellow, if it's lower than 30% it's colored red.  Moves are just&lt;br /&gt;
;  green currently.&lt;br /&gt;
;&lt;br /&gt;
;The substitute currently looks like:&lt;br /&gt;
;$&amp;amp;&amp;lt;D&amp;gt;[S]!@#&amp;lt;10/30(20|33%) 20/80(60|25%) 90mv 100/700(600|14%) t3&amp;gt;&lt;br /&gt;
;first the prompt symbols as usual,&lt;br /&gt;
;then hp: you're at 10 hp out of 30, that's 33%, you lost 20,&lt;br /&gt;
;then mana:  you're at 20 mana out of 80, that's 25% used 60,&lt;br /&gt;
;then moves: you're at 90 mv,&lt;br /&gt;
;then monitor: is at 100 out of 700, that's 14%, lost 600&lt;br /&gt;
;then the lag timer, 3 seconds.&lt;br /&gt;
&lt;br /&gt;
;To save space on the prompt line, I put tnl in tf's statusline as [320] for&lt;br /&gt;
;  example.  Tnl also shifts color, green if it's above 300, yellow for 300 or&lt;br /&gt;
;  lower, bright yellow for 130 or lower.&lt;br /&gt;
;The AFK part of the prompt is captured but not displayed anywhere.&lt;br /&gt;
&lt;br /&gt;
;prompt2 has values for surge, augment, quicken, is gagged and its values are&lt;br /&gt;
;  captured to status_ variables to use in the tf status line.  &amp;quot;Off&amp;quot; values&lt;br /&gt;
;  are changed to &amp;quot;0&amp;quot; to save some space on the satusline.  Surge, augment&lt;br /&gt;
;  and quicken levels are colored.  Surge and augment are green if they're off,&lt;br /&gt;
;  yellow if 2 or 3, bright yellow if 4 or higher.  Quicken is green if it's&lt;br /&gt;
;  off, bright yellow if it's on.&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_surge:2 :1 status_augment:2 :1 status_quicken:2 :1 status_tnl :1  insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
;If you'd like to use the script and the prompt setting above contains all the&lt;br /&gt;
;  information you want but just doesn't look the way you want, I'd recommend&lt;br /&gt;
;  setting it to the format above anyways and then change the substitute below&lt;br /&gt;
;  to make it appear the way you want.&lt;br /&gt;
&lt;br /&gt;
;If prompt_exe is set to a string tf will send a &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot; to Avatar&lt;br /&gt;
;  when it receives a prompt.  However, it intercepts the &amp;quot;PROMPT_EXE*&amp;quot; string&lt;br /&gt;
;  with a send hook of priority 990.  This allowes you to make a higher priority&lt;br /&gt;
;  send hook in a script to do something when you get a prompt in.&lt;br /&gt;
/set prompt_exe=&lt;br /&gt;
&lt;br /&gt;
;set mud side prompt to be compatible with prompt.tf&lt;br /&gt;
/def -i prompt_set = \&lt;br /&gt;
        prompt &amp;lt;%%h/%%H(%%p) %%m/%%M(%%o) %%v/%%V [%%T] %%w/%%W(%%P) t%%s&amp;gt;%%n%;\&lt;br /&gt;
        prompt2 &amp;lt;s%%S a%%A q%%Q&amp;gt;%%n%;\&lt;br /&gt;
        config +prompt%;\&lt;br /&gt;
        config +prompt2&lt;br /&gt;
&lt;br /&gt;
;Hooray for regexps!&lt;br /&gt;
/def -i -F -p400 -mregexp -t&amp;quot;^(\$|)(\&amp;amp;|)(\&amp;lt;D\&amp;gt;|)(\[S\]|)(\!|)(\@|)(\#|)(\*Deaf\* |)(\(AFK\) |)&amp;lt;(-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*) \[(-?[0-9]*)\] (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%?\) t([0-9]+)&amp;gt;&amp;quot; substitute_prompt1 =\&lt;br /&gt;
;set prompt vars&lt;br /&gt;
        /set prompt_sanctuary %{P1}%;\&lt;br /&gt;
        /set prompt_werrebocler %{P2}%;\&lt;br /&gt;
        /set prompt_demonfire %{P3}%;\&lt;br /&gt;
        /set prompt_stance %{P4}%;\&lt;br /&gt;
        /set prompt_invis %{P5}%;\&lt;br /&gt;
        /set prompt_move_hidden %{P6}%;\&lt;br /&gt;
        /set prompt_sneak %{P7}%;\&lt;br /&gt;
        /set prompt_deaf %{P8}%;\&lt;br /&gt;
        /set prompt_afk %{P9}%;\&lt;br /&gt;
        /test prompt_hp:=strip_attr({P10})%;\&lt;br /&gt;
        /test prompt_hp_max:=strip_attr({P11})%;\&lt;br /&gt;
        /test prompt_hp_relative:=strip_attr({P12})%;\&lt;br /&gt;
        /test prompt_mana:=strip_attr({P13})%;\&lt;br /&gt;
        /test prompt_mana_max:=strip_attr({P14})%;\&lt;br /&gt;
        /test prompt_mana_relative:=strip_attr({P15})%;\&lt;br /&gt;
        /test prompt_move:=strip_attr({P16})%;\&lt;br /&gt;
        /test prompt_move_max:=strip_attr({P17})%;\&lt;br /&gt;
        /test prompt_tnl:=strip_attr({P18})%;\&lt;br /&gt;
        /test prompt_monitor:=strip_attr({P19})%;\&lt;br /&gt;
        /test prompt_monitor_max:=strip_attr({P20})%;\&lt;br /&gt;
        /test prompt_monitor_relative:=strip_attr({P21})%;\&lt;br /&gt;
        /test prompt_lagtimer:=strip_attr({P22})%;\&lt;br /&gt;
        /set prompt_hp_diff $[prompt_hp_max - prompt_hp]%;\&lt;br /&gt;
        /set prompt_mana_diff $[prompt_mana_max - prompt_mana]%;\&lt;br /&gt;
        /set prompt_monitor_diff -%;\&lt;br /&gt;
        /test (prompt_monitor_max !~ &amp;quot;-&amp;quot;) &amp;amp; (prompt_monitor_diff:=prompt_monitor_max - prompt_monitor)%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (prompt_hp_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_hp_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (prompt_mana_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_mana_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color monitor&lt;br /&gt;
        /if (prompt_monitor_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_monitor_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mv green&lt;br /&gt;
        /test (prompt_move:=decode_attr(prompt_move, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                prompt_move_max:=decode_attr(prompt_move_max, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (prompt_tnl &amp;gt; 500) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 300) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 150) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cyellow&amp;quot;)]%;\&lt;br /&gt;
        /else /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCyellow&amp;quot;)]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;for the status line&lt;br /&gt;
        /set status_tnl [%{prompt_tnl}]%;\&lt;br /&gt;
;color lagtimer&lt;br /&gt;
        /test prompt_lagtimer:=decode_attr(prompt_lagtimer, &amp;quot;Cgreen&amp;quot;)%;\&lt;br /&gt;
;finally, the substitute&lt;br /&gt;
        /substitute -aCgreen \&lt;br /&gt;
;prompt symbols&lt;br /&gt;
        %{prompt_sanctuary}%{prompt_werrebocler}%{prompt_demonfire}\&lt;br /&gt;
        %{prompt_stance}%{prompt_invis}%{prompt_move_hidden}%{prompt_sneak}\&lt;br /&gt;
        %{prompt_deaf}\&lt;br /&gt;
;hp&lt;br /&gt;
        &amp;lt;%{prompt_hp}/%{prompt_hp_max}(%{prompt_hp_diff}|%{prompt_hp_relative}%%) \&lt;br /&gt;
;mana&lt;br /&gt;
        %{prompt_mana}/%{prompt_mana_max}(%{prompt_mana_diff}|%{prompt_mana_relative}%%) \&lt;br /&gt;
;mv&lt;br /&gt;
        %{prompt_move}mv \&lt;br /&gt;
;&lt;br /&gt;
;[tnl] -- uncomment the next line to restore tnl to the prompt you see&lt;br /&gt;
;       [%{prompt_tnl}] \&lt;br /&gt;
;&lt;br /&gt;
;monitor&lt;br /&gt;
        %{prompt_monitor}/%{prompt_monitor_max}(%{prompt_monitor_diff}|%{prompt_monitor_relative}%%) \&lt;br /&gt;
;lag timer&lt;br /&gt;
        t%{prompt_lagtimer}\&lt;br /&gt;
        &amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Grab prompt2 and set the status line variables&lt;br /&gt;
;Also, pretend to send PROMPT_EXE to the server if prompt_exe is set...&lt;br /&gt;
/def -i -ag -F -p400 -mregexp -t&amp;quot;^&amp;lt;s([^ ]+) a([^ ]+) q([^ ]+)&amp;gt;$&amp;quot; substitute_prompt2 =\&lt;br /&gt;
        /test prompt_surge:=strip_attr({P1})%;\&lt;br /&gt;
        /test prompt_augment:=strip_attr({P2})%;\&lt;br /&gt;
        /test prompt_quicken:=strip_attr({P3})%;\&lt;br /&gt;
        /set status_surge s%{prompt_surge}%;\&lt;br /&gt;
        /set status_augment a%{prompt_augment}%;\&lt;br /&gt;
        /set status_quicken q%{prompt_quicken}%;\&lt;br /&gt;
        /test (status_surge =~ &amp;quot;soff&amp;quot;) &amp;amp; (status_surge:=&amp;quot;s0&amp;quot;)%;\&lt;br /&gt;
        /test (status_augment =~ &amp;quot;aoff&amp;quot;) &amp;amp; (status_augment:=&amp;quot;a0&amp;quot;)%;\&lt;br /&gt;
        /test (status_quicken =~ &amp;quot;qoff&amp;quot;) &amp;amp; (status_quicken:=&amp;quot;q0&amp;quot;)%;\&lt;br /&gt;
;color surge&lt;br /&gt;
        /if (prompt_surge &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_surge BCyellow%;\&lt;br /&gt;
        /elseif (prompt_surge &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_surge Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_surge=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color augment&lt;br /&gt;
        /if (prompt_augment &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_augment BCyellow%;\&lt;br /&gt;
        /elseif (prompt_augment &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_augment Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_augment=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color quicken&lt;br /&gt;
        /if (prompt_quicken &amp;gt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_quicken BCyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_quicken=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (prompt_exe !~ &amp;quot;&amp;quot;) /send -h PROMPT_EXE %{prompt_exe}%;/endif&lt;br /&gt;
&lt;br /&gt;
;... except that we intercept the PROMPT_EXE with this send hook.  Other scripts&lt;br /&gt;
;  can now use a send hook with priority &amp;gt;990 to know when we got a prompt in.&lt;br /&gt;
;If you'd change the hook please be aware that unlike triggers, hooks apparently&lt;br /&gt;
;  need a body to do anything at all!&lt;br /&gt;
/def -i -p990 -mglob -h'send PROMPT_EXE*' send_hook_PROMPT_EXE = /test&lt;br /&gt;
&lt;br /&gt;
;Set the prompts right automagically at login&lt;br /&gt;
/def -i -p900 -F -i -t&amp;quot;Welcome back to the AVATAR System*&amp;quot; prompt_wb = \&lt;br /&gt;
        /set prompt_lagtimer err%;\&lt;br /&gt;
        /set prompt_mana_diff err%;\&lt;br /&gt;
        /set prompt_surge err%;\&lt;br /&gt;
        /set prompt_quicken err%;\&lt;br /&gt;
        /repeat -0.5 1 /prompt_check&lt;br /&gt;
&lt;br /&gt;
/def -i prompt_check = \&lt;br /&gt;
        /if ((prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_lagtimer =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_quicken =~ &amp;quot;err&amp;quot;)) \&lt;br /&gt;
                /echo -aCcyan %%% Setting prompt compatible to prompt.tf%;\&lt;br /&gt;
                /prompt_set%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Verbose.tf&amp;diff=33779</id>
		<title>Verbose.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Verbose.tf&amp;diff=33779"/>
		<updated>2008-11-10T01:01:47Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: More trailing whitespaces removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While writing a new script, I often wrote a quick &amp;quot;/echo variable is %{variable}&amp;quot; in a macro to see if the values of variables were computed correctly.  When I had finished writing the script I'd remove them to reduce the spam on my screen.  Sometimes though when I decided to take a different approach to some macros I'd find myself adding pretty much the same /echo's again, rewrite the macro's and then remove them again.&lt;br /&gt;
&lt;br /&gt;
Duh.  Wouldn't it be nice if I could just leave them in there and turn them on and off when i want to?&lt;br /&gt;
&lt;br /&gt;
Also, suppose you'd write a somewhat more complicated script that can run for a while and change a lot of variables.  Sometimes you'd like to see a lot of debug info, and sometimes you just want to let it do its job without spamming you crazy while you're chatting.&lt;br /&gt;
&lt;br /&gt;
This script makes that pretty easy.  To use it in a script I have TINYPREFIX set in my config file, pointing at the directory with my tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
and load it with this line in the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;/eval /require -q %{TINYPREFIX}verbose.tf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See for example [[identify.tf]] or [[label.tf]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/verbose.tf&lt;br /&gt;
&lt;br /&gt;
;Flexible script verbosity..&lt;br /&gt;
&lt;br /&gt;
/def -i verbose_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /verbose              Shows usage and current levels%;\&lt;br /&gt;
        /echo -aCyellow %%% /verbose &amp;lt;line&amp;gt;       /echo &amp;lt;line&amp;gt; if verbosity level is 1 or higher%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-l&amp;lt;level&amp;gt;]           /echo if verbosity level is &amp;lt;level&amp;gt; or higher%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-o&amp;lt;level&amp;gt;]           override verbosity level with &amp;lt;level&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;level&amp;gt;] [&amp;lt;script&amp;gt;]set verbosity level (of &amp;lt;script&amp;gt;) to &amp;lt;level&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/verbose_usage&lt;br /&gt;
&lt;br /&gt;
; Instead of just /echoing lines to the screen, scripts can use /verbose&lt;br /&gt;
;   so you can easily change the spamminess of scripts.  You can set a&lt;br /&gt;
;   sytem verbosity level in this script, or override it with a script&lt;br /&gt;
;   verbosity level in another script.&lt;br /&gt;
&lt;br /&gt;
; The verbosity levels I use are:&lt;br /&gt;
;&lt;br /&gt;
;  0   Complete silence&lt;br /&gt;
;  1   Script announces itself and may print additional information&lt;br /&gt;
;        if it could actually be useful while playing&lt;br /&gt;
;  2   All macros announce themselves, sometimes with variables and values&lt;br /&gt;
;  3   Full debug mode, all available spam including variables and values&lt;br /&gt;
;&lt;br /&gt;
&lt;br /&gt;
; A higher level verbosity does include a lower level.&lt;br /&gt;
&lt;br /&gt;
; Default system wide verbosity level&lt;br /&gt;
/set verbosity 1&lt;br /&gt;
&lt;br /&gt;
; Everything after a single - is fed to /echo as is, so to use /verbose to&lt;br /&gt;
;   print a line in red if the verbosity level is 1 or higher, you could&lt;br /&gt;
;             /verbose - -aCred a line&lt;br /&gt;
;   and the -aCred will be seen as option for /echo.&lt;br /&gt;
&lt;br /&gt;
; The -l option indicates at which verbosity level the line should be printed&lt;br /&gt;
; and defaults to 1.&lt;br /&gt;
&lt;br /&gt;
; Individual scripts can pass their own verbosity level with -o.  If the&lt;br /&gt;
; level given by -o is 0 or positive it will override %verbosity .&lt;br /&gt;
; In other words, use /verbose -o-100  to turn the individual script level&lt;br /&gt;
; off.  Default:  -100, don't override.  Setting it to -1 would do the&lt;br /&gt;
; trick too but -100 is easier to distinguish on &amp;quot;/listvar verbosity*&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Suppose you'd have a walk script, consisting of a trigger and some other&lt;br /&gt;
; macros.  You could set a verbosity_walk variable.  Depending on its value and&lt;br /&gt;
; on the value of verbosity in this script you could create different&lt;br /&gt;
; possibilities:&lt;br /&gt;
;&lt;br /&gt;
;   normal verbosity while playing&lt;br /&gt;
;         /set verbosity 1&lt;br /&gt;
;         /set verbosity_walk -100&lt;br /&gt;
;   the same would by accomplished by:&lt;br /&gt;
;         /verbose -s1&lt;br /&gt;
;         /verbose -s-100 walk&lt;br /&gt;
&lt;br /&gt;
;   debug the new walk script without all the other ones spamming you crazy,&lt;br /&gt;
;         /set verbosity 1&lt;br /&gt;
;         /set verbosity_walk 3&lt;br /&gt;
;&lt;br /&gt;
;   debug all scripts but that spammy walk one that isn't the problem anyways,&lt;br /&gt;
;         /set verbosity 3&lt;br /&gt;
;         /set verbosity_walk 1&lt;br /&gt;
;&lt;br /&gt;
;   watch the flow through each individual macro of all scripts while&lt;br /&gt;
;   fully debugging the walk script&lt;br /&gt;
;         /set verbosity 2&lt;br /&gt;
;         /set verbosity_walk 3&lt;br /&gt;
;&lt;br /&gt;
; The walk script would then need to call /verbose e.g. in the body of the trigger:&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l1 - -aCyellow Walk script running!  Use /walk to walk!&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l1 - -aBCred NOTE: Water breathing or death!&lt;br /&gt;
;&lt;br /&gt;
; If you put this at the top of any macro in the script it will show which&lt;br /&gt;
; options and arguments the call used:&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l2 - /%0:  Called as /%0 %*&lt;br /&gt;
;&lt;br /&gt;
; After expressions, to see what values are computed:&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l3 - -aCyellow /%0: variable is %{variable}.&lt;br /&gt;
&lt;br /&gt;
; The -s option sets the verbosity level.  &amp;quot;/verbose -s2&amp;quot; to set the system&lt;br /&gt;
; verbosity level to 2, &amp;quot;/vebose -s3 walk&amp;quot; to set verbosity_walk to 3.&lt;br /&gt;
&lt;br /&gt;
/def -i verbose = \&lt;br /&gt;
        /if ({*} =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /verbose_usage%;\&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /echo -p %%% @{Cyellow}Current verbosity levels:%;\&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /listvar verbosity*%;\&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let line_level=1%;\&lt;br /&gt;
        /let override_level=-100%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;l:o:s:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /let _arg %1%;\&lt;br /&gt;
                /if (_arg =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                        /set verbosity %{opt_s}%;\&lt;br /&gt;
                        /echo -aCyellow %%% Verbosity level set to %verbosity%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /eval /set verbosity_%{_arg} %{opt_s}%;\&lt;br /&gt;
                        /eval /echo -aCyellow %%%% Verbosity level of %{_arg} set to %%{verbosity_%{_arg}}%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test (opt_l !~ &amp;quot;&amp;quot;) &amp;amp; (line_level:=opt_l)%;\&lt;br /&gt;
        /test (opt_o !~ &amp;quot;&amp;quot;) &amp;amp; (override_level:=opt_o)%;\&lt;br /&gt;
        /if (override_level &amp;gt;= 0) \&lt;br /&gt;
                /if (override_level &amp;gt;= line_level) \&lt;br /&gt;
                        /echo %*%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /elseif (verbosity &amp;gt;= line_level) \&lt;br /&gt;
                /echo %*%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Tabbing.tf&amp;diff=33778</id>
		<title>Tabbing.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Tabbing.tf&amp;diff=33778"/>
		<updated>2008-11-10T00:58:12Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;;;=== ircII style tabbing for tinyfugue  ===&lt;br /&gt;
;; 1&amp;gt; You give or get a tell.&lt;br /&gt;
;; 2&amp;gt; Name of person is stored in a list.&lt;br /&gt;
;; 3&amp;gt; When you hit tab, &amp;quot;tell &amp;lt;person&amp;gt;&amp;quot; will appear on the input line.&lt;br /&gt;
;;    Where &amp;lt;person&amp;gt; is the last person you added.&lt;br /&gt;
;; 4&amp;gt; If you hit tab again, the name of the person prior to the last&lt;br /&gt;
;;    is used. Etcetc. If last name is reached, next tab will cycle thru.&lt;br /&gt;
;; 5&amp;gt; ESC-Tab will remove the name currently on the input line from the list,&lt;br /&gt;
;;    and clear the input line.&lt;br /&gt;
;; 6&amp;gt; Try it... it rocks :-)&lt;br /&gt;
&lt;br /&gt;
/require lisp.tf&lt;br /&gt;
&lt;br /&gt;
/set tabbing_name_list=&lt;br /&gt;
/set tabbing_name_index=0&lt;br /&gt;
&lt;br /&gt;
/def -i tabbing_get_name = \&lt;br /&gt;
    /if (tabbing_name_index &amp;gt; 1) \&lt;br /&gt;
        /nth $[tabbing_name_index] %tabbing_name_list %;\&lt;br /&gt;
        /set tabbing_name_index=$[tabbing_name_index-1] %;\&lt;br /&gt;
    /else \&lt;br /&gt;
        /nth $[tabbing_name_index] %tabbing_name_list %;\&lt;br /&gt;
        /set tabbing_name_index=$(/length %tabbing_name_list) %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
/def -i tabbing_add_name = \&lt;br /&gt;
    /if (tabbing_name_index = 0) \&lt;br /&gt;
        /set tabbing_name_list=%{1} %;\&lt;br /&gt;
        /set tabbing_name_index=1 %;\&lt;br /&gt;
    /else \&lt;br /&gt;
        /set tabbing_name_list=$(/remove %{1} %tabbing_name_list) %;\&lt;br /&gt;
        /set tabbing_name_list=%tabbing_name_list %{1} %;\&lt;br /&gt;
        /set tabbing_name_index=$(/length %tabbing_name_list) %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
;Bind to TAB key:&lt;br /&gt;
;/def -i -b'^I' keyForwardName  = \&lt;br /&gt;
/def -i key_tab = \&lt;br /&gt;
    /if (tabbing_name_index &amp;gt; 0) \&lt;br /&gt;
        /grab tell $(/tabbing_get_name) %;\&lt;br /&gt;
        /test input (&amp;quot; &amp;quot;) %;\&lt;br /&gt;
    /else \&lt;br /&gt;
        /echo %%% No names in list! %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
;ESC - TAB will remove the name displayed on the input line and clear the line:&lt;br /&gt;
;/def -ib'^[^I' removeCurrentName = \&lt;br /&gt;
/def -i key_esc_tab = \&lt;br /&gt;
    /test kbgoto(kbwordleft()) %;\&lt;br /&gt;
    /set name=$[kbtail()] %;\&lt;br /&gt;
    /set tabbing_name_list=$(/remove %{name} %tabbing_name_list) %;\&lt;br /&gt;
    /set tabbing_name_index=$(/length %tabbing_name_list) %;\&lt;br /&gt;
    /test kbgoto(kblen()) %;\&lt;br /&gt;
    /test kbdel(0) %;\&lt;br /&gt;
    /unset name&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -F -p100 -t&amp;quot;^([^ ]+) tells you '&amp;quot; tabbing_tells_you = \&lt;br /&gt;
    /if (({P1} !~ &amp;quot;Someone&amp;quot;) &amp;amp; ({P1} !~ &amp;quot;someone&amp;quot;)) \&lt;br /&gt;
        /tabbing_add_name %{P1} %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -F -p100 -t&amp;quot;^You dream of ([^ ]+) telling you '&amp;quot; tabbing_you_dream_telling = \&lt;br /&gt;
    /if (({P1} !~ &amp;quot;Someone&amp;quot;) &amp;amp; ({P1} !~ &amp;quot;someone&amp;quot;)) \&lt;br /&gt;
        /tabbing_add_name %{P1} %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -F -p100 -t&amp;quot;^You tell ([^ ]+) &amp;quot;  tabbing_you_tell = \&lt;br /&gt;
    /if (({P1} !~ &amp;quot;the&amp;quot;) &amp;amp; ({P1} !~ &amp;quot;Someone&amp;quot;) &amp;amp; ({P1} !~ &amp;quot;someone&amp;quot;)) \&lt;br /&gt;
        /tabbing_add_name %{P1} %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -mregexp -F -p100 -t&amp;quot;^([^ ]+) is asleep, but you tell (her|him|it) '&amp;quot; tabbing_tell_they_sleep = \&lt;br /&gt;
    /if (({P1} !~ &amp;quot;Someone&amp;quot;) &amp;amp; ({P1} !~ &amp;quot;someone&amp;quot;)) \&lt;br /&gt;
        /tabbing_add_name %{P1} %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Sharpen.tf&amp;diff=33777</id>
		<title>Sharpen.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Sharpen.tf&amp;diff=33777"/>
		<updated>2008-11-10T00:56:56Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Removed trailing whitespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This script will sharpen an item until it dulls, or is as sharp as it is going to get.&lt;br /&gt;
&lt;br /&gt;
Aside from this script I already had a simple trigger to make me hold a new whetstone when the old one is worn out.  The script will hold a whetstone if it tries to sharpen without it, so you won't really need this trigger, but it'd make it run a little more graceful.&lt;br /&gt;
&amp;lt;pre&amp;gt;/def -i -t&amp;quot;The whetstone crumbles out of your hand.&amp;quot; byebye_whetstone = hold whetstone&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script uses [[verbose.tf]] so you'll want that if you want to use this script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/sharpen.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /sharpen &amp;lt;item&amp;gt;       Sharpen &amp;lt;item&amp;gt; until it's finished&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; after full sharpen&lt;br /&gt;
&lt;br /&gt;
;This script will sharpen an item untill it dulls, or is as sharp as it is&lt;br /&gt;
;  going to get.  It will schedule the next sharpen at 3 minutes and 15 seconds&lt;br /&gt;
;  to give you a chance to chat some lines or some, and prevend triggers like&lt;br /&gt;
;  heighten senses to stack up the lag too much.&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var sharpen_exit to&lt;br /&gt;
;no_weapon      couldn't find your weapon&lt;br /&gt;
;no_whetstone   couldn't find a whetstone to use&lt;br /&gt;
;was_sharp      the weapon was already as sharp as it could be&lt;br /&gt;
;sharp          the weapon is now as sharp as it can be&lt;br /&gt;
;dull           we slipped and dulled the weapon&lt;br /&gt;
;brill          our hands tingled and we got a brilliant green and so on&lt;br /&gt;
;brilldull      this weapon brilled but dulled afterwards&lt;br /&gt;
;&lt;br /&gt;
;re no_whetstone:  If the weapon was (brill) sharpened, the whetstone crumbles&lt;br /&gt;
;   and you don't have a new one, it'll lose the information about the result.&lt;br /&gt;
;I'm simply keeping a couple of spare whetstone on my sharpen alt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 sharpen&lt;br /&gt;
&lt;br /&gt;
;some hilites ... makes it easier to catch these in scrollback&lt;br /&gt;
/def -i -p800 -F -PCyellow -mregexp -t&amp;quot;^You smile as you feel the increased sharpness of .+!$&amp;quot; sharpen_hi_ok&lt;br /&gt;
/def -i -p800 -F -PBCyellow -mregexp -t&amp;quot;^Your hands tingle as a brilliant green light bursts from .+!$&amp;quot; sharpen_hi_brill&lt;br /&gt;
/def -i -p800 -F -PBCred -mregexp -t&amp;quot;^You sigh as you realize you have slipped and dulled .+!$&amp;quot; sharpen_hi_dulled&lt;br /&gt;
/def -i -p800 -F -PCwhite -mregexp -t&amp;quot;^Despite your efforts, nothing happens to .+&amp;quot; sharpen_hi_nothing&lt;br /&gt;
/def -i -p800 -F -PCwhite -mregexp -t&amp;quot;^The weapon is now as sharp as it is going to get!&amp;quot; sharpen_hi_finished&lt;br /&gt;
/def -i -p800 -F -PCwhite -mregexp -t&amp;quot;^The weapon is as sharp as it is going to get!&amp;quot; sharpen_hi_was_sharp&lt;br /&gt;
&lt;br /&gt;
/def -i sharpen_init = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set auto_sharpen=0%;\&lt;br /&gt;
        /set sharpen_item=%;\&lt;br /&gt;
        /set _sharpen_next_pid=0%;\&lt;br /&gt;
        /set sharpen_brill=0%;\&lt;br /&gt;
        /set sharpen_exit=%;\&lt;br /&gt;
        /set sharpen_post=&lt;br /&gt;
&lt;br /&gt;
/def -i sharpen = \&lt;br /&gt;
        /sharpen_init%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set sharpen_post %{opt_x}%;\&lt;br /&gt;
        /set auto_sharpen 1%;\&lt;br /&gt;
        /set sharpen_item %*%;\&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l1 - -aCcyan %%% /%0:  Start sharpenening %sharpen_item.  Exit command is %sharpen_post%;\&lt;br /&gt;
        stand%;hei%;hei%;\&lt;br /&gt;
        sharpen %{sharpen_item}&lt;br /&gt;
&lt;br /&gt;
/def -i sharpen_next = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: Sharpening again%;\&lt;br /&gt;
        /repeat -0:03:15 1 sharpen %{sharpen_item}%;\&lt;br /&gt;
        /set _sharpen_next_pid=%?&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;You must be carrying a weapon to sharpen it!&amp;quot; sharpen_no_weapon = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l1 - -aBCred %%% Can't find your weapon, %{sharpen_item}!  Bailing out.%;\&lt;br /&gt;
        /sharpen_exit no_weapon&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;Sharpen it with what!&amp;quot; sharpen_no_whetstone = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: Not holding a whetstone.  Trying to hold one.%;\&lt;br /&gt;
        /set auto_sharpen_whetstone 1%;\&lt;br /&gt;
        hold whetstone&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen_whetstone) -p699 -F -t&amp;quot;You hold a whetstone in your hands.&amp;quot; sharpen_now_whetstone = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: We have a whetstone!  Alright, sharpening.%;\&lt;br /&gt;
        /set auto_sharpen_whetstone 0%;\&lt;br /&gt;
        sharpen %{sharpen_item}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen_whetstone) -p699 -F -t&amp;quot;You are not carrying a whetstone.&amp;quot; sharpen_really_no_whetstone = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l1 - -aBCred %%% /%0: No whetstone to use!  Bailing out.%;\&lt;br /&gt;
        /set auto_sharpen_whetstone 0%;\&lt;br /&gt;
        /sharpen_exit no_whetstone&lt;br /&gt;
&lt;br /&gt;
;we should probably sharpen more&lt;br /&gt;
;if not, sharpen_finished will kill the next sharpen&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;You smile as you feel the increased sharpness of *!&amp;quot; sharpen_ok = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: Sharpening again...%;\&lt;br /&gt;
        /sharpen_next&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;Your hands tingle as a brilliant green light bursts from *!&amp;quot; sharpen_brill = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aBCyellow %%% /%0: Yeeeehaaaa!!  Teh brillz!  Sharpening again...%;\&lt;br /&gt;
        /test ++sharpen_brill%;\&lt;br /&gt;
        /sharpen_next&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;Despite your efforts, nothing happens to *&amp;quot; sharpen_nothing = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: Sharpening again...%;\&lt;br /&gt;
        /sharpen_next&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;You sigh as you realize you have slipped and dulled *!&amp;quot; sharpen_dulled = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: Exit sharpen.%;\&lt;br /&gt;
        /repeat -0:03:15 1 /sharpen_exit dull&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;The weapon is now as sharp as it is going to get!&amp;quot; sharpen_finished = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: But we're done!  Killing planned sharpen and exit.%;\&lt;br /&gt;
        /@test _sharpen_next_pid &amp;amp; (kill(_sharpen_next_pid), _sharpen_next_pid:=0)%;\&lt;br /&gt;
        /repeat -0:03:15 1 /sharpen_exit sharp&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_sharpen) -p699 -F -t&amp;quot;The weapon is as sharp as it is going to get!&amp;quot; sharpen_was_sharp = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: This weapon doesn't need sharpening.  Exit.%;\&lt;br /&gt;
        /sharpen_exit was_sharp&lt;br /&gt;
&lt;br /&gt;
/def -i sharpen_exit = \&lt;br /&gt;
        /let post %sharpen_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l1 - -aCcyan %%% /%0:  Done with this weapon. Executing command: %post%;\&lt;br /&gt;
        /if (sharpen_brill &amp;amp; {1} =~ &amp;quot;dull&amp;quot;) \&lt;br /&gt;
                /sharpen_init%;\&lt;br /&gt;
                /set sharpen_exit brilldull%;\&lt;br /&gt;
        /elseif (sharpen_brill) \&lt;br /&gt;
                /sharpen_init%;\&lt;br /&gt;
                /set sharpen_exit brill%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /sharpen_init%;\&lt;br /&gt;
                /set sharpen_exit %1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_sharpen} -l2 - -aCyellow %%% /%0: Exit code: %{sharpen_exit}%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Rescue.tf&amp;diff=33776</id>
		<title>Rescue.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Rescue.tf&amp;diff=33776"/>
		<updated>2008-11-10T00:55:44Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/echo %% /rescue            Toggle autorescue&lt;br /&gt;
/echo %% /rescue &amp;lt;on|off&amp;gt;   Set autorescue on or off&lt;br /&gt;
/echo %% /addrescue &amp;lt;name&amp;gt;  Add name to rescue list&lt;br /&gt;
/echo %% /lsrescue          List rescue names&lt;br /&gt;
/echo %% /rmrescue &amp;lt;name&amp;gt;   Remove name from rescue list&lt;br /&gt;
&lt;br /&gt;
;/addrescue is case insensitive&lt;br /&gt;
;/rmrescue is case sensitive&lt;br /&gt;
&lt;br /&gt;
/set warn_curly_re=off&lt;br /&gt;
/set rescue_fatigue 0&lt;br /&gt;
/set auto_rescue 1&lt;br /&gt;
/echo %% Autorescue is enabled.&lt;br /&gt;
&lt;br /&gt;
/def -i rescue = \&lt;br /&gt;
        /if ({1} =~ &amp;quot;&amp;quot;) /set auto_rescue $[!auto_rescue] %;\&lt;br /&gt;
        /elseif ({1} =~ &amp;quot;on&amp;quot;) /set auto_rescue 1 %;\&lt;br /&gt;
        /elseif ({1} =~ &amp;quot;off&amp;quot;)  /set auto_rescue 0%;\&lt;br /&gt;
        /else /echo Valid arguments are: on, off and &amp;lt;none&amp;gt;%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (auto_rescue) /echo %%% Autorescue is enabled.%;\&lt;br /&gt;
        /else /echo %%% Autorescue is disabled%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i addrescue = \&lt;br /&gt;
    /def -i -E(auto_rescue) -mregexp -t&amp;quot;(?i) strikes %{1} &amp;quot; rescue_%{1}1 = /rescue_them %{1}%;\&lt;br /&gt;
    /def -i -E(auto_rescue) -mregexp -t&amp;quot;(?i) attacks strike %{1} ([^ ]+) times, with &amp;quot; rescue_%{1}2 = /rescue_them %{1}%;\&lt;br /&gt;
    /def -i -E(auto_rescue) -mregexp -t&amp;quot;(?i) attacks haven't hurt %{1}!\$&amp;quot; rescue_%{1}3 = /rescue_them %{1}%;\&lt;br /&gt;
    /def -i -E(auto_rescue) -mregexp -t&amp;quot;(?i) tries to stand and defend against %{1} but can't!\$&amp;quot; rescue_%{1}4 = /rescue_them %{1}%;\&lt;br /&gt;
    /def -i -E(auto_rescue) -mregexp -t&amp;quot;(?i) shot hits %{1} with &amp;quot; rescue_%{1}5 = /rescue_them %{1}%;\&lt;br /&gt;
    /rescue_add_name %{1}&lt;br /&gt;
&lt;br /&gt;
/def -i rmrescue = \&lt;br /&gt;
    /for c 1 5 /undef rescue_%{1}%%c%;\&lt;br /&gt;
    /set rescue_name_list=$(/remove %{1} %rescue_name_list) %;\&lt;br /&gt;
    /set rescue_name_index=$(/length %rescue_name_list)&lt;br /&gt;
&lt;br /&gt;
/def -i lsrescue = /echo %% rescue_name_list = %rescue_name_list&lt;br /&gt;
&lt;br /&gt;
;I'm fatigueing the rescue trigs to not rescue 5 times&lt;br /&gt;
;with config +battleother&lt;br /&gt;
/def -i rescue_them = \&lt;br /&gt;
    /if (!rescue_fatigue) rescue %1%;/endif%;\&lt;br /&gt;
    /set rescue_fatigue 1%;\&lt;br /&gt;
    /repeat -0:00:0.3 1 /set rescue_fatigue 0&lt;br /&gt;
&lt;br /&gt;
/def -i rescue_add_name = \&lt;br /&gt;
    /if (rescue_name_index = 0) \&lt;br /&gt;
        /set rescue_name_list=%{1} %;\&lt;br /&gt;
        /set rescue_name_index=1 %;\&lt;br /&gt;
    /else \&lt;br /&gt;
        /set rescue_name_list=$(/remove %{1} %rescue_name_list) %;\&lt;br /&gt;
        /set rescue_name_list=%rescue_name_list %{1} %;\&lt;br /&gt;
        /set rescue_name_index=$(/length %rescue_name_list) %;\&lt;br /&gt;
    /endif&lt;br /&gt;
&lt;br /&gt;
/set warn_curly_re=on&lt;br /&gt;
&lt;br /&gt;
;High priority non-fallthru triggers to prevent rescue triggers from kicking in&lt;br /&gt;
;this list is incomplete&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;chain lightning strikes ([^ ]+) with &amp;quot; dont_rescue1&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;icestrike strikes ([^ ]+) with &amp;quot; dont_rescue2&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;blast of gas strikes ([^ ]+) with &amp;quot; dont_rescue3&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;disintegrate strikes ([^ ]+) with &amp;quot; dont_rescue4&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;cyclone strikes ([^ ]+) with &amp;quot; dont_rescue5&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;blast of acid strikes ([^ ]+) with &amp;quot; dont_rescue6&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;vampire touch strikes ([^ ]+) with &amp;quot; dont_rescue7&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;earthquake strikes ([^ ]+) with &amp;quot; dont_rescue8&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;harm spell strikes ([^ ]+) with &amp;quot; dont_rescue9&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;flamestrike strikes ([^ ]+) with &amp;quot; dont_rescue10&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;ultrablast strikes ([^ ]+) with &amp;quot; dont_rescue11&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;brainstorm strikes ([^ ]+) with &amp;quot; dont_rescue12&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;psionic blast strikes ([^ ]+) with &amp;quot; dont_rescue13&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;mindpower strikes ([^ ]+) with &amp;quot; dont_rescue14&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;blast of flame strikes ([^ ]+) with &amp;quot; dont_rescue15&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;high explosive ammo strikes ([^ ]+) with &amp;quot; dont_rescue16&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;firestorm strikes ([^ ]+) with &amp;quot; dont_rescue17&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;acid rain strikes ([^ ]+) with &amp;quot; dont_rescue18&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;blast of frost strikes ([^ ]+) with &amp;quot; dont_rescue19&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;smash strikes ([^ ]+) with &amp;quot; dont_rescue20&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;Meteor Swarm strikes ([^ ]+) with &amp;quot; dont_rescue21&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;cataclysm strikes ([^ ]+) with &amp;quot; dont_rescue22&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;shard storm strikes ([^ ]+) with &amp;quot; dont_rescue23&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;torment strikes ([^ ]+) with &amp;quot; dont_rescue24&lt;br /&gt;
/def -i -p100 -mregexp -t&amp;quot;blast of lightning strikes ([^ ]+) with &amp;quot; dont_rescue25&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Regen.tf&amp;diff=33775</id>
		<title>Regen.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Regen.tf&amp;diff=33775"/>
		<updated>2008-11-10T00:54:54Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: removed trailing whitespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A regen script.  It sends a blank line to the server and checks if we're done at regular intervals, currently 8 seconds.  It uses variables from [[prompt.tf]] to see if we're done.&lt;br /&gt;
&lt;br /&gt;
This script uses both [[prompt.tf]] and [[verbose.tf]] so you'll need those if you want to use this&lt;br /&gt;
script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see examples of its use in the [[identify.tf]] or the [[enchant.tf]] script.  If it doesnt have mana for the spell, it calls this script to regen and go back when it's done with the regen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/regen.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /regen -x&amp;lt;command&amp;gt;    Fully regen, then execute &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;A regen script.  It will make you sleep to regen.  It will make you stand and&lt;br /&gt;
;execute a command when you're done, for example:&lt;br /&gt;
;  sanc dw&lt;br /&gt;
;  regen -x&amp;quot;e=u=u=sleep&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;Or it might just be more useful in other scripts.&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and use system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s2 regen&lt;br /&gt;
&lt;br /&gt;
/def -i regen = \&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set regen_post %{opt_x}%;\&lt;br /&gt;
        /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Starting checks.  Post command is: %regen_post%;\&lt;br /&gt;
        sleep%;\&lt;br /&gt;
        /repeat -7.5 1 /send%;\&lt;br /&gt;
        /repeat -8 1 /regen_check&lt;br /&gt;
&lt;br /&gt;
/def -i regen_check = \&lt;br /&gt;
        /let _post %{regen_post}%;\&lt;br /&gt;
        /let _move_relative $[prompt_move*100/prompt_move_max]%;\&lt;br /&gt;
        /if ((prompt_hp_relative &amp;gt;= 100) &amp;amp; (prompt_mana_relative &amp;gt;= 100) &amp;amp; \&lt;br /&gt;
                        (_move_relative &amp;gt;= 100) &amp;amp; (!prompt_lagtimer)) \&lt;br /&gt;
                /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Regen done!  Executing post command: %regen_post%;\&lt;br /&gt;
                stand%;\&lt;br /&gt;
                /unset regen_post%;\&lt;br /&gt;
                /if (_post !~ &amp;quot;&amp;quot;) /eval %{_post}%; /endif%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_regen} -l2 - -aCyellow %%% %0: not done yet....%;\&lt;br /&gt;
                /repeat -7.5 1 /send%;\&lt;br /&gt;
                /repeat -8 1 /regen_check%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33774</id>
		<title>Prompt.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33774"/>
		<updated>2008-11-10T00:54:06Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A prompt script:&lt;br /&gt;
* Values are grabbed&lt;br /&gt;
* prompt1 is substituted, hp/mana/monitor are colored to reflect their status&lt;br /&gt;
* prompt2 containing surge/augment/quicken levels is gagged, the levels go into the status line and are colored&lt;br /&gt;
* Provides an easy way for other scripts to trigger on a prompt&lt;br /&gt;
* If you log in with a prompt that's incompatible with prompt.tf, it'll set the prompt to be compatible&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
* prompt_exe: instead of setting prompt_exe to 1, you can now set it to a string and it'll send &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot;.  Makes it easier to have multiple scripts use prompt_exe.  See the chkaff macro in [[affects.tf]] for an example.&lt;br /&gt;
&lt;br /&gt;
Read the comments in the script for more information.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/prompt.tf&lt;br /&gt;
&lt;br /&gt;
;These are the prompts I set on the mud.&lt;br /&gt;
;prompt &amp;lt;%h/%H(%p) %m/%M(%o) %v/%V [%T] %w/%W(%P) t%s&amp;gt;%n&lt;br /&gt;
;prompt2 &amp;lt;s%S a%A q%Q&amp;gt;%n&lt;br /&gt;
;also type &amp;quot;prompt2&amp;quot; once or twice and make sure it's on since the trigger below&lt;br /&gt;
;  gags it&lt;br /&gt;
&lt;br /&gt;
;Prompt1 is substituted by substitute_prompt1.  It adds values to see the loss&lt;br /&gt;
;  in hp, mana and monitor's hp.  It also changes the color of hp/mana/monitor.&lt;br /&gt;
;  If hp is higher than 70% it's colored green, if it's between 30% and 70% it's&lt;br /&gt;
;  colored yellow, if it's lower than 30% it's colored red.  Moves are just&lt;br /&gt;
;  green currently.&lt;br /&gt;
;&lt;br /&gt;
;The substitute currently looks like:&lt;br /&gt;
;$&amp;amp;&amp;lt;D&amp;gt;[S]!@#&amp;lt;10/30(20|33%) 20/80(60|25%) 90mv 100/700(600|14%) t3&amp;gt;&lt;br /&gt;
;first the prompt symbols as usual,&lt;br /&gt;
;then hp: you're at 10 hp out of 30, that's 33%, you lost 20,&lt;br /&gt;
;then mana:  you're at 20 mana out of 80, that's 25% used 60,&lt;br /&gt;
;then moves: you're at 90 mv,&lt;br /&gt;
;then monitor: is at 100 out of 700, that's 14%, lost 600&lt;br /&gt;
;then the lag timer, 3 seconds.&lt;br /&gt;
&lt;br /&gt;
;To save space on the prompt line, I put tnl in tf's statusline as [320] for&lt;br /&gt;
;  example.  Tnl also shifts color, green if it's above 300, yellow for 300 or&lt;br /&gt;
;  lower, bright yellow for 130 or lower.&lt;br /&gt;
;The AFK part of the prompt is captured but not displayed anywhere.&lt;br /&gt;
&lt;br /&gt;
;prompt2 has values for surge, augment, quicken, is gagged and its values are&lt;br /&gt;
;  captured to status_ variables to use in the tf status line.  &amp;quot;Off&amp;quot; values&lt;br /&gt;
;  are changed to &amp;quot;0&amp;quot; to save some space on the satusline.  Surge, augment&lt;br /&gt;
;  and quicken levels are colored.  Surge and augment are green if they're off,&lt;br /&gt;
;  yellow if 2 or 3, bright yellow if 4 or higher.  Quicken is green if it's&lt;br /&gt;
;  off, bright yellow if it's on.&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_surge:2 :1 status_augment:2 :1 status_quicken:2 :1 status_tnl :1  insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
;If you'd like to use the script and the prompt setting above contains all the&lt;br /&gt;
;  information you want but just doesn't look the way you want, I'd recommend&lt;br /&gt;
;  setting it to the format above anyways and then change the substitute below&lt;br /&gt;
;  to make it appear the way you want.&lt;br /&gt;
&lt;br /&gt;
;If prompt_exe is set to a string tf will send a &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot; to Avatar&lt;br /&gt;
;  when it receives a prompt.  However, it intercepts the &amp;quot;PROMPT_EXE*&amp;quot; string&lt;br /&gt;
;  with a send hook of priority 990.  This allowes you to make a higher priority&lt;br /&gt;
;  send hook in a script to do something when you get a prompt in.&lt;br /&gt;
/set prompt_exe=&lt;br /&gt;
&lt;br /&gt;
;set mud side prompt to be compatible with prompt.tf&lt;br /&gt;
/def -i prompt_set = \&lt;br /&gt;
        prompt &amp;lt;%%h/%%H(%%p) %%m/%%M(%%o) %%v/%%V [%%T] %%w/%%W(%%P) t%%s&amp;gt;%%n%;\&lt;br /&gt;
        prompt2 &amp;lt;s%%S a%%A q%%Q&amp;gt;%%n%;\&lt;br /&gt;
        config +prompt%;\&lt;br /&gt;
        config +prompt2&lt;br /&gt;
&lt;br /&gt;
;Hooray for regexps!&lt;br /&gt;
/def -i -F -p400 -mregexp -t&amp;quot;^(\$|)(\&amp;amp;|)(\&amp;lt;D\&amp;gt;|)(\[S\]|)(\!|)(\@|)(\#|)(\*Deaf\* |)(\(AFK\) |)&amp;lt;(-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*) \[(-?[0-9]*)\] (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%?\) t([0-9]+)&amp;gt;&amp;quot; substitute_prompt1 =\&lt;br /&gt;
;set prompt vars&lt;br /&gt;
        /set prompt_sanctuary %{P1}%;\&lt;br /&gt;
        /set prompt_werrebocler %{P2}%;\&lt;br /&gt;
        /set prompt_demonfire %{P3}%;\&lt;br /&gt;
        /set prompt_stance %{P4}%;\&lt;br /&gt;
        /set prompt_invis %{P5}%;\&lt;br /&gt;
        /set prompt_move_hidden %{P6}%;\&lt;br /&gt;
        /set prompt_sneak %{P7}%;\&lt;br /&gt;
        /set prompt_deaf %{P8}%;\&lt;br /&gt;
        /set prompt_afk %{P9}%;\&lt;br /&gt;
        /test prompt_hp:=strip_attr({P10})%;\&lt;br /&gt;
        /test prompt_hp_max:=strip_attr({P11})%;\&lt;br /&gt;
        /test prompt_hp_relative:=strip_attr({P12})%;\&lt;br /&gt;
        /test prompt_mana:=strip_attr({P13})%;\&lt;br /&gt;
        /test prompt_mana_max:=strip_attr({P14})%;\&lt;br /&gt;
        /test prompt_mana_relative:=strip_attr({P15})%;\&lt;br /&gt;
        /test prompt_move:=strip_attr({P16})%;\&lt;br /&gt;
        /test prompt_move_max:=strip_attr({P17})%;\&lt;br /&gt;
        /test prompt_tnl:=strip_attr({P18})%;\&lt;br /&gt;
        /test prompt_monitor:=strip_attr({P19})%;\&lt;br /&gt;
        /test prompt_monitor_max:=strip_attr({P20})%;\&lt;br /&gt;
        /test prompt_monitor_relative:=strip_attr({P21})%;\&lt;br /&gt;
        /test prompt_lagtimer:=strip_attr({P22})%;\&lt;br /&gt;
        /set prompt_hp_diff $[prompt_hp_max - prompt_hp]%;\&lt;br /&gt;
        /set prompt_mana_diff $[prompt_mana_max - prompt_mana]%;\&lt;br /&gt;
        /set prompt_monitor_diff -%;\&lt;br /&gt;
        /test (prompt_monitor_max !~ &amp;quot;-&amp;quot;) &amp;amp; (prompt_monitor_diff:=prompt_monitor_max - prompt_monitor)%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (prompt_hp_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_hp_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (prompt_mana_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_mana_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color monitor&lt;br /&gt;
        /if (prompt_monitor_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_monitor_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mv green&lt;br /&gt;
        /test (prompt_move:=decode_attr(prompt_move, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                prompt_move_max:=decode_attr(prompt_move_max, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (prompt_tnl &amp;gt; 500) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 300) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 150) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cyellow&amp;quot;)]%;\&lt;br /&gt;
        /else /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCyellow&amp;quot;)]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;for the status line&lt;br /&gt;
        /set status_tnl [%{prompt_tnl}]%;\&lt;br /&gt;
;color lagtimer&lt;br /&gt;
        /test prompt_lagtimer:=decode_attr(prompt_lagtimer, &amp;quot;Cgreen&amp;quot;)%;\&lt;br /&gt;
;finally, the substitute&lt;br /&gt;
        /substitute -aCrgb010 \&lt;br /&gt;
;prompt symbols&lt;br /&gt;
        %{prompt_sanctuary}%{prompt_werrebocler}%{prompt_demonfire}\&lt;br /&gt;
        %{prompt_stance}%{prompt_invis}%{prompt_move_hidden}%{prompt_sneak}\&lt;br /&gt;
        %{prompt_deaf}\&lt;br /&gt;
;hp&lt;br /&gt;
        &amp;lt;%{prompt_hp}/%{prompt_hp_max}(%{prompt_hp_diff}|%{prompt_hp_relative}%%) \&lt;br /&gt;
;mana&lt;br /&gt;
        %{prompt_mana}/%{prompt_mana_max}(%{prompt_mana_diff}|%{prompt_mana_relative}%%) \&lt;br /&gt;
;mv&lt;br /&gt;
        %{prompt_move}mv \&lt;br /&gt;
;&lt;br /&gt;
;[tnl] -- uncomment the next line to restore tnl to the prompt you see&lt;br /&gt;
;       [%{prompt_tnl}] \&lt;br /&gt;
;&lt;br /&gt;
;monitor&lt;br /&gt;
        %{prompt_monitor}/%{prompt_monitor_max}(%{prompt_monitor_diff}|%{prompt_monitor_relative}%%) \&lt;br /&gt;
;lag timer&lt;br /&gt;
        t%{prompt_lagtimer}\&lt;br /&gt;
        &amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Grab prompt2 and set the status line variables&lt;br /&gt;
;Also, pretend to send PROMPT_EXE to the server if prompt_exe is set...&lt;br /&gt;
/def -i -ag -F -p400 -mregexp -t&amp;quot;^&amp;lt;s([^ ]+) a([^ ]+) q([^ ]+)&amp;gt;$&amp;quot; substitute_prompt2 =\&lt;br /&gt;
        /test prompt_surge:=strip_attr({P1})%;\&lt;br /&gt;
        /test prompt_augment:=strip_attr({P2})%;\&lt;br /&gt;
        /test prompt_quicken:=strip_attr({P3})%;\&lt;br /&gt;
        /set status_surge s%{prompt_surge}%;\&lt;br /&gt;
        /set status_augment a%{prompt_augment}%;\&lt;br /&gt;
        /set status_quicken q%{prompt_quicken}%;\&lt;br /&gt;
        /test (status_surge =~ &amp;quot;soff&amp;quot;) &amp;amp; (status_surge:=&amp;quot;s0&amp;quot;)%;\&lt;br /&gt;
        /test (status_augment =~ &amp;quot;aoff&amp;quot;) &amp;amp; (status_augment:=&amp;quot;a0&amp;quot;)%;\&lt;br /&gt;
        /test (status_quicken =~ &amp;quot;qoff&amp;quot;) &amp;amp; (status_quicken:=&amp;quot;q0&amp;quot;)%;\&lt;br /&gt;
;color surge&lt;br /&gt;
        /if (prompt_surge &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_surge BCyellow%;\&lt;br /&gt;
        /elseif (prompt_surge &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_surge Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_surge=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color augment&lt;br /&gt;
        /if (prompt_augment &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_augment BCyellow%;\&lt;br /&gt;
        /elseif (prompt_augment &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_augment Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_augment=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color quicken&lt;br /&gt;
        /if (prompt_quicken &amp;gt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_quicken BCyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_quicken=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (prompt_exe !~ &amp;quot;&amp;quot;) /send -h PROMPT_EXE %{prompt_exe}%;/endif&lt;br /&gt;
&lt;br /&gt;
;... except that we intercept the PROMPT_EXE with this send hook.  Other scripts&lt;br /&gt;
;  can now use a send hook with priority &amp;gt;990 to know when we got a prompt in.&lt;br /&gt;
;If you'd change the hook please be aware that unlike triggers, hooks apparently&lt;br /&gt;
;  need a body to do anything at all!&lt;br /&gt;
/def -i -p990 -mglob -h'send PROMPT_EXE*' send_hook_PROMPT_EXE = /test&lt;br /&gt;
&lt;br /&gt;
;Set the prompts right automagically at login&lt;br /&gt;
/def -i -p900 -F -i -t&amp;quot;Welcome back to the AVATAR System*&amp;quot; prompt_wb = \&lt;br /&gt;
        /set prompt_lagtimer err%;\&lt;br /&gt;
        /set prompt_mana_diff err%;\&lt;br /&gt;
        /set prompt_surge err%;\&lt;br /&gt;
        /set prompt_quicken err%;\&lt;br /&gt;
        /repeat -0.5 1 /prompt_check&lt;br /&gt;
&lt;br /&gt;
/def -i prompt_check = \&lt;br /&gt;
        /if ((prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_lagtimer =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_quicken =~ &amp;quot;err&amp;quot;)) \&lt;br /&gt;
                /echo -aCcyan %%% Setting prompt compatible to prompt.tf%;\&lt;br /&gt;
                /prompt_set%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33773</id>
		<title>Enchantbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33773"/>
		<updated>2008-11-10T00:51:04Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: removed trailing whitespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h4&amp;gt;Features&amp;lt;/h4&amp;gt;&lt;br /&gt;
So you have a pile of armor to enchant.  And a couple of weapons and bows to go with that.  Well you toss it all in fodderbag, run this script, and collect the results from upgradebag, sparebag or wastebag.  Or if you don't configure it with your current gear, you can collect the items from brillbag, shimmerbag, wastebag.  It accepts some options:&lt;br /&gt;
&lt;br /&gt;
* -l enchanting with an unshadowed lord&lt;br /&gt;
* -w&amp;lt;level&amp;gt; level we want to wear the item at&lt;br /&gt;
* -x&amp;lt;command&amp;gt; execute &amp;lt;command&amp;gt; when done&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;get 1. fodderbag&amp;quot;, identifies 1., and enchants 1. .  It will check the names of&lt;br /&gt;
* the item you got from the fodderbag&lt;br /&gt;
* the first item in your inventory&lt;br /&gt;
* the name of the item it's identifying&lt;br /&gt;
If they're not all the same it won't enchant the item.&lt;br /&gt;
&lt;br /&gt;
It sets config +blind, +combine, -condition, +nosummon, +notake, +nodisturb and filter +spellother to decrease the chance of anything/anyone messing up the script.  That should make sure the triggers don't respond on people cutting/pasting brills to channels, the triggers work on you inventory, your regen is not interrupted and the triggers won't respond to other players enchants.  Config +blind doesn't affect grtz channel but that is still covered by safechannel.tf.  The script uses config.tf to store/restore your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Example config file&amp;lt;/h4&amp;gt;&lt;br /&gt;
The script will try to load an enchantbag.gear.tf file with a configuration of gear.  It's simply a list of variables, like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/set enchantbag_hero_essence_amorphous_orb                  12dr 10dr&lt;br /&gt;
/set enchantbag_hero_hero_heroes_shield                     b12    b12&lt;br /&gt;
/set enchantbag_hero_bow_sliver_glowing_moonlight_arc       21hr&lt;br /&gt;
/set enchantbag_hero_lemans_family_seal_talisman            b12 -9 b12 -6&lt;br /&gt;
&lt;br /&gt;
;To reuse a value for an equivalent item, you could&lt;br /&gt;
/eval /set enchantbag_hero_mother_pearl %{enchantbag_hero_lemans_family_seal_talisman}&lt;br /&gt;
&lt;br /&gt;
;Lord stuff&lt;br /&gt;
/set enchantbag_lord_essence_amorphous_orb                  15dr 13dr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the variable name, you'd append &amp;quot;enchantbag_&amp;quot; with either &amp;quot;hero_&amp;quot;, &amp;quot;lord_&amp;quot;, or &amp;quot;lowmort_&amp;quot;, then append that with the keywords you get from identify, remove &amp;quot;weird&amp;quot; characters (anything not in [a-zA-Z0-9 ]) and turn spaces into underscores.&lt;br /&gt;
&lt;br /&gt;
The first value is the current gear, anything above that will go into upgradebag.  The second value is the lowest spare that should go into sparebag.  The script currently treats spares kinda aggressively, it'll try to enchant a 12 -3 spare to a 12 -6 spare if the level permits, even if you have 12 -3 as lowest spare to keep.  Perhaps I should switch that around, I don't know yet.  You can omit the second value, it'll then use the default ranges for spares.&lt;br /&gt;
&lt;br /&gt;
If you're enchanting armor and want to use the configuration, you'll also need to add the item to [[identify.tf]] to know the multiplier for the armor class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Stuff you need&amp;lt;/h4&amp;gt;&lt;br /&gt;
This script uses [[config.tf]], [[verbose.tf]], [[enchant.tf]] and [[identify.tf]] so you'll want those if you want to use this script.  Config.tf and identify.tf use [[prompt.tf]], and enchant.tf uses [[regen.tf]] and [[safechannel.tf]] so get those while you're at it.  &amp;lt;b&amp;gt;If you update this script from an older version, please update these scripts as well,&amp;lt;/b&amp;gt; or strange things might happen, or it might not work at all.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll also need some bags, look at the comments in the script for a list of etches and christens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Examples&amp;lt;/h4&amp;gt;&lt;br /&gt;
Enchant a pile of stuff with a hero for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of mother pearls with an unshadowed lord but for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of amorphous orbs or doom shards for lord and sleep afterwards:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l -w125 -xsleep&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you'd want to see all debug spam it produces, try&lt;br /&gt;
&amp;lt;pre&amp;gt;/verbose -s3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Disclaimer&amp;lt;/h4&amp;gt;&lt;br /&gt;
It's not all pretty, some parts of the script might taste good with some bolognese.  Larger tf scripts tend to get like that.  I blame it on the lack of structured data types, lack of way to pass variables around, lack of pointers, linked lists, anything that a modern language would provide.  If you'd know a better design approach tho, please let me know :)&lt;br /&gt;
&lt;br /&gt;
I didn't test enchanting piles of lord eq.  If you know any such piles please let me know where I can pick them up ;)&lt;br /&gt;
&lt;br /&gt;
I'm guessing a hero level bow would raise 5 levels if you'd enchant it with a lord.  I'm not sure.  Also don't know why anybody would want to do that so I can't be bothered to check it.&lt;br /&gt;
&lt;br /&gt;
I've used this script quite a number of times now and debugged it extensively.  It works fine for me.  However, if you were to vape your b12 -9 shield or heros, or blow your 13/13 hero level doom shard, I'll be more than happy to accept your bug report but will not accept any responsibility for the items.  I guess keeping your inventory clean is the way to be 100% sure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Trailing space bug&amp;lt;/h4&amp;gt;&lt;br /&gt;
Somehow some lines got some spaces appended to them when I cut'n'pasted them from my editor.  That's nasty, newlines won't be escaped anymore and it'll break the script.  Odd thing is there aren't any trailing tabs or spaces in my file.  Also, my editor has syntax coloring and putting *anything* after the '\' that's supposed to be at the end of the line will make it change color and I'd notice that immediately.  So it's gotta have happened during the cutting and pasting... if you have any idea how/why... please let me know... it's annoying! ;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;The script&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}enchant.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}config.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /enchantbag           Enchant all items in fodderbag and distribute results&lt;br /&gt;
/echo -aCyellow %%      [-l]                 you're an unshadowed lord.  Default: you're a hero&lt;br /&gt;
/echo -aCyellow %%      [-w&amp;lt;level&amp;gt;]          you wear the item at level &amp;lt;level&amp;gt;.  Default 51.&lt;br /&gt;
/echo -aCyellow %%      [-x&amp;lt;command&amp;gt;]        execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
;etch           christen&lt;br /&gt;
;fodderbag      Fodderbag&lt;br /&gt;
;upgradebag     Upgradebag&lt;br /&gt;
;sparebag       Sparebag&lt;br /&gt;
;wastebag       Wastebag&lt;br /&gt;
;brillbag       Brillbag&lt;br /&gt;
;shimmerbag     Shimmerbag&lt;br /&gt;
;&lt;br /&gt;
;Only the rename of the fodderbag matters, enchantbag_got_item triggers on it&lt;br /&gt;
;Use the same name or change the trigger to match your bag&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var enchantbag_exit to&lt;br /&gt;
;0              enchantbag finished correctly with an empty fodderbag&lt;br /&gt;
;enchant_err    we got an error code from enchant.tf&lt;br /&gt;
;no_fodderbag   couldnt find the fodderbag&lt;br /&gt;
;wrong_name     names didn't check out&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchantbag&lt;br /&gt;
&lt;br /&gt;
;Range to use if we didn't set the lowest spare to keep in the config file&lt;br /&gt;
;Range includes the item in the gear, so if the armor spare range is 4 and the&lt;br /&gt;
;item in our gear is a 12 -9 lemans seal, the lowest upgrade would be b12 -10,&lt;br /&gt;
;and the spares could be b12 -7, b12 -8, b12 -9.  If the level permits&lt;br /&gt;
;enchanting tho, the script *will* try to make a b12 -9 spare out of a b12 -6,&lt;br /&gt;
;or enchant a 12-9 spare to a 12-12 upgrade.&lt;br /&gt;
/set enchantbag_armor_spare_range=3&lt;br /&gt;
/set enchantbag_weapon_spare_range=2&lt;br /&gt;
/set enchantbag_bow_spare_range=3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Load file with current gear&lt;br /&gt;
/set enchantbag_gear_file=enchantbag.gear.tf&lt;br /&gt;
/eval /set enchantbag_path=%{TINYPREFIX}&lt;br /&gt;
/eval /load -q %{enchantbag_path}%{enchantbag_gear_file}&lt;br /&gt;
&lt;br /&gt;
;should NOT set enchantbag_post here&lt;br /&gt;
/def -i enchantbag_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set enchantbag=0%;\&lt;br /&gt;
        /set enchantbag_name=%;\&lt;br /&gt;
        /set enchantbag_name_check=0%;\&lt;br /&gt;
        /set enchantbag_inv=0%;\&lt;br /&gt;
        /set enchantbag_inv_name=%;\&lt;br /&gt;
        /set enchantbag_level_increment=0%;\&lt;br /&gt;
        /set enchantbag_enchant_count=0%;\&lt;br /&gt;
        /set enchantbag_max_level=0%;\&lt;br /&gt;
        /set enchantbag_fade=0%;\&lt;br /&gt;
        /set enchantbag_shimmer=0%;\&lt;br /&gt;
        /set enchantbag_brill=0%;\&lt;br /&gt;
        /set enchantbag_vape=0%;\&lt;br /&gt;
        /set enchantbag_item_known=0%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_exit=&lt;br /&gt;
&lt;br /&gt;
/enchantbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /set enchantbag_enchanter_level=51%;\&lt;br /&gt;
        /set enchantbag_wear_level=51%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0: Start processing bag.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Loading %{enchantbag_path}%{enchantbag_gear_file}.%;\&lt;br /&gt;
        /load -q %{enchantbag_path}%{enchantbag_gear_file}%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;lx:w#&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_l) /set enchantbag_enchanter_level 125%;/endif%;\&lt;br /&gt;
        /if (opt_w) /set enchantbag_wear_level %{opt_w}%;/endif%;\&lt;br /&gt;
        /set enchantbag_post %{opt_x}%;\&lt;br /&gt;
        /config_store -senchantbag -x/enchantbag_config_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_config_done = \&lt;br /&gt;
        /filter_store -senchantbag -x/enchantbag_filter_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_filter_done = \&lt;br /&gt;
        config +blind%;\&lt;br /&gt;
        config +combine%;\&lt;br /&gt;
        config -condition%;\&lt;br /&gt;
        config +nosummon%;\&lt;br /&gt;
        config +notake%;\&lt;br /&gt;
        config +nodisturb%;\&lt;br /&gt;
        filter +spellother%;\&lt;br /&gt;
        /enchantbag_next_item&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_next_item = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Getting next item from the fodderbag.%;\&lt;br /&gt;
        get 1. fodderbag&lt;br /&gt;
&lt;br /&gt;
;Bag empty.  We're finished.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;You see nothing like that in Fodderbag.&amp;quot; enchantbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Your fodderbag is empty.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit 0&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Fodderbag in a bag?&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;I see no fodderbag here.&amp;quot; enchantbag_no_fodderbag = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% You are not carrying the fodderbag.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit no_fodderbag&lt;br /&gt;
&lt;br /&gt;
;New item.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from Fodderbag.$&amp;quot; enchantbag_got_item = \&lt;br /&gt;
        /set enchantbag_name %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% Got %{enchantbag_name}.  Going to identify it.%;\&lt;br /&gt;
        /identify -x/enchantbag_identify_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Done identifying.  Doing cross reference on name.%;\&lt;br /&gt;
        /set enchantbag_name_check 1%;\&lt;br /&gt;
        inv%;\&lt;br /&gt;
        look &amp;quot;%{identify_object}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -p799 -t&amp;quot;You are carrying:&amp;quot; enchantbag_inv = \&lt;br /&gt;
        /def -1 -mregexp -t&amp;quot;^(\\( ?[0-9]+\\)|    ) (\\([a-zA-Z]+\\) )\*([^\\[]+)( \\[.+)\*\$&amp;quot; _enchantbag_inv = \&lt;br /&gt;
                /set enchantbag_inv_name=%%{P3}%%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%%% /%%0: First item in inventory is %%enchantbag_inv_name&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -mregexp -t&amp;quot;^You look at (.+) in your inventory...$&amp;quot; enchantbag_name_check = \&lt;br /&gt;
        /let identify_name %{P1}%;\&lt;br /&gt;
        /set enchantbag_name_check 0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Looking at %identify_object, we got: %identify_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: First item in inventory is %enchantbag_inv_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We got %enchantbag_name from the fodderbag.%;\&lt;br /&gt;
        /if ((identify_name =~ enchantbag_name) &amp;amp; (identify_name =~ enchantbag_inv_name)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Names ok.%;\&lt;br /&gt;
                /echo%;\&lt;br /&gt;
                /repeat -0.3 1 /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Names mismatch.  Exit.  Messy inventory?%;\&lt;br /&gt;
                /enchantbag_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_processor = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Processing identify information.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: brill is %enchantbag_brill, shimmer is %enchantbag_shimmer, level is %identify_level.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: fade is %enchantbag_fade, vape is %enchantbag_vape, enchant_count is %enchantbag_enchant_count%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_armor%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_weapon%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_bow%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (enchantbag_item_known) \&lt;br /&gt;
                /if (enchantbag_upgrade) \&lt;br /&gt;
                        put 1. upgradebag%;\&lt;br /&gt;
                        save%;\&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: An upgrade!  Stashing... Next!%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_possible_upgrade) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible upgrade!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_possible_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible spare!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A spare!  Stashing... Next!%;\&lt;br /&gt;
                        put 1. sparebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: This item goes to waste... Next!%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: Item unknown.  Using simple distribution method.%;\&lt;br /&gt;
                /if (enchantbag_brill) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into brillbag.%;\&lt;br /&gt;
                        put 1. brillbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_shimmer) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into shimmerbag.%;\&lt;br /&gt;
                        put 1. shimmerbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (identify_level &amp;lt; enchantbag_max_level) \&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /else \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into wastebag.%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_enchant_done = \&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_type|no_item|wrong_type&amp;quot;, enchant_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Exit enchantbag, enchant_err.%;\&lt;br /&gt;
                /enchantbag_exit enchant_err%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;wrong_name&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Rechecking names.%;\&lt;br /&gt;
                /identify -x/enchantbag_identify_done 1.%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;vape&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCred %%% /%0: Our item vaped...  Next!%;\&lt;br /&gt;
                /enchantbag_next_item%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;fade&amp;quot;) \&lt;br /&gt;
                /send get idontwanttoLID%;\&lt;br /&gt;
                /test ++identify_level%;\&lt;br /&gt;
                /set identify_enchant_armor 0%;\&lt;br /&gt;
                /set identify_enchant_weapon 0%;\&lt;br /&gt;
                /set identify_enchant_bow 0%;\&lt;br /&gt;
                /set enchantbag_fade 1%;\&lt;br /&gt;
                /set enchantbag_brill 0%;\&lt;br /&gt;
                /set enchantbag_shimmer 0%;\&lt;br /&gt;
                /set enchantbag_enchant_count 0%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_fade 0%;\&lt;br /&gt;
                /test identify_level += %enchantbag_level_increment%;\&lt;br /&gt;
                /test ++enchantbag_enchant_count%;\&lt;br /&gt;
                /if (enchant_exit =~ &amp;quot;shimmer&amp;quot;) \&lt;br /&gt;
                        /test ++enchantbag_shimmer%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test ++identify_enchant_weapon%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 2%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (regmatch(&amp;quot;presence|brill&amp;quot;, enchant_exit)) \&lt;br /&gt;
                        /test ++enchantbag_brill%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 3%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_weapon += 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 3%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_armor = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this piece of armor?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /if (!identify_armor_multiplier) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know the armor multiplier for %identify_object.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let id_total_armor=0%;\&lt;br /&gt;
        /let id_max_armor=0%;\&lt;br /&gt;
        /let acgear_stats=%;\&lt;br /&gt;
        /let acgear_base=0%;\&lt;br /&gt;
        /let acgear_enchant=0%;\&lt;br /&gt;
        /let acgear_total_armor=0%;\&lt;br /&gt;
        /let acgear_spare_base=0%;\&lt;br /&gt;
        /let acgear_spare_enchant=0%;\&lt;br /&gt;
        /let acgear_spare_armor=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_armor $[(identify_armor_class * identify_armor_multiplier) - identify_enchant_armor]%;\&lt;br /&gt;
        /test acgear_stats:=enchantbag_get_stats(identify_object)%;\&lt;br /&gt;
        /if (acgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our acgear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;b([0-9]+) \*(-?\\+?[0-9]\*) \*b?([0-9]\*) \*(-?\\+?[0-9]\*)$$&amp;quot;, acgear_stats)%;\&lt;br /&gt;
        /let acgear_base %{P1}%;\&lt;br /&gt;
        /let acgear_enchant %{P2}%;\&lt;br /&gt;
        /let acgear_spare_base %{P3}%;\&lt;br /&gt;
        /let acgear_spare_enchant %{P4}%;\&lt;br /&gt;
        /let acgear_total_armor $[acgear_base * identify_armor_multiplier - acgear_enchant]%;\&lt;br /&gt;
        /let acgear_spare_armor $[acgear_spare_base * identify_armor_multiplier - acgear_spare_enchant]%;\&lt;br /&gt;
        /if (!acgear_spare_armor) \&lt;br /&gt;
                /let acgear_spare_armor $[acgear_total_armor - enchantbag_armor_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_armor $[id_total_armor - (possible_enchants * -3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_armor &amp;gt; acgear_total_armor]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_armor &amp;gt; acgear_total_armor)]%;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_armor &amp;gt;= acgear_spare_armor)]%;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_armor &amp;gt;= acgear_spare_armor]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our acgear, we have base %acgear_base, enchant %acgear_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Lowest spare we want to keep is base %acgear_spare_base, enchant %acgear_spare_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Armor class multiplier of this item is %identify_armor_multiplier%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCred %%% /%0: Acgear item has a total armor of %acgear_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Spare item has min armor of %acgear_spare_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has a total armor of %id_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: We could make the total armor %id_max_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_weapon = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this weapon?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;essence amorphous orb|shard black doom marble&amp;quot;, identify_object)) \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 5]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_dr=0%;\&lt;br /&gt;
        /let id_max_dr=0%;\&lt;br /&gt;
        /let damgear_stats=%;\&lt;br /&gt;
        /let damgear_total_dr=0%;\&lt;br /&gt;
        /let damgear_spare_dr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_dr $[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let damgear_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (damgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)dr \*([0-9]+)?(dr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let damgear_total_dr %{P1}%;\&lt;br /&gt;
        /let damgear_spare_dr %{P2}%;\&lt;br /&gt;
        /if (!damgear_spare_dr) \&lt;br /&gt;
                /let damgear_spare_dr $[damgear_total_dr - enchantbag_weapon_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_dr $[id_total_dr + (possible_enchants * 2)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_dr &amp;gt; damgear_total_dr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_dr &amp;gt; damgear_total_dr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_dr &amp;gt;= damgear_spare_dr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_dr &amp;gt;= damgear_spare_dr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our damgear, we have a %{damgear_total_dr}dr weapon%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %id_total_dr dr.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total dr %id_max_dr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_bow = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: The item is a bow.  Preprocessing.%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this bow?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
;DEBUG don't actually know what the level would do if a lord enchanted a hero&lt;br /&gt;
;DEBUG bow, this is a guess.  Also wouldn't know why you'd want to do a thing&lt;br /&gt;
;DEBUG like that&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_hr=0%;\&lt;br /&gt;
        /let id_max_hr=0%;\&lt;br /&gt;
        /let bow_cur_stats=%;\&lt;br /&gt;
        /let bow_cur_hr=0%;\&lt;br /&gt;
        /let bow_spare_hr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_hr $[identify_hr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let bow_cur_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (bow_cur_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)hr \*([0-9]+)?(hr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let bow_cur_hr %{P1}%;\&lt;br /&gt;
        /let bow_spare_hr %{P2}%;\&lt;br /&gt;
        /if (!bow_spare_hr) \&lt;br /&gt;
                /let bow_spare_hr $[bow_cur_hr - enchantbag_bow_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_hr $[id_total_hr + (possible_enchants * 3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_hr &amp;gt; bow_cur_hr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_hr &amp;gt; bow_cur_hr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_hr &amp;gt;= bow_spare_hr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_hr &amp;gt;= bow_spare_hr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: We have a %{bow_cur_hr}hr bow in our gear%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %{id_total_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total hr %{id_max_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_get_stats = \&lt;br /&gt;
        /if (enchantbag_wear_level == 51) \&lt;br /&gt;
                /let var_mid hero%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level == 125) \&lt;br /&gt;
                /let var_mid lord%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level &amp;lt;= 50) \&lt;br /&gt;
                /let var_mid lowmort%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let var_right=%*%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
        /test var_right:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_right)%;\&lt;br /&gt;
        /test var_right:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_right)%;\&lt;br /&gt;
        /let varname enchantbag_%{var_mid}_%{var_right}%;\&lt;br /&gt;
        /eval /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%%% /%0: Stats we have on file for %identify_object is %%{%{varname}}%;\&lt;br /&gt;
        /eval /return &amp;quot;%%{%{varname}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_possible_enchants = \&lt;br /&gt;
        /let pos_ench=0%;\&lt;br /&gt;
        /let counter %{identify_level}%;\&lt;br /&gt;
        /while (counter &amp;lt; enchantbag_wear_level - 1) \&lt;br /&gt;
                /if (counter + enchantbag_level_increment &amp;lt;= enchantbag_max_level) \&lt;br /&gt;
                        /test ++pos_ench%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /test counter+=enchantbag_level_increment%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /if (enchantbag_enchanter_level == enchantbag_wear_level) \&lt;br /&gt;
                /test pos_ench+=$[enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment))]%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test pos_ench+=$[(enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment)))/enchantbag_level_increment]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (pos_ench &amp;lt; 0) /let pos_ench 0%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: We could enchant %pos_ench more times%;\&lt;br /&gt;
        /return %{pos_ench}&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_exit = \&lt;br /&gt;
        /let _post %enchantbag_post%;\&lt;br /&gt;
        /config_restore -senchantbag blind%;\&lt;br /&gt;
        /config_restore -senchantbag combine%;\&lt;br /&gt;
        /config_restore -senchantbag condition%;\&lt;br /&gt;
        /config_restore -senchantbag nosummon%;\&lt;br /&gt;
        /config_restore -senchantbag notake%;\&lt;br /&gt;
        /config_restore -senchantbag nodisturb%;\&lt;br /&gt;
        /config_rmset enchantbag%;\&lt;br /&gt;
        /filter_restore -senchantbag spellother%;\&lt;br /&gt;
        /filter_rmset enchantbag%;\&lt;br /&gt;
        /unset enchantbag%;\&lt;br /&gt;
        /unset enchantbag_name%;\&lt;br /&gt;
        /unset enchantbag_name_check%;\&lt;br /&gt;
        /unset enchantbag_inv%;\&lt;br /&gt;
        /unset enchantbag_inv_name%;\&lt;br /&gt;
        /unset enchantbag_level_increment%;\&lt;br /&gt;
        /unset enchantbag_enchant_count%;\&lt;br /&gt;
        /unset enchantbag_max_level%;\&lt;br /&gt;
        /unset enchantbag_fade%;\&lt;br /&gt;
        /unset enchantbag_shimmer%;\&lt;br /&gt;
        /unset enchantbag_brill%;\&lt;br /&gt;
        /unset enchantbag_vape%;\&lt;br /&gt;
        /unset enchantbag_item_known%;\&lt;br /&gt;
        /unset enchantbag_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_spare%;\&lt;br /&gt;
        /unset enchantbag_spare%;\&lt;br /&gt;
        /unset enchantbag_post%;\&lt;br /&gt;
        /unset enchantbag_enchanter_level%;\&lt;br /&gt;
        /unset enchantbag_wear_level%;\&lt;br /&gt;
        /set enchantbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0 reports: We're finished.  Post command is: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.3 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchant.tf&amp;diff=33772</id>
		<title>Enchant.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchant.tf&amp;diff=33772"/>
		<updated>2008-11-10T00:43:43Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: whitespaces removed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An enchant script.  It'll enchant an item until something happens to it, and execute the command given by option -x when it's done.  The -i option makes it use information gathered by the [[identify.tf]] script, and is its default way of getting the item's type.  When the enchant is finished it will set global var enchant_exit to some useful exit status.&lt;br /&gt;
&lt;br /&gt;
This script uses [[verbose.tf]], [[regen.tf]] and [[safechannel.tf]] so you'll want those if you want to use this script.  Regen.tf uses [[prompt.tf]].  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/enchant.tf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}regen.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}safechannel.tf&lt;br /&gt;
&lt;br /&gt;
;All tf commands have the options before the arguments, e.g.&lt;br /&gt;
;/enchant -a ring&lt;br /&gt;
/def -i enchant_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /enchant &amp;lt;item&amp;gt;       Enchant &amp;lt;item&amp;gt; until something happens to it%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-a]                  item is an armor%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-w]                  item is a weapon%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-b]                  item is a bow%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-i]                  item is a %%{identify_type} &amp;lt;- default%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-n&amp;quot;&amp;lt;name&amp;gt;&amp;quot;]          use &amp;lt;name&amp;gt; to verify triggers%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;quot;&amp;lt;command&amp;gt;&amp;quot;]       execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
/enchant_usage&lt;br /&gt;
&lt;br /&gt;
;When the enchant is finished it will set global var enchant_exit to&lt;br /&gt;
;no_type        couldn't determine item type&lt;br /&gt;
;no_item        you're not carrying the item&lt;br /&gt;
;wrong_type     the items type is not what was expected&lt;br /&gt;
;wrong_name     the triggers responded to something but the name was wrong&lt;br /&gt;
;fade           we enchanted and got a fade&lt;br /&gt;
;shimmer        we enchanted and got a shimmer&lt;br /&gt;
;presence       we enchanted and got a shimmer and a presence&lt;br /&gt;
;brill          we enchanted and got a brilliant&lt;br /&gt;
;vape           we enchanted and the item vaporized or exploded&lt;br /&gt;
;&lt;br /&gt;
;re wrong_name:  the script does ignore the next line of mud output when someone&lt;br /&gt;
;   else enchants something.  If it still exits with wrong_name it probably&lt;br /&gt;
;   means something weird is going on.&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and use system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchant&lt;br /&gt;
&lt;br /&gt;
/def -i enchant_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Initializing .... %;\&lt;br /&gt;
        /set auto_enchant=0%;\&lt;br /&gt;
        /set enchant_timeout=0%;\&lt;br /&gt;
        /set enchant_keyword=%;\&lt;br /&gt;
        /set enchant_name=%;\&lt;br /&gt;
        /set enchant_type=%;\&lt;br /&gt;
        /set enchant_exit=%;\&lt;br /&gt;
        /set enchant_post=&lt;br /&gt;
&lt;br /&gt;
/def -i enchant = \&lt;br /&gt;
        /enchant_init%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;awbin:x:&amp;quot;)) /return 0%;/endif%; \&lt;br /&gt;
        /set enchant_name %{opt_n}%;\&lt;br /&gt;
        /safechannel -q on%;\&lt;br /&gt;
        /set enchant_post %{opt_x}%;\&lt;br /&gt;
        /if (opt_a) /set enchant_type armor%;\&lt;br /&gt;
        /elseif (opt_w) /set enchant_type weapon%;\&lt;br /&gt;
        /elseif (opt_b) /set enchant_type bow%;\&lt;br /&gt;
        /elseif (identify_type !~ &amp;quot;&amp;quot;) /set enchant_type %{identify_type}%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /echo -aCyellow %%% No idea how to enchant %*.%;\&lt;br /&gt;
                /enchant_exit no_type%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /set enchant_keyword %*%;\&lt;br /&gt;
        /set auto_enchant 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCcyan %%% /%0: Start enchanting %enchant_keyword.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Type is %enchant_type, post command is %enchant_post%;\&lt;br /&gt;
        /enchant_do%;\&lt;br /&gt;
&lt;br /&gt;
/def -i enchant_do = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Enchanting %{enchant_keyword} as %{enchant_type}.%;\&lt;br /&gt;
        c 'enchant %{enchant_type}' %{enchant_keyword}&lt;br /&gt;
&lt;br /&gt;
;Stuff that could go wrong&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -t&amp;quot;You are not carrying *!&amp;quot; enchant_no_item = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aBCred %%% Can't find your item, %{enchant_keyword}!  Bailing out.%;\&lt;br /&gt;
        /enchant_exit no_item&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^You do not have enough mana to cast enchant (weapon|bow|armor).$&amp;quot; enchant_no_mana = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCcyan %%% /%0: Yikes!  Out of mana.  Calling regen script and returning.%;\&lt;br /&gt;
        /regen -x/enchant_do&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^That isn't (an|a) (armor|weapon|bow).$&amp;quot; enchant_wrong_type = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aBCred %%% /%0: WRONG TYPE!  Exiting.%;\&lt;br /&gt;
        /enchant_exit wrong_type&lt;br /&gt;
&lt;br /&gt;
;If someone else enchants we dont want our triggers to grab their results&lt;br /&gt;
/def -i -E(auto_enchant) -t&amp;quot;* utters the words, 'enchant *'.&amp;quot; enchant_timeout = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Someone enchanted something.  Disabling enchant triggers.%;\&lt;br /&gt;
        /set enchant_timeout 1&lt;br /&gt;
;So we ignore the next line of mud output with a highest priority non-fallthru trigger&lt;br /&gt;
/def -i -E(enchant_timeout) -p999 -t&amp;quot;*&amp;quot; enchant_exit_timeout = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: We got their result.  Enabling enchant triggers.%;\&lt;br /&gt;
        /set enchant_timeout 0&lt;br /&gt;
;DEBUG? triggers are still not 100% fool proof (but getting really close)&lt;br /&gt;
;someone could enchant something just a millisecond before we do so both results&lt;br /&gt;
;would be on consecutive lines of mud output.  If their enchant fails or does&lt;br /&gt;
;nothing, we'll be ignoring the result of ours, stalling the script.&lt;br /&gt;
&lt;br /&gt;
;armor, weapon, bow&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^Nothing seemed to happen.$&amp;quot; enchant_nothing = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCyellow %%% /%0: Sigh... *yawn* ... Mumble mumph ZZZZZZZZZ ... retrying...%;\&lt;br /&gt;
        /enchant_do&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows brightly, then fades...oops.$&amp;quot; enchant_fade = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Item fades!  Beh.%;\&lt;br /&gt;
                /enchant_exit fade%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;a presence kills the enchant_exit /repeated by the shimmer&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^You feel the presence of (Shizaga|Quixoltan|Durr)!$&amp;quot; enchant_presence = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0:  Gotta love %{P1}!%;\&lt;br /&gt;
        /@test _enchant_exit_pid &amp;amp; (kill(_enchant_exit_pid), _enchant_exit_pid:=0)%;\&lt;br /&gt;
        /enchant_exit presence&lt;br /&gt;
&lt;br /&gt;
;armor&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; shimmers with a gold aura.$&amp;quot; enchant_shimmers_gold = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: We got gold... But where is Shizaga?%;\&lt;br /&gt;
                /repeat -0.5 1 /enchant_exit shimmer%;\&lt;br /&gt;
                /set _enchant_exit_pid=%?%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows a brilliant gold!$&amp;quot; enchant_brilliant_gold = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCyellow %%% /%0: Yesss!!!  A brill!.%;\&lt;br /&gt;
                /enchant_exit brill%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; flares blindingly... and evaporates!$&amp;quot; enchant_vape = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCred %%% /%0: Oh nooooooooo.... another one vaped!%;\&lt;br /&gt;
                /enchant_exit vape%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;weapon, bow&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows blue.$&amp;quot; enchant_shimmers_blue = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: This one enchanted...  any presence?%;\&lt;br /&gt;
                /repeat -0.5 1 /enchant_exit shimmer%;\&lt;br /&gt;
                /set _enchant_exit_pid=%?%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows a brilliant blue!$&amp;quot; enchant_brilliant_blue = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCblue %%% /%0: I wish this would happen all the time!%;\&lt;br /&gt;
                /enchant_exit brill%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; shivers violently and explodes!$&amp;quot; enchant_explode = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCred %%% /%0: Boom boom boom boom... Byebye!!%;\&lt;br /&gt;
                /enchant_exit vape%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;Finally, we exit!&lt;br /&gt;
/def -i enchant_exit = \&lt;br /&gt;
        /let _post %{enchant_post}%;\&lt;br /&gt;
        /safechannel -q off%;\&lt;br /&gt;
        /unset auto_enchant%;\&lt;br /&gt;
        /unset enchant_timeout%;\&lt;br /&gt;
        /unset enchant_keyword%;\&lt;br /&gt;
        /unset enchant_name%;\&lt;br /&gt;
        /unset enchant_type%;\&lt;br /&gt;
        /unset enchant_post%;\&lt;br /&gt;
        /set enchant_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Exit code: %{enchant_exit}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCcyan %%% /%0: Enchant script done!  Executing post command: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.4 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Dirrev.tf&amp;diff=33771</id>
		<title>Dirrev.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Dirrev.tf&amp;diff=33771"/>
		<updated>2008-11-10T00:37:59Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: mutter at wiki whitespace stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Non issue: The script won't revert 3w200s, max supported is 99.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /dirrev &amp;lt;path&amp;gt;        Revert speedwalk path&lt;br /&gt;
&lt;br /&gt;
/def -i dirrev = \&lt;br /&gt;
        /if ({#}=0) \&lt;br /&gt;
                /echo -p %%% @{Cred}Syntax: /%{0} &amp;lt;path&amp;gt;@{n}%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /let _dir_str %1 %;\&lt;br /&gt;
                /let _length $[strlen(_dir_str)] %;\&lt;br /&gt;
                /let _double_digit=0%;\&lt;br /&gt;
                /set dirrev=%;\&lt;br /&gt;
                /for c 0 $[_length-1] \&lt;br /&gt;
                        /let _position $$[_length-c] %%;\&lt;br /&gt;
                        /let _cur_char $$[substr(_dir_str, _position-1, 1)] %%;\&lt;br /&gt;
                        /if (_cur_char =~ &amp;quot;e&amp;quot;) /let _new_char w %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;s&amp;quot;) /let _new_char n %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;w&amp;quot;) /let _new_char e %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;n&amp;quot;) /let _new_char s %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;u&amp;quot;) /let _new_char d %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;d&amp;quot;) /let _new_char u %%;\&lt;br /&gt;
                        /else  /let _new_char %%{_cur_char} %%;\&lt;br /&gt;
                        /endif %%;\&lt;br /&gt;
                        /if ((_new_char =/ &amp;quot;[0-9]&amp;quot;) &amp;amp; (!_double_digit)) \&lt;br /&gt;
                                /set dirrev $$[strcat(substr(dirrev, 0, c-1), _new_char, substr(dirrev, c-1, 1))] %%;\&lt;br /&gt;
                                /if (substr(_dir_str, _position-2, 1) =/ &amp;quot;[0-9]&amp;quot;) \&lt;br /&gt;
                                        /set dirrev $$[strcat(substr(dirrev, 0, c-1), substr(_dir_str, _position-2, 1), substr(dirrev, c-1, 2))] %%;\&lt;br /&gt;
                                        /let _double_digit 1 %%;\&lt;br /&gt;
                                /endif %%;\&lt;br /&gt;
                        /elseif ( regmatch(&amp;quot;[nsewud]&amp;quot;, _new_char) ) \&lt;br /&gt;
                                /set dirrev $$[strcat(dirrev, _new_char)] %%;\&lt;br /&gt;
                                /let _double_digit 0 %%;\&lt;br /&gt;
                        /endif %;\&lt;br /&gt;
                /echo -p %%% @{Cwhite}The reverse of @{Cgreen}%{_dir_str} @{Cwhite}is @{Cgreen}%dirrev@{n}%;\&lt;br /&gt;
                /return &amp;quot;%dirrev&amp;quot;%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Config.tf&amp;diff=33770</id>
		<title>Config.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Config.tf&amp;diff=33770"/>
		<updated>2008-11-10T00:33:54Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: whitespace annoying wiki stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A script to store mud side configuration and filter options into variables and restore them later.  It also allows you to set defaults and restore them with &amp;quot;/config_restore all&amp;quot;  For more information, read the comments in the first 100 lines.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[verbose.tf]] so you'll want those if you want to use this script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/config.tf&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
;Scripts can use this script to store configuration and filter options from&lt;br /&gt;
;  Avatar into variables.  Example for a call from myscript&lt;br /&gt;
;&lt;br /&gt;
;       /config_store -smyscript -x/myscript_config_done&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_config_done = \&lt;br /&gt;
;       config +notake%;\&lt;br /&gt;
;       config +nosummon%;\&lt;br /&gt;
;       /myscript_continues&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_exit = \&lt;br /&gt;
;       /config_restore -smyscript notake%;\&lt;br /&gt;
;       /config_restore -smyscript nosummon%;\&lt;br /&gt;
;       /config_rmset myscript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /config_store         Stores mud configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore &amp;lt;option&amp;gt; Restore config &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore all   Restore all config options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_rmset &amp;lt;set&amp;gt;   Remove config &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
/def -i filter_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /filter_store         Stores mud filter configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore &amp;lt;option&amp;gt; Restore filter &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore all   Restore all filter options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_rmset &amp;lt;set&amp;gt;   Remove filter &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
;Default config.  If you interrupt a script or otherwise mess up your config&lt;br /&gt;
;  you can just use &amp;quot;/config_restore all&amp;quot;.&lt;br /&gt;
;To produce this list I used &amp;quot;/config_store&amp;quot; and &amp;quot;/listvar config_avatar*&amp;quot;.&lt;br /&gt;
/set config_avatar_autoexit=    +autoexit&lt;br /&gt;
/set config_avatar_autogold=    +autogold&lt;br /&gt;
/set config_avatar_autogroup=   +autogroup&lt;br /&gt;
/set config_avatar_autoloot=    -autoloot&lt;br /&gt;
/set config_avatar_autopull=    +autopull&lt;br /&gt;
/set config_avatar_autosac=     -autosac&lt;br /&gt;
/set config_avatar_autosplit=   +autosplit&lt;br /&gt;
/set config_avatar_autotitle=   +autotitle&lt;br /&gt;
/set config_avatar_battlenone=  -battlenone&lt;br /&gt;
/set config_avatar_battleother= -battleother&lt;br /&gt;
/set config_avatar_battleself=  -battleself&lt;br /&gt;
/set config_avatar_blank=       +blank&lt;br /&gt;
/set config_avatar_blind=       -blind&lt;br /&gt;
/set config_avatar_brief=       -brief&lt;br /&gt;
/set config_avatar_cmdcolor=    +cmdcolor&lt;br /&gt;
/set config_avatar_color=       +color&lt;br /&gt;
/set config_avatar_combine=     +combine&lt;br /&gt;
/set config_avatar_condition=   -condition&lt;br /&gt;
/set config_avatar_demonbank=   +demonbank&lt;br /&gt;
/set config_avatar_keepalive=   -keepalive&lt;br /&gt;
/set config_avatar_label=       +label&lt;br /&gt;
/set config_avatar_nobeep=      -nobeep&lt;br /&gt;
/set config_avatar_nodisturb=   -nodisturb&lt;br /&gt;
/set config_avatar_nogenesis=   -nogenesis&lt;br /&gt;
/set config_avatar_nosummon=    -nosummon&lt;br /&gt;
/set config_avatar_notake=      -notake&lt;br /&gt;
/set config_avatar_prompt=      +prompt&lt;br /&gt;
/set config_avatar_prompt2=     +prompt2&lt;br /&gt;
/set config_avatar_scoreaff=    -scoreaff&lt;br /&gt;
/set config_avatar_telnetga=    -telnetga&lt;br /&gt;
/set config_avatar_list= autoexit autoloot autogold autogroup autopull \&lt;br /&gt;
        autosplit autosac autotitle battleother battleself battlenone blank blind \&lt;br /&gt;
        brief color cmdcolor combine condition demonbank keepalive nobeep \&lt;br /&gt;
        nogenesis nosummon notake nodisturb label prompt prompt2 scoreaff telnetga&lt;br /&gt;
/eval /set config_set_list $(/unique %{config_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Default filter, for /filter_restore all&lt;br /&gt;
/set filter_avatar_objectother=0&lt;br /&gt;
/set filter_avatar_roomindiv=0&lt;br /&gt;
/set filter_avatar_roomtotal=1&lt;br /&gt;
/set filter_avatar_spellother=0&lt;br /&gt;
/set filter_avatar_walkother=0&lt;br /&gt;
/set filter_avatar_list= walkother roomindiv roomtotal spellother objectother&lt;br /&gt;
/eval /set filter_set_list $(/unique %{filter_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 config&lt;br /&gt;
&lt;br /&gt;
/config_usage&lt;br /&gt;
/filter_usage&lt;br /&gt;
&lt;br /&gt;
/def -i config_store = \&lt;br /&gt;
        /set config_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set config_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set config_post %{opt_x}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list=%;\&lt;br /&gt;
        /set config_set_list $(/unique %{config_set_list} %{config_set})%;\&lt;br /&gt;
        /set config_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing configuration, storing in set %config_set%;\&lt;br /&gt;
        config&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -t&amp;quot;\[ Keyword    \] Option&amp;quot; config_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of configuration list%;\&lt;br /&gt;
        /set prompt_exe config_store&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -mregexp -t&amp;quot;^\[(-|\+)([a-zA-Z0-9]+) *\] .+\.$&amp;quot; config_option = \&lt;br /&gt;
        /let _sign %{P1}%;\&lt;br /&gt;
        /let _option $[tolower({P2})]%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got config option: %{_option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list %%{config_%{config_set}_list} %%{_option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_%{_option} %{_sign}%{_option}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -p991 -mglob -h'send PROMPT_EXE config_store' config_prompt_exe = \&lt;br /&gt;
        /let _post %{config_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset config_store%;\&lt;br /&gt;
        /unset config_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored configuration in set %{config_set}, executing %{_post}%;\&lt;br /&gt;
        /unset config_set%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_restore = \&lt;br /&gt;
        /let _set=avatar%;\&lt;br /&gt;
        /set config_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /let _set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \&lt;br /&gt;
                /if (!regmatch(&amp;quot;autoexit&amp;quot;, config_%{_set}_autoexit)) \&lt;br /&gt;
                        /set config_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /let _option %1%;\&lt;br /&gt;
        /if (config_noset) \&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% /%0: No configuration set %{_set} stored!%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
        /elseif (_option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /config_restore %%{config_%{_set}_list}%;\&lt;br /&gt;
        /elseif (_option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval config %%{config_%{_set}_%{_option}}%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /config_usage%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Option %{_option} restored using set %{_set}%;\&lt;br /&gt;
        /unset config_noset&lt;br /&gt;
&lt;br /&gt;
/def -i config_rmset = \&lt;br /&gt;
        /let _set %*%;\&lt;br /&gt;
        /if (_set =~ &amp;quot;&amp;quot;) /let _set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{config_%{_set}_list}%;\&lt;br /&gt;
        /let _length $(/length %{rmset_options})%;\&lt;br /&gt;
        /let _counter=1%;\&lt;br /&gt;
        /while (_counter &amp;lt;= _length) \&lt;br /&gt;
                /unset config_%{_set}_$(/nth %{_counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set config_set_list $(/remove %{_set} %{config_set_list})%;\&lt;br /&gt;
        /unset config_%{_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (config_set_list =~ &amp;quot;&amp;quot;) /unset config_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Configuration set %{_set} removed.&lt;br /&gt;
&lt;br /&gt;
; Same for filter&lt;br /&gt;
&lt;br /&gt;
/def -i filter_store = \&lt;br /&gt;
        /set filter_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set filter_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set filter_post %{opt_x}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list=%;\&lt;br /&gt;
        /set filter_set_list $(/unique %{filter_set_list} %{filter_set})%;\&lt;br /&gt;
        /set filter_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing filters, storing in set %filter_set%;\&lt;br /&gt;
        filter&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -t&amp;quot;Filter Type           Status&amp;quot; filter_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of filter list%;\&lt;br /&gt;
        /set prompt_exe filter_store&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -mregexp -t&amp;quot;^([A-Z]+).+(ON|off)&amp;quot; filter_option = \&lt;br /&gt;
        /let _option $[tolower({P1})]%;\&lt;br /&gt;
        /let _sign %{P2}%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got filter: %{_option}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list %%{filter_%{filter_set}_list} %%{_option}%;\&lt;br /&gt;
        /if (_sign =~ &amp;quot;off&amp;quot;) \&lt;br /&gt;
                /eval /set filter_%{filter_set}_%{_option} 0%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /eval /set filter_%{filter_set}_%{_option} 1%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -p991 -mglob -h'send PROMPT_EXE filter_store' filter_prompt_exe = \&lt;br /&gt;
        /let _post %{filter_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset filter_store%;\&lt;br /&gt;
        /unset filter_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored filters in set %{filter_set}, executing %{_post}%;\&lt;br /&gt;
        /unset filter_set%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i filter_restore = \&lt;br /&gt;
        /let _set=avatar%;\&lt;br /&gt;
        /set filter_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /let _set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \&lt;br /&gt;
                /if (!regmatch(&amp;quot;0|1&amp;quot;, filter_%{_set}_objectother)) \&lt;br /&gt;
                        /set filter_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /let _option %1%;\&lt;br /&gt;
        /if (filter_noset) \&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% /%0: No filter set %{_set} stored!%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
        /elseif (_option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /filter_restore %%{filter_%{_set}_list}%;\&lt;br /&gt;
        /elseif (_option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval \&lt;br /&gt;
                        /if (filter_%{_set}_%{_option}) \&lt;br /&gt;
                                filter +%%{_option}%%;\&lt;br /&gt;
                        /else \&lt;br /&gt;
                                filter -%%{_option}%%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Filter %{_option} restored using set %{_set}%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /filter_usage%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /unset filter_noset&lt;br /&gt;
&lt;br /&gt;
/def -i filter_rmset = \&lt;br /&gt;
        /let _set %*%;\&lt;br /&gt;
        /if (_set =~ &amp;quot;&amp;quot;) /let _set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{filter_%{_set}_list}%;\&lt;br /&gt;
        /let _length $(/length %{rmset_options})%;\&lt;br /&gt;
        /let _counter=1%;\&lt;br /&gt;
        /while (_counter &amp;lt;= _length) \&lt;br /&gt;
                /unset filter_%{_set}_$(/nth %{_counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set filter_set_list $(/remove %{_set} %{filter_set_list})%;\&lt;br /&gt;
        /unset filter_%{_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (filter_set_list =~ &amp;quot;&amp;quot;) /unset filter_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Filter set %{_set} removed.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Alt.tf&amp;diff=33769</id>
		<title>Alt.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Alt.tf&amp;diff=33769"/>
		<updated>2008-11-10T00:19:42Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: more whitespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P&amp;gt;This script provides&lt;br /&gt;
* easy alt switching, one command will log out the current char and login the other&lt;br /&gt;
* triggers to log in quickly scrolling by the motd and what not&lt;br /&gt;
* a modified /world (stdlib.tf) which will not connect if tf has an active connection&lt;br /&gt;
* a modification to /world to set secho off during the /@connect, this prevends the password from being displayed if you have secho on.&lt;br /&gt;
* you can use /alt -x&amp;lt;command&amp;gt; &amp;lt;alt&amp;gt;  to log in &amp;lt;alt&amp;gt; and have &amp;lt;command&amp;gt; executed when the alt logged in, so you could easily make a spellup macro that'd use 2 alts :)&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P&amp;gt;&lt;br /&gt;
You'll probably want to change the value of &amp;quot;main_alt&amp;quot; at the beginning of this script.&lt;br /&gt;
&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;B&amp;gt;An older version had a bug&amp;lt;/B&amp;gt; that creeped in when I changed the trigger to a disconnect hook.  It didn't turn it off after an alt switch.  If you'd use it to log in (create) a denied character, &amp;lt;B&amp;gt;the script would loop trying to log in that character.&amp;lt;/B&amp;gt;  I suspect it'd do the same if you'd have a wrong password in your config file.  Big oops!  If you're using this script, plz make sure and update.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/alt.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /alt                  (Logout and) login %{main_alt}&lt;br /&gt;
/echo -aCyellow %% /alt &amp;lt;world&amp;gt;          (Logout and) login &amp;lt;world&amp;gt;&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; after alt switch&lt;br /&gt;
/echo -aCyellow %% /relog                (Logout and) login current world&lt;br /&gt;
&lt;br /&gt;
;Set this variable to your main alt&lt;br /&gt;
/set main_alt sulfar&lt;br /&gt;
&lt;br /&gt;
/def alt_init = \&lt;br /&gt;
        /set alt_get=0%;\&lt;br /&gt;
        /set alt=%;\&lt;br /&gt;
        /set alt_post=%;\&lt;br /&gt;
        /set alt_execute_post=0&lt;br /&gt;
&lt;br /&gt;
;;Quick, easy and safe alt switching&lt;br /&gt;
/def -i alt = \&lt;br /&gt;
        /alt_init%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /if (opt_x !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set alt_post %{opt_x}%;\&lt;br /&gt;
                /set alt_execute_post 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /set alt %*%;\&lt;br /&gt;
        /if (alt =~ &amp;quot;&amp;quot;) /set alt %{main_alt}%;/endif%;\&lt;br /&gt;
        /if (is_open())\&lt;br /&gt;
                /set alt_get 1%;\&lt;br /&gt;
                quit%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /world %{alt}%;\&lt;br /&gt;
                /set alt=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i relog = /alt ${world_name}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(alt_get) -p999 -F -h'disconnect' alt_disconnect = \&lt;br /&gt;
        /set alt_get 0%;\&lt;br /&gt;
        /world %{alt}%;\&lt;br /&gt;
        /set alt=&lt;br /&gt;
&lt;br /&gt;
/def -i -E(alt_execute_post) -p999 -F -t&amp;quot;Welcome back to the AVATAR System, *&amp;quot; alt_welcome_back = \&lt;br /&gt;
        /let post %alt_post%;\&lt;br /&gt;
        /alt_init%;\&lt;br /&gt;
        /echo -aCcyan %%% /%0: Alt switch ready!  Executing command: %post%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&lt;br /&gt;
;Some triggers to scroll by the motd and what not&lt;br /&gt;
/def -i -mregexp -t&amp;quot;AVATAR (PLAYER|MORTAL) INFORMATION CENTER&amp;quot; login_enter_1 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %;/echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;Please press &amp;lt;enter&amp;gt; to continue&amp;quot; login_enter_2 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;Please ensure that you've read and understood the Rules.&amp;quot; login_enter_3 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;please press *RETURN* to continue&amp;quot; login_enter_4 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
/def -i -mregexp -t&amp;quot;Press &amp;lt;ENTER&amp;gt; to continue&amp;quot; login_enter_5 = /eval /send%;/repeat -0:00:0.5 1 /eval /send %; /echo %%% trigger: %0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Modified /world (stdlib.tf)&lt;br /&gt;
; will not connect if tf has an active connection to avoid multiplay accidents&lt;br /&gt;
; will turn secho off before connecting to prevend echoing the password to the&lt;br /&gt;
;   screen in case it was on.  The value of secho is restored after connecting.&lt;br /&gt;
/def -i world = \&lt;br /&gt;
        /if (!getopts(&amp;quot;nlqxfb&amp;quot;, 0)) /return 0%; \&lt;br /&gt;
        /endif%; \&lt;br /&gt;
        /let _args=%*%; \&lt;br /&gt;
        /if (_args =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /let _args=$(/nth 1 $(/@listworlds -s))%; \&lt;br /&gt;
                /if (_args =/ &amp;quot;default&amp;quot;) \&lt;br /&gt;
                        /let _args=$(/nth 2 $(/@listworlds -s))%; \&lt;br /&gt;
                /endif%; \&lt;br /&gt;
        /endif%; \&lt;br /&gt;
        /let _opts=%; \&lt;br /&gt;
        /if (is_open(_args)) \&lt;br /&gt;
                /if (opt_n) /let _opts=%_opts -n%; /endif%; \&lt;br /&gt;
                /if (opt_q) /let _opts=%_opts -q%; /endif%; \&lt;br /&gt;
                /@fg %_opts %_args%; \&lt;br /&gt;
        /elseif (is_open())\&lt;br /&gt;
                /echo %% But you *are* connected!%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /if (opt_l) /let _opts=%_opts -l%; /endif%; \&lt;br /&gt;
                /if (opt_q) /let _opts=%_opts -q%; /endif%; \&lt;br /&gt;
                /if (opt_x) /let _opts=%_opts -x%; /endif%; \&lt;br /&gt;
                /if (opt_f) /let _opts=%_opts -f%; /endif%; \&lt;br /&gt;
                /if (opt_b) /let _opts=%_opts -b%; /endif%; \&lt;br /&gt;
                /let _secho %{secho}%;\&lt;br /&gt;
                /set secho off%;\&lt;br /&gt;
                /@connect %_opts %_args%; \&lt;br /&gt;
                /set secho %{_secho}%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Affects.tf&amp;diff=33768</id>
		<title>Affects.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Affects.tf&amp;diff=33768"/>
		<updated>2008-11-10T00:17:36Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Provides&lt;br /&gt;
* custom colors of affects list&lt;br /&gt;
* /aff &amp;lt;spell&amp;gt; shows affects list just for &amp;lt;spell&amp;gt;&lt;br /&gt;
* /sick shows how sick you are&lt;br /&gt;
* /chkaff shows which spells you are *not* affected by&lt;br /&gt;
* Sanctuary ticker on the satus line&lt;br /&gt;
* Spellup ticker on the status line&lt;br /&gt;
&lt;br /&gt;
The tickers grab the duration of sanctuary and holy aura from the affects list, colors them and puts them in a status variable.  It then uses [[tick.tf]] to make the tickers count down on the tick.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[tick.tf]] so you'll need those too.  Also, you should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}tick.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /aff &amp;lt;spell&amp;gt;          Shows affects list for &amp;lt;spell&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /sick                 Shows how sick you are&lt;br /&gt;
/echo -aCyellow %% /chkaff               Shows which spells you are *not* affected by&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script:&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_sanctuary:3 :1 status_spellup:3 :1 status_position insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Custom color the affects list..&lt;br /&gt;
;Paint all of the affects list green&lt;br /&gt;
/def -i -p999 -F -PCgreen -mregexp -t&amp;quot;^Spell: '.*&amp;quot; affects_green&lt;br /&gt;
&lt;br /&gt;
;yellow for some spells i might want to check more than others&lt;br /&gt;
/def -i -p998 -F -PCyellow -mregexp -t&amp;quot;^Spell: '(steel|iron|bark|pass|fly|water|heigh|conc).*&amp;quot; affects_yellow&lt;br /&gt;
&lt;br /&gt;
;white for spells i most probably want to find quickly&lt;br /&gt;
/def -i -p998 -F -PCwhite -mregexp -t&amp;quot;^Spell: '(sanc|regen|scramble|hand).*&amp;quot; affects_white&lt;br /&gt;
&lt;br /&gt;
;You can &amp;quot;/aff sanc&amp;quot; and it'll only show the sanctuary line&lt;br /&gt;
;or use a regexp, &amp;quot;/aff sanc|fren&amp;quot;&lt;br /&gt;
/def -i aff = \&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _aff_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '%{1}.*&amp;quot; _aff_spell%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _aff_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 /undef _aff_affected _aff_spell _aff_gag_other_affects%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;Just a /sick macro.&lt;br /&gt;
/def -i sick = \&lt;br /&gt;
        /set sick_poison 0%;\&lt;br /&gt;
        /set sick_disease 0%;\&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _sick_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(poison|toxin|biotoxin|venom)'.*&amp;quot; _sick_poison = /test $$$[++sick_poison] %%;\&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(virus|plague)'.*&amp;quot; _sick_disease = /test $$$[++sick_disease]%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _sick_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 \&lt;br /&gt;
                        /undef _sick_affected _sick_poison _sick_disease _sick_gag_other_affects%%%;\&lt;br /&gt;
                gtell %%%%% I am affected by: %%%sick_poison poisons and %%%sick_disease diseases%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;/chkaff will show you the spells from the chkaff_list by which&lt;br /&gt;
;you're *not* affected.&lt;br /&gt;
/def -i chkaff = \&lt;br /&gt;
        /set chkaff_list= |BR| sanctuary |R| awen foci fortitudes \&lt;br /&gt;
                invincibility barkskin steel_skeleton iron_skin |W| protection_evil bless holy_aura \&lt;br /&gt;
                holy_armor armor water_breathing energy_shield displacement body_brace \&lt;br /&gt;
                mental_barrier calcify_flesh biofeedback anticipate adrenaline_pump concentrate \&lt;br /&gt;
                pass_door fly shield stone_skin giant_strength |G| frenzy |B| heighten_senses%;\&lt;br /&gt;
        /set chkaff 1%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -t&amp;quot;You are affected by:&amp;quot; chkaff_affected = \&lt;br /&gt;
        /set prompt_exe chkaff&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -mregexp -t&amp;quot;^Spell: '(.+)' .+&amp;quot; chkaff_spell = \&lt;br /&gt;
        /let affect=$[replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, {P1})]%;\&lt;br /&gt;
        /set chkaff_list=$(/remove %affect %chkaff_list)&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p991 -mglob -h'send PROMPT_EXE chkaff' chkaff_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /set chkaff 0%;\&lt;br /&gt;
        gtell %%% I am *not* affected by %chkaff_list&lt;br /&gt;
&lt;br /&gt;
;Sanc and spellup tickers on the status line&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;You are affected by:&amp;quot; tickers_init = \&lt;br /&gt;
        /set sanctuary_duration=%;\&lt;br /&gt;
        /set spellup_duration=%;\&lt;br /&gt;
        /sanctuary_status%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/tickers_init&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'sanctuary'  for ([0-9]+) hours.$&amp;quot; aff_sanc = \&lt;br /&gt;
        /test sanctuary_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;The protective aura fades from around your body.&amp;quot; sanctuary_fades = \&lt;br /&gt;
        /set sanctuary_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' sanctuary_tick = \&lt;br /&gt;
        /if (sanctuary_duration &amp;gt; 0) /test --sanctuary_duration%;\&lt;br /&gt;
        /else /set sanctuary_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i sanctuary_status = \&lt;br /&gt;
        /set status_sanctuary \$%{sanctuary_duration}%;\&lt;br /&gt;
        /if (sanctuary_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /elseif (sanctuary_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary BCred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 5) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -t&amp;quot;You are surrounded by a white aura.&amp;quot; got_sanc = affects&lt;br /&gt;
&lt;br /&gt;
;Do the same for holy aura to have a spellup ticker&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'holy aura'  modifies armor class by -[0-9]+ for ([0-9]+) hours.$&amp;quot; aff_spellup = \&lt;br /&gt;
        /test spellup_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;Your Aura of Holiness fades...&amp;quot; spellup_fades = \&lt;br /&gt;
        /set spellup_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' spellup_tick = \&lt;br /&gt;
        /if (spellup_duration &amp;gt; 0) /test --spellup_duration%;\&lt;br /&gt;
        /else /set spellup_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i spellup_status = \&lt;br /&gt;
        /set status_spellup s%{spellup_duration}%;\&lt;br /&gt;
        /if (spellup_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /elseif (spellup_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_spellup BCred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 3) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Tick.tf&amp;diff=33767</id>
		<title>Tick.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Tick.tf&amp;diff=33767"/>
		<updated>2008-11-10T00:14:46Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: More annoying whitespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A modified tick.tf.  It's backwards compatible with tick.tf as found in tflib.  Changes are in the comments below.  &lt;br /&gt;
&lt;br /&gt;
It also provides a means to other scripts to have something executed on the tick.  See tick_exe in the script, or [[affects.tf]] for a usage example of this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
;;;; Tick counting&lt;br /&gt;
;;;; This file implements several tick counting commands similar to those&lt;br /&gt;
;;;; found in tintin, useful on Diku muds.&lt;br /&gt;
&lt;br /&gt;
;;;; usage:&lt;br /&gt;
/echo -aCyellow %% /tick                 Display the time remaining until next tick&lt;br /&gt;
/echo -aCyellow %% /tickon               Reset and start the tick counter&lt;br /&gt;
/echo -aCyellow %% /tickoff              Stop the tick counter&lt;br /&gt;
/echo -aCyellow %% /tickset              Reset and start the tick counter&lt;br /&gt;
/echo -aCyellow %% /ticksize &amp;lt;n&amp;gt;         Set the tick length to &amp;lt;n&amp;gt; seconds (default is 28.45)&lt;br /&gt;
/echo -aCyellow %% /tickshow             Toggle tick messages&lt;br /&gt;
/echo -aCyellow %% /tick+                Increase the ticksize with 0.05 seconds&lt;br /&gt;
/echo -aCyellow %% /tick-                Decrease the ticksize with 0.05 seconds&lt;br /&gt;
&lt;br /&gt;
;;;; This is a modified version of tick.tf as found in tf-lib&lt;br /&gt;
;;;; Modifications:&lt;br /&gt;
;;; Mod - Made tick warning catch the eye&lt;br /&gt;
;;; New - 5 seconds tick warning&lt;br /&gt;
;;; Mod - /tickoff also kills the 5 seconds warning&lt;br /&gt;
;;; New - /tickshow, you can now run the counter without seeing a message&lt;br /&gt;
;;;                  if you need the counter, you can /tickshow to see the&lt;br /&gt;
;;;                  messages and have a synced tick counter ready&lt;br /&gt;
;;; Mod - Made /tickset show a message if show_tick is 1&lt;br /&gt;
;;; New - /tick+ and /tick-&lt;br /&gt;
;;; New - Triggers to sync tick counter&lt;br /&gt;
;;; New - Send TICK_EXE to the server but intercept it, see tick_exe below&lt;br /&gt;
&lt;br /&gt;
/loaded __TFLIB__/tick.tf&lt;br /&gt;
&lt;br /&gt;
;Time between ticks in seconds&lt;br /&gt;
/set ticksize=28.45&lt;br /&gt;
&lt;br /&gt;
/set next_tick=0&lt;br /&gt;
/set _tick_pid1=0&lt;br /&gt;
/set _tick_pid2=0&lt;br /&gt;
/set _tick_pid3=0&lt;br /&gt;
/set show_tick=1&lt;br /&gt;
/set tickon_time 0&lt;br /&gt;
&lt;br /&gt;
/def -i tick_warn = /if (show_tick) /echo %%% Next tick in 10 seconds.%;/endif&lt;br /&gt;
/def -i tick_warn2 = /if (show_tick) /echo %%% Next tick in 5 seconds.%;/endif&lt;br /&gt;
/def -i tick_action = /if (show_tick) /echo %%%   ---===&amp;gt; TICK &amp;lt;===---   ---===&amp;gt; TICK &amp;lt;===---   ---===&amp;gt; TICK &amp;lt;===---%;/endif&lt;br /&gt;
&lt;br /&gt;
/def -i tick = \&lt;br /&gt;
        /if (next_tick) \&lt;br /&gt;
                /eval /echo %%% $$[next_tick - $(/time @)] seconds until tick%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /echo -e %% Tick counter is not running.%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;Send TICK_EXE to the server,&lt;br /&gt;
/def tick_exe = /send -h TICK_EXE&lt;br /&gt;
&lt;br /&gt;
;but intercept it with a send hook.&lt;br /&gt;
;If you'd change the hook please be aware it needs a body to do anything at all!&lt;br /&gt;
/def -i -p990 -mglob -h'send TICK_EXE' send_hook_TICK_EXE = /test&lt;br /&gt;
&lt;br /&gt;
;If an other script needs to do anything on the tick all you need to do is&lt;br /&gt;
;create a similar send hook with a higher priority, like&lt;br /&gt;
;/def -E(some_boolean) -i -p991 -F -mglob -h'send TICK_EXE' myscript_tick = /some_command&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;tick_on calls /tick_exe if it didn't do so in the past 4 seconds&lt;br /&gt;
/def -i tickon = \&lt;br /&gt;
        /let tick_cur_t $(/time @)%;\&lt;br /&gt;
        /if (tickon_time + 4 &amp;lt; tick_cur_t) \&lt;br /&gt;
                /tick_exe%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /set tickon_time $(/time @)%;\&lt;br /&gt;
        /tickoff%;\&lt;br /&gt;
        /@test next_tick := $(/time @) + ticksize %;\&lt;br /&gt;
        /repeat -$[ticksize - 10] 1 \&lt;br /&gt;
                /set _tick_pid1=0%%;\&lt;br /&gt;
                /tick_warn%;\&lt;br /&gt;
        /set _tick_pid1=%?%;\&lt;br /&gt;
        /repeat -$[ticksize - 5] 1 \&lt;br /&gt;
                /set _tick_pid3=0%%;\&lt;br /&gt;
                /tick_warn2%;\&lt;br /&gt;
        /set _tick_pid3=%?%;\&lt;br /&gt;
        /repeat -%ticksize 1 \&lt;br /&gt;
                /set _tick_pid2=0%%;\&lt;br /&gt;
                /tick_action%%;\&lt;br /&gt;
                /tickon%;\&lt;br /&gt;
        /set _tick_pid2=%?&lt;br /&gt;
&lt;br /&gt;
/def -i tickoff = \&lt;br /&gt;
        /@test _tick_pid1 &amp;amp; (kill(_tick_pid1), _tick_pid1:=0)%;\&lt;br /&gt;
        /@test _tick_pid3 &amp;amp; (kill(_tick_pid3), _tick_pid3:=0)%;\&lt;br /&gt;
        /@test _tick_pid2 &amp;amp; (kill(_tick_pid2), _tick_pid2:=0)%;\&lt;br /&gt;
        /set next_tick=0&lt;br /&gt;
&lt;br /&gt;
/def -i tickset = \&lt;br /&gt;
        /if (show_tick) \&lt;br /&gt;
                /eval /echo %%% Tick counter offset $$[next_tick - $(/time @)]%;\&lt;br /&gt;
                /echo %%%   ---===&amp;gt; TICK &amp;lt;===---   ---===&amp;gt; TICK &amp;lt;===---  synchronized%;\&lt;br /&gt;
;A spellup dropping was causing a lot of tick sync spam, so:&lt;br /&gt;
                /set show_tick 0%;\&lt;br /&gt;
                /repeat -0:0:2 1 /set show_tick 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /tickon&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i ticksize = /set ticksize %*&lt;br /&gt;
&lt;br /&gt;
/def -i tickshow = \&lt;br /&gt;
        /set show_tick $[!show_tick] %;\&lt;br /&gt;
        /if (show_tick) \&lt;br /&gt;
                /echo %% Now showing tick messages%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /echo %% No longer showing tick messages%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;macros to fiddle with ticksize&lt;br /&gt;
/def -i tick+ = /set ticksize $[ticksize + 0.05] %;/echo Ticksize is now %{ticksize} seconds.&lt;br /&gt;
/def -i tick- = /set ticksize $[ticksize - 0.05] %;/echo Ticksize is now %{ticksize} seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;triggers to sync tick counter&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * decays into dust.&amp;quot; tick_corpse_decays = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * decays leaving only a stench.&amp;quot; tick_corpse_decays2 = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * dissolves into smoke.&amp;quot; tick_corpse_smokes = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * gets taken by imps.&amp;quot; tick_corpse_imped = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * spontaneously combusts leaving only ash.&amp;quot; tick_corpse_combusts = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * liquifies into nothing.&amp;quot; tick_corpse_liquifies = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * is consumed by maggots.&amp;quot; tick_corpse_consumed = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Corpse of * breaks apart into pieces.&amp;quot; tick_corpse_breaks = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;An imp grabs * and vanishes.&amp;quot; tick_imp_grabs = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;* decomposes.&amp;quot; tick_something_decomposes = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The portal crackles suddenly, flares brightly, and is gone!&amp;quot; tick_portal = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The room shudders as the nexus implodes in on itself and vanishes!&amp;quot; tick_nexus = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You can't take the bright sunlight!&amp;quot; tick_no_sun_self = /tickset&lt;br /&gt;
/def -i -p200 -F -mregexp -t&amp;quot;^([^ ]+) screams in pain from the sunlight!$&amp;quot; tick_no_sun_other = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The sky is getting cloudy.&amp;quot; tick_sky_cloudy = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The clouds disappear.&amp;quot; tick_clouds_disappear = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;It starts to rain!&amp;quot; tick_rain_starts = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The rain has stopped.&amp;quot; tick_rain_stops = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Lightning flashes in the sky.&amp;quot; tick_lightning_flashes = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The lightning has stopped.&amp;quot; tick_lightning_stopped = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The day has begun.&amp;quot; tick_day_begun = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The night has begun.&amp;quot; tick_night_begun = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The sun slowly disappears in the west.&amp;quot; tick_sun_disappears = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The sun rises in the east.&amp;quot; tick_sun_rises = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The protective aura fades from around your body.&amp;quot; tick_sanctuary = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You slowly come out of your rage.&amp;quot; tick_frenzy = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less perceptive.&amp;quot; tick_alertness = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your senses return to normal.&amp;quot; tick_heighten_senses = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less righteous.&amp;quot; tick_bless = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less focused.&amp;quot; tick_concentration = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your battle sense has faded.&amp;quot; tick_anticipate = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your God's presence disappears.&amp;quot; tick_prayer = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You no longer perceive auras.&amp;quot; tick_detect_alignment = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less armored.&amp;quot; tick_armor = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your Aura of Holiness fades...&amp;quot; tick_holy_aura = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You are no longer protected by your God.&amp;quot; tick_holy_armor = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less fatigued.&amp;quot; tick_racial_fatigue = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;One of your Exhausted spells has refreshed.&amp;quot; tick_exhausted = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your pulse slows and your body returns to normal.&amp;quot; tick_regeneration = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You no longer feel invincible!&amp;quot; tick_invincibility = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your lungs adapt to oxygen once again.&amp;quot; tick_water_breathing = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your skin softens and returns to normal.&amp;quot; tick_iron_skin = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your skin feels soft again.&amp;quot; tick_stone_skin = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your force shield shimmers then fades away.&amp;quot; tick_shield = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel weaker.&amp;quot; tick_giant_strength = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your calcified flesh softens and returns to normal.&amp;quot; tick_calcify = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel lighter as your bones return to normal.&amp;quot; tick_steel_skeleton = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You gain a sense of reality.&amp;quot; tick_overconfidence = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;The voices in your head fall silent.&amp;quot; tick_scramble = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less savvy.&amp;quot; tick_savvy = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You no longer feel quite so mellow.&amp;quot; tick_calm = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;You feel less insightful.&amp;quot; tick_acumen = /tickset&lt;br /&gt;
/def -i -p200 -F -t&amp;quot;Your innate frenzy subdues down to normal.&amp;quot; tick_racial_frenzy = /tickset&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33766</id>
		<title>Prompt.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Prompt.tf&amp;diff=33766"/>
		<updated>2008-11-10T00:06:54Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: mutter mutter trailing whitespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A prompt script:&lt;br /&gt;
* Values are grabbed&lt;br /&gt;
* prompt1 is substituted, hp/mana/monitor are colored to reflect their status&lt;br /&gt;
* prompt2 containing surge/augment/quicken levels is gagged, the levels go into the status line and are colored&lt;br /&gt;
* Provides an easy way for other scripts to trigger on a prompt&lt;br /&gt;
* If you log in with a prompt that's incompatible with prompt.tf, it'll set the prompt to be compatible&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
* prompt_exe: instead of setting prompt_exe to 1, you can now set it to a string and it'll send &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot;.  Makes it easier to have multiple scripts use prompt_exe.  See the chkaff macro in [[affects.tf]] for an example.&lt;br /&gt;
&lt;br /&gt;
Read the comments in the script for more information.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/prompt.tf&lt;br /&gt;
&lt;br /&gt;
;These are the prompts I set on the mud.&lt;br /&gt;
;prompt &amp;lt;%h/%H(%p) %m/%M(%o) %v/%V [%T] %w/%W(%P) t%s&amp;gt;%n&lt;br /&gt;
;prompt2 &amp;lt;s%S a%A q%Q&amp;gt;%n&lt;br /&gt;
;also type &amp;quot;prompt2&amp;quot; once or twice and make sure it's on since the trigger below&lt;br /&gt;
;  gags it&lt;br /&gt;
&lt;br /&gt;
;Prompt1 is substituted by substitute_prompt1.  It adds values to see the loss&lt;br /&gt;
;  in hp, mana and monitor's hp.  It also changes the color of hp/mana/monitor.&lt;br /&gt;
;  If hp is higher than 70% it's colored green, if it's between 30% and 70% it's&lt;br /&gt;
;  colored yellow, if it's lower than 30% it's colored red.  Moves are just&lt;br /&gt;
;  green currently.&lt;br /&gt;
;&lt;br /&gt;
;The substitute currently looks like:&lt;br /&gt;
;$&amp;amp;&amp;lt;D&amp;gt;[S]!@#&amp;lt;10/30(20|33%) 20/80(60|25%) 90mv 100/700(600|14%) t3&amp;gt;&lt;br /&gt;
;first the prompt symbols as usual,&lt;br /&gt;
;then hp: you're at 10 hp out of 30, that's 33%, you lost 20,&lt;br /&gt;
;then mana:  you're at 20 mana out of 80, that's 25% used 60,&lt;br /&gt;
;then moves: you're at 90 mv,&lt;br /&gt;
;then monitor: is at 100 out of 700, that's 14%, lost 600&lt;br /&gt;
;then the lag timer, 3 seconds.&lt;br /&gt;
&lt;br /&gt;
;To save space on the prompt line, I put tnl in tf's statusline as [320] for&lt;br /&gt;
;  example.  Tnl also shifts color, green if it's above 300, yellow for 300 or&lt;br /&gt;
;  lower, bright yellow for 130 or lower.&lt;br /&gt;
;The AFK part of the prompt is captured but not displayed anywhere.&lt;br /&gt;
&lt;br /&gt;
;prompt2 has values for surge, augment, quicken, is gagged and its values are&lt;br /&gt;
;  captured to status_ variables to use in the tf status line.  &amp;quot;Off&amp;quot; values&lt;br /&gt;
;  are changed to &amp;quot;0&amp;quot; to save some space on the satusline.  Surge, augment&lt;br /&gt;
;  and quicken levels are colored.  Surge and augment are green if they're off,&lt;br /&gt;
;  yellow if 2 or 3, bright yellow if 4 or higher.  Quicken is green if it's&lt;br /&gt;
;  off, bright yellow if it's on.&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_surge:2 :1 status_augment:2 :1 status_quicken:2 :1 status_tnl :1  insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
;If you'd like to use the script and the prompt setting above contains all the&lt;br /&gt;
;  information you want but just doesn't look the way you want, I'd recommend&lt;br /&gt;
;  setting it to the format above anyways and then change the substitute below&lt;br /&gt;
;  to make it appear the way you want.&lt;br /&gt;
&lt;br /&gt;
;If prompt_exe is set to a string tf will send a &amp;quot;PROMPT_EXE &amp;lt;string&amp;gt;&amp;quot; to Avatar&lt;br /&gt;
;  when it receives a prompt.  However, it intercepts the &amp;quot;PROMPT_EXE*&amp;quot; string&lt;br /&gt;
;  with a send hook of priority 990.  This allowes you to make a higher priority&lt;br /&gt;
;  send hook in a script to do something when you get a prompt in.&lt;br /&gt;
/set prompt_exe=&lt;br /&gt;
&lt;br /&gt;
;set mud side prompt to be compatible with prompt.tf&lt;br /&gt;
/def -i prompt_set = \&lt;br /&gt;
        prompt &amp;lt;%%h/%%H(%%p) %%m/%%M(%%o) %%v/%%V [%%T] %%w/%%W(%%P) t%%s&amp;gt;%%n%;\&lt;br /&gt;
        prompt2 &amp;lt;s%%S a%%A q%%Q&amp;gt;%%n%;\&lt;br /&gt;
        config +prompt%;\&lt;br /&gt;
        config +prompt2&lt;br /&gt;
&lt;br /&gt;
;Hooray for regexps!&lt;br /&gt;
/def -i -F -p400 -mregexp -t&amp;quot;^(\$|)(\&amp;amp;|)(\&amp;lt;D\&amp;gt;|)(\[S\]|)(\!|)(\@|)(\#|)(\*Deaf\* |)(\(AFK\) |)&amp;lt;(-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%\) (-?[0-9]*)/(-?[0-9]*) \[(-?[0-9]*)\] (-?[0-9]*)/(-?[0-9]*)\((-?[0-9]*)\%?\) t([0-9]+)&amp;gt;&amp;quot; substitute_prompt1 =\&lt;br /&gt;
;set prompt vars&lt;br /&gt;
        /set prompt_sanctuary %{P1}%;\&lt;br /&gt;
        /set prompt_werrebocler %{P2}%;\&lt;br /&gt;
        /set prompt_demonfire %{P3}%;\&lt;br /&gt;
        /set prompt_stance %{P4}%;\&lt;br /&gt;
        /set prompt_invis %{P5}%;\&lt;br /&gt;
        /set prompt_move_hidden %{P6}%;\&lt;br /&gt;
        /set prompt_sneak %{P7}%;\&lt;br /&gt;
        /set prompt_deaf %{P8}%;\&lt;br /&gt;
        /set prompt_afk %{P9}%;\&lt;br /&gt;
        /test prompt_hp:=strip_attr({P10})%;\&lt;br /&gt;
        /test prompt_hp_max:=strip_attr({P11})%;\&lt;br /&gt;
        /test prompt_hp_relative:=strip_attr({P12})%;\&lt;br /&gt;
        /test prompt_mana:=strip_attr({P13})%;\&lt;br /&gt;
        /test prompt_mana_max:=strip_attr({P14})%;\&lt;br /&gt;
        /test prompt_mana_relative:=strip_attr({P15})%;\&lt;br /&gt;
        /test prompt_move:=strip_attr({P16})%;\&lt;br /&gt;
        /test prompt_move_max:=strip_attr({P17})%;\&lt;br /&gt;
        /test prompt_tnl:=strip_attr({P18})%;\&lt;br /&gt;
        /test prompt_monitor:=strip_attr({P19})%;\&lt;br /&gt;
        /test prompt_monitor_max:=strip_attr({P20})%;\&lt;br /&gt;
        /test prompt_monitor_relative:=strip_attr({P21})%;\&lt;br /&gt;
        /test prompt_lagtimer:=strip_attr({P22})%;\&lt;br /&gt;
        /set prompt_hp_diff $[prompt_hp_max - prompt_hp]%;\&lt;br /&gt;
        /set prompt_mana_diff $[prompt_mana_max - prompt_mana]%;\&lt;br /&gt;
        /set prompt_monitor_diff -%;\&lt;br /&gt;
        /test (prompt_monitor_max !~ &amp;quot;-&amp;quot;) &amp;amp; (prompt_monitor_diff:=prompt_monitor_max - prompt_monitor)%;\&lt;br /&gt;
;color hp&lt;br /&gt;
        /if (prompt_hp_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_hp_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_hp:=decode_attr(prompt_hp, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_max:=decode_attr(prompt_hp_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_diff:=decode_attr(prompt_hp_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_hp_relative:=decode_attr(prompt_hp_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mana&lt;br /&gt;
        /if (prompt_mana_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_mana_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_mana:=decode_attr(prompt_mana, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_max:=decode_attr(prompt_mana_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_diff:=decode_attr(prompt_mana_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_mana_relative:=decode_attr(prompt_mana_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color monitor&lt;br /&gt;
        /if (prompt_monitor_relative &amp;lt;= 30) \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cred&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cred&amp;quot;))%;\&lt;br /&gt;
        /elseif (prompt_monitor_relative &amp;lt;= 70)  \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cyellow&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cyellow&amp;quot;))%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /test (prompt_monitor:=decode_attr(prompt_monitor, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_max:=decode_attr(prompt_monitor_max, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_diff:=decode_attr(prompt_monitor_diff, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                        prompt_monitor_relative:=decode_attr(prompt_monitor_relative, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color mv green&lt;br /&gt;
        /test (prompt_move:=decode_attr(prompt_move, &amp;quot;Cgreen&amp;quot;), \&lt;br /&gt;
                prompt_move_max:=decode_attr(prompt_move_max, &amp;quot;Cgreen&amp;quot;))%;\&lt;br /&gt;
;color tnl&lt;br /&gt;
        /if (prompt_tnl &amp;gt; 500) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 300) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCgreen&amp;quot;)]%;\&lt;br /&gt;
        /elseif (prompt_tnl &amp;gt; 150) /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;Cyellow&amp;quot;)]%;\&lt;br /&gt;
        /else /set prompt_tnl $[decode_attr(prompt_tnl, &amp;quot;BCyellow&amp;quot;)]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;for the status line&lt;br /&gt;
        /set status_tnl [%{prompt_tnl}]%;\&lt;br /&gt;
;color lagtimer&lt;br /&gt;
        /test prompt_lagtimer:=decode_attr(prompt_lagtimer, &amp;quot;Cgreen&amp;quot;)%;\&lt;br /&gt;
;finally, the substitute&lt;br /&gt;
        /substitute -aCrgb010 \&lt;br /&gt;
;prompt symbols&lt;br /&gt;
        %{prompt_sanctuary}%{prompt_werrebocler}%{prompt_demonfire}\&lt;br /&gt;
        %{prompt_stance}%{prompt_invis}%{prompt_move_hidden}%{prompt_sneak}\&lt;br /&gt;
        %{prompt_deaf}\&lt;br /&gt;
;hp&lt;br /&gt;
        &amp;lt;%{prompt_hp}/%{prompt_hp_max}(%{prompt_hp_diff}|%{prompt_hp_relative}%%) \&lt;br /&gt;
;mana   &lt;br /&gt;
        %{prompt_mana}/%{prompt_mana_max}(%{prompt_mana_diff}|%{prompt_mana_relative}%%) \&lt;br /&gt;
;mv&lt;br /&gt;
        %{prompt_move}mv \&lt;br /&gt;
;&lt;br /&gt;
;[tnl] -- uncomment the next line to restore tnl to the prompt you see&lt;br /&gt;
;       [%{prompt_tnl}] \&lt;br /&gt;
;&lt;br /&gt;
;monitor&lt;br /&gt;
        %{prompt_monitor}/%{prompt_monitor_max}(%{prompt_monitor_diff}|%{prompt_monitor_relative}%%) \&lt;br /&gt;
;lag timer&lt;br /&gt;
        t%{prompt_lagtimer}\&lt;br /&gt;
        &amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Grab prompt2 and set the status line variables&lt;br /&gt;
;Also, pretend to send PROMPT_EXE to the server if prompt_exe is set...&lt;br /&gt;
/def -i -ag -F -p400 -mregexp -t&amp;quot;^&amp;lt;s([^ ]+) a([^ ]+) q([^ ]+)&amp;gt;$&amp;quot; substitute_prompt2 =\&lt;br /&gt;
        /test prompt_surge:=strip_attr({P1})%;\&lt;br /&gt;
        /test prompt_augment:=strip_attr({P2})%;\&lt;br /&gt;
        /test prompt_quicken:=strip_attr({P3})%;\&lt;br /&gt;
        /set status_surge s%{prompt_surge}%;\&lt;br /&gt;
        /set status_augment a%{prompt_augment}%;\&lt;br /&gt;
        /set status_quicken q%{prompt_quicken}%;\&lt;br /&gt;
        /test (status_surge =~ &amp;quot;soff&amp;quot;) &amp;amp; (status_surge:=&amp;quot;s0&amp;quot;)%;\&lt;br /&gt;
        /test (status_augment =~ &amp;quot;aoff&amp;quot;) &amp;amp; (status_augment:=&amp;quot;a0&amp;quot;)%;\&lt;br /&gt;
        /test (status_quicken =~ &amp;quot;qoff&amp;quot;) &amp;amp; (status_quicken:=&amp;quot;q0&amp;quot;)%;\&lt;br /&gt;
;color surge&lt;br /&gt;
        /if (prompt_surge &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_surge BCyellow%;\&lt;br /&gt;
        /elseif (prompt_surge &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_surge Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_surge=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color augment&lt;br /&gt;
        /if (prompt_augment &amp;gt;= 4) \&lt;br /&gt;
                /set status_attr_var_status_augment BCyellow%;\&lt;br /&gt;
        /elseif (prompt_augment &amp;gt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_augment Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_augment=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;color quicken&lt;br /&gt;
        /if (prompt_quicken &amp;gt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_quicken BCyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_quicken=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (prompt_exe !~ &amp;quot;&amp;quot;) /send -h PROMPT_EXE %{prompt_exe}%;/endif&lt;br /&gt;
&lt;br /&gt;
;... except that we intercept the PROMPT_EXE with this send hook.  Other scripts&lt;br /&gt;
;  can now use a send hook with priority &amp;gt;990 to know when we got a prompt in.&lt;br /&gt;
;If you'd change the hook please be aware that unlike triggers, hooks apparently&lt;br /&gt;
;  need a body to do anything at all!&lt;br /&gt;
/def -i -p990 -mglob -h'send PROMPT_EXE*' send_hook_PROMPT_EXE = /test&lt;br /&gt;
&lt;br /&gt;
;Set the prompts right automagically at login&lt;br /&gt;
/def -i -p900 -F -i -t&amp;quot;Welcome back to the AVATAR System*&amp;quot; prompt_wb = \&lt;br /&gt;
        /set prompt_lagtimer err%;\&lt;br /&gt;
        /set prompt_mana_diff err%;\&lt;br /&gt;
        /set prompt_surge err%;\&lt;br /&gt;
        /set prompt_quicken err%;\&lt;br /&gt;
        /repeat -0.5 1 /prompt_check&lt;br /&gt;
&lt;br /&gt;
/def -i prompt_check = \&lt;br /&gt;
        /if ((prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_lagtimer =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_surge =~ &amp;quot;err&amp;quot;) | \&lt;br /&gt;
                        (prompt_quicken =~ &amp;quot;err&amp;quot;)) \&lt;br /&gt;
                /echo -aCcyan %%% Setting prompt compatible to prompt.tf%;\&lt;br /&gt;
                /prompt_set%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Sharpenbag.tf&amp;diff=33759</id>
		<title>Sharpenbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Sharpenbag.tf&amp;diff=33759"/>
		<updated>2008-11-09T18:27:12Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: bugfix exit command and a typo or two&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So you have a bunch of weapons to sharpen.  Toss them in a weaponbag, run the script, collect the results from sharpbag, brillbag, dullbag, or brilldullbag.  See the comments in the script for a list of etches/christens. It accepts a -x&amp;lt;command&amp;gt; option to have a &amp;lt;command&amp;gt; executed when it's done.&lt;br /&gt;
&lt;br /&gt;
The script is not 100% fool proof.  It gets 1. from weaponbag, then sharpens 1.  So if you're carrying or wielding a weapon similar to the one you got from the weaponbag, 1. might not be the weapon you want to sharpen.  Keep the inv clean from weapons, don't wield anything, and it'll work perfectly fine always.  Or should anyways.&lt;br /&gt;
&lt;br /&gt;
This script uses [[verbose.tf]] and [[sharpen.tf]] so you'll want those if you want to use this script.  Also, you should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}sharpen.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /sharpenbag           Sharpen all items in sharpbag and distribute results&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         command to execute after sharpenbag&lt;br /&gt;
&lt;br /&gt;
;etch           christen&lt;br /&gt;
;weaponbag      a bag of sharpenable weapons&lt;br /&gt;
;sharpbag       a bag of sharpened weapons&lt;br /&gt;
;brillbag       a bag of brill sharpened weapons&lt;br /&gt;
;dullbag        a bag of dulled weapons&lt;br /&gt;
;brilldullbag   a bag of weapons that brilled, then dulled&lt;br /&gt;
;&lt;br /&gt;
;Only the christen for the weaponbag matters, sharpenbag_got_weapon triggers&lt;br /&gt;
;  on it&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var sharpenbag_exit to&lt;br /&gt;
;0              sharpenbag finished correctly with an empty weaponbag&lt;br /&gt;
;no_weapon      error code from sharpen.tf&lt;br /&gt;
;no_whetstone   error code from sharpen.tf&lt;br /&gt;
;no_weaponbag   can't find the weaponbag&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 sharpenbag&lt;br /&gt;
&lt;br /&gt;
/def -i sharpenbag_init = \&lt;br /&gt;
        /set sharpenbag=0%;\&lt;br /&gt;
        /set sharpenbag_post=%;\&lt;br /&gt;
        /set sharpenbag_exit=&lt;br /&gt;
&lt;br /&gt;
/sharpenbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i sharpenbag = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /sharpenbag_init%;\&lt;br /&gt;
        /set sharpenbag=1%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set sharpenbag_post %{opt_x}%;\&lt;br /&gt;
        /sharpenbag_start&lt;br /&gt;
&lt;br /&gt;
/def -i sharpenbag_start = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l2 - -aCyellow %%% /%0: Start sharpening%;\&lt;br /&gt;
        stand%;hei%;hei%;\&lt;br /&gt;
        get 1. weaponbag&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Weaponbag in a bag?&lt;br /&gt;
/def -i -E(sharpenbag) -p799 -F -t&amp;quot;I see no weaponbag here.&amp;quot; sharpenbag_no_weaponbag = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l1 - -aBCred %%% You are not carrying the weaponbag.  Exiting /sharpenbag.%;\&lt;br /&gt;
        /enchantbag_exit no_weaponbag&lt;br /&gt;
&lt;br /&gt;
/def -i -E(sharpenbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from a bag of sharpenable weapons.$&amp;quot; sharpenbag_got_weapon = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l2 - -aCyellow %%% /%0: Got weapon, %{P1}.%;\&lt;br /&gt;
        /sharpen -x/sharpenbag_weapon_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(sharpenbag) -p799 -F -t&amp;quot;You see nothing like that in a bag of sharpenable weapons.&amp;quot;  weaponbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l1 - -aCcyan %%% Your weaponbag is empty.  Exiting /sharpenbag.%;\&lt;br /&gt;
        /sharpenbag_exit 0&lt;br /&gt;
&lt;br /&gt;
/def -i sharpenbag_weapon_done = \&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l2 - -aCyellow %%% /%0: This weapon is done.%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_weapon|no_whetstone&amp;quot;, sharpen_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_sharpenbag} -l1 - -aBCred %%% /%0: Sharpen script exit status: %{sharpen_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_sharpenbag} -l1 - -aBCred %%% /%0: Exit sharpenbag, sharpen_err.%;\&lt;br /&gt;
                /sharpenbag_exit %{P1}%;\&lt;br /&gt;
        /elseif (regmatch(&amp;quot;sharp|was_sharp&amp;quot;, sharpen_exit)) \&lt;br /&gt;
                put 1. sharpbag%;\&lt;br /&gt;
                /sharpenbag_start%;\&lt;br /&gt;
        /elseif (sharpen_exit =~ &amp;quot;dull&amp;quot;) \&lt;br /&gt;
                put 1. dullbag%;\&lt;br /&gt;
                /sharpenbag_start%;\&lt;br /&gt;
        /elseif (sharpen_exit =~ &amp;quot;brill&amp;quot;) \&lt;br /&gt;
                put 1. brillbag%;\&lt;br /&gt;
                /sharpenbag_start%;\&lt;br /&gt;
        /elseif (sharpen_exit =~ &amp;quot;brilldull&amp;quot;) \&lt;br /&gt;
                put 1. brilldullbag%;\&lt;br /&gt;
                /sharpenbag_start%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i sharpenbag_exit = \&lt;br /&gt;
        /let _post %sharpenbag_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l1 - -aCyellow %%% /%0: Exiting and executing command: %_post%;\&lt;br /&gt;
        /sharpenbag_init%;\&lt;br /&gt;
        /set sharpenbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_sharpenbag} -l3 - -aCyellow %%% /%0: Exit code: %sharpenbag_exit%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Regen.tf&amp;diff=33755</id>
		<title>Regen.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Regen.tf&amp;diff=33755"/>
		<updated>2008-11-09T06:51:21Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A regen script.  It sends a blank line to the server and checks if we're done at regular intervals, currently 8 seconds.  It uses variables from [[prompt.tf]] to see if we're done.&lt;br /&gt;
&lt;br /&gt;
This script uses both [[prompt.tf]] and [[verbose.tf]] so you'll need those if you want to use this&lt;br /&gt;
script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see examples of its use in the [[identify.tf]] or the [[enchant.tf]] script.  If it doesnt have mana for the spell, it calls this script to regen and go back when it's done with the regen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/regen.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /regen -x&amp;lt;command&amp;gt;    Fully regen, then execute &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;A regen script.  It will make you sleep to regen.  It will make you stand and&lt;br /&gt;
;execute a command when you're done, for example:&lt;br /&gt;
;  sanc dw&lt;br /&gt;
;  regen -x&amp;quot;e=u=u=sleep&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;Or it might just be more useful in other scripts.&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and use system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s2 regen&lt;br /&gt;
&lt;br /&gt;
/def -i regen = \&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set regen_post %{opt_x}%;\&lt;br /&gt;
        /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Starting checks.  Post command is: %regen_post%;\&lt;br /&gt;
        sleep%;\&lt;br /&gt;
        /repeat -7.5 1 /send%;\&lt;br /&gt;
        /repeat -8 1 /regen_check&lt;br /&gt;
&lt;br /&gt;
/def -i regen_check = \&lt;br /&gt;
        /let _post %{regen_post}%;\&lt;br /&gt;
        /let _move_relative $[prompt_move*100/prompt_move_max]%;\&lt;br /&gt;
        /if ((prompt_hp_relative &amp;gt;= 100) &amp;amp; (prompt_mana_relative &amp;gt;= 100) &amp;amp; \&lt;br /&gt;
                        (_move_relative &amp;gt;= 100) &amp;amp; (!prompt_lagtimer)) \&lt;br /&gt;
                /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Regen done!  Executing post command: %regen_post%;\&lt;br /&gt;
                stand%;\&lt;br /&gt;
                /unset regen_post%;\&lt;br /&gt;
                /if (_post !~ &amp;quot;&amp;quot;) /eval %{_post}%; /endif%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_regen} -l2 - -aCyellow %%% %0: not done yet....%;\&lt;br /&gt;
                /repeat -7.5 1 /send%;\&lt;br /&gt;
                /repeat -8 1 /regen_check%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Verbose.tf&amp;diff=33754</id>
		<title>Verbose.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Verbose.tf&amp;diff=33754"/>
		<updated>2008-11-08T14:47:51Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: arrgh @ magically appearing trailing white spaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;While writing a new script, I often wrote a quick &amp;quot;/echo variable is %{variable}&amp;quot; in a macro to see if the values of variables were computed correctly.  When I had finished writing the script I'd remove them to reduce the spam on my screen.  Sometimes though when I decided to take a different approach to some macros I'd find myself adding pretty much the same /echo's again, rewrite the macro's and then remove them again.&lt;br /&gt;
&lt;br /&gt;
Duh.  Wouldn't it be nice if I could just leave them in there and turn them on and off when i want to?&lt;br /&gt;
&lt;br /&gt;
Also, suppose you'd write a somewhat more complicated script that can run for a while and change a lot of variables.  Sometimes you'd like to see a lot of debug info, and sometimes you just want to let it do its job without spamming you crazy while you're chatting.&lt;br /&gt;
&lt;br /&gt;
This script makes that pretty easy.  To use it in a script I have TINYPREFIX set in my config file, pointing at the directory with my tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
and load it with this line in the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;/eval /require -q %{TINYPREFIX}verbose.tf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See for example [[identify.tf]] or [[label.tf]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/verbose.tf&lt;br /&gt;
 &lt;br /&gt;
;Flexible script verbosity..&lt;br /&gt;
&lt;br /&gt;
/def -i verbose_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /verbose              Shows usage and current levels%;\&lt;br /&gt;
        /echo -aCyellow %%% /verbose &amp;lt;line&amp;gt;       /echo &amp;lt;line&amp;gt; if verbosity level is 1 or higher%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-l&amp;lt;level&amp;gt;]           /echo if verbosity level is &amp;lt;level&amp;gt; or higher%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-o&amp;lt;level&amp;gt;]           override verbosity level with &amp;lt;level&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;level&amp;gt;] [&amp;lt;script&amp;gt;]set verbosity level (of &amp;lt;script&amp;gt;) to &amp;lt;level&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/verbose_usage&lt;br /&gt;
  &lt;br /&gt;
; Instead of just /echoing lines to the screen, scripts can use /verbose&lt;br /&gt;
;   so you can easily change the spamminess of scripts.  You can set a&lt;br /&gt;
;   sytem verbosity level in this script, or override it with a script&lt;br /&gt;
;   verbosity level in another script.&lt;br /&gt;
  &lt;br /&gt;
; The verbosity levels I use are:&lt;br /&gt;
;&lt;br /&gt;
;  0   Complete silence&lt;br /&gt;
;  1   Script announces itself and may print additional information&lt;br /&gt;
;        if it could actually be useful while playing&lt;br /&gt;
;  2   All macros announce themselves, sometimes with variables and values&lt;br /&gt;
;  3   Full debug mode, all available spam including variables and values&lt;br /&gt;
;&lt;br /&gt;
  &lt;br /&gt;
; A higher level verbosity does include a lower level.&lt;br /&gt;
  &lt;br /&gt;
; Default system wide verbosity level&lt;br /&gt;
/set verbosity 1&lt;br /&gt;
 &lt;br /&gt;
; Everything after a single - is fed to /echo as is, so to use /verbose to&lt;br /&gt;
;   print a line in red if the verbosity level is 1 or higher, you could&lt;br /&gt;
;             /verbose - -aCred a line&lt;br /&gt;
;   and the -aCred will be seen as option for /echo.&lt;br /&gt;
  &lt;br /&gt;
; The -l option indicates at which verbosity level the line should be printed&lt;br /&gt;
; and defaults to 1.&lt;br /&gt;
&lt;br /&gt;
; Individual scripts can pass their own verbosity level with -o.  If the&lt;br /&gt;
; level given by -o is 0 or positive it will override %verbosity .&lt;br /&gt;
; In other words, use /verbose -o-100  to turn the individual script level&lt;br /&gt;
; off.  Default:  -100, don't override.  Setting it to -1 would do the&lt;br /&gt;
; trick too but -100 is easier to distinguish on &amp;quot;/listvar verbosity*&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
; Suppose you'd have a walk script, consisting of a trigger and some other&lt;br /&gt;
; macros.  You could set a verbosity_walk variable.  Depending on its value and&lt;br /&gt;
; on the value of verbosity in this script you could create different&lt;br /&gt;
; possibilities:&lt;br /&gt;
;&lt;br /&gt;
;   normal verbosity while playing&lt;br /&gt;
;         /set verbosity 1&lt;br /&gt;
;         /set verbosity_walk -100&lt;br /&gt;
;   the same would by accomplished by:&lt;br /&gt;
;         /verbose -s1&lt;br /&gt;
;         /verbose -s-100 walk&lt;br /&gt;
&lt;br /&gt;
;   debug the new walk script without all the other ones spamming you crazy,&lt;br /&gt;
;         /set verbosity 1&lt;br /&gt;
;         /set verbosity_walk 3&lt;br /&gt;
;&lt;br /&gt;
;   debug all scripts but that spammy walk one that isn't the problem anyways,&lt;br /&gt;
;         /set verbosity 3&lt;br /&gt;
;         /set verbosity_walk 1&lt;br /&gt;
;&lt;br /&gt;
;   watch the flow through each individual macro of all scripts while&lt;br /&gt;
;   fully debugging the walk script&lt;br /&gt;
;         /set verbosity 2&lt;br /&gt;
;         /set verbosity_walk 3&lt;br /&gt;
;&lt;br /&gt;
; The walk script would then need to call /verbose e.g. in the body of the trigger:&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l1 - -aCyellow Walk script running!  Use /walk to walk!&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l1 - -aBCred NOTE: Water breathing or death!&lt;br /&gt;
;&lt;br /&gt;
; If you put this at the top of any macro in the script it will show which&lt;br /&gt;
; options and arguments the call used:&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l2 - /%0:  Called as /%0 %*&lt;br /&gt;
;&lt;br /&gt;
; After expressions, to see what values are computed:&lt;br /&gt;
;     /verbose -o%{verbosity_walk} -l3 - -aCyellow /%0: variable is %{variable}.&lt;br /&gt;
&lt;br /&gt;
; The -s option sets the verbosity level.  &amp;quot;/verbose -s2&amp;quot; to set the system&lt;br /&gt;
; verbosity level to 2, &amp;quot;/vebose -s3 walk&amp;quot; to set verbosity_walk to 3.&lt;br /&gt;
&lt;br /&gt;
/def -i verbose = \&lt;br /&gt;
        /if ({*} =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /verbose_usage%;\&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /echo -p %%% @{Cyellow}Current verbosity levels:%;\&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /listvar verbosity*%;\&lt;br /&gt;
                /echo -p %%% @{Cred}--------------------------------------------------------------------------%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let line_level=1%;\&lt;br /&gt;
        /let override_level=-100%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;l:o:s:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /let _arg %1%;\&lt;br /&gt;
                /if (_arg =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                        /set verbosity %{opt_s}%;\&lt;br /&gt;
                        /echo -aCyellow %%% Verbosity level set to %verbosity%;\&lt;br /&gt;
                /else \ &lt;br /&gt;
                        /eval /set verbosity_%{_arg} %{opt_s}%;\&lt;br /&gt;
                        /eval /echo -aCyellow %%%% Verbosity level of %{_arg} set to %%{verbosity_%{_arg}}%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test (opt_l !~ &amp;quot;&amp;quot;) &amp;amp; (line_level:=opt_l)%;\&lt;br /&gt;
        /test (opt_o !~ &amp;quot;&amp;quot;) &amp;amp; (override_level:=opt_o)%;\&lt;br /&gt;
        /if (override_level &amp;gt;= 0) \&lt;br /&gt;
                /if (override_level &amp;gt;= line_level) \&lt;br /&gt;
                        /echo %*%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /elseif (verbosity &amp;gt;= line_level) \&lt;br /&gt;
                /echo %*%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Regen.tf&amp;diff=33753</id>
		<title>Regen.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Regen.tf&amp;diff=33753"/>
		<updated>2008-11-08T14:39:12Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Where do these @!%^&amp;amp;$$ whitespaces come from&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A regen script.  It sends a blank line to the server and checks if we're done at regular intervals, currently 8 seconds.  It uses variables from [[prompt.tf]] to see if we're done.&lt;br /&gt;
&lt;br /&gt;
This script uses both [[prompt.tf]] and [[verbose.tf]] so you'll need those if you want to use this&lt;br /&gt;
script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see examples of its use in the [[identify.tf]] or the [[enchant.tf]] script.  If it doesnt have mana for the spell, it calls this script to regen and go back when it's done with the regen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/regen.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /regen -x&amp;lt;command&amp;gt;    Fully regen, then execute &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;A regen script.  It will make you sleep to regen.  It will make you stand and&lt;br /&gt;
;execute a command when you're done, for example:&lt;br /&gt;
;  sanc dw&lt;br /&gt;
;  regen -x&amp;quot;e=u=u=sleep&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;Or it might just be more useful in other scripts.&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and use system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s2 regen&lt;br /&gt;
&lt;br /&gt;
/def -i regen = \&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set regen_post %{opt_x}%;\&lt;br /&gt;
        /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Starting checks.  Post command is: %regen_post%;\&lt;br /&gt;
        sleep%;\&lt;br /&gt;
        /repeat -7.5 1 /send%;\&lt;br /&gt;
        /repeat -8 1 /regen_check&lt;br /&gt;
&lt;br /&gt;
/def -i regen_check = \&lt;br /&gt;
        /let _post %{regen_post}%;\&lt;br /&gt;
        /let _move_relative $[prompt_move*100/prompt_move_max]%;\&lt;br /&gt;
        /if ((prompt_hp_relative &amp;gt;= 100) &amp;amp; (prompt_mana_relative &amp;gt;= 100) &amp;amp; \&lt;br /&gt;
                        (_move_relative &amp;gt;= 100) &amp;amp; (!prompt_lagtimer)) \&lt;br /&gt;
                /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Regen done!  Executing post command: %regen_post%;\&lt;br /&gt;
                stand%;\&lt;br /&gt;
                /unset regen_post%;\&lt;br /&gt;
                /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_regen} -l2 - -aCyellow %%% %0: not done yet....%;\&lt;br /&gt;
                /repeat -7.5 1 /send%;\&lt;br /&gt;
                /repeat -8 1 /regen_check%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Lowmort_gear_macro_and_etching_scheme&amp;diff=33752</id>
		<title>Lowmort gear macro and etching scheme</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Lowmort_gear_macro_and_etching_scheme&amp;diff=33752"/>
		<updated>2008-11-08T14:33:23Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: arrgh trailing white spaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Running 4 lowmorts at a time on multiday can give you a headache.  After each multiday I've been trying to find ways to cut down annoyance time and have more playing time ;)  This etching scheme and the script below cuts out the most annoying and time consuming part of running lowmorts on a multiday... keeping track of about 250 pieces of equipment.  If you have your gear etched and bagged according to the etching scheme, the script will always make you wear the best gear available to you on the level - and within a second.&lt;br /&gt;
&lt;br /&gt;
I use 3 locker alts.  One carries bags of ac gear, one hit gear and one arc gear.  The bags are etched according to the gear kit and level range they contain.  The etch is b&amp;amp;lt;gear&amp;amp;gt;&amp;amp;lt;levelrange&amp;amp;gt;, bac20 for a bag of ac gear you can wear from level 20-30, barc40 for a bag of arc gear you can wear from 40-50 and so on.  All of them have level 50 hero gear in a bag as well, bags go like bhit47, bac47, barc47.&lt;br /&gt;
&lt;br /&gt;
I etch items according to the gear kit they're in (ac, arc, hit) and the level... Pay attention though, I didn't use the level of the item for the etch but the level you can wear/wield it at.  Wields are kept in a seperate bag, called bwields.  I put bows and shields in the barc/bac bags as I would with the other archer/ac items. This list of examples should cover all etches in use by the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
item                                     etch&lt;br /&gt;
level 27 gargoyle bracer b7              ac24&lt;br /&gt;
level 28 gargoyle bracer b7 -3           ac25&lt;br /&gt;
level 29 gargoyle bracer b8 -3           ac26&lt;br /&gt;
level 14 pants of illusion               hit11&lt;br /&gt;
level 36 spidersilk bracers              arc33&lt;br /&gt;
level 20 simple hunter's bow             arc15&lt;br /&gt;
level 23 sharpened golden claw           wield18&lt;br /&gt;
level 25 offhand 11/11 moonblade dagger  offhand20&lt;br /&gt;
level 30 silver cavalry shield           ac27&lt;br /&gt;
level 50 flaming pants                   hit47&lt;br /&gt;
bag of lvl 10-20 wearable hitgear        bhit10&lt;br /&gt;
bag of lvl 20-30 wearable arcgear        barc20 &lt;br /&gt;
bag of lvl 30-40 wearable acgear         bac30&lt;br /&gt;
bag of lvl 50 hero hit gear              bhit47&lt;br /&gt;
bag of lvl 50 hero arc gear              barc47&lt;br /&gt;
bag of wields                            bwields&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since I have just 2 nicely enchanted offhands for the 2 wars i dont really use a loop for those but just &amp;quot;wear offhand&amp;quot;.  The three gargoyle bracers here serve as an example... As long as you make sure the higher level wrist item is better than the lower level wrist item, you can put as many of them in your bags as you like, the script will make you wear the best you can at the level.  My bags of lowmort hit gear actually contain everything for 2 sets, the second warrior will just use the best of what's left over by the first ;)&lt;br /&gt;
&lt;br /&gt;
Now I can start manipulating all these items with loops.  What I do is &amp;quot;drop all.barc&amp;quot;, &amp;quot;drop all.bac&amp;quot; or &amp;quot;drop all.bhit=drop bwields&amp;quot; with the locker carrying the gear, then hit the fixgear script with the lowmort, then pick up the bags with the locker(!).&lt;br /&gt;
This is the script, i put some example output below it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
; lowmort gear fixing macro :)&lt;br /&gt;
; /fixgear &amp;lt;gear&amp;gt; &amp;lt;level&amp;gt;   Wears hit, ac, arc or mana gear for level&lt;br /&gt;
; /fixgear &amp;lt;gear&amp;gt; 0         Will put the gear into the appropriate bags&lt;br /&gt;
&lt;br /&gt;
/def -i fixgear = \&lt;br /&gt;
        /let gear %1%;\&lt;br /&gt;
        /let level %2%;\&lt;br /&gt;
        rem all%;\&lt;br /&gt;
        /if (level &amp;gt;= 47) \&lt;br /&gt;
                get all b%{gear}47%;\&lt;br /&gt;
                wear all.%{gear}47%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        put all.%{gear}47 b%{gear}47%;\&lt;br /&gt;
        /let level_counter=%;\&lt;br /&gt;
        /test (level_counter:=level, level_counter &amp;gt; 46) &amp;amp; (level_counter:=46)%;\&lt;br /&gt;
        /while (level_counter &amp;gt; 10) \&lt;br /&gt;
                /if ((level_counter == level) | (level_counter == 46)) \&lt;br /&gt;
                        get all b%{gear}$[(level_counter/10)]0%;\&lt;br /&gt;
                /elseif (mod(level_counter, 10) == 9) \&lt;br /&gt;
                        put all.%{gear}$[(level_counter/10)+1] b%{gear}$[(level_counter/10)+1]0%;\&lt;br /&gt;
                        get all b%{gear}$[(level_counter/10)]0%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                wear all.%{gear}%{level_counter}%;\&lt;br /&gt;
                /test --level_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
;cleanup line&lt;br /&gt;
        /for c 1 4 put all.%{gear}%%{c} b%{gear}%%{c}0%;\&lt;br /&gt;
        /if (gear =~ &amp;quot;hit&amp;quot;) \&lt;br /&gt;
                get all bwields%;\&lt;br /&gt;
                /for c $[level-9] %{level} wield wield%%{c}%;\&lt;br /&gt;
                put all.wield bwields%;\&lt;br /&gt;
                wear offhand%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
;try to wear some level eq i might have&lt;br /&gt;
        wear &amp;quot;cult hat bonk&amp;quot;%;\&lt;br /&gt;
        wear &amp;quot;golden robe&amp;quot;%;\&lt;br /&gt;
        wear &amp;quot;wreath laurel&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example (trimmed) output of &amp;quot;/fixgear hit 32&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
remove all&lt;br /&gt;
get all bhit30&lt;br /&gt;
wear all.hit32&lt;br /&gt;
wear all.hit31&lt;br /&gt;
wear all.hit30&lt;br /&gt;
put all.hit3 bhit30&lt;br /&gt;
get all bhit20&lt;br /&gt;
wear all.hit29&lt;br /&gt;
... [snip] ...&lt;br /&gt;
wear all.hit20&lt;br /&gt;
put all.hit2 bhit20&lt;br /&gt;
... [snip, that'll continue to level 11] ...&lt;br /&gt;
get all bwields&lt;br /&gt;
wield wield23&lt;br /&gt;
wield wield24&lt;br /&gt;
... [snip] ...&lt;br /&gt;
wield wield32&lt;br /&gt;
put all.wield bwields&lt;br /&gt;
wear offhand&lt;br /&gt;
wear &amp;quot;golden robe&amp;quot;&lt;br /&gt;
wear &amp;quot;wreath laurel&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For armor pieces I use the fact that &amp;quot;wear all.*&amp;quot; will not switch out gear you're already wearing, for wields I use the fact that wield wield20 *will* switch out the wield19.  What's left to pack manually is 4 wreathes, a golden robe, 2 shields to bash with and a bunch of arrows to shoot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a useful example but easier than the fixgear script, this would clean up all hit gear:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;put all.wield bwields&lt;br /&gt;
put all.hit47 bhit47&lt;br /&gt;
/for c 1 4 put all.hit%c bhit%{c}0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or for the arc gear it would be&lt;br /&gt;
&amp;lt;pre&amp;gt;put all.arc47 barc47&lt;br /&gt;
/for c 1 4 put all.arc%c barc%{c}0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To label all items, I wrote [[label.tf]] and used it like&lt;br /&gt;
&amp;lt;pre&amp;gt;/for c 1 20 /label %c.ac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
HTH&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Identify.tf&amp;diff=33751</id>
		<title>Identify.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Identify.tf&amp;diff=33751"/>
		<updated>2008-11-08T14:27:01Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Fixed annoying trailing white space thing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This identify script was mostly cut from the old label script, to make it useful for other things than just labeling.  The script identifies an item and grabs some info.  You can use -e&amp;lt;command&amp;gt; to specify a command that should run before the identify, which is useful if you'd expect to loop the identify.  See [[label.tf]].&lt;br /&gt;
&lt;br /&gt;
You can use -x&amp;lt;command&amp;gt; to specify a command that should run when all the info grabbing triggers had a chance to do their job.  This is useful for other scripts, again see [[label.tf]].&lt;br /&gt;
&lt;br /&gt;
It also tries to look up the multiplier for the armor class of the slot where its worn at, like 3.50 for a shield.  It does this by converting the object keyword to a variable name.  See the list at the bottom of the script.  I currently use the values with armor opt.  The list is complete only as far as I've used it.&lt;br /&gt;
&lt;br /&gt;
You can see which info it grabs by looking at identify_init, at its triggers, or by typing &amp;quot;/listvar identify*&amp;quot;.  I've only added identify lines I've been using.&lt;br /&gt;
&lt;br /&gt;
To use it in a script I have TINYPREFIX set in my config file, pointing at the directory with my tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
and load it with this line in the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;/eval /require -q %{TINYPREFIX}identify.tf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identify uses [[verbose.tf]], [[regen.tf]] and [[prompt.tf]] so you'll need those as well if you want to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;DEBUG indefinately incomplete identify_armor_multiplier_ variable list&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/identify.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}regen.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /identify &amp;lt;item&amp;gt;      Identify item and grab info&lt;br /&gt;
/echo -aCyellow %%     [-e&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; before identify&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
/echo -aCyellow %% /id [-x] [-e] &amp;lt;item&amp;gt;      short version of /identify ;)&lt;br /&gt;
&lt;br /&gt;
;When identify's finished it sets an exit code&lt;br /&gt;
; 0         finished correctly&lt;br /&gt;
; no_item   couldn't find item&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 identify&lt;br /&gt;
&lt;br /&gt;
;When the identify is finished it will set global var identify_exit to&lt;br /&gt;
;0              identify script exit normally&lt;br /&gt;
;no_item        couldn't find your item to identify&lt;br /&gt;
&lt;br /&gt;
;do NOT set identify_post here&lt;br /&gt;
/def -i identify_init = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set identify_pre=%;\&lt;br /&gt;
        /set identify_object=%;\&lt;br /&gt;
        /set identify_type=%;\&lt;br /&gt;
        /set identify_flags=%;\&lt;br /&gt;
        /set identify_etch=%;\&lt;br /&gt;
        /set identify_weight=%;\&lt;br /&gt;
        /set identify_value=%;\&lt;br /&gt;
        /set identify_level=%;\&lt;br /&gt;
        /set identify_type=%;\&lt;br /&gt;
        /set identify_enchant_armor=%;\&lt;br /&gt;
        /set identify_enchant_weapon=%;\&lt;br /&gt;
        /set identify_enchant_bow=%;\&lt;br /&gt;
        /set identify_armor_class=%;\&lt;br /&gt;
        /set identify_armor_multiplier=%;\&lt;br /&gt;
        /set identify_dam_min=%;\&lt;br /&gt;
        /set identify_dam_max=%;\&lt;br /&gt;
        /set identify_dam_avg=%;\&lt;br /&gt;
        /set identify_hr=%;\&lt;br /&gt;
        /set identify_dr=%;\&lt;br /&gt;
        /set identify_draw_strength=%;\&lt;br /&gt;
        /set identify_capacity=%;\&lt;br /&gt;
        /set identify_flametongue=%;\&lt;br /&gt;
        /set identify_lightning=%;\&lt;br /&gt;
        /set identify_exit=&lt;br /&gt;
&lt;br /&gt;
/identify_init&lt;br /&gt;
&lt;br /&gt;
/def -i id = /identify %*&lt;br /&gt;
&lt;br /&gt;
/def -i identify = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l1 - -aCcyan %%% /%0: Identifying and grabbing info.%;\&lt;br /&gt;
        /set identify_call /%0 %*%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Identify was called as:  %identify_call%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;e:x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set identify_pre %{opt_e}%;\&lt;br /&gt;
        /set identify_post %{opt_x}%;\&lt;br /&gt;
        /set identify_grab 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: identify_pre is %identify_pre.  identify_post is %identify_post.%;\&lt;br /&gt;
        /if (identify_pre !~ &amp;quot;&amp;quot;) /eval -s0 %identify_pre %;/endif%;\&lt;br /&gt;
        c identify %1&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -t&amp;quot;You are not carrying .+!&amp;quot; identify_no_item = \&lt;br /&gt;
        /identify_exit no_item%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Not carrying that, exit no_item.  Post command is %identify_post%;\&lt;br /&gt;
        /if (identify_post !~ &amp;quot;&amp;quot;) /eval %{identify_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -t&amp;quot;You failed your identify due to lack of concentration!&amp;quot; identify_failed = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Retrying.....%;\&lt;br /&gt;
        /eval -s0 %{identify_call}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -t&amp;quot;You do not have enough mana to cast identify.&amp;quot; identify_no_mana = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% Yikes!  Out of mana.  Calling regen script and retrying.%;\&lt;br /&gt;
        /regen -x'%{identify_call}'&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Object '(.+)' type ([^ ]+), extra flags (.+).$&amp;quot; identify_object = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Grabbing.....  Post command is %identify_post%;\&lt;br /&gt;
        /identify_init%;\&lt;br /&gt;
        /set identify_object %{P1}%;\&lt;br /&gt;
        /set identify_type %{P2}%;\&lt;br /&gt;
        /set identify_flags %{P3}%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;etched&amp;quot;, identify_flags)) \&lt;br /&gt;
                /test regmatch(&amp;quot;(.+) ([^ ]+)$$&amp;quot;, identify_object)%;\&lt;br /&gt;
                /set identify_object %{P1}%;\&lt;br /&gt;
                /set identify_etch %{P2}%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Object is %identify_object, type is %identify_type, etch is %identify_etch%;\&lt;br /&gt;
        /set prompt_exe identify&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p991 -mglob -h'send PROMPT_EXE identify' identify_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /identify_exit 0&lt;br /&gt;
&lt;br /&gt;
/def -i identify_exit = \&lt;br /&gt;
        /let post %{identify_post}%;\&lt;br /&gt;
        /set identify_grab 0%;\&lt;br /&gt;
        /set identify_pre=%;\&lt;br /&gt;
        /set identify_exit %1%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /let var_postfix=%{identify_object}%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
                /test var_postfix:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_postfix)%;\&lt;br /&gt;
                /test var_postfix:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_postfix)%;\&lt;br /&gt;
                /eval /set identify_armor_multiplier %%{identify_armor_multiplier_%{var_postfix}}%;\&lt;br /&gt;
                /if (identify_armor_multiplier &amp;gt; 0) /verbose -o%{verbosity_identify} -l1 - -aCcyan %%% /%0: Known armor.  Its base multiplier is %identify_armor_multiplier%;/endif%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Exit code: %{identify_exit}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l1 - -aCyellow %%% /%0: Finishing up.  Post command is %identify_post%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Weight ([0-9]+), value ([0-9]+), level ([0-9]+).$&amp;quot; identify_level = \&lt;br /&gt;
        /set identify_weight %{P1}%;\&lt;br /&gt;
        /set identify_value %{P2}%;\&lt;br /&gt;
        /set identify_level %{P3}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Weight %identify_weight, Value %identify_value, Level %identify_level.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Armor class is ([0-9]+).&amp;quot; identify_armor_class = \&lt;br /&gt;
        /set identify_armor_class %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Armor class is %identify_armor_class.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Damage is ([0-9]+) to ([0-9]+) \(average ([0-9]+)\).$&amp;quot; identify_dam = \&lt;br /&gt;
        /set identify_dam_min %{P1}%;\&lt;br /&gt;
        /set identify_dam_max %{P2}%;\&lt;br /&gt;
        /set identify_dam_avg %{P3}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Damage, minimum: %identify_dam_min, average: %identify_dam_avg, maximum: %identify_dam_max&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^'enchant armor  'Modifies armor class by (-[0-9]+) continuous.$&amp;quot; identify_enchant_armor = \&lt;br /&gt;
        /set identify_enchant_armor %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Enchanted armor, by %identify_enchant_armor continuous.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^ Modifies damage roll by (-?[0-9]+) continuous.$&amp;quot; identify_dr = \&lt;br /&gt;
        /set identify_dr %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: It has a dr mod, %identify_dr continuous.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^ Modifies hit roll by (-?[0-9]+) continuous.$&amp;quot; identify_hr = \&lt;br /&gt;
        /set identify_hr %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: It has a hr mod, %identify_dr.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^'enchant weapon 'Modifies damage roll by ([0-9]+) continuous.$&amp;quot; identify_enchant_weapon = \&lt;br /&gt;
        /set identify_enchant_weapon %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Enchanted weapon, enchanted %identify_enchant_weapon/%identify_enchant_weapon.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^'enchant bow    'Modifies hit roll by ([0-9]+) continuous.$&amp;quot; identify_enchant_bow = \&lt;br /&gt;
        /set identify_enchant_bow %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Enchanted bow, enchanted %identify_enchant_bow.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Draw strength is ([0-9]+).$&amp;quot; identify_draw_strength = \&lt;br /&gt;
        /set identify_draw_strength %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This bow's draw strength is %identify_draw_strength&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Capacity is ([0-9]+) lbs.$&amp;quot; identify_capacity = \&lt;br /&gt;
        /set identify_capacity %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This container has a capacity of %identify_capacity lbs.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^It has ([0-9]+) charges of flametongue.$&amp;quot; identify_flametongue = \&lt;br /&gt;
        /set identify_flametongue %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This shield has %identify_flametongue charges of flametongue.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^It has ([0-9]+) charges of arc lightning.$&amp;quot; identify_lightning = \&lt;br /&gt;
        /set identify_lightning %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This shield has %identify_lightning charges arc lightning.&lt;br /&gt;
&lt;br /&gt;
;To add values, create a line like these below.  The recipe for the variable&lt;br /&gt;
;name is: identify an object, take the 'object', remove all weird characters,&lt;br /&gt;
;then change spaces to underscores, prefix identify_armor_multiplier_ .&lt;br /&gt;
;Kinda clumsy but a quick hack and i don't expect to enchant hundreds of&lt;br /&gt;
;different items or something ;)&lt;br /&gt;
/set identify_armor_multiplier_Antharian_Signet_ring                  1.00&lt;br /&gt;
/set identify_armor_multiplier_carved_bone_necklace                   1.00&lt;br /&gt;
/set identify_armor_multiplier_embroidered_breastplate_silk           3.50&lt;br /&gt;
/set identify_armor_multiplier_teardrop_helmet                        1.25&lt;br /&gt;
/set identify_armor_multiplier_crown_smoldering                       1.25&lt;br /&gt;
/set identify_armor_multiplier_heroic_dragonscale_dragon_scale_skirt  1.25&lt;br /&gt;
/set identify_armor_multiplier_fatewalkers_mystical_sandals           1.00&lt;br /&gt;
/set identify_armor_multiplier_single_silver_archers_gauntlet         1.00&lt;br /&gt;
/set identify_armor_multiplier_steel_bracers                          1.25&lt;br /&gt;
/set identify_armor_multiplier_hero_heroes_shield                     3.50&lt;br /&gt;
/set identify_armor_multiplier_shroud_cloth_unholy                    2.25&lt;br /&gt;
/set identify_armor_multiplier_collar_steel_chained                   1.25&lt;br /&gt;
/set identify_armor_multiplier_orosca_enchanted_wrist_guard           1.10&lt;br /&gt;
/set identify_armor_multiplier_lemans_family_seal_talisman            1.00&lt;br /&gt;
/set identify_armor_multiplier_mother_pearl                           1.00&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33750</id>
		<title>Enchantbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33750"/>
		<updated>2008-11-08T14:17:15Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Removed some trailing spaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h4&amp;gt;Features&amp;lt;/h4&amp;gt;&lt;br /&gt;
So you have a pile of armor to enchant.  And a couple of weapons and bows to go with that.  Well you toss it all in fodderbag, run this script, and collect the results from upgradebag, sparebag or wastebag.  Or if you don't configure it with your current gear, you can collect the items from brillbag, shimmerbag, wastebag.  It accepts some options:&lt;br /&gt;
&lt;br /&gt;
* -l enchanting with an unshadowed lord&lt;br /&gt;
* -w&amp;lt;level&amp;gt; level we want to wear the item at&lt;br /&gt;
* -x&amp;lt;command&amp;gt; execute &amp;lt;command&amp;gt; when done&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;get 1. fodderbag&amp;quot;, identifies 1., and enchants 1. .  It will check the names of&lt;br /&gt;
* the item you got from the fodderbag&lt;br /&gt;
* the first item in your inventory&lt;br /&gt;
* the name of the item it's identifying&lt;br /&gt;
If they're not all the same it won't enchant the item.&lt;br /&gt;
&lt;br /&gt;
It sets config +blind, +combine, -condition, +nosummon, +notake, +nodisturb and filter +spellother to decrease the chance of anything/anyone messing up the script.  That should make sure the triggers don't respond on people cutting/pasting brills to channels, the triggers work on you inventory, your regen is not interrupted and the triggers won't respond to other players enchants.  Config +blind doesn't affect grtz channel but that is still covered by safechannel.tf.  The script uses config.tf to store/restore your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Example config file&amp;lt;/h4&amp;gt;&lt;br /&gt;
The script will try to load an enchantbag.gear.tf file with a configuration of gear.  It's simply a list of variables, like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/set enchantbag_hero_essence_amorphous_orb                  12dr 10dr&lt;br /&gt;
/set enchantbag_hero_hero_heroes_shield                     b12    b12&lt;br /&gt;
/set enchantbag_hero_bow_sliver_glowing_moonlight_arc       21hr&lt;br /&gt;
/set enchantbag_hero_lemans_family_seal_talisman            b12 -9 b12 -6&lt;br /&gt;
&lt;br /&gt;
;To reuse a value for an equivalent item, you could&lt;br /&gt;
/eval /set enchantbag_hero_mother_pearl %{enchantbag_hero_lemans_family_seal_talisman}&lt;br /&gt;
&lt;br /&gt;
;Lord stuff&lt;br /&gt;
/set enchantbag_lord_essence_amorphous_orb                  15dr 13dr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the variable name, you'd append &amp;quot;enchantbag_&amp;quot; with either &amp;quot;hero_&amp;quot;, &amp;quot;lord_&amp;quot;, or &amp;quot;lowmort_&amp;quot;, then append that with the keywords you get from identify, remove &amp;quot;weird&amp;quot; characters (anything not in [a-zA-Z0-9 ]) and turn spaces into underscores.&lt;br /&gt;
&lt;br /&gt;
The first value is the current gear, anything above that will go into upgradebag.  The second value is the lowest spare that should go into sparebag.  The script currently treats spares kinda aggressively, it'll try to enchant a 12 -3 spare to a 12 -6 spare if the level permits, even if you have 12 -3 as lowest spare to keep.  Perhaps I should switch that around, I don't know yet.  You can omit the second value, it'll then use the default ranges for spares.&lt;br /&gt;
&lt;br /&gt;
If you're enchanting armor and want to use the configuration, you'll also need to add the item to [[identify.tf]] to know the multiplier for the armor class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Stuff you need&amp;lt;/h4&amp;gt;&lt;br /&gt;
This script uses [[config.tf]], [[verbose.tf]], [[enchant.tf]] and [[identify.tf]] so you'll want those if you want to use this script.  Config.tf and identify.tf use [[prompt.tf]], and enchant.tf uses [[regen.tf]] and [[safechannel.tf]] so get those while you're at it.  &amp;lt;b&amp;gt;If you update this script from an older version, please update these scripts as well,&amp;lt;/b&amp;gt; or strange things might happen, or it might not work at all.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll also need some bags, look at the comments in the script for a list of etches and christens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Examples&amp;lt;/h4&amp;gt;&lt;br /&gt;
Enchant a pile of stuff with a hero for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of mother pearls with an unshadowed lord but for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of amorphous orbs or doom shards for lord and sleep afterwards:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l -w125 -xsleep&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you'd want to see all debug spam it produces, try&lt;br /&gt;
&amp;lt;pre&amp;gt;/verbose -s3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Disclaimer&amp;lt;/h4&amp;gt;&lt;br /&gt;
It's not all pretty, some parts of the script might taste good with some bolognese.  Larger tf scripts tend to get like that.  I blame it on the lack of structured data types, lack of way to pass variables around, lack of pointers, linked lists, anything that a modern language would provide.  If you'd know a better design approach tho, please let me know :)&lt;br /&gt;
&lt;br /&gt;
I didn't test enchanting piles of lord eq.  If you know any such piles please let me know where I can pick them up ;)&lt;br /&gt;
&lt;br /&gt;
I'm guessing a hero level bow would raise 5 levels if you'd enchant it with a lord.  I'm not sure.  Also don't know why anybody would want to do that so I can't be bothered to check it.&lt;br /&gt;
&lt;br /&gt;
I've used this script quite a number of times now and debugged it extensively.  It works fine for me.  However, if you were to vape your b12 -9 shield or heros, or blow your 13/13 hero level doom shard, I'll be more than happy to accept your bug report but will not accept any responsibility for the items.  I guess keeping your inventory clean is the way to be 100% sure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Trailing space bug&amp;lt;/h4&amp;gt;&lt;br /&gt;
Somehow some lines got some spaces appended to them when I cut'n'pasted them from my editor.  That's nasty, newlines won't be escaped anymore and it'll break the script.  Odd thing is there aren't any trailing tabs or spaces in my file.  Also, my editor has syntax coloring and putting *anything* after the '\' that's supposed to be at the end of the line will make it change color and I'd notice that immediately.  So it's gotta have happened during the cutting and pasting... if you have any idea how/why... please let me know... it's annoying! ;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;The script&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}enchant.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}config.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /enchantbag           Enchant all items in fodderbag and distribute results&lt;br /&gt;
/echo -aCyellow %%      [-l]                 you're an unshadowed lord.  Default: you're a hero&lt;br /&gt;
/echo -aCyellow %%      [-w&amp;lt;level&amp;gt;]          you wear the item at level &amp;lt;level&amp;gt;.  Default 51.&lt;br /&gt;
/echo -aCyellow %%      [-x&amp;lt;command&amp;gt;]        execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
;etch           christen&lt;br /&gt;
;fodderbag      Fodderbag&lt;br /&gt;
;upgradebag     Upgradebag&lt;br /&gt;
;sparebag       Sparebag&lt;br /&gt;
;wastebag       Wastebag&lt;br /&gt;
;brillbag       Brillbag&lt;br /&gt;
;shimmerbag     Shimmerbag&lt;br /&gt;
;&lt;br /&gt;
;Only the rename of the fodderbag matters, enchantbag_got_item triggers on it&lt;br /&gt;
;Use the same name or change the trigger to match your bag&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var enchantbag_exit to&lt;br /&gt;
;0              enchantbag finished correctly with an empty fodderbag&lt;br /&gt;
;enchant_err    we got an error code from enchant.tf&lt;br /&gt;
;no_fodderbag   couldnt find the fodderbag&lt;br /&gt;
;wrong_name     names didn't check out&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchantbag&lt;br /&gt;
&lt;br /&gt;
;Range to use if we didn't set the lowest spare to keep in the config file&lt;br /&gt;
;Range includes the item in the gear, so if the armor spare range is 4 and the&lt;br /&gt;
;item in our gear is a 12 -9 lemans seal, the lowest upgrade would be b12 -10,&lt;br /&gt;
;and the spares could be b12 -7, b12 -8, b12 -9.  If the level permits&lt;br /&gt;
;enchanting tho, the script *will* try to make a b12 -9 spare out of a b12 -6,&lt;br /&gt;
;or enchant a 12-9 spare to a 12-12 upgrade.&lt;br /&gt;
/set enchantbag_armor_spare_range=3&lt;br /&gt;
/set enchantbag_weapon_spare_range=2&lt;br /&gt;
/set enchantbag_bow_spare_range=3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Load file with current gear&lt;br /&gt;
/set enchantbag_gear_file=enchantbag.gear.tf&lt;br /&gt;
/eval /set enchantbag_path=%{TINYPREFIX}&lt;br /&gt;
/eval /load -q %{enchantbag_path}%{enchantbag_gear_file}&lt;br /&gt;
&lt;br /&gt;
;should NOT set enchantbag_post here&lt;br /&gt;
/def -i enchantbag_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set enchantbag=0%;\&lt;br /&gt;
        /set enchantbag_name=%;\&lt;br /&gt;
        /set enchantbag_name_check=0%;\&lt;br /&gt;
        /set enchantbag_inv=0%;\&lt;br /&gt;
        /set enchantbag_inv_name=%;\&lt;br /&gt;
        /set enchantbag_level_increment=0%;\&lt;br /&gt;
        /set enchantbag_enchant_count=0%;\&lt;br /&gt;
        /set enchantbag_max_level=0%;\&lt;br /&gt;
        /set enchantbag_fade=0%;\&lt;br /&gt;
        /set enchantbag_shimmer=0%;\&lt;br /&gt;
        /set enchantbag_brill=0%;\&lt;br /&gt;
        /set enchantbag_vape=0%;\&lt;br /&gt;
        /set enchantbag_item_known=0%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_exit=&lt;br /&gt;
&lt;br /&gt;
/enchantbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /set enchantbag_enchanter_level=51%;\&lt;br /&gt;
        /set enchantbag_wear_level=51%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0: Start processing bag.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Loading %{enchantbag_path}%{enchantbag_gear_file}.%;\&lt;br /&gt;
        /load -q %{enchantbag_path}%{enchantbag_gear_file}%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;lx:w#&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_l) /set enchantbag_enchanter_level 125%;/endif%;\&lt;br /&gt;
        /if (opt_w) /set enchantbag_wear_level %{opt_w}%;/endif%;\&lt;br /&gt;
        /set enchantbag_post %{opt_x}%;\&lt;br /&gt;
        /config_store -senchantbag -x/enchantbag_config_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_config_done = \&lt;br /&gt;
        /filter_store -senchantbag -x/enchantbag_filter_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_filter_done = \&lt;br /&gt;
        config +blind%;\&lt;br /&gt;
        config +combine%;\&lt;br /&gt;
        config -condition%;\&lt;br /&gt;
        config +nosummon%;\&lt;br /&gt;
        config +notake%;\&lt;br /&gt;
        config +nodisturb%;\&lt;br /&gt;
        filter +spellother%;\&lt;br /&gt;
        /enchantbag_next_item&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_next_item = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Getting next item from the fodderbag.%;\&lt;br /&gt;
        get 1. fodderbag&lt;br /&gt;
&lt;br /&gt;
;Bag empty.  We're finished.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;You see nothing like that in Fodderbag.&amp;quot; enchantbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Your fodderbag is empty.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit 0&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Fodderbag in a bag?&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;I see no fodderbag here.&amp;quot; enchantbag_no_fodderbag = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% You are not carrying the fodderbag.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit no_fodderbag&lt;br /&gt;
&lt;br /&gt;
;New item.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from Fodderbag.$&amp;quot; enchantbag_got_item = \&lt;br /&gt;
        /set enchantbag_name %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% Got %{enchantbag_name}.  Going to identify it.%;\&lt;br /&gt;
        /identify -x/enchantbag_identify_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Done identifying.  Doing cross reference on name.%;\&lt;br /&gt;
        /set enchantbag_name_check 1%;\&lt;br /&gt;
        inv%;\&lt;br /&gt;
        look &amp;quot;%{identify_object}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -p799 -t&amp;quot;You are carrying:&amp;quot; enchantbag_inv = \&lt;br /&gt;
        /def -1 -mregexp -t&amp;quot;^(\\( ?[0-9]+\\)|    ) (\\([a-zA-Z]+\\) )\*([^\\[]+)( \\[.+)\*\$&amp;quot; _enchantbag_inv = \&lt;br /&gt;
                /set enchantbag_inv_name=%%{P3}%%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%%% /%%0: First item in inventory is %%enchantbag_inv_name&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -mregexp -t&amp;quot;^You look at (.+) in your inventory...$&amp;quot; enchantbag_name_check = \&lt;br /&gt;
        /let identify_name %{P1}%;\&lt;br /&gt;
        /set enchantbag_name_check 0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Looking at %identify_object, we got: %identify_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: First item in inventory is %enchantbag_inv_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We got %enchantbag_name from the fodderbag.%;\&lt;br /&gt;
        /if ((identify_name =~ enchantbag_name) &amp;amp; (identify_name =~ enchantbag_inv_name)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Names ok.%;\&lt;br /&gt;
                /echo%;\&lt;br /&gt;
                /repeat -0.3 1 /enchantbag_processor%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Names mismatch.  Exit.  Messy inventory?%;\&lt;br /&gt;
                /enchantbag_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_processor = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Processing identify information.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: brill is %enchantbag_brill, shimmer is %enchantbag_shimmer, level is %identify_level.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: fade is %enchantbag_fade, vape is %enchantbag_vape, enchant_count is %enchantbag_enchant_count%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_armor%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_weapon%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_bow%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (enchantbag_item_known) \&lt;br /&gt;
                /if (enchantbag_upgrade) \&lt;br /&gt;
                        put 1. upgradebag%;\&lt;br /&gt;
                        save%;\&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: An upgrade!  Stashing... Next!%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_possible_upgrade) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible upgrade!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_possible_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible spare!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A spare!  Stashing... Next!%;\&lt;br /&gt;
                        put 1. sparebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /else \ &lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: This item goes to waste... Next!%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: Item unknown.  Using simple distribution method.%;\&lt;br /&gt;
                /if (enchantbag_brill) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into brillbag.%;\&lt;br /&gt;
                        put 1. brillbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_shimmer) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into shimmerbag.%;\&lt;br /&gt;
                        put 1. shimmerbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (identify_level &amp;lt; enchantbag_max_level) \&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /else \ &lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into wastebag.%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_enchant_done = \&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_type|no_item|wrong_type&amp;quot;, enchant_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Exit enchantbag, enchant_err.%;\&lt;br /&gt;
                /enchantbag_exit enchant_err%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;wrong_name&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Rechecking names.%;\&lt;br /&gt;
                /identify -x/enchantbag_identify_done 1.%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;vape&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCred %%% /%0: Our item vaped...  Next!%;\&lt;br /&gt;
                /enchantbag_next_item%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;fade&amp;quot;) \&lt;br /&gt;
                /send get idontwanttoLID%;\&lt;br /&gt;
                /test ++identify_level%;\&lt;br /&gt;
                /set identify_enchant_armor 0%;\&lt;br /&gt;
                /set identify_enchant_weapon 0%;\&lt;br /&gt;
                /set identify_enchant_bow 0%;\&lt;br /&gt;
                /set enchantbag_fade 1%;\&lt;br /&gt;
                /set enchantbag_brill 0%;\&lt;br /&gt;
                /set enchantbag_shimmer 0%;\&lt;br /&gt;
                /set enchantbag_enchant_count 0%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_fade 0%;\&lt;br /&gt;
                /test identify_level += %enchantbag_level_increment%;\&lt;br /&gt;
                /test ++enchantbag_enchant_count%;\&lt;br /&gt;
                /if (enchant_exit =~ &amp;quot;shimmer&amp;quot;) \&lt;br /&gt;
                        /test ++enchantbag_shimmer%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test ++identify_enchant_weapon%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 2%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (regmatch(&amp;quot;presence|brill&amp;quot;, enchant_exit)) \&lt;br /&gt;
                        /test ++enchantbag_brill%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 3%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_weapon += 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 3%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_armor = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this piece of armor?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /if (!identify_armor_multiplier) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know the armor multiplier for %identify_object.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let id_total_armor=0%;\&lt;br /&gt;
        /let id_max_armor=0%;\&lt;br /&gt;
        /let acgear_stats=%;\&lt;br /&gt;
        /let acgear_base=0%;\&lt;br /&gt;
        /let acgear_enchant=0%;\&lt;br /&gt;
        /let acgear_total_armor=0%;\&lt;br /&gt;
        /let acgear_spare_base=0%;\&lt;br /&gt;
        /let acgear_spare_enchant=0%;\&lt;br /&gt;
        /let acgear_spare_armor=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_armor $[(identify_armor_class * identify_armor_multiplier) - identify_enchant_armor]%;\&lt;br /&gt;
        /test acgear_stats:=enchantbag_get_stats(identify_object)%;\&lt;br /&gt;
        /if (acgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our acgear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;b([0-9]+) \*(-?\\+?[0-9]\*) \*b?([0-9]\*) \*(-?\\+?[0-9]\*)$$&amp;quot;, acgear_stats)%;\&lt;br /&gt;
        /let acgear_base %{P1}%;\&lt;br /&gt;
        /let acgear_enchant %{P2}%;\&lt;br /&gt;
        /let acgear_spare_base %{P3}%;\&lt;br /&gt;
        /let acgear_spare_enchant %{P4}%;\&lt;br /&gt;
        /let acgear_total_armor $[acgear_base * identify_armor_multiplier - acgear_enchant]%;\&lt;br /&gt;
        /let acgear_spare_armor $[acgear_spare_base * identify_armor_multiplier - acgear_spare_enchant]%;\&lt;br /&gt;
        /if (!acgear_spare_armor) \&lt;br /&gt;
                /let acgear_spare_armor $[acgear_total_armor - enchantbag_armor_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_armor $[id_total_armor - (possible_enchants * -3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_armor &amp;gt; acgear_total_armor]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_armor &amp;gt; acgear_total_armor)]%;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_armor &amp;gt;= acgear_spare_armor)]%;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_armor &amp;gt;= acgear_spare_armor]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our acgear, we have base %acgear_base, enchant %acgear_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Lowest spare we want to keep is base %acgear_spare_base, enchant %acgear_spare_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Armor class multiplier of this item is %identify_armor_multiplier%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCred %%% /%0: Acgear item has a total armor of %acgear_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Spare item has min armor of %acgear_spare_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has a total armor of %id_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: We could make the total armor %id_max_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_weapon = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this weapon?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;essence amorphous orb|shard black doom marble&amp;quot;, identify_object)) \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 5]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_dr=0%;\&lt;br /&gt;
        /let id_max_dr=0%;\&lt;br /&gt;
        /let damgear_stats=%;\&lt;br /&gt;
        /let damgear_total_dr=0%;\&lt;br /&gt;
        /let damgear_spare_dr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_dr $[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let damgear_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (damgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)dr \*([0-9]+)?(dr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let damgear_total_dr %{P1}%;\&lt;br /&gt;
        /let damgear_spare_dr %{P2}%;\&lt;br /&gt;
        /if (!damgear_spare_dr) \&lt;br /&gt;
                /let damgear_spare_dr $[damgear_total_dr - enchantbag_weapon_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_dr $[id_total_dr + (possible_enchants * 2)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_dr &amp;gt; damgear_total_dr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_dr &amp;gt; damgear_total_dr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_dr &amp;gt;= damgear_spare_dr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_dr &amp;gt;= damgear_spare_dr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our damgear, we have a %{damgear_total_dr}dr weapon%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %id_total_dr dr.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total dr %id_max_dr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_bow = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: The item is a bow.  Preprocessing.%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this bow?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
;DEBUG don't actually know what the level would do if a lord enchanted a hero&lt;br /&gt;
;DEBUG bow, this is a guess.  Also wouldn't know why you'd want to do a thing&lt;br /&gt;
;DEBUG like that&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_hr=0%;\&lt;br /&gt;
        /let id_max_hr=0%;\&lt;br /&gt;
        /let bow_cur_stats=%;\&lt;br /&gt;
        /let bow_cur_hr=0%;\&lt;br /&gt;
        /let bow_spare_hr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_hr $[identify_hr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let bow_cur_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (bow_cur_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)hr \*([0-9]+)?(hr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let bow_cur_hr %{P1}%;\&lt;br /&gt;
        /let bow_spare_hr %{P2}%;\&lt;br /&gt;
        /if (!bow_spare_hr) \&lt;br /&gt;
                /let bow_spare_hr $[bow_cur_hr - enchantbag_bow_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_hr $[id_total_hr + (possible_enchants * 3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_hr &amp;gt; bow_cur_hr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_hr &amp;gt; bow_cur_hr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_hr &amp;gt;= bow_spare_hr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_hr &amp;gt;= bow_spare_hr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: We have a %{bow_cur_hr}hr bow in our gear%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %{id_total_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total hr %{id_max_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_get_stats = \&lt;br /&gt;
        /if (enchantbag_wear_level == 51) \&lt;br /&gt;
                /let var_mid hero%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level == 125) \&lt;br /&gt;
                /let var_mid lord%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level &amp;lt;= 50) \&lt;br /&gt;
                /let var_mid lowmort%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let var_right=%*%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
        /test var_right:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_right)%;\&lt;br /&gt;
        /test var_right:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_right)%;\&lt;br /&gt;
        /let varname enchantbag_%{var_mid}_%{var_right}%;\&lt;br /&gt;
        /eval /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%%% /%0: Stats we have on file for %identify_object is %%{%{varname}}%;\&lt;br /&gt;
        /eval /return &amp;quot;%%{%{varname}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_possible_enchants = \&lt;br /&gt;
        /let pos_ench=0%;\&lt;br /&gt;
        /let counter %{identify_level}%;\&lt;br /&gt;
        /while (counter &amp;lt; enchantbag_wear_level - 1) \&lt;br /&gt;
                /if (counter + enchantbag_level_increment &amp;lt;= enchantbag_max_level) \&lt;br /&gt;
                        /test ++pos_ench%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /test counter+=enchantbag_level_increment%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /if (enchantbag_enchanter_level == enchantbag_wear_level) \&lt;br /&gt;
                /test pos_ench+=$[enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment))]%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /test pos_ench+=$[(enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment)))/enchantbag_level_increment]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (pos_ench &amp;lt; 0) /let pos_ench 0%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: We could enchant %pos_ench more times%;\&lt;br /&gt;
        /return %{pos_ench}&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_exit = \&lt;br /&gt;
        /let _post %enchantbag_post%;\&lt;br /&gt;
        /config_restore -senchantbag blind%;\&lt;br /&gt;
        /config_restore -senchantbag combine%;\&lt;br /&gt;
        /config_restore -senchantbag condition%;\&lt;br /&gt;
        /config_restore -senchantbag nosummon%;\&lt;br /&gt;
        /config_restore -senchantbag notake%;\&lt;br /&gt;
        /config_restore -senchantbag nodisturb%;\&lt;br /&gt;
        /config_rmset enchantbag%;\&lt;br /&gt;
        /filter_restore -senchantbag spellother%;\&lt;br /&gt;
        /filter_rmset enchantbag%;\&lt;br /&gt;
        /unset enchantbag%;\&lt;br /&gt;
        /unset enchantbag_name%;\&lt;br /&gt;
        /unset enchantbag_name_check%;\&lt;br /&gt;
        /unset enchantbag_inv%;\&lt;br /&gt;
        /unset enchantbag_inv_name%;\&lt;br /&gt;
        /unset enchantbag_level_increment%;\&lt;br /&gt;
        /unset enchantbag_enchant_count%;\&lt;br /&gt;
        /unset enchantbag_max_level%;\&lt;br /&gt;
        /unset enchantbag_fade%;\&lt;br /&gt;
        /unset enchantbag_shimmer%;\&lt;br /&gt;
        /unset enchantbag_brill%;\&lt;br /&gt;
        /unset enchantbag_vape%;\&lt;br /&gt;
        /unset enchantbag_item_known%;\&lt;br /&gt;
        /unset enchantbag_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_spare%;\&lt;br /&gt;
        /unset enchantbag_spare%;\&lt;br /&gt;
        /unset enchantbag_post%;\&lt;br /&gt;
        /unset enchantbag_enchanter_level%;\&lt;br /&gt;
        /unset enchantbag_wear_level%;\&lt;br /&gt;
        /set enchantbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0 reports: We're finished.  Post command is: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.3 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchant.tf&amp;diff=33749</id>
		<title>Enchant.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchant.tf&amp;diff=33749"/>
		<updated>2008-11-08T13:44:28Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: cleanup, enchant_exit now unsets most global vars instead of reinitializing them, also, diff *again* shows the old version on the wiki had some trailing spaces!?  What's up with that!?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An enchant script.  It'll enchant an item until something happens to it, and execute the command given by option -x when it's done.  The -i option makes it use information gathered by the [[identify.tf]] script, and is its default way of getting the item's type.  When the enchant is finished it will set global var enchant_exit to some useful exit status.&lt;br /&gt;
&lt;br /&gt;
This script uses [[verbose.tf]], [[regen.tf]] and [[safechannel.tf]] so you'll want those if you want to use this script.  Regen.tf uses [[prompt.tf]].  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/enchant.tf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}regen.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}safechannel.tf&lt;br /&gt;
&lt;br /&gt;
;All tf commands have the options before the arguments, e.g.&lt;br /&gt;
;/enchant -a ring&lt;br /&gt;
/def -i enchant_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /enchant &amp;lt;item&amp;gt;       Enchant &amp;lt;item&amp;gt; until something happens to it%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-a]                  item is an armor%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-w]                  item is a weapon%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-b]                  item is a bow%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-i]                  item is a %%{identify_type} &amp;lt;- default%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-n&amp;quot;&amp;lt;name&amp;gt;&amp;quot;]          use &amp;lt;name&amp;gt; to verify triggers%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;quot;&amp;lt;command&amp;gt;&amp;quot;]       execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
&lt;br /&gt;
/enchant_usage&lt;br /&gt;
&lt;br /&gt;
;When the enchant is finished it will set global var enchant_exit to&lt;br /&gt;
;no_type        couldn't determine item type&lt;br /&gt;
;no_item        you're not carrying the item&lt;br /&gt;
;wrong_type     the items type is not what was expected&lt;br /&gt;
;wrong_name     the triggers responded to something but the name was wrong&lt;br /&gt;
;fade           we enchanted and got a fade&lt;br /&gt;
;shimmer        we enchanted and got a shimmer&lt;br /&gt;
;presence       we enchanted and got a shimmer and a presence &lt;br /&gt;
;brill          we enchanted and got a brilliant&lt;br /&gt;
;vape           we enchanted and the item vaporized or exploded&lt;br /&gt;
;&lt;br /&gt;
;re wrong_name:  the script does ignore the next line of mud output when someone&lt;br /&gt;
;   else enchants something.  If it still exits with wrong_name it probably&lt;br /&gt;
;   means something weird is going on.&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and use system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchant&lt;br /&gt;
&lt;br /&gt;
/def -i enchant_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Initializing .... %;\&lt;br /&gt;
        /set auto_enchant=0%;\&lt;br /&gt;
        /set enchant_timeout=0%;\&lt;br /&gt;
        /set enchant_keyword=%;\&lt;br /&gt;
        /set enchant_name=%;\&lt;br /&gt;
        /set enchant_type=%;\&lt;br /&gt;
        /set enchant_exit=%;\&lt;br /&gt;
        /set enchant_post=&lt;br /&gt;
&lt;br /&gt;
/def -i enchant = \&lt;br /&gt;
        /enchant_init%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;awbin:x:&amp;quot;)) /return 0%;/endif%; \&lt;br /&gt;
        /set enchant_name %{opt_n}%;\&lt;br /&gt;
        /safechannel -q on%;\&lt;br /&gt;
        /set enchant_post %{opt_x}%;\&lt;br /&gt;
        /if (opt_a) /set enchant_type armor%;\&lt;br /&gt;
        /elseif (opt_w) /set enchant_type weapon%;\&lt;br /&gt;
        /elseif (opt_b) /set enchant_type bow%;\&lt;br /&gt;
        /elseif (identify_type !~ &amp;quot;&amp;quot;) /set enchant_type %{identify_type}%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /echo -aCyellow %%% No idea how to enchant %*.%;\&lt;br /&gt;
                /enchant_exit no_type%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /set enchant_keyword %*%;\&lt;br /&gt;
        /set auto_enchant 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCcyan %%% /%0: Start enchanting %enchant_keyword.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Type is %enchant_type, post command is %enchant_post%;\&lt;br /&gt;
        /enchant_do%;\&lt;br /&gt;
&lt;br /&gt;
/def -i enchant_do = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Enchanting %{enchant_keyword} as %{enchant_type}.%;\&lt;br /&gt;
        c 'enchant %{enchant_type}' %{enchant_keyword}&lt;br /&gt;
&lt;br /&gt;
;Stuff that could go wrong&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -t&amp;quot;You are not carrying *!&amp;quot; enchant_no_item = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aBCred %%% Can't find your item, %{enchant_keyword}!  Bailing out.%;\&lt;br /&gt;
        /enchant_exit no_item&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^You do not have enough mana to cast enchant (weapon|bow|armor).$&amp;quot; enchant_no_mana = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCcyan %%% /%0: Yikes!  Out of mana.  Calling regen script and returning.%;\&lt;br /&gt;
        /regen -x/enchant_do&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^That isn't (an|a) (armor|weapon|bow).$&amp;quot; enchant_wrong_type = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aBCred %%% /%0: WRONG TYPE!  Exiting.%;\&lt;br /&gt;
        /enchant_exit wrong_type&lt;br /&gt;
&lt;br /&gt;
;If someone else enchants we dont want our triggers to grab their results&lt;br /&gt;
/def -i -E(auto_enchant) -t&amp;quot;* utters the words, 'enchant *'.&amp;quot; enchant_timeout = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Someone enchanted something.  Disabling enchant triggers.%;\&lt;br /&gt;
        /set enchant_timeout 1&lt;br /&gt;
;So we ignore the next line of mud output with a highest priority non-fallthru trigger&lt;br /&gt;
/def -i -E(enchant_timeout) -p999 -t&amp;quot;*&amp;quot; enchant_exit_timeout = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: We got their result.  Enabling enchant triggers.%;\&lt;br /&gt;
        /set enchant_timeout 0&lt;br /&gt;
;DEBUG? triggers are still not 100% fool proof (but getting really close)&lt;br /&gt;
;someone could enchant something just a millisecond before we do so both results&lt;br /&gt;
;would be on consecutive lines of mud output.  If their enchant fails or does&lt;br /&gt;
;nothing, we'll be ignoring the result of ours, stalling the script.&lt;br /&gt;
&lt;br /&gt;
;armor, weapon, bow&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^Nothing seemed to happen.$&amp;quot; enchant_nothing = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCyellow %%% /%0: Sigh... *yawn* ... Mumble mumph ZZZZZZZZZ ... retrying...%;\&lt;br /&gt;
        /enchant_do&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows brightly, then fades...oops.$&amp;quot; enchant_fade = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Item fades!  Beh.%;\&lt;br /&gt;
                /enchant_exit fade%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;a presence kills the enchant_exit /repeated by the shimmer&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot;^You feel the presence of (Shizaga|Quixoltan|Durr)!$&amp;quot; enchant_presence = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0:  Gotta love %{P1}!%;\&lt;br /&gt;
        /@test _enchant_exit_pid &amp;amp; (kill(_enchant_exit_pid), _enchant_exit_pid:=0)%;\&lt;br /&gt;
        /enchant_exit presence&lt;br /&gt;
&lt;br /&gt;
;armor&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; shimmers with a gold aura.$&amp;quot; enchant_shimmers_gold = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: We got gold... But where is Shizaga?%;\&lt;br /&gt;
                /repeat -0.5 1 /enchant_exit shimmer%;\&lt;br /&gt;
                /set _enchant_exit_pid=%?%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows a brilliant gold!$&amp;quot; enchant_brilliant_gold = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCyellow %%% /%0: Yesss!!!  A brill!.%;\&lt;br /&gt;
                /enchant_exit brill%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; flares blindingly... and evaporates!$&amp;quot; enchant_vape = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCred %%% /%0: Oh nooooooooo.... another one vaped!%;\&lt;br /&gt;
                /enchant_exit vape%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;weapon, bow&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows blue.$&amp;quot; enchant_shimmers_blue = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: This one enchanted...  any presence?%;\&lt;br /&gt;
                /repeat -0.5 1 /enchant_exit shimmer%;\&lt;br /&gt;
                /set _enchant_exit_pid=%?%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; glows a brilliant blue!$&amp;quot; enchant_brilliant_blue = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCblue %%% /%0: I wish this would happen all the time!%;\&lt;br /&gt;
                /enchant_exit brill%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(auto_enchant) -p699 -F -mregexp -t&amp;quot; shivers violently and explodes!$&amp;quot; enchant_explode = \&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from -n: %enchant_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Name from trigger: %{PL}%;\&lt;br /&gt;
        /if ((enchant_name =~ &amp;quot;&amp;quot;) | (enchant_name =/ {PL})) \&lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aBCred %%% /%0: Boom boom boom boom... Byebye!!%;\&lt;br /&gt;
                /enchant_exit vape%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchant} -l2 - -aCyellow %%% /%0: Name mismatch.  Exit.%;\&lt;br /&gt;
                /enchant_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
;Finally, we exit!&lt;br /&gt;
/def -i enchant_exit = \&lt;br /&gt;
        /let _post %{enchant_post}%;\&lt;br /&gt;
        /safechannel -q off%;\&lt;br /&gt;
        /unset auto_enchant%;\&lt;br /&gt;
        /unset enchant_timeout%;\&lt;br /&gt;
        /unset enchant_keyword%;\&lt;br /&gt;
        /unset enchant_name%;\&lt;br /&gt;
        /unset enchant_type%;\&lt;br /&gt;
        /unset enchant_post%;\&lt;br /&gt;
        /set enchant_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l3 - -aCyellow %%% /%0: Exit code: %{enchant_exit}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchant} -l1 - -aCcyan %%% /%0: Enchant script done!  Executing post command: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.4 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Dirrev.tf&amp;diff=33748</id>
		<title>Dirrev.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Dirrev.tf&amp;diff=33748"/>
		<updated>2008-11-08T12:49:39Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: cleanup, changed most global vars to local vars, made it return a value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Non issue: The script won't revert 3w200s, max supported is 99.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /dirrev &amp;lt;path&amp;gt;        Revert speedwalk path&lt;br /&gt;
&lt;br /&gt;
/def -i dirrev = \&lt;br /&gt;
        /if ({#}=0) \&lt;br /&gt;
                /echo -p %%% @{Cred}Syntax: /%{0} &amp;lt;path&amp;gt;@{n}%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /let _dir_str %1 %;\  &lt;br /&gt;
                /let _length $[strlen(_dir_str)] %;\&lt;br /&gt;
                /let _double_digit=0%;\&lt;br /&gt;
                /set dirrev=%;\&lt;br /&gt;
                /for c 0 $[_length-1] \  &lt;br /&gt;
                        /let _position $$[_length-c] %%;\ &lt;br /&gt;
                        /let _cur_char $$[substr(_dir_str, _position-1, 1)] %%;\&lt;br /&gt;
                        /if (_cur_char =~ &amp;quot;e&amp;quot;) /let _new_char w %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;s&amp;quot;) /let _new_char n %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;w&amp;quot;) /let _new_char e %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;n&amp;quot;) /let _new_char s %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;u&amp;quot;) /let _new_char d %%;\&lt;br /&gt;
                        /elseif (_cur_char =~ &amp;quot;d&amp;quot;) /let _new_char u %%;\&lt;br /&gt;
                        /else  /let _new_char %%{_cur_char} %%;\&lt;br /&gt;
                        /endif %%;\&lt;br /&gt;
                        /if ((_new_char =/ &amp;quot;[0-9]&amp;quot;) &amp;amp; (!_double_digit)) \&lt;br /&gt;
                                /set dirrev $$[strcat(substr(dirrev, 0, c-1), _new_char, substr(dirrev, c-1, 1))] %%;\&lt;br /&gt;
                                /if (substr(_dir_str, _position-2, 1) =/ &amp;quot;[0-9]&amp;quot;) \&lt;br /&gt;
                                        /set dirrev $$[strcat(substr(dirrev, 0, c-1), substr(_dir_str, _position-2, 1), substr(dirrev, c-1, 2))] %%;\&lt;br /&gt;
                                        /let _double_digit 1 %%;\&lt;br /&gt;
                                /endif %%;\&lt;br /&gt;
                        /elseif ( regmatch(&amp;quot;[nsewud]&amp;quot;, _new_char) ) \&lt;br /&gt;
                                /set dirrev $$[strcat(dirrev, _new_char)] %%;\&lt;br /&gt;
                                /let _double_digit 0 %%;\&lt;br /&gt;
                        /endif %;\&lt;br /&gt;
                /echo -p %%% @{Cwhite}The reverse of @{Cgreen}%{_dir_str} @{Cwhite}is @{Cgreen}%dirrev@{n}%;\&lt;br /&gt;
                /return &amp;quot;%dirrev&amp;quot;%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Config.tf&amp;diff=33747</id>
		<title>Config.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Config.tf&amp;diff=33747"/>
		<updated>2008-11-08T12:09:50Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: bugfix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A script to store mud side configuration and filter options into variables and restore them later.  It also allows you to set defaults and restore them with &amp;quot;/config_restore all&amp;quot;  For more information, read the comments in the first 100 lines.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[verbose.tf]] so you'll want those if you want to use this script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/config.tf&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
;Scripts can use this script to store configuration and filter options from&lt;br /&gt;
;  Avatar into variables.  Example for a call from myscript&lt;br /&gt;
;&lt;br /&gt;
;       /config_store -smyscript -x/myscript_config_done&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_config_done = \&lt;br /&gt;
;       config +notake%;\&lt;br /&gt;
;       config +nosummon%;\&lt;br /&gt;
;       /myscript_continues&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_exit = \&lt;br /&gt;
;       /config_restore -smyscript notake%;\&lt;br /&gt;
;       /config_restore -smyscript nosummon%;\&lt;br /&gt;
;       /config_rmset myscript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /config_store         Stores mud configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore &amp;lt;option&amp;gt; Restore config &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore all   Restore all config options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_rmset &amp;lt;set&amp;gt;   Remove config &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
/def -i filter_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /filter_store         Stores mud filter configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore &amp;lt;option&amp;gt; Restore filter &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore all   Restore all filter options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_rmset &amp;lt;set&amp;gt;   Remove filter &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
;Default config.  If you interrupt a script or otherwise mess up your config&lt;br /&gt;
;  you can just use &amp;quot;/config_restore all&amp;quot;.&lt;br /&gt;
;To produce this list I used &amp;quot;/config_store&amp;quot; and &amp;quot;/listvar config_avatar*&amp;quot;.&lt;br /&gt;
/set config_avatar_autoexit=    +autoexit&lt;br /&gt;
/set config_avatar_autogold=    +autogold&lt;br /&gt;
/set config_avatar_autogroup=   +autogroup&lt;br /&gt;
/set config_avatar_autoloot=    -autoloot&lt;br /&gt;
/set config_avatar_autopull=    +autopull&lt;br /&gt;
/set config_avatar_autosac=     -autosac&lt;br /&gt;
/set config_avatar_autosplit=   +autosplit&lt;br /&gt;
/set config_avatar_autotitle=   +autotitle&lt;br /&gt;
/set config_avatar_battlenone=  -battlenone&lt;br /&gt;
/set config_avatar_battleother= -battleother&lt;br /&gt;
/set config_avatar_battleself=  -battleself&lt;br /&gt;
/set config_avatar_blank=       +blank&lt;br /&gt;
/set config_avatar_blind=       -blind&lt;br /&gt;
/set config_avatar_brief=       -brief&lt;br /&gt;
/set config_avatar_cmdcolor=    +cmdcolor&lt;br /&gt;
/set config_avatar_color=       +color&lt;br /&gt;
/set config_avatar_combine=     +combine&lt;br /&gt;
/set config_avatar_condition=   -condition&lt;br /&gt;
/set config_avatar_demonbank=   +demonbank&lt;br /&gt;
/set config_avatar_keepalive=   -keepalive&lt;br /&gt;
/set config_avatar_label=       +label&lt;br /&gt;
/set config_avatar_nobeep=      -nobeep&lt;br /&gt;
/set config_avatar_nodisturb=   -nodisturb&lt;br /&gt;
/set config_avatar_nogenesis=   -nogenesis&lt;br /&gt;
/set config_avatar_nosummon=    -nosummon&lt;br /&gt;
/set config_avatar_notake=      -notake&lt;br /&gt;
/set config_avatar_prompt=      +prompt&lt;br /&gt;
/set config_avatar_prompt2=     +prompt2&lt;br /&gt;
/set config_avatar_scoreaff=    -scoreaff&lt;br /&gt;
/set config_avatar_telnetga=    -telnetga&lt;br /&gt;
/set config_avatar_list= autoexit autoloot autogold autogroup autopull \&lt;br /&gt;
        autosplit autosac autotitle battleother battleself battlenone blank blind \&lt;br /&gt;
        brief color cmdcolor combine condition demonbank keepalive nobeep \&lt;br /&gt;
        nogenesis nosummon notake nodisturb label prompt prompt2 scoreaff telnetga&lt;br /&gt;
/eval /set config_set_list $(/unique %{config_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Default filter, for /filter_restore all&lt;br /&gt;
/set filter_avatar_objectother=0&lt;br /&gt;
/set filter_avatar_roomindiv=0&lt;br /&gt;
/set filter_avatar_roomtotal=1&lt;br /&gt;
/set filter_avatar_spellother=0&lt;br /&gt;
/set filter_avatar_walkother=0&lt;br /&gt;
/set filter_avatar_list= walkother roomindiv roomtotal spellother objectother&lt;br /&gt;
/eval /set filter_set_list $(/unique %{filter_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 config&lt;br /&gt;
&lt;br /&gt;
/config_usage&lt;br /&gt;
/filter_usage&lt;br /&gt;
&lt;br /&gt;
/def -i config_store = \&lt;br /&gt;
        /set config_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set config_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set config_post %{opt_x}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list=%;\&lt;br /&gt;
        /set config_set_list $(/unique %{config_set_list} %{config_set})%;\&lt;br /&gt;
        /set config_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing configuration, storing in set %config_set%;\&lt;br /&gt;
        config&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -t&amp;quot;\[ Keyword    \] Option&amp;quot; config_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of configuration list%;\&lt;br /&gt;
        /set prompt_exe config_store&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -mregexp -t&amp;quot;^\[(-|\+)([a-zA-Z0-9]+) *\] .+\.$&amp;quot; config_option = \&lt;br /&gt;
        /let _sign %{P1}%;\&lt;br /&gt;
        /let _option $[tolower({P2})]%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got config option: %{_option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list %%{config_%{config_set}_list} %%{_option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_%{_option} %{_sign}%{_option}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -p991 -mglob -h'send PROMPT_EXE config_store' config_prompt_exe = \&lt;br /&gt;
        /let _post %{config_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset config_store%;\&lt;br /&gt;
        /unset config_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored configuration in set %{config_set}, executing %{_post}%;\&lt;br /&gt;
        /unset config_set%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_restore = \&lt;br /&gt;
        /let _set=avatar%;\&lt;br /&gt;
        /set config_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /let _set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \ &lt;br /&gt;
                /if (!regmatch(&amp;quot;autoexit&amp;quot;, config_%{_set}_autoexit)) \&lt;br /&gt;
                        /set config_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /let _option %1%;\&lt;br /&gt;
        /if (config_noset) \&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% /%0: No configuration set %{_set} stored!%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
        /elseif (_option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /config_restore %%{config_%{_set}_list}%;\&lt;br /&gt;
        /elseif (_option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval config %%{config_%{_set}_%{_option}}%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /config_usage%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Option %{_option} restored using set %{_set}%;\&lt;br /&gt;
        /unset config_noset&lt;br /&gt;
&lt;br /&gt;
/def -i config_rmset = \&lt;br /&gt;
        /let _set %*%;\&lt;br /&gt;
        /if (_set =~ &amp;quot;&amp;quot;) /let _set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{config_%{_set}_list}%;\&lt;br /&gt;
        /let _length $(/length %{rmset_options})%;\&lt;br /&gt;
        /let _counter=1%;\&lt;br /&gt;
        /while (_counter &amp;lt;= _length) \&lt;br /&gt;
                /unset config_%{_set}_$(/nth %{_counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set config_set_list $(/remove %{_set} %{config_set_list})%;\&lt;br /&gt;
        /unset config_%{_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (config_set_list =~ &amp;quot;&amp;quot;) /unset config_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Configuration set %{_set} removed.&lt;br /&gt;
&lt;br /&gt;
; Same for filter&lt;br /&gt;
&lt;br /&gt;
/def -i filter_store = \&lt;br /&gt;
        /set filter_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set filter_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set filter_post %{opt_x}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list=%;\&lt;br /&gt;
        /set filter_set_list $(/unique %{filter_set_list} %{filter_set})%;\&lt;br /&gt;
        /set filter_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing filters, storing in set %filter_set%;\&lt;br /&gt;
        filter&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -t&amp;quot;Filter Type           Status&amp;quot; filter_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of filter list%;\&lt;br /&gt;
        /set prompt_exe filter_store&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -mregexp -t&amp;quot;^([A-Z]+).+(ON|off)&amp;quot; filter_option = \&lt;br /&gt;
        /let _option $[tolower({P1})]%;\&lt;br /&gt;
        /let _sign %{P2}%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got filter: %{_option}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list %%{filter_%{filter_set}_list} %%{_option}%;\&lt;br /&gt;
        /if (_sign =~ &amp;quot;off&amp;quot;) \&lt;br /&gt;
                /eval /set filter_%{filter_set}_%{_option} 0%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /eval /set filter_%{filter_set}_%{_option} 1%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -p991 -mglob -h'send PROMPT_EXE filter_store' filter_prompt_exe = \&lt;br /&gt;
        /let _post %{filter_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset filter_store%;\&lt;br /&gt;
        /unset filter_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored filters in set %{filter_set}, executing %{_post}%;\&lt;br /&gt;
        /unset filter_set%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i filter_restore = \&lt;br /&gt;
        /let _set=avatar%;\&lt;br /&gt;
        /set filter_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /let _set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \ &lt;br /&gt;
                /if (!regmatch(&amp;quot;0|1&amp;quot;, filter_%{_set}_objectother)) \&lt;br /&gt;
                        /set filter_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /let _option %1%;\&lt;br /&gt;
        /if (filter_noset) \&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% /%0: No filter set %{_set} stored!%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
        /elseif (_option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /filter_restore %%{filter_%{_set}_list}%;\&lt;br /&gt;
        /elseif (_option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval \ &lt;br /&gt;
                        /if (filter_%{_set}_%{_option}) \&lt;br /&gt;
                                filter +%%{_option}%%;\&lt;br /&gt;
                        /else \ &lt;br /&gt;
                                filter -%%{_option}%%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Filter %{_option} restored using set %{_set}%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /filter_usage%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /unset filter_noset&lt;br /&gt;
&lt;br /&gt;
/def -i filter_rmset = \&lt;br /&gt;
        /let _set %*%;\&lt;br /&gt;
        /if (_set =~ &amp;quot;&amp;quot;) /let _set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{filter_%{_set}_list}%;\&lt;br /&gt;
        /let _length $(/length %{rmset_options})%;\&lt;br /&gt;
        /let _counter=1%;\&lt;br /&gt;
        /while (_counter &amp;lt;= _length) \&lt;br /&gt;
                /unset filter_%{_set}_$(/nth %{_counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set filter_set_list $(/remove %{_set} %{filter_set_list})%;\&lt;br /&gt;
        /unset filter_%{_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (filter_set_list =~ &amp;quot;&amp;quot;) /unset filter_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Filter set %{_set} removed.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Affects.tf&amp;diff=33746</id>
		<title>Affects.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Affects.tf&amp;diff=33746"/>
		<updated>2008-11-08T11:43:58Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: made the tickers init when the script loads.. also diff shows there was a trailing space on line 144?  odd :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Provides&lt;br /&gt;
* custom colors of affects list&lt;br /&gt;
* /aff &amp;lt;spell&amp;gt; shows affects list just for &amp;lt;spell&amp;gt;&lt;br /&gt;
* /sick shows how sick you are&lt;br /&gt;
* /chkaff shows which spells you are *not* affected by&lt;br /&gt;
* Sanctuary ticker on the satus line&lt;br /&gt;
* Spellup ticker on the status line&lt;br /&gt;
&lt;br /&gt;
The tickers grab the duration of sanctuary and holy aura from the affects list, colors them and puts them in a status variable.  It then uses [[tick.tf]] to make the tickers count down on the tick.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[tick.tf]] so you'll need those too.  Also, you should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}tick.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /aff &amp;lt;spell&amp;gt;          Shows affects list for &amp;lt;spell&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /sick                 Shows how sick you are&lt;br /&gt;
/echo -aCyellow %% /chkaff               Shows which spells you are *not* affected by&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script:&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_sanctuary:3 :1 status_spellup:3 :1 status_position insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Custom color the affects list..&lt;br /&gt;
;Paint all of the affects list green&lt;br /&gt;
/def -i -p999 -F -PCgreen -mregexp -t&amp;quot;^Spell: '.*&amp;quot; affects_green&lt;br /&gt;
&lt;br /&gt;
;yellow for some spells i might want to check more than others&lt;br /&gt;
/def -i -p998 -F -PCyellow -mregexp -t&amp;quot;^Spell: '(steel|iron|bark|pass|fly|water|heigh|conc).*&amp;quot; affects_yellow&lt;br /&gt;
&lt;br /&gt;
;white for spells i most probably want to find quickly&lt;br /&gt;
/def -i -p998 -F -PCwhite -mregexp -t&amp;quot;^Spell: '(sanc|regen|scramble|hand).*&amp;quot; affects_white&lt;br /&gt;
&lt;br /&gt;
;You can &amp;quot;/aff sanc&amp;quot; and it'll only show the sanctuary line&lt;br /&gt;
;or use a regexp, &amp;quot;/aff sanc|fren&amp;quot;&lt;br /&gt;
/def -i aff = \&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _aff_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '%{1}.*&amp;quot; _aff_spell%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _aff_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 /undef _aff_affected _aff_spell _aff_gag_other_affects%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;Just a /sick macro.&lt;br /&gt;
/def -i sick = \&lt;br /&gt;
        /set sick_poison 0%;\&lt;br /&gt;
        /set sick_disease 0%;\&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _sick_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(poison|toxin|biotoxin|venom)'.*&amp;quot; _sick_poison = /test $$$[++sick_poison] %%;\&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(virus|plague)'.*&amp;quot; _sick_disease = /test $$$[++sick_disease]%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _sick_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 \&lt;br /&gt;
                        /undef _sick_affected _sick_poison _sick_disease _sick_gag_other_affects%%%;\&lt;br /&gt;
                gtell %%%%% I am affected by: %%%sick_poison poisons and %%%sick_disease diseases%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;/chkaff will show you the spells from the chkaff_list by which&lt;br /&gt;
;you're *not* affected.&lt;br /&gt;
/def -i chkaff = \&lt;br /&gt;
        /set chkaff_list= |BR| sanctuary |R| awen foci fortitudes \&lt;br /&gt;
                invincibility barkskin steel_skeleton iron_skin |W| protection_evil bless holy_aura \&lt;br /&gt;
                holy_armor armor water_breathing energy_shield displacement body_brace \&lt;br /&gt;
                mental_barrier calcify_flesh biofeedback anticipate adrenaline_pump concentrate \&lt;br /&gt;
                pass_door fly shield stone_skin giant_strength |G| frenzy |B| heighten_senses%;\&lt;br /&gt;
        /set chkaff 1%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -t&amp;quot;You are affected by:&amp;quot; chkaff_affected = \&lt;br /&gt;
        /set prompt_exe chkaff&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -mregexp -t&amp;quot;^Spell: '(.+)' .+&amp;quot; chkaff_spell = \&lt;br /&gt;
        /let affect=$[replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, {P1})]%;\&lt;br /&gt;
        /set chkaff_list=$(/remove %affect %chkaff_list)&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p991 -mglob -h'send PROMPT_EXE chkaff' chkaff_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /set chkaff 0%;\&lt;br /&gt;
        gtell %%% I am *not* affected by %chkaff_list&lt;br /&gt;
&lt;br /&gt;
;Sanc and spellup tickers on the status line&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;You are affected by:&amp;quot; tickers_init = \&lt;br /&gt;
        /set sanctuary_duration=%;\&lt;br /&gt;
        /set spellup_duration=%;\&lt;br /&gt;
        /sanctuary_status%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/tickers_init&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'sanctuary'  for ([0-9]+) hours.$&amp;quot; aff_sanc = \&lt;br /&gt;
        /test sanctuary_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;The protective aura fades from around your body.&amp;quot; sanctuary_fades = \&lt;br /&gt;
        /set sanctuary_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' sanctuary_tick = \&lt;br /&gt;
        /if (sanctuary_duration &amp;gt; 0) /test --sanctuary_duration%;\&lt;br /&gt;
        /else /set sanctuary_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i sanctuary_status = \&lt;br /&gt;
        /set status_sanctuary \$%{sanctuary_duration}%;\&lt;br /&gt;
        /if (sanctuary_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /elseif (sanctuary_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary BCred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 5) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cyellow%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -t&amp;quot;You are surrounded by a white aura.&amp;quot; got_sanc = affects&lt;br /&gt;
&lt;br /&gt;
;Do the same for holy aura to have a spellup ticker&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'holy aura'  modifies armor class by -[0-9]+ for ([0-9]+) hours.$&amp;quot; aff_spellup = \&lt;br /&gt;
        /test spellup_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;Your Aura of Holiness fades...&amp;quot; spellup_fades = \&lt;br /&gt;
        /set spellup_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' spellup_tick = \&lt;br /&gt;
        /if (spellup_duration &amp;gt; 0) /test --spellup_duration%;\&lt;br /&gt;
        /else /set spellup_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i spellup_status = \&lt;br /&gt;
        /set status_spellup s%{spellup_duration}%;\&lt;br /&gt;
        /if (spellup_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /elseif (spellup_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_spellup BCred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 3) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cyellow%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Affects.tf&amp;diff=33745</id>
		<title>Affects.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Affects.tf&amp;diff=33745"/>
		<updated>2008-11-08T11:30:55Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: one regexp triggers wasnt really a regexp, anchored some others, and fixes 2 harmless bugs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Provides&lt;br /&gt;
* custom colors of affects list&lt;br /&gt;
* /aff &amp;lt;spell&amp;gt; shows affects list just for &amp;lt;spell&amp;gt;&lt;br /&gt;
* /sick shows how sick you are&lt;br /&gt;
* /chkaff shows which spells you are *not* affected by&lt;br /&gt;
* Sanctuary ticker on the satus line&lt;br /&gt;
* Spellup ticker on the status line&lt;br /&gt;
&lt;br /&gt;
The tickers grab the duration of sanctuary and holy aura from the affects list, colors them and puts them in a status variable.  It then uses [[tick.tf]] to make the tickers count down on the tick.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[tick.tf]] so you'll need those too.  Also, you should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}tick.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /aff &amp;lt;spell&amp;gt;          Shows affects list for &amp;lt;spell&amp;gt;&lt;br /&gt;
/echo -aCyellow %% /sick                 Shows how sick you are&lt;br /&gt;
/echo -aCyellow %% /chkaff               Shows which spells you are *not* affected by&lt;br /&gt;
&lt;br /&gt;
;I set my status line in a single command in my config file, this is what it&lt;br /&gt;
;  looks like with the right variables for this script:&lt;br /&gt;
;/status_add -c @more:8:Br @world:9 :1 status_sanctuary:3 :1 status_spellup:3 :1 status_position insert:2 :1 @clock:16&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Custom color the affects list..&lt;br /&gt;
;Paint all of the affects list green&lt;br /&gt;
/def -i -p999 -F -PCgreen -mregexp -t&amp;quot;^Spell: '.*&amp;quot; affects_green&lt;br /&gt;
&lt;br /&gt;
;yellow for some spells i might want to check more than others&lt;br /&gt;
/def -i -p998 -F -PCyellow -mregexp -t&amp;quot;^Spell: '(steel|iron|bark|pass|fly|water|heigh|conc).*&amp;quot; affects_yellow&lt;br /&gt;
&lt;br /&gt;
;white for spells i most probably want to find quickly&lt;br /&gt;
/def -i -p998 -F -PCwhite -mregexp -t&amp;quot;^Spell: '(sanc|regen|scramble|hand).*&amp;quot; affects_white&lt;br /&gt;
&lt;br /&gt;
;You can &amp;quot;/aff sanc&amp;quot; and it'll only show the sanctuary line&lt;br /&gt;
;or use a regexp, &amp;quot;/aff sanc|fren&amp;quot;&lt;br /&gt;
/def -i aff = \&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _aff_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '%{1}.*&amp;quot; _aff_spell%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _aff_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 /undef _aff_affected _aff_spell _aff_gag_other_affects%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;Just a /sick macro.&lt;br /&gt;
/def -i sick = \&lt;br /&gt;
        /set sick_poison 0%;\&lt;br /&gt;
        /set sick_disease 0%;\&lt;br /&gt;
        /def -t&amp;quot;You are affected by:&amp;quot; _sick_affected = \&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(poison|toxin|biotoxin|venom)'.*&amp;quot; _sick_poison = /test $$$[++sick_poison] %%;\&lt;br /&gt;
                /def -p900 -mregexp -t&amp;quot;^Spell: '(virus|plague)'.*&amp;quot; _sick_disease = /test $$$[++sick_disease]%%;\&lt;br /&gt;
                /def -p899 -ag -mregexp -t&amp;quot;^Spell: '&amp;quot; _sick_gag_other_affects%%;\&lt;br /&gt;
                /repeat -0.3 1 \&lt;br /&gt;
                        /undef _sick_affected _sick_poison _sick_disease _sick_gag_other_affects%%%;\&lt;br /&gt;
                gtell %%%%% I am affected by: %%%sick_poison poisons and %%%sick_disease diseases%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
;/chkaff will show you the spells from the chkaff_list by which&lt;br /&gt;
;you're *not* affected.&lt;br /&gt;
/def -i chkaff = \&lt;br /&gt;
        /set chkaff_list= |BR| sanctuary |R| awen foci fortitudes \&lt;br /&gt;
                invincibility barkskin steel_skeleton iron_skin |W| protection_evil bless holy_aura \&lt;br /&gt;
                holy_armor armor water_breathing energy_shield displacement body_brace \&lt;br /&gt;
                mental_barrier calcify_flesh biofeedback anticipate adrenaline_pump concentrate \&lt;br /&gt;
                pass_door fly shield stone_skin giant_strength |G| frenzy |B| heighten_senses%;\&lt;br /&gt;
        /set chkaff 1%;\&lt;br /&gt;
        affects&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -t&amp;quot;You are affected by:&amp;quot; chkaff_affected = \&lt;br /&gt;
        /set prompt_exe chkaff&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p100 -F -mregexp -t&amp;quot;^Spell: '(.+)' .+&amp;quot; chkaff_spell = \&lt;br /&gt;
        /let affect=$[replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, {P1})]%;\&lt;br /&gt;
        /set chkaff_list=$(/remove %affect %chkaff_list)&lt;br /&gt;
&lt;br /&gt;
/def -i -E(chkaff) -p991 -mglob -h'send PROMPT_EXE chkaff' chkaff_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /set chkaff 0%;\&lt;br /&gt;
        gtell %%% I am *not* affected by %chkaff_list&lt;br /&gt;
&lt;br /&gt;
;Sanctuary ticker on the status line&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;You are affected by:&amp;quot; = \&lt;br /&gt;
        /set sanctuary_duration=%;\&lt;br /&gt;
        /set spellup_duration=%;\&lt;br /&gt;
        /sanctuary_status%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'sanctuary'  for ([0-9]+) hours.$&amp;quot; aff_sanc = \&lt;br /&gt;
        /test sanctuary_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;The protective aura fades from around your body.&amp;quot; sanctuary_fades = \&lt;br /&gt;
        /set sanctuary_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' sanctuary_tick = \&lt;br /&gt;
        /if (sanctuary_duration &amp;gt; 0) /test --sanctuary_duration%;\&lt;br /&gt;
        /else /set sanctuary_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /sanctuary_status&lt;br /&gt;
&lt;br /&gt;
/def -i sanctuary_status = \&lt;br /&gt;
        /set status_sanctuary \$%{sanctuary_duration}%;\&lt;br /&gt;
        /if (sanctuary_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /elseif (sanctuary_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary BCred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 2) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cred%;\&lt;br /&gt;
        /elseif (sanctuary_duration &amp;lt;= 5) \&lt;br /&gt;
                /set status_attr_var_status_sanctuary Cyellow%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set status_attr_var_status_sanctuary=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -t&amp;quot;You are surrounded by a white aura.&amp;quot; got_sanc = affects&lt;br /&gt;
&lt;br /&gt;
;Do the same for holy aura to have a spellup ticker&lt;br /&gt;
/def -i -p999 -F -mregexp -t&amp;quot;^Spell: 'holy aura'  modifies armor class by -[0-9]+ for ([0-9]+) hours.$&amp;quot; aff_spellup = \&lt;br /&gt;
        /test spellup_duration:=strip_attr({P1})%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def -i -p999 -F -t&amp;quot;Your Aura of Holiness fades...&amp;quot; spellup_fades = \&lt;br /&gt;
        /set spellup_duration=&lt;br /&gt;
&lt;br /&gt;
/def -i -p991 -F -mglob -h'send TICK_EXE' spellup_tick = \&lt;br /&gt;
        /if (spellup_duration &amp;gt; 0) /test --spellup_duration%;\&lt;br /&gt;
        /else /set spellup_duration=%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /spellup_status&lt;br /&gt;
&lt;br /&gt;
/def spellup_status = \&lt;br /&gt;
        /set status_spellup s%{spellup_duration}%;\&lt;br /&gt;
        /if (spellup_duration =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /elseif (spellup_duration == 0) \&lt;br /&gt;
                /set status_attr_var_status_spellup BCred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 1) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cred%;\&lt;br /&gt;
        /elseif (spellup_duration &amp;lt;= 3) \&lt;br /&gt;
                /set status_attr_var_status_spellup Cyellow%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set status_attr_var_status_spellup=%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Regen.tf&amp;diff=33744</id>
		<title>Regen.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Regen.tf&amp;diff=33744"/>
		<updated>2008-11-08T10:08:56Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: cleaning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A regen script.  It sends a blank line to the server and checks if we're done at regular intervals, currently 8 seconds.  It uses variables from [[prompt.tf]] to see if we're done.&lt;br /&gt;
&lt;br /&gt;
This script uses both [[prompt.tf]] and [[verbose.tf]] so you'll need those if you want to use this&lt;br /&gt;
script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see examples of its use in the [[identify.tf]] or the [[enchant.tf]] script.  If it doesnt have mana for the spell, it calls this script to regen and go back when it's done with the regen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/regen.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /regen -x&amp;lt;command&amp;gt;    Fully regen, then execute &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;A regen script.  It will make you sleep to regen.  It will make you stand and&lt;br /&gt;
;execute a command when you're done, for example:&lt;br /&gt;
;  sanc dw&lt;br /&gt;
;  regen -x&amp;quot;e=u=u=sleep&amp;quot;&lt;br /&gt;
;&lt;br /&gt;
;Or it might just be more useful in other scripts.&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and use system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s2 regen&lt;br /&gt;
&lt;br /&gt;
/def -i regen = \&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set regen_post %{opt_x}%;\&lt;br /&gt;
        /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Starting checks.  Post command is: %regen_post%;\ &lt;br /&gt;
        sleep%;\&lt;br /&gt;
        /repeat -7.5 1 /send%;\&lt;br /&gt;
        /repeat -8 1 /regen_check&lt;br /&gt;
&lt;br /&gt;
/def -i regen_check = \&lt;br /&gt;
        /let _post %{regen_post}%;\&lt;br /&gt;
        /let _move_relative $[prompt_move*100/prompt_move_max]%;\&lt;br /&gt;
        /if ((prompt_hp_relative &amp;gt;= 100) &amp;amp; (prompt_mana_relative &amp;gt;= 100) &amp;amp; \&lt;br /&gt;
                        (_move_relative &amp;gt;= 100) &amp;amp; (!prompt_lagtimer)) \&lt;br /&gt;
                /verbose -o%{verbosity_regen} -l1 - -aCcyan %%% /%0: Regen done!  Executing post command: %regen_post%;\&lt;br /&gt;
                stand%;\&lt;br /&gt;
                /unset regen_post%;\&lt;br /&gt;
                /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif%;\&lt;br /&gt;
        /else \&lt;br /&gt;
                /verbose -o%{verbosity_regen} -l2 - -aCyellow %%% %0: not done yet....%;\&lt;br /&gt;
                /repeat -7.5 1 /send%;\&lt;br /&gt;
                /repeat -8 1 /regen_check%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33743</id>
		<title>Enchantbag.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Enchantbag.tf&amp;diff=33743"/>
		<updated>2008-11-08T09:59:05Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Mods _exit to unset global vars instead of reinitializing them&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h4&amp;gt;Features&amp;lt;/h4&amp;gt;&lt;br /&gt;
So you have a pile of armor to enchant.  And a couple of weapons and bows to go with that.  Well you toss it all in fodderbag, run this script, and collect the results from upgradebag, sparebag or wastebag.  Or if you don't configure it with your current gear, you can collect the items from brillbag, shimmerbag, wastebag.  It accepts some options:&lt;br /&gt;
&lt;br /&gt;
* -l enchanting with an unshadowed lord&lt;br /&gt;
* -w&amp;lt;level&amp;gt; level we want to wear the item at&lt;br /&gt;
* -x&amp;lt;command&amp;gt; execute &amp;lt;command&amp;gt; when done&lt;br /&gt;
&lt;br /&gt;
The script uses &amp;quot;get 1. fodderbag&amp;quot;, identifies 1., and enchants 1. .  It will check the names of&lt;br /&gt;
* the item you got from the fodderbag&lt;br /&gt;
* the first item in your inventory&lt;br /&gt;
* the name of the item it's identifying&lt;br /&gt;
If they're not all the same it won't enchant the item.&lt;br /&gt;
&lt;br /&gt;
It sets config +blind, +combine, -condition, +nosummon, +notake, +nodisturb and filter +spellother to decrease the chance of anything/anyone messing up the script.  That should make sure the triggers don't respond on people cutting/pasting brills to channels, the triggers work on you inventory, your regen is not interrupted and the triggers won't respond to other players enchants.  Config +blind doesn't affect grtz channel but that is still covered by safechannel.tf.  The script uses config.tf to store/restore your configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Example config file&amp;lt;/h4&amp;gt;&lt;br /&gt;
The script will try to load an enchantbag.gear.tf file with a configuration of gear.  It's simply a list of variables, like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/set enchantbag_hero_essence_amorphous_orb                  12dr 10dr&lt;br /&gt;
/set enchantbag_hero_hero_heroes_shield                     b12    b12&lt;br /&gt;
/set enchantbag_hero_bow_sliver_glowing_moonlight_arc       21hr&lt;br /&gt;
/set enchantbag_hero_lemans_family_seal_talisman            b12 -9 b12 -6&lt;br /&gt;
&lt;br /&gt;
;To reuse a value for an equivalent item, you could&lt;br /&gt;
/eval /set enchantbag_hero_mother_pearl %{enchantbag_hero_lemans_family_seal_talisman}&lt;br /&gt;
&lt;br /&gt;
;Lord stuff&lt;br /&gt;
/set enchantbag_lord_essence_amorphous_orb                  15dr 13dr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the variable name, you'd append &amp;quot;enchantbag_&amp;quot; with either &amp;quot;hero_&amp;quot;, &amp;quot;lord_&amp;quot;, or &amp;quot;lowmort_&amp;quot;, then append that with the keywords you get from identify, remove &amp;quot;weird&amp;quot; characters (anything not in [a-zA-Z0-9 ]) and turn spaces into underscores.&lt;br /&gt;
&lt;br /&gt;
The first value is the current gear, anything above that will go into upgradebag.  The second value is the lowest spare that should go into sparebag.  The script currently treats spares kinda aggressively, it'll try to enchant a 12 -3 spare to a 12 -6 spare if the level permits, even if you have 12 -3 as lowest spare to keep.  Perhaps I should switch that around, I don't know yet.  You can omit the second value, it'll then use the default ranges for spares.&lt;br /&gt;
&lt;br /&gt;
If you're enchanting armor and want to use the configuration, you'll also need to add the item to [[identify.tf]] to know the multiplier for the armor class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Stuff you need&amp;lt;/h4&amp;gt;&lt;br /&gt;
This script uses [[config.tf]], [[verbose.tf]], [[enchant.tf]] and [[identify.tf]] so you'll want those if you want to use this script.  Config.tf and identify.tf use [[prompt.tf]], and enchant.tf uses [[regen.tf]] and [[safechannel.tf]] so get those while you're at it.  &amp;lt;b&amp;gt;If you update this script from an older version, please update these scripts as well,&amp;lt;/b&amp;gt; or strange things might happen, or it might not work at all.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll also need some bags, look at the comments in the script for a list of etches and christens.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Examples&amp;lt;/h4&amp;gt;&lt;br /&gt;
Enchant a pile of stuff with a hero for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of mother pearls with an unshadowed lord but for hero tier:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enchant a pile of amorphous orbs or doom shards for lord and sleep afterwards:&lt;br /&gt;
&amp;lt;pre&amp;gt;/enchantbag -l -w125 -xsleep&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you'd want to see all debug spam it produces, try&lt;br /&gt;
&amp;lt;pre&amp;gt;/verbose -s3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Disclaimer&amp;lt;/h4&amp;gt;&lt;br /&gt;
It's not all pretty, some parts of the script might taste good with some bolognese.  Larger tf scripts tend to get like that.  I blame it on the lack of structured data types, lack of way to pass variables around, lack of pointers, linked lists, anything that a modern language would provide.  If you'd know a better design approach tho, please let me know :)&lt;br /&gt;
&lt;br /&gt;
I didn't test enchanting piles of lord eq.  If you know any such piles please let me know where I can pick them up ;)&lt;br /&gt;
&lt;br /&gt;
I'm guessing a hero level bow would raise 5 levels if you'd enchant it with a lord.  I'm not sure.  Also don't know why anybody would want to do that so I can't be bothered to check it.&lt;br /&gt;
&lt;br /&gt;
I've used this script quite a number of times now and debugged it extensively.  It works fine for me.  However, if you were to vape your b12 -9 shield or heros, or blow your 13/13 hero level doom shard, I'll be more than happy to accept your bug report but will not accept any responsibility for the items.  I guess keeping your inventory clean is the way to be 100% sure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;The script&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;brillbag       Brillbag&lt;br /&gt;
;shimmerbag     Shimmerbag&lt;br /&gt;
;&lt;br /&gt;
;Only the rename of the fodderbag matters, enchantbag_got_item triggers on it&lt;br /&gt;
;Use the same name or change the trigger to match your bag&lt;br /&gt;
&lt;br /&gt;
;When the script exits it sets global var enchantbag_exit to&lt;br /&gt;
;0              enchantbag finished correctly with an empty fodderbag&lt;br /&gt;
;enchant_err    we got an error code from enchant.tf&lt;br /&gt;
;no_fodderbag   couldnt find the fodderbag&lt;br /&gt;
;wrong_name     names didn't check out&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 enchantbag&lt;br /&gt;
&lt;br /&gt;
;Range to use if we didn't set the lowest spare to keep in the config file&lt;br /&gt;
;Range includes the item in the gear, so if the armor spare range is 4 and the&lt;br /&gt;
;item in our gear is a 12 -9 lemans seal, the lowest upgrade would be b12 -10,&lt;br /&gt;
;and the spares could be b12 -7, b12 -8, b12 -9.  If the level permits&lt;br /&gt;
;enchanting tho, the script *will* try to make a b12 -9 spare out of a b12 -6,&lt;br /&gt;
;or enchant a 12-9 spare to a 12-12 upgrade.&lt;br /&gt;
/set enchantbag_armor_spare_range=3&lt;br /&gt;
/set enchantbag_weapon_spare_range=2&lt;br /&gt;
/set enchantbag_bow_spare_range=3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Load file with current gear&lt;br /&gt;
/set enchantbag_gear_file=enchantbag.gear.tf&lt;br /&gt;
/eval /set enchantbag_path=%{TINYPREFIX}&lt;br /&gt;
/eval /load -q %{enchantbag_path}%{enchantbag_gear_file}&lt;br /&gt;
&lt;br /&gt;
;should NOT set enchantbag_post here&lt;br /&gt;
/def -i enchantbag_init = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set enchantbag=0%;\&lt;br /&gt;
        /set enchantbag_name=%;\&lt;br /&gt;
        /set enchantbag_name_check=0%;\&lt;br /&gt;
        /set enchantbag_inv=0%;\&lt;br /&gt;
        /set enchantbag_inv_name=%;\&lt;br /&gt;
        /set enchantbag_level_increment=0%;\&lt;br /&gt;
        /set enchantbag_enchant_count=0%;\&lt;br /&gt;
        /set enchantbag_max_level=0%;\&lt;br /&gt;
        /set enchantbag_fade=0%;\&lt;br /&gt;
        /set enchantbag_shimmer=0%;\&lt;br /&gt;
        /set enchantbag_brill=0%;\&lt;br /&gt;
        /set enchantbag_vape=0%;\&lt;br /&gt;
        /set enchantbag_item_known=0%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_exit=&lt;br /&gt;
&lt;br /&gt;
/enchantbag_init&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /set enchantbag_enchanter_level=51%;\&lt;br /&gt;
        /set enchantbag_wear_level=51%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0: Start processing bag.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Loading %{enchantbag_path}%{enchantbag_gear_file}.%;\&lt;br /&gt;
        /load -q %{enchantbag_path}%{enchantbag_gear_file}%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;lx:w#&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_l) /set enchantbag_enchanter_level 125%;/endif%;\&lt;br /&gt;
        /if (opt_w) /set enchantbag_wear_level %{opt_w}%;/endif%;\&lt;br /&gt;
        /set enchantbag_post %{opt_x}%;\&lt;br /&gt;
        /config_store -senchantbag -x/enchantbag_config_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_config_done = \&lt;br /&gt;
        /filter_store -senchantbag -x/enchantbag_filter_done&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_filter_done = \&lt;br /&gt;
        config +blind%;\&lt;br /&gt;
        config +combine%;\&lt;br /&gt;
        config -condition%;\&lt;br /&gt;
        config +nosummon%;\&lt;br /&gt;
        config +notake%;\&lt;br /&gt;
        config +nodisturb%;\&lt;br /&gt;
        filter +spellother%;\&lt;br /&gt;
        /enchantbag_next_item&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_next_item = \&lt;br /&gt;
        /enchantbag_init%;\&lt;br /&gt;
        /set enchantbag=1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Getting next item from the fodderbag.%;\&lt;br /&gt;
        get 1. fodderbag&lt;br /&gt;
&lt;br /&gt;
;Bag empty.  We're finished.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;You see nothing like that in Fodderbag.&amp;quot; enchantbag_empty = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Your fodderbag is empty.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit 0&lt;br /&gt;
&lt;br /&gt;
;Wrong alt?  Fodderbag in a bag?&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -t&amp;quot;I see no fodderbag here.&amp;quot; enchantbag_no_fodderbag = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% You are not carrying the fodderbag.  Exiting /enchantbag.%;\&lt;br /&gt;
        /enchantbag_exit no_fodderbag&lt;br /&gt;
&lt;br /&gt;
;New item.&lt;br /&gt;
/def -i -E(enchantbag) -p799 -F -mregexp -t&amp;quot;^You get (.+) from Fodderbag.$&amp;quot; enchantbag_got_item = \&lt;br /&gt;
        /set enchantbag_name %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% Got %{enchantbag_name}.  Going to identify it.%;\&lt;br /&gt;
        /identify -x/enchantbag_identify_done 1.&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Done identifying.  Doing cross reference on name.%;\&lt;br /&gt;
        /set enchantbag_name_check 1%;\&lt;br /&gt;
        inv%;\&lt;br /&gt;
        look &amp;quot;%{identify_object}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -p799 -t&amp;quot;You are carrying:&amp;quot; enchantbag_inv = \&lt;br /&gt;
        /def -1 -mregexp -t&amp;quot;^(\\( ?[0-9]+\\)|    ) (\\([a-zA-Z]+\\) )\*([^\\[]+)( \\[.+)\*\$&amp;quot; _enchantbag_inv = \&lt;br /&gt;
                /set enchantbag_inv_name=%%{P3}%%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%%% /%%0: First item in inventory is %%enchantbag_inv_name&lt;br /&gt;
&lt;br /&gt;
/def -i -E(enchantbag_name_check) -mregexp -t&amp;quot;^You look at (.+) in your inventory...$&amp;quot; enchantbag_name_check = \&lt;br /&gt;
        /let identify_name %{P1}%;\&lt;br /&gt;
        /set enchantbag_name_check 0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Looking at %identify_object, we got: %identify_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: First item in inventory is %enchantbag_inv_name%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We got %enchantbag_name from the fodderbag.%;\&lt;br /&gt;
        /if ((identify_name =~ enchantbag_name) &amp;amp; (identify_name =~ enchantbag_inv_name)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Names ok.%;\&lt;br /&gt;
                /echo%;\&lt;br /&gt;
                /repeat -0.3 1 /enchantbag_processor%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Names mismatch.  Exit.  Messy inventory?%;\&lt;br /&gt;
                /enchantbag_exit wrong_name%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_processor = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: Processing identify information.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: brill is %enchantbag_brill, shimmer is %enchantbag_shimmer, level is %identify_level.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: fade is %enchantbag_fade, vape is %enchantbag_vape, enchant_count is %enchantbag_enchant_count%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_armor%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_weapon%;\&lt;br /&gt;
        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                /enchantbag_pre_bow%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (enchantbag_item_known) \&lt;br /&gt;
                /if (enchantbag_upgrade) \&lt;br /&gt;
                        put 1. upgradebag%;\&lt;br /&gt;
                        save%;\&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: An upgrade!  Stashing... Next!%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_possible_upgrade) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible upgrade!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_possible_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A possible spare!  Enchanting.%;\&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /elseif (enchantbag_spare) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: A spare!  Stashing... Next!%;\&lt;br /&gt;
                        put 1. sparebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /else \ &lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: This item goes to waste... Next!%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aBCcyan %%% /%0: Item unknown.  Using simple distribution method.%;\&lt;br /&gt;
                /if (enchantbag_brill) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into brillbag.%;\&lt;br /&gt;
                        put 1. brillbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (enchantbag_shimmer) \&lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into shimmerbag.%;\&lt;br /&gt;
                        put 1. shimmerbag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /elseif (identify_level &amp;lt; enchantbag_max_level) \&lt;br /&gt;
                        /enchant -n&amp;quot;%{enchantbag_name}&amp;quot; -i -x/enchantbag_enchant_done 1.%;\&lt;br /&gt;
                /else \ &lt;br /&gt;
                        /verbose -o%{verbosity_enchantbag} -l3 -aCyellow %%% /%0: Putting item into wastebag.%;\&lt;br /&gt;
                        put 1. wastebag%;\&lt;br /&gt;
                        /enchantbag_next_item%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_enchant_done = \&lt;br /&gt;
        /if (regmatch(&amp;quot;^$|no_type|no_item|wrong_type&amp;quot;, enchant_exit)) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Exit enchantbag, enchant_err.%;\&lt;br /&gt;
                /enchantbag_exit enchant_err%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;wrong_name&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Enchant script exit status: %{enchant_exit}%;\&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l1 - -aBCred %%% /%0: Rechecking names.%;\&lt;br /&gt;
                /identify -x/enchantbag_identify_done 1.%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;vape&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l2 - -aCred %%% /%0: Our item vaped...  Next!%;\&lt;br /&gt;
                /enchantbag_next_item%;\&lt;br /&gt;
        /elseif (enchant_exit =~ &amp;quot;fade&amp;quot;) \&lt;br /&gt;
                /send get idontwanttoLID%;\&lt;br /&gt;
                /test ++identify_level%;\&lt;br /&gt;
                /set identify_enchant_armor 0%;\&lt;br /&gt;
                /set identify_enchant_weapon 0%;\&lt;br /&gt;
                /set identify_enchant_bow 0%;\&lt;br /&gt;
                /set enchantbag_fade 1%;\&lt;br /&gt;
                /set enchantbag_brill 0%;\&lt;br /&gt;
                /set enchantbag_shimmer 0%;\&lt;br /&gt;
                /set enchantbag_enchant_count 0%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_fade 0%;\&lt;br /&gt;
                /test identify_level += %enchantbag_level_increment%;\&lt;br /&gt;
                /test ++enchantbag_enchant_count%;\&lt;br /&gt;
                /if (enchant_exit =~ &amp;quot;shimmer&amp;quot;) \&lt;br /&gt;
                        /test ++enchantbag_shimmer%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test ++identify_enchant_weapon%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 2%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (regmatch(&amp;quot;presence|brill&amp;quot;, enchant_exit)) \&lt;br /&gt;
                        /test ++enchantbag_brill%;\&lt;br /&gt;
                        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_armor -= 3%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_weapon += 2%;\&lt;br /&gt;
                        /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                                /test identify_enchant_bow += 3%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /enchantbag_processor%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_armor = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this piece of armor?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /if (!identify_armor_multiplier) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know the armor multiplier for %identify_object.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let id_total_armor=0%;\&lt;br /&gt;
        /let id_max_armor=0%;\&lt;br /&gt;
        /let acgear_stats=%;\&lt;br /&gt;
        /let acgear_base=0%;\&lt;br /&gt;
        /let acgear_enchant=0%;\&lt;br /&gt;
        /let acgear_total_armor=0%;\&lt;br /&gt;
        /let acgear_spare_base=0%;\&lt;br /&gt;
        /let acgear_spare_enchant=0%;\&lt;br /&gt;
        /let acgear_spare_armor=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_armor $[(identify_armor_class * identify_armor_multiplier) - identify_enchant_armor]%;\&lt;br /&gt;
        /test acgear_stats:=enchantbag_get_stats(identify_object)%;\&lt;br /&gt;
        /if (acgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our acgear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;b([0-9]+) \*(-?\\+?[0-9]\*) \*b?([0-9]\*) \*(-?\\+?[0-9]\*)$$&amp;quot;, acgear_stats)%;\&lt;br /&gt;
        /let acgear_base %{P1}%;\&lt;br /&gt;
        /let acgear_enchant %{P2}%;\&lt;br /&gt;
        /let acgear_spare_base %{P3}%;\&lt;br /&gt;
        /let acgear_spare_enchant %{P4}%;\&lt;br /&gt;
        /let acgear_total_armor $[acgear_base * identify_armor_multiplier - acgear_enchant]%;\&lt;br /&gt;
        /let acgear_spare_armor $[acgear_spare_base * identify_armor_multiplier - acgear_spare_enchant]%;\&lt;br /&gt;
        /if (!acgear_spare_armor) \&lt;br /&gt;
                /let acgear_spare_armor $[acgear_total_armor - enchantbag_armor_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_armor $[id_total_armor - (possible_enchants * -3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_armor &amp;gt; acgear_total_armor]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_armor &amp;gt; acgear_total_armor)]%;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_armor &amp;gt;= acgear_spare_armor)]%;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_armor &amp;gt;= acgear_spare_armor]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our acgear, we have base %acgear_base, enchant %acgear_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Lowest spare we want to keep is base %acgear_spare_base, enchant %acgear_spare_enchant%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Armor class multiplier of this item is %identify_armor_multiplier%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCred %%% /%0: Acgear item has a total armor of %acgear_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: Spare item has min armor of %acgear_spare_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has a total armor of %id_total_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: We could make the total armor %id_max_armor%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_weapon = \&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this weapon?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;essence amorphous orb|shard black doom marble&amp;quot;, identify_object)) \&lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 3]%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_max_level $[enchantbag_wear_level + 5]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_dr=0%;\&lt;br /&gt;
        /let id_max_dr=0%;\&lt;br /&gt;
        /let damgear_stats=%;\&lt;br /&gt;
        /let damgear_total_dr=0%;\&lt;br /&gt;
        /let damgear_spare_dr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_dr $[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let damgear_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (damgear_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)dr \*([0-9]+)?(dr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let damgear_total_dr %{P1}%;\&lt;br /&gt;
        /let damgear_spare_dr %{P2}%;\&lt;br /&gt;
        /if (!damgear_spare_dr) \&lt;br /&gt;
                /let damgear_spare_dr $[damgear_total_dr - enchantbag_weapon_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_dr $[id_total_dr + (possible_enchants * 2)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_dr &amp;gt; damgear_total_dr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_dr &amp;gt; damgear_total_dr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_dr &amp;gt;= damgear_spare_dr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_dr &amp;gt;= damgear_spare_dr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: In our damgear, we have a %{damgear_total_dr}dr weapon%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %id_total_dr dr.%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total dr %id_max_dr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_pre_bow = \&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: The item is a bow.  Preprocessing.%;\&lt;br /&gt;
        /set enchantbag_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade=0%;\&lt;br /&gt;
        /set enchantbag_possible_spare=0%;\&lt;br /&gt;
        /set enchantbag_spare=0%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l2 - -aCyellow %%% /%0: What can we do with this bow?%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: Our enchanter is level %enchantbag_enchanter_level%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We're enchanting to level %enchantbag_max_level max.%;\&lt;br /&gt;
        /if ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 6%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 125) &amp;amp; (identify_level &amp;lt; 124)) \&lt;br /&gt;
;DEBUG don't actually know what the level would do if a lord enchanted a hero&lt;br /&gt;
;DEBUG bow, this is a guess.  Also wouldn't know why you'd want to do a thing&lt;br /&gt;
;DEBUG like that&lt;br /&gt;
                /set enchantbag_level_increment 5%;\&lt;br /&gt;
        /elseif ((enchantbag_enchanter_level == 51) &amp;amp; (identify_level &amp;lt; 50)) \&lt;br /&gt;
                /set enchantbag_level_increment 2%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /set enchantbag_level_increment 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: The level will increase by %enchantbag_level_increment per enchant.%;\&lt;br /&gt;
        /let id_total_hr=0%;\&lt;br /&gt;
        /let id_max_hr=0%;\&lt;br /&gt;
        /let bow_cur_stats=%;\&lt;br /&gt;
        /let bow_cur_hr=0%;\&lt;br /&gt;
        /let bow_spare_hr=0%;\&lt;br /&gt;
        /let possible_enchants=0%;\&lt;br /&gt;
        /let id_total_hr $[identify_hr+identify_enchant_weapon]%;\&lt;br /&gt;
        /let bow_cur_stats $[enchantbag_get_stats(identify_object)]%;\&lt;br /&gt;
        /if (bow_cur_stats =~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /verbose -o%{verbosity_enchantbag} -l3 - -aCyellow %%% /%0: We don't know if %identify_object is in our gear.%;\&lt;br /&gt;
                /set enchantbag_item_known 0%;\&lt;br /&gt;
                /return 1%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test regmatch(&amp;quot;([0-9]+)hr \*([0-9]+)?(hr)?$$&amp;quot;, damgear_stats)%;\&lt;br /&gt;
        /let bow_cur_hr %{P1}%;\&lt;br /&gt;
        /let bow_spare_hr %{P2}%;\&lt;br /&gt;
        /if (!bow_spare_hr) \&lt;br /&gt;
                /let bow_spare_hr $[bow_cur_hr - enchantbag_bow_spare_range + 1]%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /test possible_enchants:=enchantbag_possible_enchants()%;\&lt;br /&gt;
        /let id_max_hr $[id_total_hr + (possible_enchants * 3)]%;\&lt;br /&gt;
        /set enchantbag_upgrade $[id_total_hr &amp;gt; bow_cur_hr]%;\&lt;br /&gt;
        /set enchantbag_possible_upgrade $[possible_enchants &amp;amp; (id_max_hr &amp;gt; bow_cur_hr)] %;\&lt;br /&gt;
        /set enchantbag_possible_spare $[possible_enchants &amp;amp; (id_max_hr &amp;gt;= bow_spare_hr)] %;\&lt;br /&gt;
        /set enchantbag_spare $[id_total_hr &amp;gt;= bow_spare_hr]%;\&lt;br /&gt;
        /set enchantbag_item_known 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%% /%0: We have a %{bow_cur_hr}hr bow in our gear%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: New item has %{id_total_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCmagenta %%% /%0: So we could make the total hr %{id_max_hr}hr%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: upgrade is %enchantbag_upgrade, possible_upgrade is %enchantbag_possible_upgrade%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aBCblue %%% /%0: spare is %enchantbag_spare, possible_spare is %enchantbag_possible_spare&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_get_stats = \&lt;br /&gt;
        /if (enchantbag_wear_level == 51) \&lt;br /&gt;
                /let var_mid hero%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level == 125) \&lt;br /&gt;
                /let var_mid lord%;\&lt;br /&gt;
        /elseif (enchantbag_wear_level &amp;lt;= 50) \&lt;br /&gt;
                /let var_mid lowmort%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let var_right=%*%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
        /test var_right:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_right)%;\&lt;br /&gt;
        /test var_right:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_right)%;\&lt;br /&gt;
        /let varname enchantbag_%{var_mid}_%{var_right}%;\&lt;br /&gt;
        /eval /verbose -o%{verbosity_enchantbag} -l3 - -aCred %%%% /%0: Stats we have on file for %identify_object is %%{%{varname}}%;\&lt;br /&gt;
        /eval /return &amp;quot;%%{%{varname}}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_possible_enchants = \&lt;br /&gt;
        /let pos_ench=0%;\&lt;br /&gt;
        /let counter %{identify_level}%;\&lt;br /&gt;
        /while (counter &amp;lt; enchantbag_wear_level - 1) \&lt;br /&gt;
                /if (counter + enchantbag_level_increment &amp;lt;= enchantbag_max_level) \&lt;br /&gt;
                        /test ++pos_ench%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /test counter+=enchantbag_level_increment%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /if (enchantbag_enchanter_level == enchantbag_wear_level) \&lt;br /&gt;
                /test pos_ench+=$[enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment))]%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /test pos_ench+=$[(enchantbag_max_level-(identify_level+(pos_ench*enchantbag_level_increment)))/enchantbag_level_increment]%;\  &lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /if (pos_ench &amp;lt; 0) /let pos_ench 0%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l3 - -aCmagenta %%% /%0: We could enchant %pos_ench more times%;\&lt;br /&gt;
        /return %{pos_ench}&lt;br /&gt;
&lt;br /&gt;
/def -i enchantbag_exit = \&lt;br /&gt;
        /let _post %enchantbag_post%;\&lt;br /&gt;
        /config_restore -senchantbag blind%;\&lt;br /&gt;
        /config_restore -senchantbag combine%;\&lt;br /&gt;
        /config_restore -senchantbag condition%;\&lt;br /&gt;
        /config_restore -senchantbag nosummon%;\&lt;br /&gt;
        /config_restore -senchantbag notake%;\&lt;br /&gt;
        /config_restore -senchantbag nodisturb%;\&lt;br /&gt;
        /config_rmset enchantbag%;\&lt;br /&gt;
        /filter_restore -senchantbag spellother%;\&lt;br /&gt;
        /filter_rmset enchantbag%;\&lt;br /&gt;
        /unset enchantbag%;\&lt;br /&gt;
        /unset enchantbag_name%;\&lt;br /&gt;
        /unset enchantbag_name_check%;\&lt;br /&gt;
        /unset enchantbag_inv%;\&lt;br /&gt;
        /unset enchantbag_inv_name%;\&lt;br /&gt;
        /unset enchantbag_level_increment%;\&lt;br /&gt;
        /unset enchantbag_enchant_count%;\&lt;br /&gt;
        /unset enchantbag_max_level%;\&lt;br /&gt;
        /unset enchantbag_fade%;\&lt;br /&gt;
        /unset enchantbag_shimmer%;\&lt;br /&gt;
        /unset enchantbag_brill%;\&lt;br /&gt;
        /unset enchantbag_vape%;\&lt;br /&gt;
        /unset enchantbag_item_known%;\&lt;br /&gt;
        /unset enchantbag_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_upgrade%;\&lt;br /&gt;
        /unset enchantbag_possible_spare%;\&lt;br /&gt;
        /unset enchantbag_spare%;\&lt;br /&gt;
        /unset enchantbag_post%;\&lt;br /&gt;
        /unset enchantbag_enchanter_level%;\&lt;br /&gt;
        /unset enchantbag_wear_level%;\&lt;br /&gt;
        /set enchantbag_exit %1%;\&lt;br /&gt;
        /verbose -o%{verbosity_enchantbag} -l1 - -aCcyan %%% /%0 reports: We're finished.  Post command is: %{_post}%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 /repeat -0.3 1 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Label.tf&amp;diff=33742</id>
		<title>Label.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Label.tf&amp;diff=33742"/>
		<updated>2008-11-08T09:35:08Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Adds -s0 to the /eval we do on exit, no substitution needed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To see the results without actually labeling just use &amp;quot;/label &amp;amp;lt;item&amp;amp;gt;&amp;quot; while not standing at Edmuntrillion the ent.  When you're confident, go to the ent and do something like &amp;quot;remove all.acitem&amp;quot; and &amp;quot;/for c 1 16 /label %c.acitem&amp;quot;  ;)&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
New version:&lt;br /&gt;
* kinda supports treasure/light&lt;br /&gt;
* produces less spam in the room, it uses a get instead of a say to grab the keyword&lt;br /&gt;
* implements a -x&amp;lt;command on exit&amp;gt; option much like the identify script to make it useful for other scripts.&lt;br /&gt;
* fixes a minor bug, hr/dr enchants didn't make it into the label if the item was 0/0 by itself.  Now it'll just add hr/dr no matter what.  Also, draw strength shows up in the label.&lt;br /&gt;
* identify now uses prompt_exe to get rid of the /repeat... meaning identify lag doesn't matter anymore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use this script you'll need [[verbose.tf]], [[identify.tf]] and [[prompt.tf]].  The identify script tries to use [[regen.tf]] if you're out of mana, but you dont really need that for the label stuff.  You should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/label.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}identify.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /label &amp;lt;item&amp;gt;         Label item&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute command after label&lt;br /&gt;
&lt;br /&gt;
;Current label format:&lt;br /&gt;
;&lt;br /&gt;
;armor:       l&amp;lt;level&amp;gt; b&amp;lt;base&amp;gt; [&amp;lt;enchant&amp;gt;] [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;weapon:      l&amp;lt;level&amp;gt; &amp;lt;min&amp;gt;-&amp;lt;avg&amp;gt;-&amp;lt;max&amp;gt; &amp;lt;hr&amp;gt;/&amp;lt;dr&amp;gt; w&amp;lt;weight&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;bow:         l&amp;lt;level&amp;gt; &amp;lt;min&amp;gt;-&amp;lt;avg&amp;gt;-&amp;lt;max&amp;gt; [ds&amp;lt;drawstrength&amp;gt;] &amp;lt;hr&amp;gt;hr [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;container:   l&amp;lt;level&amp;gt; c&amp;lt;capacity&amp;gt; w&amp;lt;weight&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;light:       l&amp;lt;level&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;treasure     l&amp;lt;level&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 label&lt;br /&gt;
&lt;br /&gt;
/def -i label = \&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set label_post %{opt_x}%;\&lt;br /&gt;
        /verbose -o%{verbosity_label} -l1 - -aCcyan %%% /%0: Labeling.  Post command is %{label_post}%;\&lt;br /&gt;
        /identify -e&amp;quot;get %1labeleok&amp;quot; -x/label_identify_done %1&lt;br /&gt;
&lt;br /&gt;
;Setting global variable identify_grab to make /label work in loops&lt;br /&gt;
;That's ok because the last identify comes after this trigger and sets&lt;br /&gt;
;  identify_grab to 0 anyways.&lt;br /&gt;
/def -i -p900 -F -mregexp -t&amp;quot;^I see no ([^ ]+)labeleok here.$&amp;quot; label_keyword = \&lt;br /&gt;
        /set identify_grab 1%;\&lt;br /&gt;
        /set label_keyword %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_label} -l2 - -aCyellow %%% /%0: Got keyword, %{label_keyword}&lt;br /&gt;
&lt;br /&gt;
/def -i label_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_label} -l2 - -aCyellow %%% /%0: Compiling label string and labeling.%;\&lt;br /&gt;
        /let label_string=%;\&lt;br /&gt;
        /let _post=%{label_post}%;\&lt;br /&gt;
        /if (regmatch (&amp;quot;armor|weapon|bow|container|light|treasure&amp;quot;, identify_type))\&lt;br /&gt;
                /let label_string l%{identify_level}%;\&lt;br /&gt;
                /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} b%{identify_armor_class}%;\&lt;br /&gt;
                        /if (identify_enchant_armor &amp;lt; 0) \&lt;br /&gt;
                                /let label_string %{label_string} %{identify_enchant_armor}%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} %{identify_dam_min}-%{identify_dam_avg}-%{identify_dam_max}%;\&lt;br /&gt;
                        /let label_string %{label_string} $[identify_hr+identify_enchant_weapon]/$[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
                        /let label_string %{label_string} w%{identify_weight}%;\&lt;br /&gt;
                /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} %{identify_dam_min}-%{identify_dam_avg}-%{identify_dam_max}%;\&lt;br /&gt;
                        /if (identify_draw_strength !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                                /let label_string %{label_string} ds%{identify_draw_strength}%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                        /let label_string %{label_string} $[identify_hr+identify_enchant_bow]hr%;\&lt;br /&gt;
                /elseif (identify_type =~ &amp;quot;container&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} c%{identify_capacity}%;\&lt;br /&gt;
                        /let label_string %{label_string} w%{identify_weight}%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /if (identify_etch !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} %{identify_etch}%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /verbose -o%{verbosity_label} -l1 - -aCcyan %%% /%0: Labeling %{label_keyword} %{label_string}%;\&lt;br /&gt;
                label %{label_keyword} %{label_string}%;\&lt;br /&gt;
        /else /verbose -o%{verbosity_label} -l1 - -aCcyan %%% /%0: I have no idea how to label %{label_keyword} of type %{identify_type}, sorry.%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /unset label_post%;\&lt;br /&gt;
        /unset label_keyword%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Label.tf&amp;diff=33741</id>
		<title>Label.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Label.tf&amp;diff=33741"/>
		<updated>2008-11-08T09:31:42Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Cleaning till it shines...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To see the results without actually labeling just use &amp;quot;/label &amp;amp;lt;item&amp;amp;gt;&amp;quot; while not standing at Edmuntrillion the ent.  When you're confident, go to the ent and do something like &amp;quot;remove all.acitem&amp;quot; and &amp;quot;/for c 1 16 /label %c.acitem&amp;quot;  ;)&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
New version:&lt;br /&gt;
* kinda supports treasure/light&lt;br /&gt;
* produces less spam in the room, it uses a get instead of a say to grab the keyword&lt;br /&gt;
* implements a -x&amp;lt;command on exit&amp;gt; option much like the identify script to make it useful for other scripts.&lt;br /&gt;
* fixes a minor bug, hr/dr enchants didn't make it into the label if the item was 0/0 by itself.  Now it'll just add hr/dr no matter what.  Also, draw strength shows up in the label.&lt;br /&gt;
* identify now uses prompt_exe to get rid of the /repeat... meaning identify lag doesn't matter anymore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use this script you'll need [[verbose.tf]], [[identify.tf]] and [[prompt.tf]].  The identify script tries to use [[regen.tf]] if you're out of mana, but you dont really need that for the label stuff.  You should have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/label.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}identify.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /label &amp;lt;item&amp;gt;         Label item&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute command after label&lt;br /&gt;
&lt;br /&gt;
;Current label format:&lt;br /&gt;
;&lt;br /&gt;
;armor:       l&amp;lt;level&amp;gt; b&amp;lt;base&amp;gt; [&amp;lt;enchant&amp;gt;] [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;weapon:      l&amp;lt;level&amp;gt; &amp;lt;min&amp;gt;-&amp;lt;avg&amp;gt;-&amp;lt;max&amp;gt; &amp;lt;hr&amp;gt;/&amp;lt;dr&amp;gt; w&amp;lt;weight&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;bow:         l&amp;lt;level&amp;gt; &amp;lt;min&amp;gt;-&amp;lt;avg&amp;gt;-&amp;lt;max&amp;gt; [ds&amp;lt;drawstrength&amp;gt;] &amp;lt;hr&amp;gt;hr [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;container:   l&amp;lt;level&amp;gt; c&amp;lt;capacity&amp;gt; w&amp;lt;weight&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;light:       l&amp;lt;level&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
;treasure     l&amp;lt;level&amp;gt; [&amp;lt;etch&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 label&lt;br /&gt;
&lt;br /&gt;
/def -i label = \&lt;br /&gt;
        /if (!getopts(&amp;quot;x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set label_post %{opt_x}%;\&lt;br /&gt;
        /verbose -o%{verbosity_label} -l1 - -aCcyan %%% /%0: Labeling.  Post command is %{label_post}%;\&lt;br /&gt;
        /identify -e&amp;quot;get %1labeleok&amp;quot; -x/label_identify_done %1&lt;br /&gt;
&lt;br /&gt;
;Setting global variable identify_grab to make /label work in loops&lt;br /&gt;
;That's ok because the last identify comes after this trigger and sets&lt;br /&gt;
;  identify_grab to 0 anyways.&lt;br /&gt;
/def -i -p900 -F -mregexp -t&amp;quot;^I see no ([^ ]+)labeleok here.$&amp;quot; label_keyword = \&lt;br /&gt;
        /set identify_grab 1%;\&lt;br /&gt;
        /set label_keyword %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_label} -l2 - -aCyellow %%% /%0: Got keyword, %{label_keyword}&lt;br /&gt;
&lt;br /&gt;
/def -i label_identify_done = \&lt;br /&gt;
        /verbose -o%{verbosity_label} -l2 - -aCyellow %%% /%0: Compiling label string and labeling.%;\&lt;br /&gt;
        /let label_string=%;\&lt;br /&gt;
        /let _post=%{label_post}%;\&lt;br /&gt;
        /if (regmatch (&amp;quot;armor|weapon|bow|container|light|treasure&amp;quot;, identify_type))\&lt;br /&gt;
                /let label_string l%{identify_level}%;\&lt;br /&gt;
                /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} b%{identify_armor_class}%;\&lt;br /&gt;
                        /if (identify_enchant_armor &amp;lt; 0) \&lt;br /&gt;
                                /let label_string %{label_string} %{identify_enchant_armor}%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /elseif (identify_type =~ &amp;quot;weapon&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} %{identify_dam_min}-%{identify_dam_avg}-%{identify_dam_max}%;\&lt;br /&gt;
                        /let label_string %{label_string} $[identify_hr+identify_enchant_weapon]/$[identify_dr+identify_enchant_weapon]%;\&lt;br /&gt;
                        /let label_string %{label_string} w%{identify_weight}%;\&lt;br /&gt;
                /elseif (identify_type =~ &amp;quot;bow&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} %{identify_dam_min}-%{identify_dam_avg}-%{identify_dam_max}%;\&lt;br /&gt;
                        /if (identify_draw_strength !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                                /let label_string %{label_string} ds%{identify_draw_strength}%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                        /let label_string %{label_string} $[identify_hr+identify_enchant_bow]hr%;\&lt;br /&gt;
                /elseif (identify_type =~ &amp;quot;container&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} c%{identify_capacity}%;\&lt;br /&gt;
                        /let label_string %{label_string} w%{identify_weight}%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /if (identify_etch !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                        /let label_string %{label_string} %{identify_etch}%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
                /verbose -o%{verbosity_label} -l1 - -aCcyan %%% /%0: Labeling %{label_keyword} %{label_string}%;\&lt;br /&gt;
                label %{label_keyword} %{label_string}%;\&lt;br /&gt;
        /else /verbose -o%{verbosity_label} -l1 - -aCcyan %%% /%0: I have no idea how to label %{label_keyword} of type %{identify_type}, sorry.%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /unset label_post%;\&lt;br /&gt;
        /unset label_keyword%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval %{_post}%; /endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Identify.tf&amp;diff=33740</id>
		<title>Identify.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Identify.tf&amp;diff=33740"/>
		<updated>2008-11-08T09:18:54Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: Mod: summary&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This identify script was mostly cut from the old label script, to make it useful for other things than just labeling.  The script identifies an item and grabs some info.  You can use -e&amp;lt;command&amp;gt; to specify a command that should run before the identify, which is useful if you'd expect to loop the identify.  See [[label.tf]].&lt;br /&gt;
&lt;br /&gt;
You can use -x&amp;lt;command&amp;gt; to specify a command that should run when all the info grabbing triggers had a chance to do their job.  This is useful for other scripts, again see [[label.tf]].&lt;br /&gt;
&lt;br /&gt;
It also tries to look up the multiplier for the armor class of the slot where its worn at, like 3.50 for a shield.  It does this by converting the object keyword to a variable name.  See the list at the bottom of the script.  I currently use the values with armor opt.  The list is complete only as far as I've used it.&lt;br /&gt;
&lt;br /&gt;
You can see which info it grabs by looking at identify_init, at its triggers, or by typing &amp;quot;/listvar identify*&amp;quot;.  I've only added identify lines I've been using.&lt;br /&gt;
&lt;br /&gt;
To use it in a script I have TINYPREFIX set in my config file, pointing at the directory with my tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
and load it with this line in the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;/eval /require -q %{TINYPREFIX}identify.tf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Identify uses [[verbose.tf]], [[regen.tf]] and [[prompt.tf]] so you'll need those as well if you want to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;DEBUG indefinately incomplete identify_armor_multiplier_ variable list&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/identify.tf&lt;br /&gt;
&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}regen.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
/echo -aCyellow %% /identify &amp;lt;item&amp;gt;      Identify item and grab info&lt;br /&gt;
/echo -aCyellow %%     [-e&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; before identify&lt;br /&gt;
/echo -aCyellow %%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit&lt;br /&gt;
/echo -aCyellow %% /id [-x] [-e] &amp;lt;item&amp;gt;      short version of /identify ;)&lt;br /&gt;
&lt;br /&gt;
;When identify's finished it sets an exit code&lt;br /&gt;
; 0         finished correctly&lt;br /&gt;
; no_item   couldn't find item&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 identify&lt;br /&gt;
&lt;br /&gt;
;When the identify is finished it will set global var identify_exit to&lt;br /&gt;
;0              identify script exit normally&lt;br /&gt;
;no_item        couldn't find your item to identify&lt;br /&gt;
&lt;br /&gt;
;do NOT set identify_post here&lt;br /&gt;
/def -i identify_init = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0 initializing .... %;\&lt;br /&gt;
        /set identify_pre=%;\&lt;br /&gt;
        /set identify_object=%;\&lt;br /&gt;
        /set identify_type=%;\&lt;br /&gt;
        /set identify_flags=%;\&lt;br /&gt;
        /set identify_etch=%;\&lt;br /&gt;
        /set identify_weight=%;\&lt;br /&gt;
        /set identify_value=%;\&lt;br /&gt;
        /set identify_level=%;\&lt;br /&gt;
        /set identify_type=%;\&lt;br /&gt;
        /set identify_enchant_armor=%;\&lt;br /&gt;
        /set identify_enchant_weapon=%;\&lt;br /&gt;
        /set identify_enchant_bow=%;\&lt;br /&gt;
        /set identify_armor_class=%;\&lt;br /&gt;
        /set identify_armor_multiplier=%;\&lt;br /&gt;
        /set identify_dam_min=%;\&lt;br /&gt;
        /set identify_dam_max=%;\&lt;br /&gt;
        /set identify_dam_avg=%;\&lt;br /&gt;
        /set identify_hr=%;\&lt;br /&gt;
        /set identify_dr=%;\&lt;br /&gt;
        /set identify_draw_strength=%;\&lt;br /&gt;
        /set identify_capacity=%;\&lt;br /&gt;
        /set identify_flametongue=%;\&lt;br /&gt;
        /set identify_lightning=%;\&lt;br /&gt;
        /set identify_exit=&lt;br /&gt;
&lt;br /&gt;
/identify_init&lt;br /&gt;
&lt;br /&gt;
/def -i id = /identify %*&lt;br /&gt;
&lt;br /&gt;
/def -i identify = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l1 - -aCcyan %%% /%0: Identifying and grabbing info.%;\&lt;br /&gt;
        /set identify_call /%0 %*%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Identify was called as:  %identify_call%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;e:x:&amp;quot;, &amp;quot;&amp;quot;)) /return 0%; /endif%; \&lt;br /&gt;
        /set identify_pre %{opt_e}%;\&lt;br /&gt;
        /set identify_post %{opt_x}%;\&lt;br /&gt;
        /set identify_grab 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: identify_pre is %identify_pre.  identify_post is %identify_post.%;\&lt;br /&gt;
        /if (identify_pre !~ &amp;quot;&amp;quot;) /eval -s0 %identify_pre %;/endif%;\&lt;br /&gt;
        c identify %1&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -t&amp;quot;You are not carrying .+!&amp;quot; identify_no_item = \&lt;br /&gt;
        /identify_exit no_item%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Not carrying that, exit no_item.  Post command is %identify_post%;\&lt;br /&gt;
        /if (identify_post !~ &amp;quot;&amp;quot;) /eval %{identify_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -t&amp;quot;You failed your identify due to lack of concentration!&amp;quot; identify_failed = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Retrying.....%;\&lt;br /&gt;
        /eval -s0 %{identify_call}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -t&amp;quot;You do not have enough mana to cast identify.&amp;quot; identify_no_mana = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% Yikes!  Out of mana.  Calling regen script and retrying.%;\&lt;br /&gt;
        /regen -x'%{identify_call}'&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Object '(.+)' type ([^ ]+), extra flags (.+).$&amp;quot; identify_object = \&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l2 - -aCyellow %%% /%0: Grabbing.....  Post command is %identify_post%;\&lt;br /&gt;
        /identify_init%;\&lt;br /&gt;
        /set identify_object %{P1}%;\&lt;br /&gt;
        /set identify_type %{P2}%;\&lt;br /&gt;
        /set identify_flags %{P3}%;\&lt;br /&gt;
        /if (regmatch(&amp;quot;etched&amp;quot;, identify_flags)) \&lt;br /&gt;
                /test regmatch(&amp;quot;(.+) ([^ ]+)$$&amp;quot;, identify_object)%;\&lt;br /&gt;
                /set identify_object %{P1}%;\&lt;br /&gt;
                /set identify_etch %{P2}%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Object is %identify_object, type is %identify_type, etch is %identify_etch%;\ &lt;br /&gt;
        /set prompt_exe identify&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p991 -mglob -h'send PROMPT_EXE identify' identify_PROMPT_EXE = \&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /identify_exit 0&lt;br /&gt;
&lt;br /&gt;
/def -i identify_exit = \&lt;br /&gt;
        /let post %{identify_post}%;\&lt;br /&gt;
        /set identify_grab 0%;\&lt;br /&gt;
        /set identify_pre=%;\&lt;br /&gt;
        /set identify_exit %1%;\&lt;br /&gt;
        /if (identify_type =~ &amp;quot;armor&amp;quot;) \&lt;br /&gt;
                /let var_postfix=%{identify_object}%;\&lt;br /&gt;
;DEBUG are there any weird characters in the keywords&lt;br /&gt;
;DEBUG other than the ' in the archer's gauntlet..?&lt;br /&gt;
                /test var_postfix:=replace(&amp;quot;'&amp;quot;, &amp;quot;&amp;quot;, var_postfix)%;\&lt;br /&gt;
                /test var_postfix:=replace(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;, var_postfix)%;\&lt;br /&gt;
                /eval /set identify_armor_multiplier %%{identify_armor_multiplier_%{var_postfix}}%;\&lt;br /&gt;
                /if (identify_armor_multiplier &amp;gt; 0) /verbose -o%{verbosity_identify} -l1 - -aCcyan %%% /%0: Known armor.  Its base multiplier is %identify_armor_multiplier%;/endif%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Exit code: %{identify_exit}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l1 - -aCyellow %%% /%0: Finishing up.  Post command is %identify_post%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Weight ([0-9]+), value ([0-9]+), level ([0-9]+).$&amp;quot; identify_level = \&lt;br /&gt;
        /set identify_weight %{P1}%;\&lt;br /&gt;
        /set identify_value %{P2}%;\&lt;br /&gt;
        /set identify_level %{P3}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Weight %identify_weight, Value %identify_value, Level %identify_level.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Armor class is ([0-9]+).&amp;quot; identify_armor_class = \&lt;br /&gt;
        /set identify_armor_class %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Armor class is %identify_armor_class.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Damage is ([0-9]+) to ([0-9]+) \(average ([0-9]+)\).$&amp;quot; identify_dam = \&lt;br /&gt;
        /set identify_dam_min %{P1}%;\&lt;br /&gt;
        /set identify_dam_max %{P2}%;\&lt;br /&gt;
        /set identify_dam_avg %{P3}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Damage, minimum: %identify_dam_min, average: %identify_dam_avg, maximum: %identify_dam_max&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^'enchant armor  'Modifies armor class by (-[0-9]+) continuous.$&amp;quot; identify_enchant_armor = \&lt;br /&gt;
        /set identify_enchant_armor %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Enchanted armor, by %identify_enchant_armor continuous.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^ Modifies damage roll by (-?[0-9]+) continuous.$&amp;quot; identify_dr = \&lt;br /&gt;
        /set identify_dr %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: It has a dr mod, %identify_dr continuous.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^ Modifies hit roll by (-?[0-9]+) continuous.$&amp;quot; identify_hr = \&lt;br /&gt;
        /set identify_hr %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: It has a hr mod, %identify_dr.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^'enchant weapon 'Modifies damage roll by ([0-9]+) continuous.$&amp;quot; identify_enchant_weapon = \&lt;br /&gt;
        /set identify_enchant_weapon %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Enchanted weapon, enchanted %identify_enchant_weapon/%identify_enchant_weapon.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^'enchant bow    'Modifies hit roll by ([0-9]+) continuous.$&amp;quot; identify_enchant_bow = \&lt;br /&gt;
        /set identify_enchant_bow %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: Enchanted bow, enchanted %identify_enchant_bow.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Draw strength is ([0-9]+).$&amp;quot; identify_draw_strength = \&lt;br /&gt;
        /set identify_draw_strength %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This bow's draw strength is %identify_draw_strength&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^Capacity is ([0-9]+) lbs.$&amp;quot; identify_capacity = \&lt;br /&gt;
        /set identify_capacity %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This container has a capacity of %identify_capacity lbs.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^It has ([0-9]+) charges of flametongue.$&amp;quot; identify_flametongue = \&lt;br /&gt;
        /set identify_flametongue %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This shield has %identify_flametongue charges of flametongue.&lt;br /&gt;
&lt;br /&gt;
/def -i -E(identify_grab) -p900 -F -mregexp -t&amp;quot;^It has ([0-9]+) charges of arc lightning.$&amp;quot; identify_lightning = \&lt;br /&gt;
        /set identify_lightning %{P1}%;\&lt;br /&gt;
        /verbose -o%{verbosity_identify} -l3 - -aCyellow %%% /%0: This shield has %identify_lightning charges arc lightning.&lt;br /&gt;
&lt;br /&gt;
;To add values, create a line like these below.  The recipe for the variable&lt;br /&gt;
;name is: identify an object, take the 'object', remove all weird characters,&lt;br /&gt;
;then change spaces to underscores, prefix identify_armor_multiplier_ .&lt;br /&gt;
;Kinda clumsy but a quick hack and i don't expect to enchant hundreds of&lt;br /&gt;
;different items or something ;)&lt;br /&gt;
/set identify_armor_multiplier_Antharian_Signet_ring                  1.00&lt;br /&gt;
/set identify_armor_multiplier_carved_bone_necklace                   1.00&lt;br /&gt;
/set identify_armor_multiplier_embroidered_breastplate_silk           3.50&lt;br /&gt;
/set identify_armor_multiplier_teardrop_helmet                        1.25&lt;br /&gt;
/set identify_armor_multiplier_crown_smoldering                       1.25&lt;br /&gt;
/set identify_armor_multiplier_heroic_dragonscale_dragon_scale_skirt  1.25&lt;br /&gt;
/set identify_armor_multiplier_fatewalkers_mystical_sandals           1.00&lt;br /&gt;
/set identify_armor_multiplier_single_silver_archers_gauntlet         1.00&lt;br /&gt;
/set identify_armor_multiplier_steel_bracers                          1.25&lt;br /&gt;
/set identify_armor_multiplier_hero_heroes_shield                     3.50&lt;br /&gt;
/set identify_armor_multiplier_shroud_cloth_unholy                    2.25&lt;br /&gt;
/set identify_armor_multiplier_collar_steel_chained                   1.25&lt;br /&gt;
/set identify_armor_multiplier_orosca_enchanted_wrist_guard           1.10&lt;br /&gt;
/set identify_armor_multiplier_lemans_family_seal_talisman            1.00&lt;br /&gt;
/set identify_armor_multiplier_mother_pearl                           1.00&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Config.tf&amp;diff=33738</id>
		<title>Config.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Config.tf&amp;diff=33738"/>
		<updated>2008-11-07T19:48:23Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: cleaning up i found (and fixed) a bug in config_rmset and filter_rmset&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A script to store mud side configuration and filter options into variables and restore them later.  It also allows you to set defaults and restore them with &amp;quot;/config_restore all&amp;quot;  For more information, read the comments in the first 100 lines.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[verbose.tf]] so you'll want those if you want to use this script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
&lt;br /&gt;
/loaded __SULFAR__/config.tf&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
;Scripts can use this script to store configuration and filter options from&lt;br /&gt;
;  Avatar into variables.  Example for a call from myscript&lt;br /&gt;
;&lt;br /&gt;
;       /config_store -smyscript -x/myscript_config_done&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_config_done = \&lt;br /&gt;
;       config +notake%;\&lt;br /&gt;
;       config +nosummon%;\&lt;br /&gt;
;       /myscript_continues&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_exit = \&lt;br /&gt;
;       /config_restore -smyscript notake%;\&lt;br /&gt;
;       /config_restore -smyscript nosummon%;\&lt;br /&gt;
;       /config_rmset myscript&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /config_store         Stores mud configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore &amp;lt;option&amp;gt; Restore config &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore all   Restore all config options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_rmset &amp;lt;set&amp;gt;   Remove config &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
/def -i filter_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /filter_store         Stores mud filter configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore &amp;lt;option&amp;gt; Restore filter &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore all   Restore all filter options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_rmset &amp;lt;set&amp;gt;   Remove filter &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
;Default config.  If you interrupt a script or otherwise mess up your config&lt;br /&gt;
;  you can just use &amp;quot;/config_restore all&amp;quot;.&lt;br /&gt;
;To produce this list I used &amp;quot;/config_store&amp;quot; and &amp;quot;/listvar config_avatar*&amp;quot;.&lt;br /&gt;
/set config_avatar_autoexit=    +autoexit&lt;br /&gt;
/set config_avatar_autogold=    +autogold&lt;br /&gt;
/set config_avatar_autogroup=   +autogroup&lt;br /&gt;
/set config_avatar_autoloot=    -autoloot&lt;br /&gt;
/set config_avatar_autopull=    +autopull&lt;br /&gt;
/set config_avatar_autosac=     -autosac&lt;br /&gt;
/set config_avatar_autosplit=   +autosplit&lt;br /&gt;
/set config_avatar_autotitle=   +autotitle&lt;br /&gt;
/set config_avatar_battlenone=  -battlenone&lt;br /&gt;
/set config_avatar_battleother= -battleother&lt;br /&gt;
/set config_avatar_battleself=  -battleself&lt;br /&gt;
/set config_avatar_blank=       +blank&lt;br /&gt;
/set config_avatar_blind=       -blind&lt;br /&gt;
/set config_avatar_brief=       -brief&lt;br /&gt;
/set config_avatar_cmdcolor=    +cmdcolor&lt;br /&gt;
/set config_avatar_color=       +color&lt;br /&gt;
/set config_avatar_combine=     +combine&lt;br /&gt;
/set config_avatar_condition=   -condition&lt;br /&gt;
/set config_avatar_demonbank=   +demonbank&lt;br /&gt;
/set config_avatar_keepalive=   -keepalive&lt;br /&gt;
/set config_avatar_label=       +label&lt;br /&gt;
/set config_avatar_nobeep=      -nobeep&lt;br /&gt;
/set config_avatar_nodisturb=   -nodisturb&lt;br /&gt;
/set config_avatar_nogenesis=   -nogenesis&lt;br /&gt;
/set config_avatar_nosummon=    -nosummon&lt;br /&gt;
/set config_avatar_notake=      -notake&lt;br /&gt;
/set config_avatar_prompt=      +prompt&lt;br /&gt;
/set config_avatar_prompt2=     +prompt2&lt;br /&gt;
/set config_avatar_scoreaff=    -scoreaff&lt;br /&gt;
/set config_avatar_telnetga=    -telnetga&lt;br /&gt;
/set config_avatar_list= autoexit autoloot autogold autogroup autopull \&lt;br /&gt;
        autosplit autosac autotitle battleother battleself battlenone blank blind \&lt;br /&gt;
        brief color cmdcolor combine condition demonbank keepalive nobeep \&lt;br /&gt;
        nogenesis nosummon notake nodisturb label prompt prompt2 scoreaff telnetga&lt;br /&gt;
/eval /set config_set_list $(/unique %{config_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Default filter, for /filter_restore all&lt;br /&gt;
/set filter_avatar_objectother=0&lt;br /&gt;
/set filter_avatar_roomindiv=0&lt;br /&gt;
/set filter_avatar_roomtotal=1&lt;br /&gt;
/set filter_avatar_spellother=0&lt;br /&gt;
/set filter_avatar_walkother=0&lt;br /&gt;
/set filter_avatar_list= walkother roomindiv roomtotal spellother objectother&lt;br /&gt;
/eval /set filter_set_list $(/unique %{filter_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 config&lt;br /&gt;
&lt;br /&gt;
/config_usage&lt;br /&gt;
/filter_usage&lt;br /&gt;
&lt;br /&gt;
/def -i config_store = \&lt;br /&gt;
        /set config_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set config_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set config_post %{opt_x}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list=%;\&lt;br /&gt;
        /set config_set_list $(/unique %{config_set_list} %{config_set})%;\&lt;br /&gt;
        /set config_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing configuration, storing in set %config_set%;\&lt;br /&gt;
        config&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -t&amp;quot;\[ Keyword    \] Option&amp;quot; config_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of configuration list%;\&lt;br /&gt;
        /set prompt_exe config_store&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -mregexp -t&amp;quot;^\[(-|\+)([a-zA-Z0-9]+) *\] .+\.$&amp;quot; config_option = \&lt;br /&gt;
        /let _sign %{P1}%;\&lt;br /&gt;
        /let _option $[tolower({P2})]%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got config option: %{_option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list %%{config_%{config_set}_list} %%{_option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_%{_option} %{_sign}%{_option}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -p991 -mglob -h'send PROMPT_EXE config_store' config_prompt_exe = \&lt;br /&gt;
        /let _post %{config_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset config_store%;\&lt;br /&gt;
        /unset config_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored configuration in set %{config_set}, executing %{_post}%;\&lt;br /&gt;
        /unset config_set%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_restore = \&lt;br /&gt;
        /let _set=avatar%;\&lt;br /&gt;
        /set config_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /let _set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \ &lt;br /&gt;
                /if (!regmatch(&amp;quot;autoexit&amp;quot;, config_%{_set}_autoexit)) \&lt;br /&gt;
                        /set config_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /let _option %1%;\&lt;br /&gt;
        /if (config_noset) \&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% /%0: No configuration set %{_set} stored!%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
        /elseif (_option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /config_restore %%{config_%{_set}_list}%;\&lt;br /&gt;
        /elseif (_option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval config %%{config_%{_set}_%{_option}}%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /config_usage%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Option %{_option} restored using set %{_set}%;\&lt;br /&gt;
        /unset config_noset&lt;br /&gt;
&lt;br /&gt;
/def -i config_rmset = \&lt;br /&gt;
        /let _set %*%;\&lt;br /&gt;
        /if (_set =~ &amp;quot;&amp;quot;) /let _set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{config_%{_set}_list}%;\&lt;br /&gt;
        /let _length $(/length %{rmset_options})%;\&lt;br /&gt;
        /let _counter=1%;\&lt;br /&gt;
        /while (_counter &amp;lt;= _length) \&lt;br /&gt;
                /unset config_%{_set}_$(/nth %{_counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set config_set_list $(/remove %{_set} %{config_set_list})%;\&lt;br /&gt;
        /unset config_%{_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (config_set_list =~ &amp;quot;&amp;quot;) /unset config_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Configuration set %{_set} removed.&lt;br /&gt;
&lt;br /&gt;
; Same for filter&lt;br /&gt;
&lt;br /&gt;
/def -i filter_store = \&lt;br /&gt;
        /set filter_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set filter_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set filter_post %{opt_x}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list=%;\&lt;br /&gt;
        /set filter_set_list $(/unique %{filter_set_list} %{filter_set})%;\&lt;br /&gt;
        /set filter_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing filters, storing in set %filter_set%;\&lt;br /&gt;
        filter&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -t&amp;quot;Filter Type           Status&amp;quot; filter_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of filter list%;\&lt;br /&gt;
        /set prompt_exe filter_store&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -mregexp -t&amp;quot;^([A-Z]+).+(ON|off)&amp;quot; filter_option = \&lt;br /&gt;
        /let _option $[tolower({P1})]%;\&lt;br /&gt;
        /let _sign %{P2}%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got filter: %{_option}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list %%{filter_%{filter_set}_list} %%{_option}%;\&lt;br /&gt;
        /if (_sign =~ &amp;quot;off&amp;quot;) \&lt;br /&gt;
                /eval /set filter_%{filter_set}_%{_option} 0%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /eval /set filter_%{filter_set}_%{_option} 1%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -p991 -mglob -h'send PROMPT_EXE filter_store' filter_prompt_exe = \&lt;br /&gt;
        /let _post %{filter_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset filter_store%;\&lt;br /&gt;
        /unset filter_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored filters in set %{filter_set}, executing %{post}%;\&lt;br /&gt;
        /unset filter_set%;\&lt;br /&gt;
        /if (_post !~ &amp;quot;&amp;quot;) /eval -s0 %{_post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i filter_restore = \&lt;br /&gt;
        /let _set=avatar%;\&lt;br /&gt;
        /set filter_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /let _set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \ &lt;br /&gt;
                /if (!regmatch(&amp;quot;0|1&amp;quot;, filter_%{_set}_objectother)) \&lt;br /&gt;
                        /set filter_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /let _option %1%;\&lt;br /&gt;
        /if (filter_noset) \&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% /%0: No filter set %{_set} stored!%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l1 - -aCred %%% %;\&lt;br /&gt;
        /elseif (_option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /filter_restore %%{filter_%{_set}_list}%;\&lt;br /&gt;
        /elseif (_option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval \ &lt;br /&gt;
                        /if (filter_%{_set}_%{_option}) \&lt;br /&gt;
                                filter +%%{_option}%%;\&lt;br /&gt;
                        /else \ &lt;br /&gt;
                                filter -%%{_option}%%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
                /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Filter %{_option} restored using set %{_set}%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /filter_usage%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /unset filter_noset&lt;br /&gt;
&lt;br /&gt;
/def -i filter_rmset = \&lt;br /&gt;
        /let _set %*%;\&lt;br /&gt;
        /if (_set =~ &amp;quot;&amp;quot;) /let _set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{filter_%{_set}_list}%;\&lt;br /&gt;
        /let _length $(/length %{rmset_options})%;\&lt;br /&gt;
        /let _counter=1%;\&lt;br /&gt;
        /while (_counter &amp;lt;= _length) \&lt;br /&gt;
                /unset filter_%{_set}_$(/nth %{_counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++_counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set filter_set_list $(/remove %{_set} %{filter_set_list})%;\&lt;br /&gt;
        /unset filter_%{_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (filter_set_list =~ &amp;quot;&amp;quot;) /unset filter_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Filter set %{_set} removed.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
	<entry>
		<id>http://govbanned.info/index.php?title=Config.tf&amp;diff=33737</id>
		<title>Config.tf</title>
		<link rel="alternate" type="text/html" href="http://govbanned.info/index.php?title=Config.tf&amp;diff=33737"/>
		<updated>2008-11-07T05:36:13Z</updated>

		<summary type="html">&lt;p&gt;Sulfar: made /config_restore all less spammy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A script to store mud side configuration and filter options into variables and restore them later.  It also allows you to set defaults and restore them with &amp;quot;/config_restore all&amp;quot;  For more information, read the comments in the first 100 lines.&lt;br /&gt;
&lt;br /&gt;
This script uses [[prompt.tf]] and [[verbose.tf]] so you'll want those if you want to use this script.  You should also have TINYPREFIX set in your config file, pointing at the directory with tf scripts like&lt;br /&gt;
&amp;lt;pre&amp;gt;/set TINYPREFIX=~/tinyfugue/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;Bug reports, suggestions and/or diffs are appreciated, '''sulfar''' _AT_ ''inbox'' +DOT+ ''com''&lt;br /&gt;
/loaded __SULFAR__/config.tf&lt;br /&gt;
&lt;br /&gt;
/require -q lisp.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}prompt.tf&lt;br /&gt;
/eval /require -q %{TINYPREFIX}verbose.tf&lt;br /&gt;
&lt;br /&gt;
;Scripts can use this script to store configuration and filter options from&lt;br /&gt;
;  Avatar into variables.  Example for a call from myscript&lt;br /&gt;
;&lt;br /&gt;
;       /config_store -smyscript -x/myscript_config_done&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_config_done = \&lt;br /&gt;
;       config +notake%;\&lt;br /&gt;
;       config +nosummon%;\&lt;br /&gt;
;       /myscript_continues&lt;br /&gt;
;&lt;br /&gt;
;/def -i myscript_exit = \&lt;br /&gt;
;       /config_restore -smyscript notake%;\&lt;br /&gt;
;       /config_restore -smyscript nosummon%;\&lt;br /&gt;
;       /config_rmset myscript&lt;br /&gt;
&lt;br /&gt;
/def -i config_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /config_store         Stores mud configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore &amp;lt;option&amp;gt; Restore config &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_restore all   Restore all config options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /config_rmset &amp;lt;set&amp;gt;   Remove config &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
/def -i filter_usage = \&lt;br /&gt;
        /echo -aCyellow %%% /filter_store         Stores mud filter configuration%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-x&amp;lt;command&amp;gt;]         execute &amp;lt;command&amp;gt; on exit%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore &amp;lt;option&amp;gt; Restore filter &amp;lt;option&amp;gt;%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_restore all   Restore all filter options from this set%;\&lt;br /&gt;
        /echo -aCyellow %%%     [-s&amp;lt;name&amp;gt;]            name for this set of options, default: avatar%;\&lt;br /&gt;
        /echo -aCyellow %%% /filter_rmset &amp;lt;set&amp;gt;   Remove filter &amp;lt;set&amp;gt; from memory&lt;br /&gt;
&lt;br /&gt;
;Default config.  If you interrupt a script or otherwise mess up your config&lt;br /&gt;
;  you can just /config_restore all&lt;br /&gt;
;To produce this list I used &amp;quot;/config_store&amp;quot; and &amp;quot;/listvar config_avatar*&amp;quot;.&lt;br /&gt;
/set config_avatar_autoexit=    +autoexit&lt;br /&gt;
/set config_avatar_autogold=    +autogold&lt;br /&gt;
/set config_avatar_autogroup=   +autogroup&lt;br /&gt;
/set config_avatar_autoloot=    -autoloot&lt;br /&gt;
/set config_avatar_autopull=    +autopull&lt;br /&gt;
/set config_avatar_autosac=     -autosac&lt;br /&gt;
/set config_avatar_autosplit=   +autosplit&lt;br /&gt;
/set config_avatar_autotitle=   +autotitle&lt;br /&gt;
/set config_avatar_battlenone=  -battlenone&lt;br /&gt;
/set config_avatar_battleother= -battleother&lt;br /&gt;
/set config_avatar_battleself=  -battleself&lt;br /&gt;
/set config_avatar_blank=       +blank&lt;br /&gt;
/set config_avatar_blind=       -blind&lt;br /&gt;
/set config_avatar_brief=       -brief&lt;br /&gt;
/set config_avatar_cmdcolor=    +cmdcolor&lt;br /&gt;
/set config_avatar_color=       +color&lt;br /&gt;
/set config_avatar_combine=     +combine&lt;br /&gt;
/set config_avatar_condition=   -condition&lt;br /&gt;
/set config_avatar_demonbank=   +demonbank&lt;br /&gt;
/set config_avatar_keepalive=   -keepalive&lt;br /&gt;
/set config_avatar_label=       +label&lt;br /&gt;
/set config_avatar_nobeep=      -nobeep&lt;br /&gt;
/set config_avatar_nodisturb=   -nodisturb&lt;br /&gt;
/set config_avatar_nogenesis=   -nogenesis&lt;br /&gt;
/set config_avatar_nosummon=    -nosummon&lt;br /&gt;
/set config_avatar_notake=      -notake&lt;br /&gt;
/set config_avatar_prompt=      +prompt&lt;br /&gt;
/set config_avatar_prompt2=     +prompt2&lt;br /&gt;
/set config_avatar_scoreaff=    -scoreaff&lt;br /&gt;
/set config_avatar_telnetga=    -telnetga&lt;br /&gt;
/set config_avatar_list= autoexit autoloot autogold autogroup autopull \&lt;br /&gt;
        autosplit autosac autotitle battleother battleself battlenone blank blind \&lt;br /&gt;
        brief color cmdcolor combine condition demonbank keepalive nobeep \&lt;br /&gt;
        nogenesis nosummon notake nodisturb label prompt prompt2 scoreaff telnetga&lt;br /&gt;
/eval /set config_set_list $(/unique %{config_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Default filter, for /filter_restore all&lt;br /&gt;
/set filter_avatar_objectother=0&lt;br /&gt;
/set filter_avatar_roomindiv=0&lt;br /&gt;
/set filter_avatar_roomtotal=1&lt;br /&gt;
/set filter_avatar_spellother=0&lt;br /&gt;
/set filter_avatar_walkother=0&lt;br /&gt;
/set filter_avatar_list= walkother roomindiv roomtotal spellother objectother&lt;br /&gt;
/eval /set filter_set_list $(/unique %{filter_set_list} avatar)&lt;br /&gt;
&lt;br /&gt;
;Set to 0-3 to override system verbosity level&lt;br /&gt;
;Set to -100 to disable script verbosity level and keep system verbosity level&lt;br /&gt;
;see verbose.tf&lt;br /&gt;
/verbose -s-100 config&lt;br /&gt;
&lt;br /&gt;
/config_usage&lt;br /&gt;
/filter_usage&lt;br /&gt;
&lt;br /&gt;
/def -i config_store = \&lt;br /&gt;
        /set config_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set config_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set config_post %{opt_x}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list=%;\&lt;br /&gt;
        /set config_set_list $(/unique %{config_set_list} %{config_set})%;\&lt;br /&gt;
        /set config_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing configuration, storing in set %config_set%;\&lt;br /&gt;
        config&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -t&amp;quot;\[ Keyword    \] Option&amp;quot; config_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of configuration list%;\&lt;br /&gt;
        /set prompt_exe config&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -mregexp -t&amp;quot;^\[(-|\+)([a-zA-Z0-9]+) *\] .+\.$&amp;quot; config_option = \&lt;br /&gt;
        /let sign %{P1}%;\&lt;br /&gt;
        /let option $[tolower({P2})]%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got config option: %{option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_list %%{config_%{config_set}_list} %%{option}%;\&lt;br /&gt;
        /eval /set config_%{config_set}_%{option} %{sign}%{option}&lt;br /&gt;
&lt;br /&gt;
/def -i -E(config_store) -p991 -mglob -h'send PROMPT_EXE config' config_prompt_exe = \&lt;br /&gt;
        /let post %{config_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset config_store%;\&lt;br /&gt;
        /unset config_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -ls - -aCyellow %%% /%0: Stored configuration in set %{config_set}, executing %{post}%;\&lt;br /&gt;
        /unset config_set%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i config_restore = \&lt;br /&gt;
        /set config_set=avatar%;\&lt;br /&gt;
        /set config_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set config_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \ &lt;br /&gt;
                /if (!regmatch(&amp;quot;autoexit&amp;quot;, config_%{config_set}_autoexit)) \&lt;br /&gt;
                        /verbose -o%{verbosity_config} -l1 - -aCred %%%% %%;\&lt;br /&gt;
                        /verbose -o%{verbosity_config} -l1 - -aCred %%%% /%0: No configuration set %{config_set} stored!%%;\&lt;br /&gt;
                        /verbose -o%{verbosity_config} -l1 - -aCred %%%% %%;\&lt;br /&gt;
                        /set config_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /if (config_noset) \&lt;br /&gt;
                /unset config_set%;\&lt;br /&gt;
                /unset config_noset%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let option %1%;\&lt;br /&gt;
        /if (option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /config_restore %%{config_%{config_set}_list}%;\&lt;br /&gt;
        /elseif (option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval config %%{config_%{config_set}_%{option}}%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /config_usage%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Config option %{option} restored using set %{config_set}%;\&lt;br /&gt;
        /unset config_set%;\&lt;br /&gt;
        /unset config_noset&lt;br /&gt;
&lt;br /&gt;
/def -i config_rmset = \&lt;br /&gt;
        /let rmset_set %*%;\&lt;br /&gt;
        /if (rmset_set =~ &amp;quot;&amp;quot;) /let rmset_set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{config_%{rmset_set}_list}%;\&lt;br /&gt;
        /let rmset_length $(/length %rmset_options)%;\&lt;br /&gt;
        /let counter=1%;\&lt;br /&gt;
        /while (counter &amp;lt;= rmset_length) \&lt;br /&gt;
                /unset config_%{rmset_set}_$(/nth %{counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set config_set_list $(/remove %{rm_set} %{config_set_list})%;\&lt;br /&gt;
        /unset config_%{rmset_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (config_set_list =~ &amp;quot;&amp;quot;) /unset config_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Configuration set %{rmset_set} removed.&lt;br /&gt;
&lt;br /&gt;
; Same for filter&lt;br /&gt;
&lt;br /&gt;
/def -i filter_store = \&lt;br /&gt;
        /set filter_set=avatar%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;x:s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set filter_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /set filter_post %{opt_x}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list=%;\&lt;br /&gt;
        /set filter_set_list $(/unique %{filter_set_list} %{filter_set})%;\&lt;br /&gt;
        /set filter_store 1%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Grabbing filters, storing in set %filter_set%;\&lt;br /&gt;
        filter&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -t&amp;quot;Filter Type           Status&amp;quot; filter_liststart = \&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Start of filter list%;\&lt;br /&gt;
        /set prompt_exe filter&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -mregexp -t&amp;quot;^([A-Z]+).+(ON|off)&amp;quot; filter_option = \&lt;br /&gt;
        /let option $[tolower({P1})]%;\&lt;br /&gt;
        /let sign %{P2}%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l2 - -aCyellow %%% /%0: Got filter: %{option}%;\&lt;br /&gt;
        /eval /set filter_%{filter_set}_list %%{filter_%{filter_set}_list} %%{option}%;\&lt;br /&gt;
        /if (sign =~ &amp;quot;off&amp;quot;) \&lt;br /&gt;
                /eval /set filter_%{filter_set}_%{option} 0%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /eval /set filter_%{filter_set}_%{option} 1%;\&lt;br /&gt;
        /endif&lt;br /&gt;
&lt;br /&gt;
/def -i -E(filter_store) -p991 -mglob -h'send PROMPT_EXE filter' filter_prompt_exe = \&lt;br /&gt;
        /let post %{filter_post}%;\&lt;br /&gt;
        /set prompt_exe=%;\&lt;br /&gt;
        /unset filter_store%;\&lt;br /&gt;
        /unset filter_post%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Stored filters in set %{filter_set}, executing %{post}%;\&lt;br /&gt;
        /unset filter_set%;\&lt;br /&gt;
        /if (post !~ &amp;quot;&amp;quot;) /eval -s0 %{post}%; /endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/def -i filter_restore = \&lt;br /&gt;
        /set filter_set=avatar%;\&lt;br /&gt;
        /set filter_noset 0%;\&lt;br /&gt;
        /if (!getopts(&amp;quot;s:&amp;quot;)) /return 0%; /endif%;\&lt;br /&gt;
        /if (opt_s !~ &amp;quot;&amp;quot;) /set filter_set %{opt_s}%;/endif%;\&lt;br /&gt;
        /eval \ &lt;br /&gt;
                /if (!regmatch(&amp;quot;0|1&amp;quot;, filter_%{filter_set}_objectother)) \&lt;br /&gt;
                        /verbose -o%{verbosity_config} -l1 - -aCred %%%% %%;\&lt;br /&gt;
                        /verbose -o%{verbosity_config} -l1 - -aCred %%%% /%0: No filter set %{filter_set} stored!%%;\&lt;br /&gt;
                        /verbose -o%{verbosity_config} -l1 - -aCred %%%% %%;\&lt;br /&gt;
                        /set filter_noset 1%%;\&lt;br /&gt;
                /endif%;\&lt;br /&gt;
        /if (filter_noset) \&lt;br /&gt;
                /unset filter_set%;\&lt;br /&gt;
                /unset filter_noset%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /let option %1%;\&lt;br /&gt;
        /if (option =~ &amp;quot;all&amp;quot;) \&lt;br /&gt;
                /eval /mapcar /filter_restore %%{filter_%{filter_set}_list}%;\&lt;br /&gt;
        /elseif (option !~ &amp;quot;&amp;quot;) \&lt;br /&gt;
                /eval \ &lt;br /&gt;
                        /if (filter_%{filter_set}_%{option}) \&lt;br /&gt;
                                filter +%%{option}%%;\&lt;br /&gt;
                        /else \ &lt;br /&gt;
                                filter -%%{option}%%;\&lt;br /&gt;
                        /endif%;\&lt;br /&gt;
        /else \ &lt;br /&gt;
                /filter_usage%;\&lt;br /&gt;
                /return 0%;\&lt;br /&gt;
        /endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l3 - -aCyellow %%% /%0: Filter %{option} restored using set %{filter_set}%;\&lt;br /&gt;
        /unset filter_set%;\&lt;br /&gt;
        /unset filter_noset&lt;br /&gt;
&lt;br /&gt;
/def -i filter_rmset = \&lt;br /&gt;
        /let rmset_set %*%;\&lt;br /&gt;
        /if (rmset_set =~ &amp;quot;&amp;quot;) /let rmset_set=avatar%;/endif%;\&lt;br /&gt;
        /eval /set rmset_options %%{filter_%{rmset_set}_list}%;\&lt;br /&gt;
        /let rmset_length $(/length %rmset_options)%;\&lt;br /&gt;
        /let counter=1%;\&lt;br /&gt;
        /while (counter &amp;lt;= rmset_length) \&lt;br /&gt;
                /unset filter_%{rmset_set}_$(/nth %{counter} %{rmset_options})%;\&lt;br /&gt;
                /test ++counter%;\&lt;br /&gt;
        /done%;\&lt;br /&gt;
        /set filter_set_list $(/remove %{rm_set} %{filter_set_list})%;\&lt;br /&gt;
        /unset filter_%{rmset_set}_list%;\&lt;br /&gt;
        /unset rmset_options%;\&lt;br /&gt;
        /if (filter_set_list =~ &amp;quot;&amp;quot;) /unset filter_set_list%;/endif%;\&lt;br /&gt;
        /verbose -o%{verbosity_config} -l1 - -aCcyan %%% /%0: Filter set %{rmset_set} removed.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: TinyFugue Scripting]]&lt;/div&gt;</summary>
		<author><name>Sulfar</name></author>
		
	</entry>
</feed>