Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Mar 12, 2008 4:02 pm   

An inconsistency in zMUD, any solutions?
 
Ok. This is the MUD output I'm trying to capture.

Code:
----------------------------------------------------------------
Your insight into Stendarr's Holy Guardian reveals the following ....

Mob Short Name   : Stendarr's Holy Guardian
Mob Base Level   : 220
Identical Mobs   : 1
Times Killed     : 0
Alignment        : Stendarr's Holy Guardian is grey.
Immunities       : bash, pierce, slash, acid, air, cold, disease,
                   earth, energy, fire, holy, light, electric, magic,
                   mental, negative, poison, shadow, sonic, water
Note             : Target is UNKILLABLE!
----------------------------------------------------------------

You are charged 660 gold clan skill tax.


This is for a script I wrote to help with our mob database on Aardwolf. Clanskill only, so there's no real way to test it by logging into Aardwolf unless you're part of the Watchmen clan. Anyway, this is what I have for capturing immunities:

Code:
#TRIGGER {^Immunities%s: (*)} {#LOOP %numwords( "%1", ", ") {#ADDITEM mobimm {%trim( %word( "%1", %i, ","))}}}
#TRIGGER {^                   (*)} {#LOOP %numwords( "%1", ", ") {#ADDITEM mobimm {%trim( %word( "%1", %i, ","))}}}


Now it captures the immunities correctly and inputs them into the mobimm variable. The following is where the problem lies, however.

Code:
#TRIGGER {^You are charged * gold clan skill tax.} {#FORALL @mobimm {#ADDKEY insightdb {%i} {IMM}}}


If that runs from the script, I get the following output:
Code:
Stendarr's Holy Guardian,220,grey,The World of the Watchmen,Tree of Insight,IMM,IMM,0,0,0,0,0,IMM,IMM,0,0,0,0,0,IMM,IMM,0,0,0,0,N,UNKILLABLE,Charneus

Now, that is incorrect. Stendarr's Holy Guardian has all immunities, so all the 0s should be IMM. If I run the #FORALL from the command line by itself:
Code:
#FORALL @mobimm {#ADDKEY insightdb {%i} {IMM}}

then I get the correct output of:
Code:
Stendarr's Holy Guardian,220,grey,The World of the Watchmen,Tree of Insight,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,IMM,N,UNKILLABLE,Charneus


Not sure what's going on here, or if I'm missing something. Hell, maybe there's a better way to do this. The script is pretty functional, I just have to make changes by hand. I would love for it to be fully functional, though. Thanks for any advice.

Charneus
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Mar 12, 2008 4:40 pm   
 
Apparently, I found the problem. Apparently, it's a speed issue. The script is processing much faster than zMUD is able to add items to the variable. I even changed the triggers to read:
Code:
#LOOP %numwords( "%1", ", ") {#ADDKEY insightdb {%trim( %word( "%1", %i, ","))} {IMM}}

but even that fails. *sigh* Anyone have any suggestions?

Charneus
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Mar 12, 2008 5:12 pm   
 
I'm taking a stab in the dark as I haven't really read through the whole thing, or tested it but. Have you tried the #pri {} command?
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Wed Mar 12, 2008 5:38 pm   
 
The #PRI command is what you want - it will prevent zMUD from accepting further lines from the MUD until your FORALL completes.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Mar 12, 2008 8:31 pm   
 
Get rid of the extra loop, and remove some other extra code.
Code:
#TRIGGER {^Immunities%s: (*)} {#ADDITEM mobimm {%1}}
#TRIGGER {^                   (*)} {#ADDITEM mobimm {%1}}
#TRIGGER {^You are charged * gold clan skill tax.} {#FORALL %subchar(@mobimm,", ","|") {#ADDKEY insightdb {%i} {IMM}}}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net