HI everyone, i just wanted to say thanks ahead of time for any and all help! This forum has always been super helpful!!!!

In a nut shell, There is a power my mud(guild) uses and it's quite a pain in the butt due to combat scrolling and being able to decipher missing words in a set phrase(phrases) and "speak" them in line after the phrase has been sent. I was hoping to capture the text sent, and form a way (alias or macro etc) to send back the missing parts of the phrase fast enough to actually use the spell...

now.... the captured text is randomish in word's however there is ALWAYS a set phrase when invoking the power and always ONLY 3 lines or phrases sent after the intial start of the power, i'm hoping someone would know a way to make somethng workable out of this information. also there is only a "-" for the missing letters in the phrase. Also, in the last phrase the second to last word is random based on the nature of the spell.
(IE: rdiant, smoking, etc etc but always a word)

You call -orth a word of great power, invoking the prime nature of your
magic. Crumbling away from th- corpse, the soul -f the creature is
released in the form of a giant death's head that -lies freely into the
room, leaving behind it a great trail of radiant energy!

Screaming -hrough the r-om, the death's h-ad growls at Griffin.

With a hor-id grin of d-ath, the gh-stly skull leers at Griffin.

You call forth a word of great -ower, invoking the prime nature of yo-r
magic. Crumbling away from the corpse, the soul of the creature is
released in the f-rm of a giant death's head that flies freely into the
-oom, leaving behind it a great trail of smoking flames!

The ghost-y skull bobs and weav-s around A Ramen C-rd Band, growling fiercely.

The biggest hassel will be finding anchor points so as to capture the block of text in the first place.
Ideally you would use a command input trigger to know what to expect in advance, so that a trigger that otherwise might trigger to often, only needs to be enabled when you are expecting it to fire.
Here is a rough example for the info you provided.

That trigger will attempt to capture the block of test into a variable @testString.
The if statement will keep the trigger on its second state until it finds a line that matches an unchanging segment of the final line of the block.
You can add the else segment of the if statement for whatever it needs to do to manipulate your testString against the known key.

{#IF (%pos(@testString, %i)="-") i understand this part.. at any position of the variable @teststring , the second part of the #IF will concate the answer of that variable and send it.... however %len means to count them? why does it need to count them, forgive me for being extremly dense.... but i'm just not used to this at all. And again thanks so much for helping me, i truly appreciate it!

Aweomse, i see how that works now! Ok there is one hang up with the intial trigger(anchor point), I have several powers that use You call in the start of their use, so it is looping endlessly and causing crashes. Could i use a {Skip|Param 10} or some amount as there are only 4-5 lines after the initial cast. Also as a further point to find the next 2 anchor points, is it possible to allow the multi-state to look for the next hypenated lines and concate the information it sees? Sorry to keep bugging, just trying to finish this.

its not a perfect solution, it depends on just how random everything is..... if there is no constant whatsover you may need a more complicates pattern
i was just thinking of an alternative, using the range paramater of patterns....

#TR {[You-] [call-] [forth-] [a-] [word-] [of-] [great-] [power-], [invoking-] [the-] [prime-] [nature-] [of-] [your-]} {
key=You call forth a word of great power, invoking the prime nature of your
then the loop to check each line as we go
}
#COND {a similar pattern for the second line} {}
#COND {and the third} {}
#COND {and so on} {with all your script cleanup at the end}

Hmm, inside the phrase there is no real anchor point no:( ... So im guessing its based on capturing or finding hypens in sentences after the 1st phrase which ALWAYS says the same thing, but also always has random hyphens throughout it..:(

the range wildcards i am using [You-] means that only those characters listed inside the square brackets are allowed to be part of the string in question.
It takes a little longer to set up, but it should work.

I've been thinking about this some, well it seems i'd need first a way to fill the missing letters AFTER the script recognized where they are missing. regardless of the fact i've yet to get any script to do that. BUT when i do, i think i'd have to make a function of some sort to take th- and show the, and therefore the missing letter is filled...

I think Shalimar is on the right track with the range patterns, but a critical detail is missing. You will need a regex instead of zScript pattern. The reason for using a regex is to repeat the symbol range the correct number of times.

You would then add conditions for the following lines with the nearly the same code. Obviously you don't clear the variable on the sub-states, must set the patterns correctly, have to change the value of $str, and the last one would send the command. You should set the case-sensitive flag on all the triggers, and make sure the regex flag is set for all the sub-states or the will fail.

_________________The only good questions are the ones we have never answered before.
Search the Forums