|
dane Beginner
Joined: 27 Apr 2005 Posts: 18
|
Posted: 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 |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Sat Jun 04, 2005 4:37 pm |
#trigger {^Grix summons (%w) from nowhere!$} {kill ~'%1'}
Try that |
|
_________________
|
|
|
|
dane Beginner
Joined: 27 Apr 2005 Posts: 18
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
a5hi5m Beginner
Joined: 04 Mar 2004 Posts: 24 Location: Australia
|
Posted: 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 |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: 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. |
|
_________________
|
|
|
|
dane Beginner
Joined: 27 Apr 2005 Posts: 18
|
Posted: 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.
|
|
|
|
asm Wanderer
Joined: 19 Jul 2004 Posts: 68
|
Posted: 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))}
|
|
|
|
|
|
|