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


Joined: 12 Mar 2005
Posts: 195

PostPosted: Mon Mar 28, 2005 10:15 pm   

trigger and teleport question
 
Sorry for stupid questions but ive searched the forums for ages and cant find exactly what i need...

question 1

I have this trigger

Quote:
maximo bangs his fists against his heart and curses you with black-hearted anorexia.


The problem is that i need to trigger the WHOLE trigger, not just the first part. So i would trigger

Code:
(*) bangs (*) fists against (*) heart and curses you with black-hearted anorexia.


Which is triggered off one line, which is fine...

Sometimes it may be

Quote:
Mr blogs, of the city from the desert bangs his fists against his heart and curses you with black-hearted anorexia.


So it would then be pushed onto two lines, there is no fixed point at which it may flow onto the 2nd line, it can happen at any word. any idea how i should trigger it?

question 2

I want the zmud to update my location on the map when i telport.... an example is

Quote:

ls portal Curanthus
enter portal

You peer deep into the orb of your lore-stave and conjur an image of Curanthus
the trader. You cross your stave over the ground and lo! A portal projects
forth into the distance.
1170h, 496m -
You enter the portal, which seems to vaporise behind you as you pass through
its enchanted gateway.
Mercinae traders market.
You are able to see by the light of the lorestaff. Even the busy bustle of the
Cassiandora square marketplace does not prepare you as you emerge into a
scene of unmitigated chaos. Crowds swarm around you, arms aloft and voices
raised in busy bartering. Barkers shout prices from wooden pedestals which
echo about the cavernous roof. Mercinaen commodities are piled high against
the back walls, guarded by stern bemuscled men while all around you people
from the far flung corners of Avalon bustle each other for a closer look and
a better price. Curanthus the trader stands here, a wide smile upon his face.
A shiny apple seed lies here.
You notice exits east, and up (a closed door).


Ive seen some teleport scripts on here, but none of them take the name from the new room text. hope someone can help me.

thankyou for taking the time to read this!!

ads
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Mar 29, 2005 4:08 am   
 
1st:
Thats a rough one. One possible way (note that is will be *real* inefficient) is a capture everything trigger.

Code:

#VAR Line {}
#TRIGGER {^(*)$} {
    #VAR Line {%concat(@Line,"%1")}
    #IF (%ends("%1",".")) {
        #IF (%regex(@Line,".+ bangs .+ fists against .+ heart and curses you with black-hearted anorexia/.")) {
            /// do your stuff here
        }
        #VAR Line {}
    }
}


2nd:
I have a small script for exactly this. I found in combat (if I got low on hps and it flee'd automatically) the map would not update so I created a small little something to do it for me. I use it allll the time. Its not on this computer though. Ill have to dig it up and post it on Monday...
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Mar 29, 2005 4:20 am   
 
Ok, regarding the first item there might be a much better way I just thought of depending on your mud. Ideally (if they coded this option) you can disable wrapping of text from the mud side and tell ZMud to wrap your text. Or perhaps (like in my current mud) you have to give it a hard value. I just checked and my mud settings for wrapping are 499 chars.

If I remember right it doesnt matter if ZMud wraps the text or not. Will still count as one line as far as the trigger is concerned...
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Mar 29, 2005 12:58 pm   
 
When you teleport, use something like this:

Code:

#TRIGGER {^You peer deep into the orb of your lore-stave} {
    #TEMP {**} {%teleport(%mapquery("[Name] LIKE '%%1%'"))}
}


Fill in ** with whatever it takes to capture the room name and surround it in parenths. If you already have one for your mapper use the same one and be sure to check that trigger on trigger is enabled for it...

Happy mudding...
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Wed Mar 30, 2005 12:07 pm   hmm
 
the trigger problem worked great. that was fantastic

and the teport problem is party there... but getting the room name from the mud is a bit of a problem.. i have no idea how to extract it from the mud so that it can be placed in

Code:
{ #TEMP {**} 


thankyou for your help so far!
Reply with quote
Theragil
Apprentice


Joined: 13 Feb 2004
Posts: 157
Location: USA

PostPosted: Wed Mar 30, 2005 2:23 pm   
 
#tr {^You enter the portal, which seems to vaporise behind you as you pass through $its enchanted gateway. $(*).$} {#te %mapquery("[Name] LIKE '%%1%'")}

Might work. Might need tweaking. Are you storing the period in the map database or not? I don't, so I excluded it from the pattern, but if you do, just delete the period in the trigger pattern.
Reply with quote
Theragil
Apprentice


Joined: 13 Feb 2004
Posts: 157
Location: USA

PostPosted: Wed Mar 30, 2005 2:55 pm   
 
Here's a slightly more flexible one that lets you do this manually by typing whereami, and should work in any IRE MUD. If you don't use color 3 for your room title color, you'll need to change the 33 at the beginning to 30 plus whatever color you use. It assumes you have a variable named ScratchVar somewhere and uses it.

Code:

#ALIAS whereami {#temp {^%e[33m(*).} {ScratchVar = %mapquery( "[Name] LIKE '%%1%'");#if (%numitems( @ScratchVar) > 1) {#show There are %numitems( @ScratchVar) locations named ~"%%1~" and I don't know which one to move you to.} {#show Moving to ~"%%1~", room @ScratchVar.;#te @ScratchVar};#send ""} {color};ql}


I haven't tested this extensively, I have to admit, so it might need a bit of tweaking to make perfect.
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