Hi there!
I was wondering if there would be a way to make a script to take the information gathered from doing worm source (lets you see all of the wormholes in your area) and utilize the mapper rf function (or perhaps another function I'm not aware of) to help me find out where they lead.
I'm still learning the warps, so it would be helpful to have an area along with the room name. For example, worm source gives the following format:
You sense a connection between In a tunnel of loose soil and Southern grasslands.
I know I could grab the first room and start the second room and save those as variables and use in conjunction with "rf room", but I'm unsure how do redisplay that information effectively, and also to capture a line that is on another line.
For example:
You sense a connection between Before the forge in the Gnoll fortress and Climbing through the
foothills.
Foothills wraps around to the next line, and I'm not familiar enough with mudlet yet to quite know how to grab a second line. Any assistance would be appreciated, thank you!
Combining worm sources and mapping script
Re: Combining worm sources and mapping script
I'm not as familiar with the mapper functions as others, so I'll let them chime in on that part... but it sounds like you're playing one of the IRE muds... the best way to handle stuff that wraps is to let mudlet handle the wrapping. Something like CONFIG WRAPWIDTH 0 should do it for you. Then each line, no matter how many chars, is treated as one line by the trigger engine.
Re: Combining worm sources and mapping script
Threw something together and it seems to work well enough...
I trigger "You sense a connection between" to call mmp.roomFindT:
I trigger "You sense a connection between" to call mmp.roomFindT:
Re: Combining worm sources and mapping script
My screenwidth is set to 0 but it still seems to not know how to handle the second line. Something I'll work on.
Re: Combining worm sources and mapping script
It's unlikely that the server breaks the line into 2 if you have wrapwidth=0. Increase the line wrap in Mudlet to 200 to find out. If it really is a server bug then you can use the multi conditon trigger engine features to get what you want. Otherwise, I'd go for a simple regex pattern and grab both room titles right away and then look up the room ids and set the warp links as special exits in the mapper - and add them to a persistent table or a db in case the warp gates need to be removed from special exits at some point (I don't know anything about your game, just guessing).