BuffyMUD Wiki
Advertisement

Foremost,  a disclaimer is in order.  The rules of the mud state that advanced features of a player's client can be used so long as they aren't used unsupervised.  As such, discussion and material on this page should stray from any content that could be used to automate play.  Please restrict content to that which is not directly related to combat, work, fitness, or otherwise serves to circumvent rules or enforcement measures such as idle check.  If players wish to have scripts for those items, they can read the helpfiles, and write it themselves.  That having been said, scripting can be used to effectively patch problem areas in the code until such a time as they're actually fixed as well as making repetitive, time consuming tasks less so.  This is probably going to seem nerdy, but it's the result of several years of reading helpfiles and headaches.  Hopefully someone will find this helpful and be spared.



Purpose: Sells techniques automatically that aren't on a list of techniques to be ignored

Type: Trigger

Pattern:
~[([ (%d)|(%d)])~] ~[*~] ~[(%d)~]

Script Text:
Tech=%number(%1)
#if @Tech<>37&@Tech<>38&@Tech<>42&@Tech<>44&@Tech<>54&@Tech<>57&@Tech<>58&@Tech<>59&@Tech<>60&@Tech<>79&@Tech<>80&@Tech<>81&@Tech<>82&@Tech<>83&@Tech<>85&@Tech<>88&@Tech<>90&@Tech<>91&@Tech<>96&@Tech<>100&@Tech<>102&@Tech<>103 {
    #loop %2 {tech sell @Tech}
}

Explanation: The pattern identifies the lines sent to a player's client after using the 'technique library' command that look like: "[37] [                Bullet Dodging] [13]".  Tildes in a pattern tell the client that the following character is not code and should be taken as a character and is necessary for brackets amoung other things.  Parentheses around a pattern matching symbol like '%d' which identifies any single, unpunctuated number mean that matching information will be stored in a set of numbered variables.  There are two initial '%d' symbols separated by a '|' which is the symbol for 'or' in this case so that the trigger can match techniques that are single digit as well as double digit.  Only one of such variables is looked for and filled for any given line because they're enclosed in brackets.  The pattern stores the technique number as variable '%1'  and how many of that specific technique you possess as '%2'.  Immediately after that data is collected and before it's replaced with data from the next line, the script is run.  Upon execution, '%1' is converted to a number and stored in '@tech' which is checked against the list of techniques in the script.  In this case, techniques 37, 38, 42, 44, 54, 57, 58, 59, 60, 79, 80, 81, 82, 83, 88, 90, 91, 100, 102, and 103 will never be sold because they're listed.  All other techniques will be sold until they're all gone because the command 'tech sell @tech' will be sent  '%2' times.  There's no overflow protection and so if you've gone an inordinately long time without selling techniques, you may be booted from the mud if you put too many commands in at once.  In order to add a technique to the protected list, simply add '&@tech<>'technumber' where technumber is the actual number of the technique you wish to preserve.  In order to remove a technique from the protect list, remove or replace the same information.  The script text reads: If the technique number of a given technique is not equal to thirty seven and the technique number is not equal to thirty eight and the technique number is not equal to forty two and...  then sell the technique as many times as you possess it.



Purpose: The reverse of the script above. It'll prevent you from accidentally selling techniques if you change something inappropriately.

Type: Trigger

Pattern:
~[([ (%d)|(%d)])~] ~[*~] ~[(%d)~]

Script Text:

Tech=%number(%1)
#if @tech=5||@tech=6||@tech=7||@tech=8||@tech=9||@tech=11||@tech=12||@tech=13||@tech=14||@tech=16||@tech=17||@tech=18||@tech=19||@tech=20||@tech=21||@tech=23||@tech=24||@tech=26||@tech=27||@tech=28||@tech=30||@tech=31||@tech=32||@tech=33||@tech=40||@tech=43||@tech=46||@tech=47||@tech=50||@tech=51||@tech=54||@tech=55||@tech=56||@tech=61||@tech=62||@tech=63||@tech=66||@tech=67||@tech=68||@tech=71||@tech=76||@tech=77||@tech=78||@tech=90||@tech=92||@tech=93||@tech=94||@tech=95||@tech=97||@tech=99||@tech=102||@tech=104 {
    #loop %2 {tech sell @Tech}
}

Explanation: Thist will only sell the specific technique named instead of selling every tech other than the technique named. 



Purpose: Display the amount of a specific technique needed for the next level of that technique when the 'technique show' command is used

Type: Trigger

Pattern:
~[*~] ~[*(%d)~] ~[*~]   ~(%d~)

Script Text:
#if %1=0 {cost=1} 
#if %1=1 {cost=3}
#if %1=2 {cost=6}
#if %1=3 {cost=10}
#if %1=4 {cost=15}
#if %1=5 {cost=21}
#if %1=6 {cost=28}
#if %1=7 {cost=36}
#if %1=8 {cost=45}
#if %1=9 {cost=55}
#if %1=10 {cost="None"}
#say Cost to level: @cost

Explanation: When the trigger detects the pattern of the output from the 'technique show' command, it recognizes the current level of the technique and outputs "Cost to level: @cost" where '@cost' is a variable that stores the associated cost of each rank in the table.  The final output looks something like:

Tech Points: 428.
[ 0] [ 1] [Unarmed Damage]   (0)
Cost to level: 3
[ 1] [ 2] [Unarmed Damage]   (0)
Cost to level: 6
[ 2] [ 3] [Unarmed Damage]   (0)
Cost to level: 10
[ 3] [ 4] [Unarmed Damage]   (0)
Cost to level: 15
[ 4] [ 5] [Unarmed Damage]   (0)
Cost to level: 21
[ 5] [ 6] [Unarmed Damage]   (0)
Cost to level: 28
[ 6] [ 7] [Expectancy]   (91)
Cost to level: 36



Purpose: To avoid whispering to the wrong people or mobs when you're really just trying to whisper to the room in general

Type: Alias

Name:
Whisper

Script Text:
#if %1="to" {"whisper" %2 %-3} {"whisper" `x %-1}

Explanation: Whenever you type whisper (and you must type the full name in order for the alias to work), it checks to see if the second word is 'to', if it is, it directs your whisper to a person.  Otherwise, it whispers the entire message to the room in general with blank color code and a space in front of it.  The blank color code keeps the whisper from targeting people and the space keeps the first letter from being made lowercase.

Advertisement