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
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sun Nov 25, 2001 4:28 am   

Needing a bit of help
 
Okay this code ws changed in the mud. Now their out put is different. I had this set up for the old code so that whenever %line was You seen nothing in it, it would check %line2 for several different salves elixers in a test something like this:

The old code would Always look like This:

The black-walnut vial seems to be extremely heavy, with an extremely thick
wall.
It has 40 months of usefulness left.
It is strangely weightless.
It bears the distinctive mark of Rurin.
A salve of restoration sloshes about in it.
You see nothing in it.



#trigger {You see nothing in it.} {
#IF (%line2 =~ "A salve of restoration sloshes about in it.") {
#ADD counter 1
vset %item( @currentvial_vnum, @counter) restoration}



This is the new output:

The black-walnut vial seems to be extremely heavy, with an extremely thick
wall.
It has 40 months of usefulness left.
It is strangely weightless.
It bears the distinctive mark of Rurin.
A salve of restoration sloshes about in it.

The chestnut wooden vial appears to be handcarved in the shape of flame.
It has 94 months of usefulness left.
It is strangely weightless.
It bears the distinctive mark of Rurin.
You see nothing in it. <--- only shows up for an empty vial now

The chestnut wooden vial appears to be handcarved in the shape of flame.
It has 103 months of usefulness left.
It is strangely weightless.
It bears the distinctive mark of Rurin.
A salve of mass sloshes about in it.

The chestnut wooden vial appears to be handcarved in the shape of flame.
It has 95 months of usefulness left.
It is strangely weightless.
It bears the distinctive mark of Rurin.
A salve of mending sloshes about in it.

So I need something to run a test on ONE line that follows AFTER the constant
"It bears the distinct mark of Rurin."

Any Ideas on how I could do this? I have tried this piece of code.....



#Trigger {It bears the distinct mark of Rurin.$(%*)} {
#var Vialtemp "%1"
#t+ vial2}

#class vial2
#trigger {(%*).$} {
#IF (@vialtemp =~ "A salve of restoration sloshes about in it") {
#ADD counter 1
vset %item( @currentvial_vnum, @counter) restoration
#T- vial2
} {#IF (@vialtemp =~ "You see nothing in it") {
#ADD counter 1
vset %item( @currentvial_vnum, @counter) immunity
#T- vial2
}}


So now it is recognizing, but my counter is freaking out now. this is what is occuring

The black-walnut vial seems to be extremely heavy, with an extremely thick
wall.
It has 40 months of usefulness left.
It is strangely weightless.
It bears the distinctive mark of Rurin.
A salve of restoration sloshes about in it.
5988 set to RESTORATION.
14623 set to RESTORATION.
22654 set to RESTORATION.
23651 set to RESTORATION.
27903 set to RESTORATION.
35721 set to RESTORATION.
54708 set to RESTORATION.
75621 set to RESTORATION.
77175 set to RESTORATION.
88638 set to RESTORATION.
Syntax: vset #vial (empty) type[/Orange]

It just runs through my counter and I cant figure out why its doing this
Any help would be appreciated
-Shyl-
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Sun Nov 25, 2001 7:57 am   
 
Hmm, just curious, but why not just make a trigger something like:

#trigger {A salve of (%w) sloshes about in it.} {#var temp %1_counter;#add @temp 1}

if it is because you only want to do this when 'it bears the distinctive mark of rurin', you could use that bit of code to turn on the salve checking class, wait a few lines, and turn the class off again. I dont know exactly how to do that, because I've never actually had to, but I know it can be done. Of course, I try to avoid using %commands as much as possible for some reason.
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sun Nov 25, 2001 12:49 pm   
 
quote:

Hmm, just curious, but why not just make a trigger something like:

#trigger {A salve of (%w) sloshes about in it.} {#var temp %1_counter;#add @temp 1}

if it is because you only want to do this when 'it bears the distinctive mark of rurin', you could use that bit of code to turn on the salve checking class, wait a few lines, and turn the class off again. I dont know exactly how to do that, because I've never actually had to, but I know it can be done. Of course, I try to avoid using %commands as much as possible for some reason.




Because there are messages like:

A salve of restoration is in it.
A mending salve is in it.
An Elixer of Frost is in it.
An Elixer of levitation is in it.
An epidermal salve is in it.

etc etc. There are many different messages, they are not all the same, even if they are of type salve. So I must check for each one.

-Shyl-
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Nov 25, 2001 5:14 pm   
 
Do not use another trigger, do it all in the first one. The pattern blah$(%*) will get the next line after blah and you can use %1 to test it, like you do, with =~ against some string.

Kjata
Reply with quote
Shylmysten
Wanderer


Joined: 18 Sep 2001
Posts: 93
Location: USA

PostPosted: Sun Nov 25, 2001 11:02 pm   
 
hey, thanks kjata, that works
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