powwow subs

Here we discussed clients, mappers, tunnels and their settings.
Locked
wiseman
Posts: 23
Joined: Mon Jan 19, 2009 6:51 pm

powwow subs

Post by wiseman »

I've been setting up some powwow subs lately for arrives/leaves/etc and I can't seem to figure out how to get them to actually sub and not just display on a new line below the game message.

For example, this is how my subs current work:

Code: Select all

A scholar has arrived from the west.
ARRIVES FROM THE > W E S T <
I'm trying to figure out how I can get them to just show:

Code: Select all

A scholar ARRIVES FROM THE > W E S T <
Any powwow experts out there know how to do this. or if it's even possible?
Jahara
Posts: 228
Joined: Sat Feb 23, 2008 9:55 pm
Location: Indiana, USA
Contact:

Re: powwow subs

Post by Jahara »

This isn't exactly what you want, since I use regular expression to match for any of the directions and then leave the text as it is.

Code: Select all

#action %+arrived ^(.+) has arrived from (above|below|the west|the east|the north|the south)(.+)={#print (\$2 + " has ARRIVED FROM >> " + \$3 + \$4 + " <<")}
#action %+s_arrived ^(.+) has suddenly arrived.={#print (\$2 + " has SUDDENLY ARRIVED.")}
In order for it to do what you want you would need to modify it similar to this:

Code: Select all

#action %+arrived ^(.+) has arrived from the west(.+)={#print (\$2 + " has ARRIVED FROM THE >> W E S T << " + \$3)}
Elestir
Posts: 231
Joined: Sat Feb 23, 2008 11:47 pm
Location: Olomouc, Czech Republic
Contact:

Re: powwow subs

Post by Elestir »

You don't need to use regexp actions for that btw.
But as Jahara showed, you need to print an expression, such as: (\$2 + " some text " + \$3)
The backslashes in front of $2 and $3 prevent immediate (premature) substitution of the variables with their respective contents. I prefer to use $(2) and $(3) notation for the same purpose (since Cosmos, the author of powwow, told me about the possibility). Backslashes get messy when you have nested definitions.
wiseman
Posts: 23
Joined: Mon Jan 19, 2009 6:51 pm

Re: powwow subs

Post by wiseman »

Jahara wrote:This isn't exactly what you want, since I use regular expression to match for any of the directions and then leave the text as it is.

Code: Select all

#action %+arrived ^(.+) has arrived from (above|below|the west|the east|the north|the south)(.+)={#print (\$2 + " has ARRIVED FROM >> " + \$3 + \$4 + " <<")}
#action %+s_arrived ^(.+) has suddenly arrived.={#print (\$2 + " has SUDDENLY ARRIVED.")}
In order for it to do what you want you would need to modify it similar to this:

Code: Select all

#action %+arrived ^(.+) has arrived from the west(.+)={#print (\$2 + " has ARRIVED FROM THE >> W E S T << " + \$3)}
Thanks! That will get me started quite nicely.
Locked