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
Acidic
Newbie


Joined: 12 Sep 2004
Posts: 5

PostPosted: Wed Jun 08, 2005 7:42 am   

Multiple line trigger
 
I've had a problem lately with word wrap, and looked over a few forum topics to try to get around this. The MUD doesn't allow the user to change which column the MUD wraps at, forcing other players to have to trigger on 3-4 words for a single trigger (Which doesn't appear to be the best way to do this). There have been a few different responses, namely that it's very hard to do, but I tried to attempt this nonetheless.
Quote:
4072h, 4564m, 3826e, 10p ex-
With a focused look, Person strikes at you with a tae'dae bearclaw flail. Your
left leg is elegantly striked and swept out from under you, knocking you to
the ground.
3774h, 4564m, 3826e, 10p exp-

Idealistically, I'd like this to be able to be triggered in just one trigger, but the length of the name and/or weapon change depending on the type. I tried to get around this with (Probably not the most efficient way, but it's all I came up with):
Code:
#TRIGGER {^(With a focused look, (%w) strikes at you with *)} {KnightStrike = "";#if (%ends( "%1", " ")) {KnightStrike = %1}}
#COND {(*)} {#if (!%ends( "%1", "-")) {KnightStrike = @KnightStrike %1} {#if (%ends( "%1", ".")) {#state 0}}} {within|param=1}
#COND {(*)} {#if (!%ends( "%1", "-")) {KnightStrike = @KnightStrike %1}} {within|param=1}

Only now, I'm completely stuck. What would be the best way to compare this to another variable? Let's say I have a variable called, let's say, "KnightAttack", and had (I know this variable has multiple errors, it's just an example of what I'm trying to get past):
Code:
#VAR KnightAttack {With a focused look, %w strikes at you with *. Your {left|right} leg is elegantly striked and swept out from under you, knocking you to the ground.}

Using the format: #if (@KnightStrike = @KnightAttack) doesn't work for obvious reasons, so can anyone please think of a good way to trigger the original text correctly?
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Jun 09, 2005 2:00 am   
 
Code:
#TRIGGER "focused" {^(With a focused look *)} {#VARIABLE wholeline {%1}}
#COND {(*)} {#IF (%rightback(%1,1)="-") {#STATE focused 0} {#VARIABLE wholeline {%concat(@whole," %1")}}} {manual}


After trigger is complete the wholeline variable will contain the full text.
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