|
Palmer Novice
Joined: 21 Mar 2003 Posts: 38 Location: USA
|
Posted: Thu Mar 27, 2003 6:33 am
#PRI hangs the MUD |
I have a #priority command in a trigger which hangs the MUD when executed. I don't have any #wait commands in my settings. The #priority operates on an #until loop.
|
|
|
|
Palmer Novice
Joined: 21 Mar 2003 Posts: 38 Location: USA
|
Posted: Thu Mar 27, 2003 7:36 am |
Ok, here's the output line and the trigger:
4 Creators: Keil(C)(l) Nate(C)(l) Nayeli(C) Rhinehold(D)
#TRIGGER {^%d {Creator|Creators}:%s(*)$} {#VAR names {%1};#PRI #UNTIL %pos( "(", @names)=0 {#VAR temp @names;#VAR names %delete( @names, %pos( "(", @temp), 3)}
The goal is to remove the parentheses, along with the characters within them, from @names. The problem is I want to convert @names to a list variable after removing the parentheses, and concatenate it with other variables. Without the #priority command, only one loop is completed before the conversion and concatenation executes, so only one set of parentheses is removed.
I'm assuming that the trigger, as written, hangs on the #until because it doesn't also prioritize the commands in the entire #until set, indeed won't even execute them until all the "(" characters are removed, while obviously it's those following commands that remove the "(" characters. If this is the case I'm at a loss as to how to proceed.
One alternative method is to remove the unwanted characters with one command, thereby avoiding the troublesome loop. With one command I can remove the "(" characters, and with another, the ")" characters. Removing the intervening letters is a problem I can't solve.
Another method would be to seperate the loop and later commands operating on @names into seperate triggers (or a trigger and an alias). I can write this, but it would require two distinct sends from the command line, and would be cumbersome.
All help appreciated. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Mar 27, 2003 9:07 am |
If you know all the possible characters between the parentheses, you can reduce this to a series of %replace's.
#VAR names {%replace( %replace( %replace( %replace( {@names}, "(C)", ""), "(l)", ""), "(D)", ""), " ", "|")}
LightBulb
Advanced Member |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Mar 27, 2003 12:57 pm |
By the way, #PRI is supposed to hang the MUD. It avoids further processing of received lines until the block of code within #PRI finishes.
Kjata |
|
|
|
Palmer Novice
Joined: 21 Mar 2003 Posts: 38 Location: USA
|
Posted: Thu Mar 27, 2003 1:25 pm |
Yeah, it just took me a while to understand that #PRI in front of #UNTIL would pause on the #UNTIL and not execute the sub-commands in the loop, hanging the MUD indefinitely. I'll use Lightbulb's suggestion, adding new (x) characters as I discover them.
Thanks much Lightbulb. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Mar 27, 2003 3:41 pm |
No, it shouldn't do that. It should hang until the #UNTIL finishes. If the #UNTIL is an endless loop, then it will hang indefinitely. If it isn't and it still hangs indefinitely, then it may be a bug.
Anyway, I think LightBulb's suggestion will work better for what you want to do.
Kjata |
|
|
|
|
|
|
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
|
|