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
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Thu Jul 03, 2003 5:26 am   

couple more capture questions
 
I have a spell trigger that creates a window that records when my spells drop

#CLASS {SpellupMaster|Spelltracker}
#TRIGGER {{fades from around you|leaves you|You feel a bit less agile|You no longer bristle with energy|You come back into focus|faint image of yourself disappear|leave you|return to normal speed|surrounds you|Your form|You feel your extra strength departing}} {
#CAP Spelltracker
}
#CLASS 0

I have tried using #win to capture so i can add a time stamp, I can do it if I had a simple trigger to create a %1 varaible and then place that in the #win with %time(t) but other than writing a seperate trigger for each I am not sure how to.


also i am still trying to get this trigger to work in the way i want. It only captures when critters are in the room which is great, but it is not editing out all the other junk to list only the creatures

#TRIGGER {You notice (*)} {
@critters =
#VAR contents %replace( "%1", ", ", "|")
#FORALL @contents {#IF ("%1" =~ "{@enemy}") {#VAR critters %additem( "%i", @critters)}}
#WIN Room {%time( t) In the room - %replace( @critters, "|", ", ")}
}

any help appreciated

thanks nazradin
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 03, 2003 3:57 pm   
 
You don't need #WIN.
#CLASS {SpellupMaster|Spelltracker}
#TRIGGER {{fades from around you|leaves you|You feel a bit less agile|You no longer bristle with energy|You come back into focus|faint image of yourself disappear|leave you|return to normal speed|surrounds you|Your form|You feel your extra strength departing}} {
:Spelltracker:#SHOWP {%time( t) - }
#CAP Spelltracker
}
#CLASS 0

Use %i and %ismember.
#TRIGGER {You notice (*)} {
@critters =
#VAR contents %replace( "%1", ", ", "|")
#FORALL @contents {#IF (%ismember( %i, @enemy)) {#VAR critters %additem( "%i", @critters)}}
#WIN Room {%time( t) In the room - %replace( @critters, "|", ", ")}
}
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Thu Jul 03, 2003 5:41 pm   
 

thanks lightbulb the spell tracker works great.

but the critter tracker doesnt work, gone from capturing everything when there is a critter to nothing all the time, it is triggering but just entering the time stamp in the capture window

1:18 a.m. In the room -
1:22 a.m. In the room -


#TRIGGER {You notice (*)} {
@critters =
#VAR contents %replace( "%1", ", ", "|")
#FORALL @contents {#IF (%ismember( %i, @enemy)) {#VAR critters %additem( "%i", @critters)}}
#WIN Room {%time( t) In the room - %replace( @critters, "|", ", ")}
}

nazradin
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 03, 2003 8:48 pm   
 
There are several possibilities.
1. Nothing you see is in your enemies list, @enemy
2. Case matching may be needed
3. You may have forgotten to include leading articles -- "a goblin" is not the same as "goblin"
4. The double-quotes around %i might be a problem

This is not intended to list all possibilities, just the ones that came quickly to my mind.
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Fri Jul 04, 2003 5:24 pm   
 
quote:
Originally posted by LightBulb

There are several possibilities.
1. Nothing you see is in your enemies list, @enemy
2. Case matching may be needed
3. You may have forgotten to include leading articles -- "a goblin" is not the same as "goblin"
4. The double-quotes around %i might be a problem

This is not intended to list all possibilities, just the ones that came quickly to my mind.



my @enemies list was just including the activator for each creature such as "rattlesnake" instead of "a banded rattlesnake" changing partially worked

You notice a weasel pelt, a banded rattlesnake and an arrow.

gives just time stamp

You notice a weasel pelt, a banded rattlesnake, an arrow and an arrow.

gives 12:55 a.m. In the room - a banded rattlesnake

which is what i want

You notice a banded rattlesnake, a banded rattlesnake and an arrow.

gives 12:55 a.m. In the room - a banded rattlesnake

missing the second critter

also each critter can have <but not always> a state added

a banded rattlesnake (prone)
a banded rattlesnake (stunned)
a banded rattlesnake (dead)
a banded rattlesnake (calm)

how do i edit the trigger to include "states" "and" "." which seems to be the problem as it seems to be working with ","



thanks Nazradin
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jul 04, 2003 6:56 pm   
 
The (prone), (stunned), etc. makes it desirable to go back to your original method, using =~. I've changed the comparison from "%1" to "%i", and added another %replace to remove the " and ". I got rid of the period by putting it in the pattern. You can go back to just putting the keyword for each critter in @enemy. (changes in red)
#TRIGGER {You notice (*).} {
critters = %null
#VAR contents %replace( "%1", ", ", "|")
#VAR contents %replace( @contents, " and ", "|")
#FORALL @contents {#IF ("%i" =~ "{@enemy}") {#VAR critters %additem( "%i", @critters)}}
#WIN Room {%time( t) In the room - %replace( @critters, "|", ", ")}
}
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sat Jul 05, 2003 5:46 am   
 
that works most excellent thanks lightbulb


nazradin
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