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


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Fri Jan 03, 2003 5:46 pm   

Recite identify trigger
 
I have been trying to think of the best way to go about doing this, but keep getting stumped. On my mud, you recite scrolls on objects. I would like to relay what I just identified to the group. For example when I recite a scroll:

You feel informed:
Object 'blackened earring, Item type: ARMOR
Item is: GLOW MAGIC
Worn by: VAMPIRES NINJA
Weight: 1, Value: 18000
AC-apply is 2 Resistance to damage is 0
Can affect you as:
Affects : HITROLL By 2
Affects : DAMROLL By 2
Affects : MANA By 20

I would like to be able to send each line to the group, using gt for group tell. Anyone able to help?
Reply with quote
IceChild
Magician


Joined: 11 Oct 2000
Posts: 419
Location: Post Falls, ID, USA

PostPosted: Fri Jan 03, 2003 10:55 pm   
 
This is kinda off the cuff, and untested, but here goes:

#ALIAS groupid {#T+ grid;recite scroll %1}
#CLASS {grid}
#TRIGGER {^You feel informed~:$} {gt You feel informed~:$}
#TRIGGER {^Object (*)} {gt Object %1}
#TRIGGER {^Item is~: (*)} {gt Item is~: %1}
#TRIGGER {^Worn by~: (*)} {gt Worn by~: %1}
#TRIGGER {^Weight~: (*)} {gt Weight~: %1}
#TRIGGER {^AC-apply is (*)} {gt AC-apply is %1}
#TRIGGER {^Can affect you as~:} {gt Can affect you as~:}
#TRIGGER {^Affects~: (*)} {gt Affects~: %1}
#TRIGGER {$} {#T- grid}
#CLASS 0

With something like that you would then:

groupid object

where object is what your identifying.

You'll also want to look at the groupid alias, and change as needed based on the name of the scroll your reciteing.

Now obviously, if there are other lines that need to be added, you'll have to manually add each line for each object, however, it should work closely to that.

Hope this helps.

Icechild
mv -f message.text /dev/null
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Sun Jan 05, 2003 5:40 pm   
 
Ok everything worked like a charm, but I when I posted I didn't think about potions, how would be the best way to capture the spells that the potion does.

Object 'vial green', Item type: POTION
Item is: MAGIC GLOW NoBits
Worn by: MAGE BISHOP
Weight: 1, Value: 2500
Level 15 spells of:
heal
bless
shield


thanks
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jan 05, 2003 6:13 pm   
 
Assuming a potion (wand/staff/scroll/etc.) can have a max of three spells, and the spells will always be the last entry in the ID:
#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#COND {^(%w)} {gt %trigger} {Within|Param=3}
#CLASS 0

LightBulb
Senior Member
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Mon Jan 06, 2003 4:17 pm   
 
Ok it is capturing the "Level 15 Spells" but stops there, and yes spells are the last to be identified and to my knowledge there is a max of 3 spells.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 06, 2003 6:16 pm   
 
Sorry, I can't find anything that works.


LightBulb
Senior Member
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Tue Jan 07, 2003 2:38 am   
 
Is there anything that can capture the next 3 lines only? The identify is usually quick enough that it would capture the 3 spells.
Reply with quote
n0mad
Newbie


Joined: 07 Jan 2003
Posts: 5
Location: United Kingdom

PostPosted: Tue Jan 07, 2003 2:23 pm   
 
quote:

Assuming a potion (wand/staff/scroll/etc.) can have a max of three spells, and the spells will always be the last entry in the ID:
#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#COND {^(%w)} {gt %trigger} {Within|Param=3}
#CLASS 0

LightBulb
Senior Member



#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#COND {^(%w)} {gt %trigger} {Within|Param=3}
#CLASS 0

#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#TR {} {gt %trim( %line)} {Loop Lines|Param=3}
#CLASS 0
Reply with quote
n0mad
Newbie


Joined: 07 Jan 2003
Posts: 5
Location: United Kingdom

PostPosted: Tue Jan 07, 2003 2:28 pm   
 
quote:

Assuming a potion (wand/staff/scroll/etc.) can have a max of three spells, and the spells will always be the last entry in the ID:
#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#COND {^(%w)} {gt %trigger} {Within|Param=3}
#CLASS 0

LightBulb
Senior Member



#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#COND {^(%w)} {gt %trigger} {Within|Param=3}
#CLASS 0

...might work if it was...

#CLASS grid
#TR {^Level (%d) spells of} {gt Level %1 spells of:}
#TR {} {gt %trim( %line)} {Loop Lines|Param=3}
#CLASS 0

...the new trigger line should just group tell the next three lines irrespective of what's in them, but then I thought about what i'd actually posted (duh) and realised that not all of your potions will have three lines, so i thought best thing you can do is just echo the next lines until either a blank line or your prompt is read, what comes after the last spell from the MUD?
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Tue Jan 07, 2003 10:52 pm   
 
Whats the command to send a blank line? Can I use the #sh command?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jan 07, 2003 11:35 pm   
 
#CR

Kjata
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Wed Jan 08, 2003 2:00 am   
 
I'm sorry either I am not doing this right, or it is near impossible, it is still stopping right before the spells. Nothing is even echoing after the Level %1 Spells of:
Reply with quote
Maddux31
Beginner


Joined: 03 Jan 2003
Posts: 12
Location: USA

PostPosted: Wed Jan 08, 2003 2:10 am   
 
Don't know if this will help, but I will just paste what is actually being shown with the echos.

You feel informed:
Object 'vial green', Item type: POTION
gt Object 'vial green', Item type: POTION
Item is: Mage_BISHOP NoBits
gt Item is: MAGE_BISHOP NoBits
Worn by: Any
gt Worn by: Any
Weight: 1, Value: 2500
gt Weight: 1, Value: 2500
Level 10 spells of:
gt Level 10 spells of:
heal
bless
shield

Any way to trigger off that last group tell?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 08, 2003 12:47 pm   
 
To use the script provided by n0mad you need version 6.40. Try upgrading if you don't alreayd have this version. It's free and much better than previous versions.

Kjata
Reply with quote
Manx
Apprentice


Joined: 10 Oct 2000
Posts: 152
Location: USA

PostPosted: Wed Jan 08, 2003 5:50 pm   
 
Why not just have it group telling everything that comes from the MUD after sending the recite command and then have it stop when it reaches the prompt? It looks like thats what you're basically doing anyway...

pat o.
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