|
sda Wanderer
Joined: 18 Apr 2001 Posts: 55 Location: United Kingdom
|
Posted: Mon Sep 02, 2002 10:11 pm
Access violation (more info for solution?) |
1 week ago I posted about this error, but it is a long way down list so please forgive me for bringing it to top again.
Message: Access violation at address 004BD5B7 in module 'Zmud.exe'. Read of address 00000010
It was suggested I write to Zugg, and this is what he had to say...
quote: One problem is with your syntax. You have lots of extra spaces around things, and do not put parenthesis around the expressions for your #IF statements. So, for example, the line:
#IF %ismember( @healtype, @listundamage) {#VARIABLE healcommand %concat( "heal ", @healname)}
is a problem. zMUD parses commands based on spaces separating the arguments. So, zMUD might be taking "%ismember(" as the first argument, then "@healtype," as the second argument, etc. You should *always* put parenthesis around your expressions, like this:
#IF (%ismember( @healtype, @listundamage)) {#VARIABLE healcommand %concat( "heal ", @healname})}
This much I think I understand but I think he's made a booboo with the syntax in his second example, can anyone correct this?)
I understand #IF %ismember("test",@string) can be enclosed in () to make #IF (%ismember("test",@string)) but should variables be written likewise. For example, #VAR {healname "player"}
When I get the exception error and "error in parsing" message, it creates a new class folder called 1)) and inside it there is one variable called healtype. I have narrowed it down to this line I think...
#VARIABLE healtype %lower(%word(%2,1))
Now should I write the line as follows?
#VARIABLE healtype {%lower(%word(%2,1))}
Thanks in advance,
Steve |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Sep 02, 2002 10:27 pm |
The error that Zugg made is at the VERY end of the line, where the } and the ) close everything up.
quote:
#IF (%ismember( @healtype, @listundamage)) {#VARIABLE healcommand %concat( "heal ", @healname})}
The symbols in blue should be reversed, so that the closing parethesis comes immediately after the opening parenthesis and then followed by the true-condition closing curly brace. There is an extra closing curly brace on the very end, but I assume it's from a trigger/alias/button/etc.
EDIT: As far as variables go, here is the command syntax:
#VARIABLE name value default-value class
In the below case, this is how the data breaks down:
name = MyVariable
value = This is a test
default-value = 25
class = SomeClass
#VARIABLE MyVariable "This is a test" 25 "SomeClass"
If we were to remove all the quotes, this is what would happen:
name = MyVariable
value = This
default-value = is
class = a
test, 25, and SomeClass would be ignored. Because this is not what we wanted, we enclose things in braces or quotes (it doesn't really matter which, except in a couple of instances) to force ZMud to regard the enclosed data as one parameter.
li'l shmoe of Dragon's Gate MUD |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Sep 02, 2002 10:54 pm |
Yes, you should use
#VARIABLE healtype {%lower(%word(%2,1))}
An even better solution might be to use %w or %x for your second parameter so you could use %2 without needing to use %word.
LightBulb
Senior Member |
|
|
|
sda Wanderer
Joined: 18 Apr 2001 Posts: 55 Location: United Kingdom
|
Posted: Mon Sep 02, 2002 11:59 pm |
Thanks Lightbulb, and Thanks Matt too...
I don't think I can use %x for the second pattern, as this is the actual trigger pattern:
(%w) {tells you|replies|whispers to you|says|asks|asks you|snarls|sings|joiks|teases you for}{: | }(*)
and the second parameter might be 1, 2 or even 3 words and most of the time I just want the first word.
Steve :) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Sep 03, 2002 12:35 am |
The parameters are the parts of your trigger phrase which are in parentheses. In this case, your second parameter is (*). There's no reason you couldn't use (%w) or (%w) (*) instead. Which is better depends on whether you need to capture anything after the first word of the healingtype. Remember, you aren't limited to using ONE trigger. You can have one trigger for the spells that only have one word and another for the spells that have two or three.
(%w) {tells you|replies|whispers to you|says|asks|asks you|snarls|sings|joiks|teases you for}{: | }(%w)
(%w) {tells you|replies|whispers to you|says|asks|asks you|snarls|sings|joiks|teases you for}{: | }(%w) (*)
LightBulb
Senior Member |
|
|
|
sda Wanderer
Joined: 18 Apr 2001 Posts: 55 Location: United Kingdom
|
Posted: Wed Sep 04, 2002 7:17 pm |
Solved!!
Thanks for you help folks, I figured out the problem, maybe a bug in Zmud - not sure. I was capturing with (*) and then using %word(%2,1) for example, to extract a word.
All works well, but if (*) captured an exclamation mark ! then Zmud errors on the parsing. Hope this helps sort the problem.
Thanks,
Steve ;) |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|