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


Joined: 19 Jan 2001
Posts: 117
Location: Norway

PostPosted: Fri Jan 18, 2002 2:24 am   

Make a trigger non-case sensitive?
 
A fellow mudder has made a set of triggers and aliases to follow a fleeing mob. It don't work quite as it should and I now know why - but not quite how to fix it:

You type k mob.
The triggers then capture the prompt while you're fighting, to find out what it should follow when the mob flees:
* HP:Healthy SP:Bursting MV:Full - a small squirrel: Healthy >
This will capture "a small squirrel" into a variable called prey.

The current triggerpattern to follow when the mob flees is
^(*)@prey leaves ({north|east|south|west|up|down}).$

The problem is - putting the (*) there can make you follow any mob. Since "A young buck" as far as I understand can just as easily replace that (*).

What I need is making this work instead:
^@prey leaves ({north|east|south|west|up|down}).$

This requires the trigger not to be case sensitive, or to make the first letter of my @prey alias a big letter (since right now - @prey = a small squirrel , but what I get on screen is:
A small squirrel leaves north. )

Making the trigger specific would also prevent me from following random stuff when @prey = null - which would make the whole thing a lot more usable :)

Thanx!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Jan 18, 2002 2:42 am   
 
check out the %proper() function.


li'l shmoe of Dragon's Gate MUD
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri Jan 18, 2002 3:17 am   
 
^@prey leaves ({north|east|south|west|up|down}).$
Should work just fine for both "A small squirrel" and "a small squirrel" as long as Case Sensitive is unchecked in the options tab of the trigger. In either case a deer leaving would not trigger it when prey is a squirrel. I would recommend the following changes though:
^{a| the |}@prey leaves ({north|east|south|west|up|down}).$
And where you set prey strip the first word with something like this:
#IF (%begins("%x","a ")) {prey=%remove("a ","%x")} {#IF (%begins("%x","the ")) {prey=%remove("the ","%x")} {prey="%x"}
The begins and remove are case sensitive so if your prompt had "The Huge Deadly Mob" then "The" wouldn't be stripped. You could take care of this by working in some lowers to the stripping routine, but until you encounter it just unchecking the case sensitive box should fix you.
Reply with quote
Eowyn
Apprentice


Joined: 19 Jan 2001
Posts: 117
Location: Norway

PostPosted: Fri Jan 18, 2002 3:43 am   
 
thx :)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jan 18, 2002 6:09 am   
 
Triggers, by default, are not case-sensitive, so ^@prey leaves ({north|east|south|west|up|down}).$ should work the way you want without modification.


LightBulb
All scripts untested unless otherwise noted
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