Topics Author Replies Views Last post; House of Medakan zMUD Scripts Go to page: 1, 2, 3, 4 Taziar. Thu Oct 03, 2019 7:17 pm. Taziar My scripts Go to. It is a full-featured Mud client that includes full scripting capabilities similar to ZMud and TinTin+. If this is your first time to Mudding, get ready for an exciting trip. You are about to have access to hundreds of interesting and fantastic worlds. Places to make friends, maybe enemies, discover new lands, go on quests, fight monsters. Tucows194246zMUD Rights Shareware Tucowsrating 5. Plus-circle Add Review. Reviews There are no reviews yet. Be the first one to write a review.
Zmud Crack Ms Office
This tutorial delves into the new variable options in zMUD v6.20 andhigher. In addition to floating point numbers, v6.20 introduced severalnew syntax options for accessing variables and dealing with arrays which greatlyincreased the power of the scripting language.
Contents
String Variables Integer Variables Floating Point Variables String List Variables Record Variables Array Variables COM Objects System Variables MXP Variables
Introduction
The zMUD scripting language (zScript) is a Text Processing Language. This makes it quite different from computer languages such as C or Basic thatpeople might be familiar with. Although the original language syntax camefrom the original TinTin MUD client for Unix (for compatibility purposes),zScript has closer ties to text manipulation languages such as perl.
Because zMUD is designed for efficient text processing, all variables in zMUDare stored in text format. While this decreases performance formathematical calculations, if provides a great deal of flexibility. Butit's important to remember that even when we talk about variable'Types', all values are stored internally as strings (with theexception of arrays).
Variable Types
Although zMUD stores variables in text format, there are several'types' of variables that can be used in scripting:
- String: 'text' is an explicit string value.
- Integer: 123 is an integer. -2 is an integer.
- Floating Point: Single precision is supported. 1.23 is a floating point value.
- String List: a string that contains multiple values. a|b|c is a string list.
- Record: a string that contains keys and values. Like a string list, but each element of the list has a name (key).
- Arrays: formal COM-compatible array types. Indexed by an integer starting at zero. Each element can contain a string, integer, or floating point value.
- COM Objects: Variable contains a reference to a COM object.
- MXP Variables: Entities set by the MUD server.
In the next sections, examples of using each variable type will be given.
String Variables
Strings are the core of the zMUD scripting language. To force a valueto be interpreted as a string, enclose the value in double-quotes:'text', or in braces: {text}. The difference between these twosyntaxes is that other variables are expanded when you use the {}. Forexample:
stores the raw text '@abc' into the variable called VarName. Compare this to the example:
Without the quotes the variable named 'abc' is expanded, and thevalue of the '@abc' variable is stored in VarName. The aboveexample could also be written as:
Since there are no spaces in this expression, the {} are not actually needed.
To force a value to be interpreted as a string, you can also use the %stringfunction. For example, the + operator performs a numeric addition, if thearguments are numbers, or performs a string concatenation if the arguments arestrings. So: 1+2 has a value of 3, but '1'+'2' has avalue of '12'. Using the %string function, you can do:%string(1+2)+'4' which would have a value of '34' since 1+2becomes 3, which is then converted to the '3' string by the %stringfunction.
Sometimes, the trickiest part of scripting in zMUD is determining whathappens to the quotes around strings. In many cases, quotes arestripped. For example in the above VarName='@abc' example, ifyou then check the actual value of @VarName you will see that it contains @abcwithout the quotes. So, the next time you use @VarName in a script, the @abcvariable reference will get expanded since it's no longer within quotes.
Usually the scripting language will do what you want by default. Formore information on zMUD parsing modes and how to better control how strings areexpanded or evaluated, see the 'zMUD ProgrammingLanguage' article in the Support Library.
Integer Variables
Integers are numbers without any decimal place, with an optional minus signin front. Whenever zMUD performs mathematical operations, if there are notquotes around a value, zMUD checks to see if the value can be converted to anumber. Some operations depend upon whether the arguments are numbers orstrings. In the previous section, we examined the difference betweennumeric and string + operations.
zMUD integer variables are converted from string format to 32-bit integerformat for math operations.
Division with integer variables produces an integer value. The Divisionis truncated (the value after the decimal point is discarded). So, 5/2 = 2(since 5 divided by 2 is 2.5, the .5 is discarded, giving an integer result ofjust 2).
Floating Point Variables
New to zMUD version 6.20 is floating point variables. Now, numbers withdecimal places can be manipulated. zMUD supports Single-Precision floatingpoint, which has an accuracy of approximately 7 decimal digits.
A floating point value *must* have a decimal point. For example, 2 isan integer, but 2.0 is a floating point value. The %float function can beused to convert a string or integer into a floating point number. Itbasically just adds the '.0' to the end of an integer.
Division with floating point variables produces a floating point value. For example, 5.0/2.0=2.5. Only one of the values needs to be floatingpoint. Once any floating point value is detected in a calculation, allother values are automatically converted to floating point. So, 5.0/2 and5/2.0 would also give a value of 2.5. However, remember that 5/2 is aninteger-only operation, with an integer value of 2. So, if you aren't sureif a value is already floating point, use the %float function. For example%float(@a)/%float(@b) divides the variable @a by the variable @b, but ensuresthat the result is a floating point value. So, even if @a=5 and @b=2 areboth integers, the result will still be the floating point 2.5 value.
Because of the way floating point values are stored within computers, valuesthat should be equal sometimes are not. For example, in formatmathematics, 1.0/3.0 is the same as (4.0/3.0-1.0). However, in zMUD youwill find that 1.0/3.0 is 0.333333343267441 and (4.0/3.0-1.0) is 0.333333373069763. Notice that these values start out looking the same, but then differ. Thisisn't the fault of zMUD, but is simply a result of how floating point values arestored on binary computers.
So, given the above problem, if you try to do something like #IF (1.0/3.0 =(4.0/3.0-1.0)) {...}, you will never get a True result from this, since thevalues are actually not equal. To take care of this, zMUD provides the%norm function to normalize floating point values. In zMUD, %norm(1.0/3.0)has a value of 0.333332985639572 and %norm(4.0/3.0-1.0) has a value of 0.333332985639572also. Notice that these values are now the same. In fact, zMUDautomatically calls %norm whenever you use floating point values in an #IFstatement. So, in zMUD, #IF (1.0/3.0 = (4.0/3.0-1.0)) {...} is True asexpected. But if you perform your own operations, it's useful to knowabout the %norm function.
String List Variables
String Lists have been used in zMUD for a long time. They provide asimple mechanism to store multiple values in a single variable. Originally, a string list was just a list of strings separated by the |character. In fact, in older versions of zMUD, it was really that trivial.
In zMUD v6.26 and higher, string lists were improved to support nested lists. For example, in old versions of zMUD, the line:
actually added *two* items to the string list. In zMUD 6.26 and later,the above statement only adds a single item to the list. This allows zMUDto support nested lists and other operations. It also fixes problemsprevious versions had with list items that already had quotes around them.
In zMUD 6.26, if you really want to merge two lists as you could in the past,simply contatenate the lists together with the | symbol. For example:
would concat the 'a|b' list to the end of the existing list.
Depending upon what operations are used, string lists in zMUD may containduplicate entries, or may not. Using the #ADDITEM and #DELITEM commands,duplicate items in the list are removed. Using the %additem and %delitemfunctions, duplicate items in the list are NOT removed. It's important toremember this distinction when choosing whether to use a command orfunction. To manually remove duplicate items in a list, use the %dupfunction.
New to zMUD 6.20 and later is the ability to refer to string list elements asan array. For example, if @List had the value a|b|c,then @List.1 is 'a', @List.2 is 'b' and so on. NOTE:You can only *read* list values using array syntax. If you attempt anassignment using the syntax 'List.1=a' you will actually be creatingan array as described later.
There are *many* zMUD functions that work with lists. Some examplesare:
- %numitems(@List)
- returns the number of items in a list;
- %push(@List,'item')
- pushes a new item onto the beginning of the list (compared to %additem which adds the item to the end of the list).
- %pop(List)
- returns the first item from the list and removes it from the list. Notice only the Name of the list variable is given, rather than it's value (no @ is used).
- %sort(@List)
- returns a sorted list
Starting with version 6.26 you can also nest one list inside ofanother. For example:
Puts @List1 into the first element of @List2. Using the nested indexsyntax, you could query @List2.1.1 to get 'a', @List2.1.2 to get'b', and so on. Nested lists are delimited usingparenthesis. So, the list:
actually has 3 items. The first item is 'a', the second itemis the nested list 'b|c' and the third item is 'd'.
Record Variables
Records are similar to string lists, except that each element in the listalso has a name, called the Key. Although records are stored internally byzMUD as special string lists, you should not attempt to construct recordsdirectly. You should always use the #ADDKEY command or %addkey function toadd a new key and value item to the record.
Direct key reference can also be used in zMUD, for both retrieving data,*and* for assigning data. For example:
is the same as:
and @VarName.Key is the same as %db(@VarName,Key). This direct keyaccess syntax can make scripts much easier to read.
In zMUD v6.20 and later, record variables were improved, much like stringlists, to fix problems with nested values. Now you can store string lists,or other record values into record elements. You can also nest the syntaxused to reference elements. For example, if we stored a string list into arecord variable:
then we could use @Rec.List.1 to access 'a', and @Rec.List.2 toaccess 'b', etc. Just how you'd expect it to work!
Array Variables
In v6.1x, basic support for arrays was added to provide COM programmingcompatibility. However, arrays were still limited in their generalusefulness for zMUD scripting. Starting with version 6.20, arrays wereexpanded and became powerful enough to use in everyday scripting.
In version 6.20 and later, direct indexing syntax is supported for bothretrieving data, *and* for assigning data. Also, arrays are created asneeded without the need for an explicit %array function call. For example,the simple statement: Arr.1='abc' creates an array, assigns 'abc'to the first element, and stores the array in the @Arr variable. Toretrieve the element, just use the @Arr.1 syntax, just like with string lists.
Anytime you assign an element to the array, the array will automatically growto the size needed to store the item. Be careful with this. Forexample, Arr.10000='abc' suddenly creates an array with 10,000elements in it! Element 10000 has the value 'abc', and all ofthe other elements from 0 to 9999 would be empty. But the memory neededfor all 10,000 elements is allocated from Windows. To deallocate thismemory, just assign something else to the variable. For example, doing Arr='would clear the variable, freeing up all of the memory used for the array.
In v6.20 and higher, array elements can store either strings, integers, orfloating-point values. In the case of arrays, zMUD stores the data in thenative format. Strings are OLE-compatible strings, Integers are 32-bitvalues, and floating-point are Single precision values. This maintains theCOM compatibility with zMUD arrays. Note that zMUD does *not* supportnested arrays. In other words, you cannot assign an array to another arrayelement. You also cannot store COM objects directly into arrays.
Starting in zMUD v6.20, array variables can be stored in the charactersettings file, and exported/imported, just like regular variables. Inaddition, the Settings Editor can be used to edit arrays just like editingstring lists.
COM Objects
References to COM Objects can be stored in a zMUD variable using the %comcreateor %comactive function calls. For more information, see the article on COMProgramming in zMUD in the Support Library.
System Variables
By default, the @ character is used to retrieve the value of a user-definedvariable. For example, @ABC retrieves the value of the variable calledABC. The % character is used to retrieve the value from internal zMUDsystem variables. See the topic 'Predefined Variables' in thezMUD help file for a full list of available system variables. In general,system variables can be retrieved, but not set. Exceptions are noted inthe help file.
MXP Variables
MXP allows the MUD Server to set it's own variables, called ENTITIES. You can retrieve the value of MXP Entities using the %mud system recordvariable. For example, if the MUD uses the command:
to create and set an entity called 'Hp', you could retrieve this inzMUD using the syntax %mud.hp. Note that you can only retrieve entityvalues. You cannot change them. Also, you cannot query the value ofa 'Private' entity.
An mentioned in the MXP specification, the MUD server could also set theentity using the syntax:
In this case, the value 100 is displayed to the user, probably part of theMUD prompt. This still sets the entity called 'Hp' to the valueof 100 and can still be retrieved by the user using %mud.hp.
Zmud 7.21 Crack
Summary
Zmud Crack Cocaine
Now you have an overview of all of the types of variables support by zMUD andhow to use them.