 |
Nuggets_092 Newbie
Joined: 06 Sep 2003 Posts: 1
|
Posted: Sat Sep 06, 2003 5:44 am
Need help with #IF |
Hello im just wondering if one of you gurus can help me out, im looking for a trigger that will look for a certain spell to be active on my glance list targets. I want it to look for the StoneSkin spell and if its there on the glance it doesnt have to do anything, but if its missing I want it to play a .wav file of me saying StoneOneOut type of thing. Is this even possible? because i have 4 or 5 Tanks on my glance list at a time usually and wanted to be able to keep them all seperate, so if tank 3 is missing stoneskin i can make it play a wav saying StoneThreeOut or if its tank 4 or tank 2, that kind of deal.
Below is what a glance looks like on my mud, when the stoneskin is wore off the "His skin seems to be made of stone" line isnt there, any ideas?! ive tried for weeks but i cant get one that works [V]
<> glanc khaliz
Khaliz is a Drow and has quite a few wounds.
Khaliz seems to be of moderate sized size.
His skin seems to be made of stone
Thanks in advance if anybody can figure this out, or even steer me on the right path! |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sat Sep 06, 2003 6:29 am |
This is very possible. The hard part is detecting the absence of something. The only way to do that in any situation is to bracket the space in which the item should appear and then respond if it wasn't there, I am going to assume there is a blank line after the glance. Since you seem happy to record many wav files I will go a little further with your concept...
#CLASS GlanceCheck
#VAR GlanceTanks {}
#ALIAS AddGlanceT {#IF (%numparam<2) {#ECHO Usage: AddGlanceT tankname tankrace;#NOOP} {#ADDKEY GlanceTanks {%concat(%1, "is a ",%2)} {%1}}}
#ALIAS GlanceT {#LOOPDB @GlanceTanks {glance %val}}
#TR "GlanceCap" {^({@GlanceTanks}) and} {}
#COND "GlanceCap" {} {#IF (%line="His skin seems to be made of stone") {#STATE GlanceCap 0} {#IF (%line="") {#PLAY %concat(%db(@GlanceTanks,"%1"),"StoneOut.wav");#STATE GlanceCap 0}}} {looplines|param=99}
#CLASS 0
This provides a record variable containing triggerable text for the start of the glance, and detection for the end of where the stoneskin line should be. It then plays a file with the tanks name for example 'khalizStoneOut.wav'. The only problems I forsee are those mentioned in the help regarding #PLAY.
quote:
Note that zMUD does not pause while the media is playing. Also, only one media can be playing at any given time.
To overcome this you would have to queue up the glances and preform the next glance immediately if stoneskine was detected on the current, or delayed if it was not detected. |
|
|
 |
|
|
|
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
|
|