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
dane
Beginner


Joined: 27 Apr 2005
Posts: 18

PostPosted: Sat Jun 04, 2005 2:41 pm   

Script help
 
On the mud I play you can call monsters from another plane to kill.

For example.

Grix summons the Antipaladin Guardsman from nowhere!
Grix summons A cheese rat from nowhere!
Grix summons Kahmel from nowhere!

#T (%w) from nowhere!
kill %1

However, is there a way to only fire when Grix summons?
The last word before "from nowhere" is usually the keyword to kill. But if someone else summons something it also fires too.

Thanks
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Sat Jun 04, 2005 4:37 pm   
 
#trigger {^Grix summons (%w) from nowhere!$} {kill ~'%1'}

Try that
_________________
Reply with quote
dane
Beginner


Joined: 27 Apr 2005
Posts: 18

PostPosted: Mon Jun 06, 2005 4:16 am   Still doesn't work
 
Still doesn't work.

Grix summons the Antipaladin Guardsman from nowhere!
Grix summons A cheese rat from nowhere!
Grix summons Kahmel from nowhere!

It seems to only fire on one word monsters like Kahmel.
When I summon a large rat it doesn't seem to fire.

Grix summons ..... from nowhere!
I need to be able to get the last word in the middle of those two parts.

a large rat
an anteater
Kelber
ect....

Thanks
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Jun 06, 2005 4:31 am   
 
replace the space between "summons" and the opening parentheses with an * in DeathDealer's trigger. That will match everything that might appear between the word "summons" and the last word of the critter name, unless special characters appear.

If that doesn't work, replace %w with the asterisk and replace %1 with %word("%1",%numwords(%1))
_________________
EDIT: I didn't like my old signature
Reply with quote
a5hi5m
Beginner


Joined: 04 Mar 2004
Posts: 24
Location: Australia

PostPosted: Mon Jun 06, 2005 6:31 am   
 
#trigger {^Grix summons*(%w) from nowhere!$} {kill ~'%1'}



Edit: well .. just what MattLofton wrote i guess :P
_________________
Smoking@BatMUD
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Tue Jun 07, 2005 1:23 pm   
 
dang, didn't think before i posted that the %w was for one word matches.
Sorry about that.
_________________
Reply with quote
dane
Beginner


Joined: 27 Apr 2005
Posts: 18

PostPosted: Tue Jun 07, 2005 5:05 pm   
 
Thanks for the input and it sorta works. I've tried all the above methods and it's only capturing the last letter of the last word. Which is close, but still not working. Question
Reply with quote
asm
Wanderer


Joined: 19 Jul 2004
Posts: 68

PostPosted: Wed Jun 08, 2005 6:31 am   
 
Might be a better way to do this, but I came up with this real quick and it seems to work, testing with #echo

Code:

#REGEX {^Grix summons (.+) from no where!$} {kill %word( %1, %numwords( %1))}
_________________
My collections of scripts.
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